/* * Author: esteldunedain * Adds a new setting at runtime, with all it's metadata. * If has only local effects. * * Arguments: * 0: name * 1: typeName * 2: isClientSetable * 3: localizedName * 4: localizedDescription * 5: possibleValues * 6: isForced * 7: defaultValue (Any) * * Return Value: * None * * Public: No */ #include "script_component.hpp" PARAMS_8(_name,_typeName,_isClientSetable,_localizedName,_localizedDescription,_possibleValues,_isForced,_value); private ["_settingData"]; _settingData = [_name] call FUNC(getSettingData); // Exit if the setting already exists if (count _settingData > 0) exitWith {}; // Update the variable TRACE_2("Setting added",_name,_value); // Init the variable missionNamespace setVariable [_name, _value]; // Add the setting data GVAR(settings) pushBack _this; // Raise event locally ["SettingChanged", [_name, _value]] call FUNC(localEvent);