diff --git a/addons/cargo/ACE_Settings.hpp b/addons/cargo/ACE_Settings.hpp new file mode 100644 index 0000000000..300add74d2 --- /dev/null +++ b/addons/cargo/ACE_Settings.hpp @@ -0,0 +1,9 @@ +class ACE_Settings { + class GVAR(enable) { + displayName = CSTRING(ModuleSettings_enable); + description = CSTRING(ModuleSettings_enable_desc); + typeName = "BOOL"; + value = 1; + category = CSTRING(settingsCategory); + }; +}; diff --git a/addons/cargo/CfgVehicles.hpp b/addons/cargo/CfgVehicles.hpp index 25fbb7de43..9811feb219 100644 --- a/addons/cargo/CfgVehicles.hpp +++ b/addons/cargo/CfgVehicles.hpp @@ -1,5 +1,32 @@ class CfgVehicles { + + class ACE_Module; + class ACE_moduleCargoSettings: ACE_Module { + scope = 2; + displayName = CSTRING(SettingsModule_DisplayName); + icon = QUOTE(PATHTOF(UI\Icon_Module_Medical_ca.paa)); + category = "ACE"; + function = QUOTE(DFUNC(moduleSettings)); + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + author = ECSTRING(common,ACETeam); + class Arguments { + class enable { + displayName = CSTRING(ModuleSettings_enable); + description = CSTRING(ModuleSettings_enable_desc); + typeName = "BOOL"; + defaultValue = 1; + }; + }; + class ModuleDescription { + description = CSTRING(SettingsModule_Desc); + sync[] = {}; + }; + }; + + class LandVehicle; class Car: LandVehicle { GVAR(space) = 4; diff --git a/addons/cargo/UI/Icon_Module_Cargo_ca.paa b/addons/cargo/UI/Icon_Module_Cargo_ca.paa new file mode 100644 index 0000000000..a292fb4227 Binary files /dev/null and b/addons/cargo/UI/Icon_Module_Cargo_ca.paa differ diff --git a/addons/cargo/UI/Icon_load.paa b/addons/cargo/UI/Icon_load.paa new file mode 100644 index 0000000000..ccd77761e4 Binary files /dev/null and b/addons/cargo/UI/Icon_load.paa differ diff --git a/addons/cargo/XEH_preInit.sqf b/addons/cargo/XEH_preInit.sqf index b6c5342042..f0cf3357cd 100644 --- a/addons/cargo/XEH_preInit.sqf +++ b/addons/cargo/XEH_preInit.sqf @@ -11,6 +11,7 @@ PREP(GetSizeItem); PREP(initObject); PREP(initVehicle); PREP(handleDestroyed); +PREP(moduleSettings); PREP(loadItem); PREP(onMenuOpen); PREP(unloadItem); diff --git a/addons/cargo/functions/fnc_initObject.sqf b/addons/cargo/functions/fnc_initObject.sqf index 98aeb5afea..07131da341 100644 --- a/addons/cargo/functions/fnc_initObject.sqf +++ b/addons/cargo/functions/fnc_initObject.sqf @@ -24,5 +24,5 @@ _type = typeOf _object; if (_type in GVAR(initializedItemClasses)) exitWith {}; GVAR(initializedItemClasses) pushBack _type; -_action = [QGVAR(load), localize LSTRING(loadObject), "", {[_player, _target] call FUNC(startLoadIn)}, {[_player, _target] call FUNC(canLoad)}] call EFUNC(interact_menu,createAction); +_action = [QGVAR(load), localize LSTRING(loadObject), QUOTE(PATHTOF(UI\Icon_load.paa)), {[_player, _target] call FUNC(startLoadIn)}, {GVAR(enable) && {[_player, _target] call FUNC(canLoad)}] call EFUNC(interact_menu,createAction); [_type, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToClass); diff --git a/addons/cargo/functions/fnc_initVehicle.sqf b/addons/cargo/functions/fnc_initVehicle.sqf index 9653f756b2..7a03d3a1de 100644 --- a/addons/cargo/functions/fnc_initVehicle.sqf +++ b/addons/cargo/functions/fnc_initVehicle.sqf @@ -50,7 +50,7 @@ if (getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) != 1) ex private ["_text", "_condition", "_statement", "_icon", "_action"]; _text = localize "STR_ACE_Cargo_openMenu"; -_condition = {true}; +_condition = {GVAR(enable)}; _statement = {GVAR(interactionVehicle) = _target; createDialog QGVAR(menu);}; _icon = ""; diff --git a/addons/cargo/functions/fnc_moduleSettings.sqf b/addons/cargo/functions/fnc_moduleSettings.sqf new file mode 100644 index 0000000000..bb876c2840 --- /dev/null +++ b/addons/cargo/functions/fnc_moduleSettings.sqf @@ -0,0 +1,21 @@ +/* + * Author: Glowbal + * Module for adjusting the cargo settings + * + * Arguments: + * 0: The module logic + * 1: units + * 2: activated + * + * Return Value: + * None + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_logic", "_units", "_activated"]; +if !(_activated) exitWith {}; + +[_logic, QGVAR(enable), "enable"] call EFUNC(common,readSettingFromModule); diff --git a/addons/cargo/stringtable.xml b/addons/cargo/stringtable.xml index 7f9a7411c8..eab51350a3 100644 --- a/addons/cargo/stringtable.xml +++ b/addons/cargo/stringtable.xml @@ -16,5 +16,20 @@ Cargo space left: %1 + + Cargo + + + Enable Cargo + + + Enable the load in cargo module + + + Cargo Settings + + + Configure the cargo module settings + diff --git a/extras/assets/icons/Icon_Module_png/Icon_Module_Cargo_ca.png b/extras/assets/icons/Icon_Module_png/Icon_Module_Cargo_ca.png new file mode 100644 index 0000000000..0209ed8676 Binary files /dev/null and b/extras/assets/icons/Icon_Module_png/Icon_Module_Cargo_ca.png differ