diff --git a/addons/cargo/CfgVehicles.hpp b/addons/cargo/CfgVehicles.hpp index 9fe1ea3745..42b46c7a9f 100644 --- a/addons/cargo/CfgVehicles.hpp +++ b/addons/cargo/CfgVehicles.hpp @@ -1,5 +1,9 @@ class CfgVehicles { - class ACE_Module; + class Logic; + class Module_F: Logic { + class ModuleDescription; + }; + class ACE_Module: Module_F {}; class ACE_moduleCargoSettings: ACE_Module { scope = 2; displayName = CSTRING(SettingsModule_DisplayName); @@ -26,6 +30,33 @@ class CfgVehicles { sync[] = {}; }; }; + class GVAR(makeLoadable): ACE_Module { + scope = 2; + displayName = CSTRING(makeLoadable_displayName); + icon = QUOTE(PATHTOF(UI\Icon_Module_makeLoadable_ca.paa)); + category = "ACE_Logistics"; + function = QFUNC(moduleMakeLoadable); + isGlobal = 1; + isTriggerActivated = 0; + author = ECSTRING(common,ACETeam); + class Arguments { + class canLoad { + displayName = CSTRING(makeLoadable_displayName); + description = CSTRING(MakeLoadable_description); + typeName = "BOOL"; + defaultValue = 1; + }; + class setSize { + displayName = CSTRING(makeLoadable_setSize_displayName); + typeName = "NUMBER"; + defaultValue = 1; + }; + }; + class ModuleDescription: ModuleDescription { + description = CSTRING(module_MakeLoadable_description); + sync[] = {"AnyStaticObject"}; + }; + }; class LandVehicle; class Car: LandVehicle { diff --git a/addons/cargo/UI/Icon_Module_makeLoadable_ca.paa b/addons/cargo/UI/Icon_Module_makeLoadable_ca.paa new file mode 100644 index 0000000000..1577116a66 Binary files /dev/null and b/addons/cargo/UI/Icon_Module_makeLoadable_ca.paa differ diff --git a/addons/cargo/XEH_preInit.sqf b/addons/cargo/XEH_preInit.sqf index 4ec8ae94d0..1f2be9894b 100644 --- a/addons/cargo/XEH_preInit.sqf +++ b/addons/cargo/XEH_preInit.sqf @@ -14,6 +14,7 @@ PREP(initObject); PREP(initVehicle); PREP(loadItem); PREP(makeLoadable); +PREP(moduleMakeLoadable); PREP(moduleSettings); PREP(onMenuOpen); PREP(startLoadIn); diff --git a/addons/cargo/functions/fnc_moduleMakeLoadable.sqf b/addons/cargo/functions/fnc_moduleMakeLoadable.sqf new file mode 100644 index 0000000000..bcc6307863 --- /dev/null +++ b/addons/cargo/functions/fnc_moduleMakeLoadable.sqf @@ -0,0 +1,34 @@ +/* + * Author: PabstMirror + * Module to make an object loadable. + * + * Arguments: + * 0: The module logic + * 1: Synchronized units + * 2: Activated + * + * Return Value: + * None + * + * Example: + * [logic, [box], true] call ace_cargo_fnc_moduleMakeLoadable + * + * Public: No + */ +#include "script_component.hpp" + +params ["_logic", "_objects", "_activated"]; +TRACE_3("params",_logic,_objects,_activated); + +if ((isNull _logic) || {!_activated}) exitWith {}; +if (_objects isEqualTo []) exitWith { + ACE_LOGWARNING_1("ace_cargo_fnc_moduleMakeLoadable has no synced objects [%1]", _logic); +}; + +private _canLoad = _logic getVariable ["canLoad", true]; +private _setSize = _logic getVariable ["setSize", 1]; +TRACE_2("settings",_canLoad,_setSize); + +{ + [_x, _canLoad, _setSize] call FUNC(makeLoadable); +} forEach _objects; diff --git a/addons/cargo/stringtable.xml b/addons/cargo/stringtable.xml index 65c0ceb433..511785676d 100644 --- a/addons/cargo/stringtable.xml +++ b/addons/cargo/stringtable.xml @@ -133,5 +133,14 @@ %1<br/>nemůže být vyloženo %1<br/>не может быть выгружен + + Make Object Loadable + + + Sets the synced object as loadable by the cargo system. + + + Object's Size + \ No newline at end of file diff --git a/extras/assets/icons/Icon_Module_png/Icon_Module_Cargo_makeLoadable_ca.png b/extras/assets/icons/Icon_Module_png/Icon_Module_Cargo_makeLoadable_ca.png new file mode 100644 index 0000000000..a719c13aa7 Binary files /dev/null and b/extras/assets/icons/Icon_Module_png/Icon_Module_Cargo_makeLoadable_ca.png differ