From 3453a096add821378beca23ecd5418d9e4387c61 Mon Sep 17 00:00:00 2001 From: ffredyk Date: Wed, 24 Mar 2021 07:06:05 +0100 Subject: [PATCH 1/4] add: _valueInfo evaluation --- addons/attributes/functions/fnc_gui_combo.sqf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/attributes/functions/fnc_gui_combo.sqf b/addons/attributes/functions/fnc_gui_combo.sqf index d4ce4a634..6f122c663 100644 --- a/addons/attributes/functions/fnc_gui_combo.sqf +++ b/addons/attributes/functions/fnc_gui_combo.sqf @@ -20,8 +20,16 @@ */ params ["_controlsGroup", "_defaultValue", "_valueInfo"]; + +//Value Info Eval +if(typeName _valueInfo == typeName {}) then { + _valueInfo = call _valueInfo; + if(typeName _valueInfo != typeName []) then { _valueInfo = [] }; +}; + _valueInfo params [["_entries", [], [[]]]]; + private _ctrlCombo = _controlsGroup controlsGroupCtrl IDC_ATTRIBUTE_COMBO; { From 6fb534961c541fd7c86298d7b62860138e6d2e38 Mon Sep 17 00:00:00 2001 From: ffredyk Date: Wed, 24 Mar 2021 07:15:12 +0100 Subject: [PATCH 2/4] add: persistency --- addons/custom_modules/functions/fnc_init.sqf | 3 ++- addons/custom_modules/functions/fnc_register.sqf | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/custom_modules/functions/fnc_init.sqf b/addons/custom_modules/functions/fnc_init.sqf index 588e85be2..6e0e3649a 100644 --- a/addons/custom_modules/functions/fnc_init.sqf +++ b/addons/custom_modules/functions/fnc_init.sqf @@ -19,9 +19,10 @@ params ["_logic"]; private _index = getNumber (configOf _logic >> QGVAR(index)); private _function = GVAR(modulesList) param [_index, []] param [3, {}]; +private _persist = GVAR(modulesList) param [_index, []] param [4, false]; private _position = getPosASL _logic; -deleteVehicle _logic; +if(!_persist) then { deleteVehicle _logic }; // Not using curatorCanAttach because that alters the height of the module curatorMouseOver params ["_type", "_entity"]; diff --git a/addons/custom_modules/functions/fnc_register.sqf b/addons/custom_modules/functions/fnc_register.sqf index d7f44e70e..572e6f0b6 100644 --- a/addons/custom_modules/functions/fnc_register.sqf +++ b/addons/custom_modules/functions/fnc_register.sqf @@ -31,7 +31,8 @@ params [ ["_category", "", [""]], ["_displayName", "", [""]], ["_function", {}, [{}]], - ["_icon", "", [""]] + ["_icon", "", [""]], + ["_persist", false, [false]] ]; if (isNil QGVAR(modulesList)) then { @@ -55,6 +56,6 @@ if (_icon isEqualTo "") then { _icon = DEFAULT_ICON; }; -GVAR(modulesList) pushBack [_category, _displayName, _icon, _function]; +GVAR(modulesList) pushBack [_category, _displayName, _icon, _function, _persist]; true From fcee855fa1d992fca59b07bf5361baaa7ce23337 Mon Sep 17 00:00:00 2001 From: ffredyk Date: Wed, 24 Mar 2021 07:25:17 +0100 Subject: [PATCH 3/4] Revert "add: _valueInfo evaluation" This reverts commit 3453a096add821378beca23ecd5418d9e4387c61. --- addons/attributes/functions/fnc_gui_combo.sqf | 8 -------- 1 file changed, 8 deletions(-) diff --git a/addons/attributes/functions/fnc_gui_combo.sqf b/addons/attributes/functions/fnc_gui_combo.sqf index 6f122c663..d4ce4a634 100644 --- a/addons/attributes/functions/fnc_gui_combo.sqf +++ b/addons/attributes/functions/fnc_gui_combo.sqf @@ -20,16 +20,8 @@ */ params ["_controlsGroup", "_defaultValue", "_valueInfo"]; - -//Value Info Eval -if(typeName _valueInfo == typeName {}) then { - _valueInfo = call _valueInfo; - if(typeName _valueInfo != typeName []) then { _valueInfo = [] }; -}; - _valueInfo params [["_entries", [], [[]]]]; - private _ctrlCombo = _controlsGroup controlsGroupCtrl IDC_ATTRIBUTE_COMBO; { From 0124749504e2f39aff9e6ee5b8c40f17ff8d036d Mon Sep 17 00:00:00 2001 From: ffredyk Date: Wed, 24 Mar 2021 07:29:22 +0100 Subject: [PATCH 4/4] add: persistency --- addons/custom_modules/functions/fnc_init.sqf | 3 ++- addons/custom_modules/functions/fnc_register.sqf | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/custom_modules/functions/fnc_init.sqf b/addons/custom_modules/functions/fnc_init.sqf index 588e85be2..6e0e3649a 100644 --- a/addons/custom_modules/functions/fnc_init.sqf +++ b/addons/custom_modules/functions/fnc_init.sqf @@ -19,9 +19,10 @@ params ["_logic"]; private _index = getNumber (configOf _logic >> QGVAR(index)); private _function = GVAR(modulesList) param [_index, []] param [3, {}]; +private _persist = GVAR(modulesList) param [_index, []] param [4, false]; private _position = getPosASL _logic; -deleteVehicle _logic; +if(!_persist) then { deleteVehicle _logic }; // Not using curatorCanAttach because that alters the height of the module curatorMouseOver params ["_type", "_entity"]; diff --git a/addons/custom_modules/functions/fnc_register.sqf b/addons/custom_modules/functions/fnc_register.sqf index d7f44e70e..572e6f0b6 100644 --- a/addons/custom_modules/functions/fnc_register.sqf +++ b/addons/custom_modules/functions/fnc_register.sqf @@ -31,7 +31,8 @@ params [ ["_category", "", [""]], ["_displayName", "", [""]], ["_function", {}, [{}]], - ["_icon", "", [""]] + ["_icon", "", [""]], + ["_persist", false, [false]] ]; if (isNil QGVAR(modulesList)) then { @@ -55,6 +56,6 @@ if (_icon isEqualTo "") then { _icon = DEFAULT_ICON; }; -GVAR(modulesList) pushBack [_category, _displayName, _icon, _function]; +GVAR(modulesList) pushBack [_category, _displayName, _icon, _function, _persist]; true