From d8084e20d7dec155d6d64ce1c5a882688f241261 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sat, 15 Aug 2015 09:50:00 +0200 Subject: [PATCH] Added cargo settings and settings module. --- addons/cargo/ACE_Settings.hpp | 9 ++++++ addons/cargo/CfgVehicles.hpp | 27 ++++++++++++++++++ addons/cargo/UI/Icon_Module_Cargo_ca.paa | Bin 0 -> 5625 bytes addons/cargo/UI/Icon_load.paa | Bin 0 -> 5625 bytes addons/cargo/XEH_preInit.sqf | 1 + addons/cargo/functions/fnc_initObject.sqf | 2 +- addons/cargo/functions/fnc_initVehicle.sqf | 2 +- addons/cargo/functions/fnc_moduleSettings.sqf | 21 ++++++++++++++ addons/cargo/stringtable.xml | 15 ++++++++++ .../Icon_Module_png/Icon_Module_Cargo_ca.png | Bin 0 -> 703 bytes 10 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 addons/cargo/ACE_Settings.hpp create mode 100644 addons/cargo/UI/Icon_Module_Cargo_ca.paa create mode 100644 addons/cargo/UI/Icon_load.paa create mode 100644 addons/cargo/functions/fnc_moduleSettings.sqf create mode 100644 extras/assets/icons/Icon_Module_png/Icon_Module_Cargo_ca.png 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 0000000000000000000000000000000000000000..a292fb4227366641a7d9066c7ae573602050c2c6 GIT binary patch literal 5625 zcmd^DUuauZ7(a=(W*tpiX063EHr-+!qbiEDD;?y9LE6Ad2iv-d3a0fzafwuL_+ZVA z6^c;T5K%;0_n@zCwUh(;(u)CKWWtz8N_-f&;b0rojyjmhuHScW&&fF_B(ZcU;tu!1 z{oU_7-~W5gcTa;gG!#C5cxWuF5kd-uLd?de!Xt<+7>I|$M>G+ zlGBy=tNP02%lTCKYhg>xzcYdR@0gPo^93ALuwsAx^AG-mMLd24imMi`R{u`^WqFV? zNq$v~0Tkl{#XnrCcckJF?CH20Dwr(=uHQ{y zbAS*qx{-T*{N7)Qml*!#@1ytd83)>;`v2Uo(RItZ{TQRS{odV~Ta4!!R_&k7eK(&S zn9o+CtNh!=C&53l|LeF5&I|sl^7kt7XkRYQ70x7h{aDR7L)*{n4}3q@xmv|vRsL)a zoc|B|uiD$F#N&~R-lkP3VdlTeUkmTJ|F1yt(-_ZR+pSO`n}m{ufwp>XP%ps}t|K-D z`LnB#{7~U1rmt4Kwo7+CNhh*Gz7p@aUWNUP=P!ZHp78zG8y`C3JuT|rs(yB??yU}PqTQo+IWPwAzPKFel{MZjdAbCHlx&* zb#3&G@9QfaJNUw(;^k1$!|ZYUWd0sop8F|ASM{m5_i4G!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I7+p!u^*`gL;r8qX(tT7r%=Na}9ObX_6;);6mupad32hjODuY%AxcL-?w3~^b0ZiI*=(@d6s&LD*4jH9 z+nlPZ?bbGD*5Aq)4W?45rj8M+7qLy^E?nUcwZw?vkvY)~HzsfBUL_d~r|$AtxK9aX zJVfy8oWnRoe+5b?G)DwaPBn5nq1Jnr#3%#kN%ajgj^G99WB0%G_G9V?$BlH@@LG?F ze<#-PmqqJsDIoMe#x$DtHd);@K!d70HI#kf+5JOk_4*Oj&wD@_<6ZpUR9yNQj^Mez#%*evUHPzM@-_ceNY`Y~*i zM&LMNbi-jb9z8ekep{cwUazD!oc&?XEDQ>q&1xwbe^GHgH@sz}XS?3X(zJIm0CW5U DND8iv literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..0209ed8676973410916331cc53e3cbb716c439b3 GIT binary patch literal 703 zcmV;w0zmzVP))h{< zhDQL$rDxy3`Lc~rYnj^J##J1} z;U4?kz3BWSE-m33es)l&wjy|{BU4rq(}`lU8@&pAPgJNhw<-ouhb=NQRX#jcgMIAlUqy4s>p+1FSCc zj3n2#p!~nuwpR&2=bC;;#dIF80)VH<+Rj%z`7u0M6?fP0K_pYZ-6bm?(^>?ij$3PD ltL$ntAT~(_00BUA<3Gq4b|t6EH6Q>0002ovPDHLkV1kr|E}sAZ literal 0 HcmV?d00001