2015-04-05 00:17:43 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
|
|
|
* Called from the onLoad of ACE_settingsMenu dialog.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [onLoadEvent] call ACE_optionsmenu_fnc_onSettingsMenuOpen
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-04-17 00:46:42 +00:00
|
|
|
private ["_name", "_typeName", "_isClientSetable", "_localizedName", "_localizedDescription", "_possibleValues", "_defaultValue", "_setting", "_menu", "_settingsMenu"];
|
|
|
|
|
2015-04-05 09:11:54 +00:00
|
|
|
if (GVAR(serverConfigGeneration) == 0 || isMultiplayer) exitwith {closeDialog 145246;};
|
|
|
|
|
2015-04-05 00:17:43 +00:00
|
|
|
// Filter only user setable setting
|
|
|
|
GVAR(serverSideOptions) = [];
|
|
|
|
GVAR(serverSideColors) = [];
|
|
|
|
GVAR(serverSideValues) = [];
|
|
|
|
{
|
|
|
|
_name = _x select 0;
|
|
|
|
_typeName = _x select 1;
|
|
|
|
_isClientSetable = _x select 2;
|
|
|
|
_localizedName = _x select 3;
|
|
|
|
_localizedDescription = _x select 4;
|
|
|
|
_possibleValues = _x select 5;
|
|
|
|
_defaultValue = _x select 6;
|
|
|
|
|
|
|
|
// Exclude client side options if they are not included for the export
|
|
|
|
if (!(_isClientSetable) || GVAR(ClientSettingsExportIncluded)) then {
|
|
|
|
// Append the current value to the setting metadata
|
|
|
|
_setting = + _x;
|
|
|
|
_setting pushBack (missionNamespace getVariable (_x select 0));
|
|
|
|
|
|
|
|
// Categorize the setting according to types
|
|
|
|
// @todo: allow the user to modify other types of parameters?
|
|
|
|
if ((_typeName == "SCALAR" && count _possibleValues > 0) || (_x select 1) == "BOOL") then {
|
|
|
|
GVAR(serverSideOptions) pushBack _setting;
|
|
|
|
};
|
|
|
|
if (_typeName == "COLOR") then {
|
|
|
|
GVAR(serverSideColors) pushBack _setting;
|
|
|
|
};
|
|
|
|
if ((_typeName == "SCALAR" && count _possibleValues == 0) || _typeName == "ARRAY" || _typeName == "STRING") then {
|
|
|
|
GVAR(serverSideValues) pushBack _setting;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
} forEach EGVAR(common,settings);
|
|
|
|
|
|
|
|
//Delay a frame
|
|
|
|
[{ [MENU_TAB_SERVER_OPTIONS] call FUNC(onServerListBoxShowSelectionChanged) }, []] call EFUNC(common,execNextFrame);
|
|
|
|
|
|
|
|
disableSerialization;
|
|
|
|
_menu = uiNamespace getvariable "ACE_serverSettingsMenu";
|
|
|
|
(_menu displayCtrl 1003) ctrlEnable false;
|
|
|
|
|
2015-04-05 12:48:23 +00:00
|
|
|
if (GVAR(ClientSettingsExportIncluded)) then {
|
2015-08-09 00:57:57 +00:00
|
|
|
(_settingsMenu displayCtrl 1102) ctrlSetText localize (LSTRING(exClientSettings));
|
2015-04-05 12:48:23 +00:00
|
|
|
} else {
|
2015-08-09 00:57:57 +00:00
|
|
|
(_settingsMenu displayCtrl 1102) ctrlSetText localize (LSTRING(inClientSettings));
|
2015-04-05 12:48:23 +00:00
|
|
|
};
|
2015-08-08 09:52:23 +00:00
|
|
|
|
2015-08-08 11:07:22 +00:00
|
|
|
|
|
|
|
lbClear (_menu displayCtrl 14);
|
2015-08-08 09:52:23 +00:00
|
|
|
{
|
|
|
|
if (_x == "") then {
|
2015-08-09 00:57:57 +00:00
|
|
|
_x = localize (LSTRING(category_all));
|
2015-08-08 09:52:23 +00:00
|
|
|
};
|
2015-08-08 11:07:22 +00:00
|
|
|
if (isLocalized _x) then {_x = localize _x};
|
|
|
|
(_menu displayCtrl 14) lbAdd _x;
|
2015-08-08 09:52:23 +00:00
|
|
|
} forEach GVAR(categories);
|
|
|
|
|
2015-08-08 11:07:22 +00:00
|
|
|
(_menu displayCtrl 14) lbSetCurSel GVAR(currentCategorySelection); //All Catagoies
|