2015-07-15 03:51:13 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
// Exit on Headless
|
2015-10-28 22:23:02 +00:00
|
|
|
if (!hasInterface) exitWith {};
|
2015-07-15 03:51:13 +00:00
|
|
|
|
2016-05-24 13:13:11 +00:00
|
|
|
["ace_settingsInitialized", {
|
2016-03-06 14:41:17 +00:00
|
|
|
// Initial settings
|
|
|
|
[true] call FUNC(setElements);
|
2015-10-28 22:23:02 +00:00
|
|
|
|
2015-07-15 03:51:13 +00:00
|
|
|
// On load and entering/exiting a vehicle
|
2016-05-24 16:58:27 +00:00
|
|
|
["ace_infoDisplayChanged", {
|
2015-10-28 22:23:02 +00:00
|
|
|
// Selective UI Advanced
|
2016-03-06 14:41:17 +00:00
|
|
|
// Defaults must be set in this EH to make sure controls are activated and advanced settings can be modified
|
2016-03-08 17:40:23 +00:00
|
|
|
private _force = [true, false] select (GVAR(allowSelectiveUI));
|
|
|
|
{
|
|
|
|
[_x select 0, _x select 1, _x select 2, _force] call FUNC(setAdvancedElement);
|
|
|
|
} forEach ELEMENTS_ADVANCED;
|
2016-05-22 15:29:05 +00:00
|
|
|
}] call CBA_fnc_addEventHandler;
|
2015-07-15 03:51:13 +00:00
|
|
|
|
2016-03-08 17:40:23 +00:00
|
|
|
// On changing settings
|
2016-05-24 16:58:27 +00:00
|
|
|
["ace_settingChanged", {
|
2015-10-28 22:23:02 +00:00
|
|
|
params ["_name"];
|
|
|
|
|
|
|
|
// Selective UI Basic
|
|
|
|
if (_name in ELEMENTS_BASIC) then {
|
2016-04-22 22:29:58 +00:00
|
|
|
[false] call FUNC(setElements);
|
2015-10-28 22:23:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Selective UI Advanced
|
|
|
|
{
|
2016-03-08 17:49:19 +00:00
|
|
|
_x params ["_idd", "_elements", "_elementName"];
|
2015-10-28 22:23:02 +00:00
|
|
|
|
2016-03-08 17:49:19 +00:00
|
|
|
if (_name == _elementName) then {
|
|
|
|
[_idd, _elements, _elementName] call FUNC(setAdvancedElement);
|
|
|
|
TRACE_2("Setting Changed",_name,_elementName);
|
2015-10-28 22:23:02 +00:00
|
|
|
};
|
|
|
|
} forEach ELEMENTS_ADVANCED;
|
2016-05-22 15:29:05 +00:00
|
|
|
}] call CBA_fnc_addEventHandler;
|
2015-10-28 22:23:02 +00:00
|
|
|
|
2016-05-22 15:29:05 +00:00
|
|
|
}] call CBA_fnc_addEventHandler;
|