From 2d831d33da8d782275d7d0cb5a6d3001b3ac7f54 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Wed, 6 Jul 2016 13:38:25 -0500 Subject: [PATCH] CBA settings fixes - Use getMissionConfigValue instead of broadcasting variable - Fix GET_FORCED macro --- addons/settings/Cfg3DEN.hpp | 2 +- addons/settings/XEH_preInit.sqf | 2 +- addons/settings/fnc_init.sqf | 2 +- addons/settings/initMissionSettings.sqf | 2 +- addons/settings/script_component.hpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/settings/Cfg3DEN.hpp b/addons/settings/Cfg3DEN.hpp index 52fd4f459..3062a4532 100644 --- a/addons/settings/Cfg3DEN.hpp +++ b/addons/settings/Cfg3DEN.hpp @@ -14,7 +14,7 @@ class Cfg3DEN { displayName = ""; tooltip = ""; defaultValue = QUOTE(NULL_HASH); - expression = QUOTE(missionNamespace setVariable [ARR_3(QUOTE(QGVAR(hash)),_value,true)]); + expression = "" wikiType = "[[Array]]"; }; }; diff --git a/addons/settings/XEH_preInit.sqf b/addons/settings/XEH_preInit.sqf index 3492c2f98..590de052b 100644 --- a/addons/settings/XEH_preInit.sqf +++ b/addons/settings/XEH_preInit.sqf @@ -9,7 +9,7 @@ ADDON = false; ["Test_Setting_1", "CHECKBOX", ["-test checkbox-", "-tooltip-"], "My Category", true] call cba_settings_fnc_init; ["Test_Setting_2", "LIST", ["-test list-", "-tooltip-"], "My Category", [[1,0], ["enabled","disabled"], 1]] call cba_settings_fnc_init; ["Test_Setting_3", "SLIDER", ["-test slider-", "-tooltip-"], "My Category", [0, 10, 5, 0]] call cba_settings_fnc_init; -["Test_Setting_4", "COLOR", ["-test color-", "-tooltip-"], "My Category", [1,1,0]] call cba_settings_fnc_init; +["Test_Setting_4", "COLOR", ["-test color-", "-tooltip-"], "My Category", [1,1,0], false, {diag_log text format ["Color Setting Changed: %1", _this];}] call cba_settings_fnc_init; #endif // --- init settings namespaces diff --git a/addons/settings/fnc_init.sqf b/addons/settings/fnc_init.sqf index 701fc93e0..3579e76ac 100644 --- a/addons/settings/fnc_init.sqf +++ b/addons/settings/fnc_init.sqf @@ -141,7 +141,7 @@ if (!isNil "_settingInfo") then { }; // --- read previous setting values from mission -_settingsHash = missionNamespace getVariable [QGVAR(hash), "Scenario" get3DENMissionAttribute QGVAR(hash)]; +_settingsHash = getMissionConfigValue QGVAR(hash); if (isNil "_settingsHash") then { _settingsHash = NULL_HASH; diff --git a/addons/settings/initMissionSettings.sqf b/addons/settings/initMissionSettings.sqf index ddd7252ad..e3fa37a42 100644 --- a/addons/settings/initMissionSettings.sqf +++ b/addons/settings/initMissionSettings.sqf @@ -3,7 +3,7 @@ 0 = 0 spawn { { // --- read previous setting values from mission - private _settingsHash = missionNamespace getVariable [QGVAR(hash), "Scenario" get3DENMissionAttribute QGVAR(hash)]; + private _settingsHash = getMissionConfigValue QGVAR(hash); if (isNil "_settingsHash") then { _settingsHash = NULL_HASH; diff --git a/addons/settings/script_component.hpp b/addons/settings/script_component.hpp index ca4529c93..fa8638ffa 100644 --- a/addons/settings/script_component.hpp +++ b/addons/settings/script_component.hpp @@ -78,7 +78,7 @@ #define NAMESPACE_GETVAR(namespace,varname,default) ([namespace getVariable varname] param [0, default]) #define GET_VALUE(namespace,setting) ((GVAR(namespace) getVariable setting) param [0]) -#define GET_FORCED(namespace,setting) ((NAMESPACE_GETVAR(namespace,setting,[]) param [1, false]) || {isMultiplayer && {NAMESPACE_GETVAR(GVAR(defaultSettings),setting,[]) param [7, false]}}) +#define GET_FORCED(namespace,setting) ((NAMESPACE_GETVAR(GVAR(namespace),setting,[]) param [1, false]) || {isMultiplayer && {NAMESPACE_GETVAR(GVAR(defaultSettings),setting,[]) param [7, false]}}) #define GET_TEMP_NAMESPACE(source) ([ARR_3(GVAR(clientSettingsTemp),GVAR(serverSettingsTemp),GVAR(missionSettingsTemp))] param [[ARR_3('client','server','mission')] find toLower source]) #define SET_TEMP_NAMESPACE_VALUE(setting,value,source) GET_TEMP_NAMESPACE(source) setVariable [ARR_2(setting,[ARR_2(value,(GET_TEMP_NAMESPACE(source) getVariable setting) param [1])])]