ACE3/addons/optionsmenu/functions/fnc_addFromConfig.sqf

39 lines
1.4 KiB
Plaintext
Raw Normal View History

2015-01-21 23:29:42 +00:00
/**
* fnc_addFromConfig.sqf
* @Descr: N/A
* @Author: PabstMirror
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
#include "script_component.hpp"
if (isClass (configFile >> "ACE_Options")) then {
_countOptions = count (configFile >> "ACE_Options");
for "_index" from 0 to (_countOptions - 1) do {
_optionEntry = (configFile >> "ACE_Options") select _index;
_name = configName _optionEntry;
_displayName = getText (_optionEntry >> "displayName");
_description = getText (_optionEntry >> "description");
_default = getNumber (_optionEntry >> "default");
_choices = getArray (_optionEntry >> "values");
if ((count _choices) == 0) then {
2015-01-21 23:43:57 +00:00
_choices = [(localize "STR_ACE_OptionsMenu_Disabled"), (localize "STR_ACE_OptionsMenu_Enabled")];
2015-01-21 23:29:42 +00:00
};
[_name, _displayName, _description, _choices, _default] call FUNC(addClientSideOptions);
};
};
2015-01-21 23:43:57 +00:00
if (isClass (configFile >> "ACE_Colors")) then {
_countOptions = count (configFile >> "ACE_Colors");
for "_index" from 0 to (_countOptions - 1) do {
_optionEntry = (configFile >> "ACE_Colors") select _index;
_name = configName _optionEntry;
_displayName = getText (_optionEntry >> "displayName");
_description = getText (_optionEntry >> "description");
_default = getArray (_optionEntry >> "default");
[_name, _displayName, _description, _default] call FUNC(addClientSideColor);
};
};