Merge pull request #3453 from acemod/hideEmptyCategories

Hide categories that have no user settable options
This commit is contained in:
Thomas Kooi 2016-02-28 13:05:55 +01:00
commit a09d0be0d4
2 changed files with 9 additions and 4 deletions

View File

@ -22,6 +22,6 @@ disableSerialization;
_settingsMenu = uiNamespace getVariable 'ACE_settingsMenu';
_ctrlComboBox = (_settingsMenu displayCtrl 14);
GVAR(currentCategorySelection) = lbCurSel _ctrlComboBox;
GVAR(currentCategorySelection) = _ctrlComboBox lbValue (lbCurSel _ctrlComboBox);
[true] call FUNC(settingsMenuUpdateList);

View File

@ -21,6 +21,7 @@ private ["_setting", "_menu"];
// Filter only user setable setting
GVAR(clientSideOptions) = [];
GVAR(clientSideColors) = [];
private _clientSettableCategories = [""];
{
// If the setting is user setable and not forced
@ -37,6 +38,7 @@ GVAR(clientSideColors) = [];
if ((_x select 1) == "COLOR") then {
GVAR(clientSideColors) pushBack _setting;
};
_clientSettableCategories pushBackUnique (_x select 8); //Add to list of user-settable categories
};
} forEach EGVAR(common,settings);
@ -55,10 +57,13 @@ if (GVAR(serverConfigGeneration) == 0) then {
lbClear (_menu displayCtrl 14);
{
if (_x == "") then {
_x = localize LSTRING(category_all);
if (_x in _clientSettableCategories) then { //only show category if it has user-settable options
if (_x == "") then {
_x = localize LSTRING(category_all);
};
private _Index = (_menu displayCtrl 14) lbAdd _x;
(_menu displayCtrl 14) lbSetValue [_Index, _forEachIndex];
};
(_menu displayCtrl 14) lbAdd _x;
} forEach GVAR(categories);
(_menu displayCtrl 14) lbSetCurSel GVAR(currentCategorySelection); //All Catagoies