2015-01-21 11:43:58 +00:00
|
|
|
/**
|
|
|
|
* fnc_updateSetting.sqf
|
|
|
|
* @Descr:
|
|
|
|
* @Author: Glowbal
|
|
|
|
*
|
|
|
|
* @Arguments: []
|
|
|
|
* @Return:
|
|
|
|
* @PublicAPI: true
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-01-21 19:53:05 +00:00
|
|
|
private ["_changed"];
|
2015-01-21 22:27:53 +00:00
|
|
|
PARAMS_3(_type,_name,_newValue);
|
2015-01-21 11:43:58 +00:00
|
|
|
|
|
|
|
_changed = false;
|
|
|
|
|
|
|
|
switch (_type) do {
|
2015-01-21 19:53:05 +00:00
|
|
|
case (MENU_TAB_OPTIONS): {
|
2015-01-21 22:27:53 +00:00
|
|
|
{
|
2015-02-03 03:44:34 +00:00
|
|
|
if ((_x select 0) == _name) then {
|
|
|
|
|
|
|
|
if ((_x select 1) == "BOOL") then {
|
|
|
|
_newValue = [false, true] select _newValue;
|
|
|
|
};
|
|
|
|
|
2015-02-03 04:03:26 +00:00
|
|
|
if !((_x select 8) isEqualTo _newValue) then {
|
2015-02-03 03:44:34 +00:00
|
|
|
_changed = true;
|
2015-02-03 04:03:26 +00:00
|
|
|
_x set [8, _newValue];
|
2015-02-03 03:44:34 +00:00
|
|
|
} ;
|
|
|
|
|
2015-01-21 22:27:53 +00:00
|
|
|
};
|
|
|
|
} foreach GVAR(clientSideOptions);
|
|
|
|
};
|
2015-01-21 19:53:05 +00:00
|
|
|
case (MENU_TAB_COLORS): {
|
2015-01-21 22:27:53 +00:00
|
|
|
{
|
2015-02-03 04:03:26 +00:00
|
|
|
if (((_x select 0) == _name) && {!((_x select 8) isEqualTo _newValue)}) then {
|
2015-01-21 22:27:53 +00:00
|
|
|
_changed = true;
|
2015-02-03 04:03:26 +00:00
|
|
|
_x set [8, _newValue];
|
2015-01-21 22:27:53 +00:00
|
|
|
};
|
|
|
|
} foreach GVAR(clientSideColors);
|
|
|
|
};
|
2015-01-21 19:53:05 +00:00
|
|
|
};
|
2015-01-21 11:43:58 +00:00
|
|
|
|
|
|
|
if (_changed) then {
|
2015-02-03 04:03:26 +00:00
|
|
|
profileNamespace setVariable [_name, _newValue];
|
2015-02-03 04:45:04 +00:00
|
|
|
[_name, _newValue] call EFUNC(common,setSetting);
|
2015-01-21 11:43:58 +00:00
|
|
|
};
|