mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #3453 from acemod/hideEmptyCategories
Hide categories that have no user settable options
This commit is contained in:
commit
a09d0be0d4
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user