mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
ACE_Settings: various fixes
This commit is contained in:
parent
2c0d2013d4
commit
658f30b9a2
@ -13,7 +13,7 @@ call FUNC(loadSettingsFromProfile);
|
|||||||
_force = _this select 2;
|
_force = _this select 2;
|
||||||
if (_force) then {
|
if (_force) then {
|
||||||
_settingData = [_name] call FUNC(getSettingData);
|
_settingData = [_name] call FUNC(getSettingData);
|
||||||
if (isNull _settingData) exitWith {};
|
if (count _settingData == 0) exitWith {};
|
||||||
_settingData set [6,_force];
|
_settingData set [6,_force];
|
||||||
};
|
};
|
||||||
}] call FUNC(addEventhandler);
|
}] call FUNC(addEventhandler);
|
||||||
|
@ -22,7 +22,8 @@
|
|||||||
|
|
||||||
EXPLODE_1_PVT(_this,_name);
|
EXPLODE_1_PVT(_this,_name);
|
||||||
|
|
||||||
_value = objNull;
|
private ["_value"];
|
||||||
|
_value = [];
|
||||||
{
|
{
|
||||||
if ((_x select 0) == _name) exitWith {_value = _x};
|
if ((_x select 0) == _name) exitWith {_value = _x};
|
||||||
} forEach GVAR(settings);
|
} forEach GVAR(settings);
|
||||||
|
@ -17,9 +17,11 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
EXPLODE_2_PVT(_this,_name,_value);
|
private ["_name","_value"];
|
||||||
|
_name = _this select 0;
|
||||||
|
_value = _this select 1;
|
||||||
|
|
||||||
private ["force"];
|
private ["_force"];
|
||||||
_force = false;
|
_force = false;
|
||||||
if (count _this > 2) then {
|
if (count _this > 2) then {
|
||||||
_force = _this select 2;
|
_force = _this select 2;
|
||||||
@ -28,13 +30,13 @@ if (count _this > 2) then {
|
|||||||
_settingData = [_name] call FUNC(getSettingData);
|
_settingData = [_name] call FUNC(getSettingData);
|
||||||
|
|
||||||
// Exit if the setting does not exist
|
// Exit if the setting does not exist
|
||||||
if (isNull _settingData) exitWith {};
|
if (count _settingData == 0) exitWith {};
|
||||||
|
|
||||||
// Exit if the setting is already forced
|
// Exit if the setting is already forced
|
||||||
if (_settingData select 6) exitWith {};
|
if (_settingData select 6) exitWith {};
|
||||||
|
|
||||||
// Exit if the type is not right
|
// Exit if the type is not right
|
||||||
if (typeName _value != typeName (missionNamespace getVariable _name)) exitWith {};
|
if ((typeName _value) != typeName (missionNamespace getVariable _name)) exitWith {};
|
||||||
|
|
||||||
// Force it if it was required
|
// Force it if it was required
|
||||||
_settingData set [6, _force];
|
_settingData set [6, _force];
|
||||||
|
@ -13,8 +13,8 @@
|
|||||||
GVAR(clientSideOptions) = [];
|
GVAR(clientSideOptions) = [];
|
||||||
GVAR(clientSideColors) = [];
|
GVAR(clientSideColors) = [];
|
||||||
{
|
{
|
||||||
// If the setting is user setable
|
// If the setting is user setable and not forced
|
||||||
if (_x select 2) then {
|
if ((_x select 2) && !(_x select 6)) then {
|
||||||
// Append the current value to the setting metadata
|
// Append the current value to the setting metadata
|
||||||
_setting = + _x;
|
_setting = + _x;
|
||||||
_setting pushBack (missionNamespace getVariable (_x select 0));
|
_setting pushBack (missionNamespace getVariable (_x select 0));
|
||||||
|
Loading…
Reference in New Issue
Block a user