From 2565a80a22133f5708db5cf707ef0129e352da26 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 10 Aug 2015 17:19:30 -0500 Subject: [PATCH 1/5] #2098 - Option Menu Fixes for categories Use lbValue to store the index of the filtered selection --- .../functions/fnc_onCategorySelectChanged.sqf | 4 ++-- .../fnc_onListBoxSettingsChanged.sqf | 22 ++++++++++-------- .../functions/fnc_onServerSaveInputField.sqf | 6 ++++- .../functions/fnc_onSettingsMenuOpen.sqf | 2 +- .../functions/fnc_onSliderPosChanged.sqf | 8 +++++-- .../fnc_serverSettingsMenuUpdateKeyView.sqf | 23 +++++-------------- .../fnc_serverSettingsMenuUpdateList.sqf | 21 ++++++++++++----- .../fnc_settingsMenuUpdateKeyView.sqf | 23 ++++++------------- .../functions/fnc_settingsMenuUpdateList.sqf | 15 ++++++++---- .../functions/fnc_stringEscape.sqf | 2 +- addons/optionsmenu/gui/settingsMenu.hpp | 2 +- 11 files changed, 68 insertions(+), 60 deletions(-) diff --git a/addons/optionsmenu/functions/fnc_onCategorySelectChanged.sqf b/addons/optionsmenu/functions/fnc_onCategorySelectChanged.sqf index 3b97892cdb..3129e32bef 100644 --- a/addons/optionsmenu/functions/fnc_onCategorySelectChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onCategorySelectChanged.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" -private ["_settingsMenu"]; +private ["_settingsMenu", "_ctrlComboBox"]; disableSerialization; _settingsMenu = uiNamespace getVariable 'ACE_settingsMenu'; @@ -24,4 +24,4 @@ _settingsMenu = uiNamespace getVariable 'ACE_settingsMenu'; _ctrlComboBox = (_settingsMenu displayCtrl 14); GVAR(currentCategorySelection) = lbCurSel _ctrlComboBox; -[false] call FUNC(settingsMenuUpdateList); +[true] call FUNC(settingsMenuUpdateList); diff --git a/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf b/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf index 1543a2c8d5..e1be221531 100644 --- a/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf @@ -16,26 +16,30 @@ #include "script_component.hpp" -private ["_settingIndex", "_rightDropDownIndex"]; +private ["_settingsMenu", "_settingIndex", "_rightDropDownIndex"]; -_settingIndex = lbCurSel 200; //Index of left list _rightDropDownIndex = lbCurSel 400; //Index of right drop down - if (_rightDropDownIndex < 0) then {_rightDropDownIndex = 0;}; +_settingIndex = -1; +if (((lbCurSel 200) >= 0) && {(lbCurSel 200) < ((lbSize 200)/2)}) then { + _settingIndex = lbValue [200, (lbCurSel 200)]; +}; +if (_settingIndex == -1) exitWith {}; + switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_OPTIONS): { if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(clientSideOptions)))) then { - _settingIndex = (GVAR(clientSideOptions) select _settingIndex) select 0; - [MENU_TAB_OPTIONS, _settingIndex, _rightDropDownIndex] call FUNC(updateSetting); + _settingIndex = (GVAR(clientSideOptions) select _settingIndex) select 0; + [MENU_TAB_OPTIONS, _settingIndex, _rightDropDownIndex] call FUNC(updateSetting); }; [false] call FUNC(settingsMenuUpdateList); - }; + }; case (MENU_TAB_SERVER_OPTIONS): { if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(serverSideOptions)))) then { - _settingIndex = (GVAR(serverSideOptions) select _settingIndex) select 0; - [MENU_TAB_SERVER_OPTIONS, _settingIndex, _rightDropDownIndex] call FUNC(updateSetting); + _settingIndex = (GVAR(serverSideOptions) select _settingIndex) select 0; + [MENU_TAB_SERVER_OPTIONS, _settingIndex, _rightDropDownIndex] call FUNC(updateSetting); }; [false] call FUNC(serverSettingsMenuUpdateList); - }; + }; }; diff --git a/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf b/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf index 11aadc76e4..de37bc620d 100644 --- a/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf +++ b/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf @@ -18,9 +18,13 @@ private ["_settingIndex", "_inputText", "_setting", "_settingName", "_convertedValue"]; -_settingIndex = lbCurSel 200; //Index of left list _inputText = ctrlText 414; //Index of right drop down +_settingIndex = -1; +if (((lbCurSel 200) >= 0) && {(lbCurSel 200) < ((lbSize 200)/2)}) then { + _settingIndex = lbValue [200, (lbCurSel 200)]; +}; + switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_SERVER_VALUES): { if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(serverSideValues)))) then { diff --git a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf index af3e2232f3..4feace3b55 100644 --- a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf +++ b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf @@ -56,7 +56,7 @@ if (GVAR(serverConfigGeneration) == 0) then { lbClear (_menu displayCtrl 14); { if (_x == "") then { - _x = localize "STR_ACE_OptionsMenu_category_all"; + _x = localize LSTRING(category_all); }; if (isLocalized _x) then {_x = localize _x}; (_menu displayCtrl 14) lbAdd _x; diff --git a/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf b/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf index b69d8bd734..549b60484f 100644 --- a/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf @@ -16,9 +16,13 @@ #include "script_component.hpp" -private ["_newColor", "_settingIndex"]; +private ["_newColor", "_settingIndex", "_settingsMenu"]; -_settingIndex = lbCurSel 200; +_settingIndex = -1; +if (((lbCurSel 200) >= 0) && {(lbCurSel 200) < ((lbSize 200)/2)}) then { + _settingIndex = lbValue [200, (lbCurSel 200)]; +}; +if (_settingIndex == -1) exitWith {}; switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_COLORS): { diff --git a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf index ac25d719e1..c78bbd7e53 100644 --- a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf +++ b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf @@ -29,24 +29,13 @@ _collection = switch (GVAR(optionMenu_openTab)) do { default {[]}; }; -_selectedCategory = GVAR(categories) select GVAR(currentCategorySelection); -_filteredCollection = []; -{ - if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then { - _filteredCollection pushBack _x; - }; -} forEach _collection; +_settingIndex = -1; +if (((lbCurSel _ctrlList) >= 0) && {(lbCurSel _ctrlList) < ((lbSize _ctrlList)/2)}) then { + _settingIndex = _ctrlList lbValue (lbCurSel _ctrlList); +}; -if (count _filteredCollection > 0) then { - _settingIndex = (lbCurSel _ctrlList); - if (_settingIndex > (count _filteredCollection)) then { - _settingIndex = count _filteredCollection - 1; - }; - - if (_settingIndex < 0) then { - _settingIndex = 0; - }; - _setting = _filteredCollection select _settingIndex; +if ((_settingIndex >= 0) && {_settingIndex <= (count _collection)}) then { + _setting = _collection select _settingIndex; _entryName = _setting select 0; _localizedName = _setting select 3; diff --git a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf index 4a6648878a..f418d63b5a 100644 --- a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf +++ b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" -private ["_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView", "_settingsValue", "_selectedCategory"]; +private ["_added", "_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView", "_settingsValue", "_selectedCategory"]; DEFAULT_PARAM(0,_updateKeyView,true); disableSerialization; @@ -27,11 +27,11 @@ lbclear _ctrlList; _selectedCategory = GVAR(categories) select GVAR(currentCategorySelection); - +_added = 0; switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_SERVER_OPTIONS): { { - if (_selectedCategory == "" || _selectedCategory == (_X select 8)) then { + if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then { if ((_x select 3) != "") then { _ctrlList lbadd (_x select 3); } else { @@ -48,12 +48,15 @@ switch (GVAR(optionMenu_openTab)) do { }; _ctrlList lbadd (_settingsText); + + _ctrlList lbSetValue [_added, _forEachIndex]; + _added = _added + 1; }; }foreach GVAR(serverSideOptions); }; case (MENU_TAB_SERVER_COLORS): { { - if (_selectedCategory == "" || _selectedCategory == (_X select 8)) then { + if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then { _color = +(_x select 9); { _color set [_forEachIndex, ((round (_x * 100))/100)]; @@ -66,22 +69,28 @@ switch (GVAR(optionMenu_openTab)) do { }; _ctrlList lbadd (_settingsColor); _ctrlList lnbSetColor [[_forEachIndex, 1], (_x select 9)]; + + _ctrlList lbSetValue [_added, _forEachIndex]; + _added = _added + 1; }; }foreach GVAR(serverSideColors); }; case (MENU_TAB_SERVER_VALUES): { { - if (_selectedCategory == "" || _selectedCategory == (_X select 8)) then { + if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then { if ((_x select 3) != "") then { _ctrlList lbadd (_x select 3); } else { _ctrlList lbadd (_x select 0); }; _settingsValue = _x select 9; - if (typeName _settingsValue != "STRINg") then { + if (typeName _settingsValue != "STRING") then { _settingsValue = format["%1", _settingsValue]; }; _ctrlList lbadd (_settingsValue); + + _ctrlList lbSetValue [_added, _forEachIndex]; + _added = _added + 1; }; }foreach GVAR(serverSideValues); }; diff --git a/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf b/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf index 442a1ceb50..21440125ea 100644 --- a/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf +++ b/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf @@ -28,24 +28,15 @@ _collection = switch (GVAR(optionMenu_openTab)) do { default {[]}; }; -_selectedCategory = GVAR(categories) select GVAR(currentCategorySelection); -_filteredCollection = []; -{ - if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then { - _filteredCollection pushBack _x; - }; -} forEach _collection; +_settingIndex = -1; +if (((lbCurSel _ctrlList) >= 0) && {(lbCurSel _ctrlList) < ((lbSize _ctrlList)/2)}) then { + _settingIndex = _ctrlList lbValue (lbCurSel _ctrlList); +}; -if (count _filteredCollection > 0) then { - _settingIndex = (lbCurSel _ctrlList); - if (_settingIndex > (count _filteredCollection)) then { - _settingIndex = count _filteredCollection - 1; - }; +TRACE_3("Selected",_settingIndex,(lbCurSel _ctrlList),((lbSize _ctrlList)/2)); - if (_settingIndex < 0) then { - _settingIndex = 0; - }; - _setting = _filteredCollection select _settingIndex; +if ((_settingIndex >= 0) && {_settingIndex <= (count _collection)}) then { + _setting = _collection select _settingIndex; _entryName = _setting select 0; _localizedName = _setting select 3; diff --git a/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf index 18075a1844..ea31e4b759 100644 --- a/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf +++ b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" -private ["_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView", "_settingsValue", "_selectedCategory"]; +private ["_added", "_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView", "_settingsValue", "_selectedCategory"]; DEFAULT_PARAM(0,_updateKeyView,true); disableSerialization; @@ -27,10 +27,11 @@ lbclear _ctrlList; _selectedCategory = GVAR(categories) select GVAR(currentCategorySelection); +_added = 0; switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_OPTIONS): { { - if (_selectedCategory == "" || _selectedCategory == (_X select 8)) then { + if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then { _ctrlList lbadd (_x select 3); _settingsValue = _x select 9; @@ -41,12 +42,15 @@ switch (GVAR(optionMenu_openTab)) do { (_x select 5) select _settingsValue; }; _ctrlList lbadd (_settingsText); + + _ctrlList lbSetValue [_added, _forEachIndex]; + _added = _added + 1; }; - }foreach GVAR(clientSideOptions); + } foreach GVAR(clientSideOptions); }; case (MENU_TAB_COLORS): { { - if (_selectedCategory == "" || _selectedCategory == (_X select 8)) then { + if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then { _color = +(_x select 9); { _color set [_forEachIndex, ((round (_x * 100))/100)]; @@ -55,6 +59,9 @@ switch (GVAR(optionMenu_openTab)) do { _ctrlList lbadd (_x select 3); _ctrlList lbadd (_settingsColor); _ctrlList lnbSetColor [[_forEachIndex, 1], (_x select 9)]; + + _ctrlList lbSetValue [_added, _forEachIndex]; + _added = _added + 1; }; }foreach GVAR(clientSideColors); }; diff --git a/addons/optionsmenu/functions/fnc_stringEscape.sqf b/addons/optionsmenu/functions/fnc_stringEscape.sqf index fe3930f68c..1493f76445 100644 --- a/addons/optionsmenu/functions/fnc_stringEscape.sqf +++ b/addons/optionsmenu/functions/fnc_stringEscape.sqf @@ -14,7 +14,7 @@ * Public: No */ -private ["_str", "_array", "_maxIndex"]; +private ["_str", "_array", "_maxIndex", "_isEven"]; _str = _this; _isEven = { diff --git a/addons/optionsmenu/gui/settingsMenu.hpp b/addons/optionsmenu/gui/settingsMenu.hpp index 2c79bdab1d..d2f3ea7996 100644 --- a/addons/optionsmenu/gui/settingsMenu.hpp +++ b/addons/optionsmenu/gui/settingsMenu.hpp @@ -277,7 +277,7 @@ class ACE_settingsMenu { }; class ACE_serverSettingsMenu: ACE_settingsMenu { onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_serverSettingsMenu', _this select 0)]; [] call FUNC(onServerSettingsMenuOpen);); - onUnload = QUOTE(uiNamespace setVariable [ARR_2('ACE_serverSettingsMenu', nil)];); + onUnload = QUOTE(uiNamespace setVariable [ARR_2('ACE_serverSettingsMenu', nil)]; [] call FUNC(onSettingsMenuOpen);); class controls: controls { class HeaderName { idc = 1; From bdca10eac47a3eb59b51dc1fe829c4df93189193 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 11 Aug 2015 01:38:31 -0500 Subject: [PATCH 2/5] Close Client Settings When open Server Settings --- addons/optionsmenu/gui/settingsMenu.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/optionsmenu/gui/settingsMenu.hpp b/addons/optionsmenu/gui/settingsMenu.hpp index d2f3ea7996..cd65eb966d 100644 --- a/addons/optionsmenu/gui/settingsMenu.hpp +++ b/addons/optionsmenu/gui/settingsMenu.hpp @@ -256,7 +256,7 @@ class ACE_settingsMenu { idc = 1102; text = CSTRING(OpenExport); x = X_PART(18); - action = QUOTE(if (GVAR(serverConfigGeneration) > 0) then {createDialog 'ACE_serverSettingsMenu'; }); + action = QUOTE(if (GVAR(serverConfigGeneration) > 0) then {closeDialog 0; createDialog 'ACE_serverSettingsMenu';}); }; class action_debug: actionClose { idc = 1102; @@ -277,7 +277,7 @@ class ACE_settingsMenu { }; class ACE_serverSettingsMenu: ACE_settingsMenu { onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_serverSettingsMenu', _this select 0)]; [] call FUNC(onServerSettingsMenuOpen);); - onUnload = QUOTE(uiNamespace setVariable [ARR_2('ACE_serverSettingsMenu', nil)]; [] call FUNC(onSettingsMenuOpen);); + onUnload = QUOTE(uiNamespace setVariable [ARR_2('ACE_serverSettingsMenu', nil)];); class controls: controls { class HeaderName { idc = 1; From a90886331787c95633e127f64f390139c36a08ec Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 11 Aug 2015 04:15:55 -0500 Subject: [PATCH 3/5] Use proper lnbXXX commands --- .../fnc_onListBoxSettingsChanged.sqf | 6 +-- .../fnc_onServerCategorySelectChanged.sqf | 2 +- .../functions/fnc_onServerSaveInputField.sqf | 4 +- .../functions/fnc_onSliderPosChanged.sqf | 6 +-- .../functions/fnc_resetSettings.sqf | 4 +- .../functions/fnc_serverResetSettings.sqf | 2 +- .../fnc_serverSettingsMenuUpdateKeyView.sqf | 7 ++-- .../fnc_serverSettingsMenuUpdateList.sqf | 41 ++++++++----------- .../fnc_settingsMenuUpdateKeyView.sqf | 6 +-- .../functions/fnc_settingsMenuUpdateList.sqf | 22 ++++------ 10 files changed, 44 insertions(+), 56 deletions(-) diff --git a/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf b/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf index e1be221531..b122d0da0e 100644 --- a/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf @@ -16,14 +16,14 @@ #include "script_component.hpp" -private ["_settingsMenu", "_settingIndex", "_rightDropDownIndex"]; +private ["_settingIndex", "_rightDropDownIndex"]; _rightDropDownIndex = lbCurSel 400; //Index of right drop down if (_rightDropDownIndex < 0) then {_rightDropDownIndex = 0;}; _settingIndex = -1; -if (((lbCurSel 200) >= 0) && {(lbCurSel 200) < ((lbSize 200)/2)}) then { - _settingIndex = lbValue [200, (lbCurSel 200)]; +if (((lnbCurSelRow 200) >= 0) && {(lnbCurSelRow 200) < ((lnbSize 200) select 0)}) then { + _settingIndex = lnbValue [200, [(lnbCurSelRow 200), 0]]; }; if (_settingIndex == -1) exitWith {}; diff --git a/addons/optionsmenu/functions/fnc_onServerCategorySelectChanged.sqf b/addons/optionsmenu/functions/fnc_onServerCategorySelectChanged.sqf index f294e27a5e..d134cda993 100644 --- a/addons/optionsmenu/functions/fnc_onServerCategorySelectChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onServerCategorySelectChanged.sqf @@ -23,4 +23,4 @@ _settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu'; _ctrlComboBox = (_settingsMenu displayCtrl 14); GVAR(currentCategorySelection) = lbCurSel _ctrlComboBox; -[false] call FUNC(serverSettingsMenuUpdateList); +[true] call FUNC(serverSettingsMenuUpdateList); diff --git a/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf b/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf index de37bc620d..fde370426f 100644 --- a/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf +++ b/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf @@ -21,8 +21,8 @@ private ["_settingIndex", "_inputText", "_setting", "_settingName", "_convertedV _inputText = ctrlText 414; //Index of right drop down _settingIndex = -1; -if (((lbCurSel 200) >= 0) && {(lbCurSel 200) < ((lbSize 200)/2)}) then { - _settingIndex = lbValue [200, (lbCurSel 200)]; +if (((lnbCurSelRow 200) >= 0) && {(lnbCurSelRow 200) < ((lnbSize 200) select 0)}) then { + _settingIndex = lnbValue [200, [(lnbCurSelRow 200), 0]]; }; switch (GVAR(optionMenu_openTab)) do { diff --git a/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf b/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf index 549b60484f..7df198cc5f 100644 --- a/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf @@ -16,11 +16,11 @@ #include "script_component.hpp" -private ["_newColor", "_settingIndex", "_settingsMenu"]; +private ["_newColor", "_settingIndex"]; _settingIndex = -1; -if (((lbCurSel 200) >= 0) && {(lbCurSel 200) < ((lbSize 200)/2)}) then { - _settingIndex = lbValue [200, (lbCurSel 200)]; +if (((lnbCurSelRow 200) >= 0) && {(lnbCurSelRow 200) < ((lnbSize 200) select 0)}) then { + _settingIndex = lnbValue [200, [(lnbCurSelRow 200), 0]]; }; if (_settingIndex == -1) exitWith {}; diff --git a/addons/optionsmenu/functions/fnc_resetSettings.sqf b/addons/optionsmenu/functions/fnc_resetSettings.sqf index 07fc43cdfc..8d6c3958c6 100644 --- a/addons/optionsmenu/functions/fnc_resetSettings.sqf +++ b/addons/optionsmenu/functions/fnc_resetSettings.sqf @@ -30,8 +30,8 @@ private ["_name", "_default", "_lastSelected"]; [MENU_TAB_COLORS, _name, _default] call FUNC(updateSetting); } forEach GVAR(clientSideColors); -_lastSelected = lbCurSel 200; +_lastSelected = lnbCurSelRow 200; [GVAR(optionMenu_openTab)] call FUNC(onListBoxShowSelectionChanged); if (_lastSelected != -1) then { - lbSetCurSel [200, _lastSelected]; + lnbSetCurSelRow [200, _lastSelected]; }; diff --git a/addons/optionsmenu/functions/fnc_serverResetSettings.sqf b/addons/optionsmenu/functions/fnc_serverResetSettings.sqf index 434e622818..d9f6a4ad96 100644 --- a/addons/optionsmenu/functions/fnc_serverResetSettings.sqf +++ b/addons/optionsmenu/functions/fnc_serverResetSettings.sqf @@ -36,7 +36,7 @@ private ["_name", "_default", "_lastSelected"]; [MENU_TAB_SERVER_VALUES, _name, _default] call FUNC(updateSetting); } forEach GVAR(serverSideVakyes); -_lastSelected = lbCurSel 200; +_lastSelected = lnbCurSelRow 200; [GVAR(optionMenu_openTab)] call FUNC(onserverListBoxShowSelectionChanged); if (_lastSelected != -1) then { lbSetCurSel [200, _lastSelected]; diff --git a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf index c78bbd7e53..87532aaf86 100644 --- a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf +++ b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf @@ -16,11 +16,10 @@ #include "script_component.hpp" -private ["_settingsMenu", "_ctrlList", "_collection", "_settingIndex", "_setting", "_entryName", "_localizedName", "_localizedDescription", "_possibleValues", "_settingsValue", "_currentColor", "_expectedType", "_filteredCollection", "_selectedCategory"]; +private ["_settingsMenu", "_collection", "_settingIndex", "_setting", "_entryName", "_localizedName", "_localizedDescription", "_possibleValues", "_settingsValue", "_currentColor", "_expectedType"]; disableSerialization; _settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu'; -_ctrlList = _settingsMenu displayCtrl 200; _collection = switch (GVAR(optionMenu_openTab)) do { case MENU_TAB_SERVER_OPTIONS: {GVAR(serverSideOptions)}; @@ -30,8 +29,8 @@ _collection = switch (GVAR(optionMenu_openTab)) do { }; _settingIndex = -1; -if (((lbCurSel _ctrlList) >= 0) && {(lbCurSel _ctrlList) < ((lbSize _ctrlList)/2)}) then { - _settingIndex = _ctrlList lbValue (lbCurSel _ctrlList); +if (((lnbCurSelRow 200) >= 0) && {(lnbCurSelRow 200) < ((lnbSize 200) select 0)}) then { + _settingIndex = lnbValue [200, [(lnbCurSelRow 200), 0]]; }; if ((_settingIndex >= 0) && {_settingIndex <= (count _collection)}) then { diff --git a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf index f418d63b5a..39a036828a 100644 --- a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf +++ b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf @@ -16,14 +16,14 @@ #include "script_component.hpp" -private ["_added", "_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView", "_settingsValue", "_selectedCategory"]; +private ["_settingName", "_added", "_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView", "_settingsValue", "_selectedCategory"]; DEFAULT_PARAM(0,_updateKeyView,true); disableSerialization; _settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu'; _ctrlList = _settingsMenu displayCtrl 200; -lbclear _ctrlList; +lnbClear _ctrlList; _selectedCategory = GVAR(categories) select GVAR(currentCategorySelection); @@ -32,10 +32,10 @@ switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_SERVER_OPTIONS): { { if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then { - if ((_x select 3) != "") then { - _ctrlList lbadd (_x select 3); + _settingName = if ((_x select 3) != "") then { + (_x select 3); } else { - _ctrlList lbadd (_x select 0); + (_x select 0); }; _settingsValue = _x select 9; @@ -47,10 +47,8 @@ switch (GVAR(optionMenu_openTab)) do { (_x select 5) select _settingsValue; }; - _ctrlList lbadd (_settingsText); - - _ctrlList lbSetValue [_added, _forEachIndex]; - _added = _added + 1; + _added = _ctrlList lnbAddRow [_settingName, _settingsText]; + _ctrlList lnbSetValue [[_added, 0], _forEachIndex]; }; }foreach GVAR(serverSideOptions); }; @@ -62,35 +60,32 @@ switch (GVAR(optionMenu_openTab)) do { _color set [_forEachIndex, ((round (_x * 100))/100)]; } forEach _color; _settingsColor = str _color; - if ((_x select 3) != "") then { - _ctrlList lbadd (_x select 3); + _settingName = if ((_x select 3) != "") then { + (_x select 3); } else { - _ctrlList lbadd (_x select 0); + (_x select 0); }; - _ctrlList lbadd (_settingsColor); + + _added = _ctrlList lnbAddRow [_settingName, _settingsColor]; _ctrlList lnbSetColor [[_forEachIndex, 1], (_x select 9)]; - - _ctrlList lbSetValue [_added, _forEachIndex]; - _added = _added + 1; + _ctrlList lnbSetValue [[_added, 0], _forEachIndex]; }; }foreach GVAR(serverSideColors); }; case (MENU_TAB_SERVER_VALUES): { { if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then { - if ((_x select 3) != "") then { - _ctrlList lbadd (_x select 3); + _settingName = if ((_x select 3) != "") then { + (_x select 3); } else { - _ctrlList lbadd (_x select 0); + (_x select 0); }; _settingsValue = _x select 9; if (typeName _settingsValue != "STRING") then { _settingsValue = format["%1", _settingsValue]; }; - _ctrlList lbadd (_settingsValue); - - _ctrlList lbSetValue [_added, _forEachIndex]; - _added = _added + 1; + _added = _ctrlList lnbAddRow [_settingName, _settingsValue]; + _ctrlList lnbSetValue [[_added, 0], _forEachIndex]; }; }foreach GVAR(serverSideValues); }; diff --git a/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf b/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf index 21440125ea..64f45121e5 100644 --- a/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf +++ b/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf @@ -29,12 +29,10 @@ _collection = switch (GVAR(optionMenu_openTab)) do { }; _settingIndex = -1; -if (((lbCurSel _ctrlList) >= 0) && {(lbCurSel _ctrlList) < ((lbSize _ctrlList)/2)}) then { - _settingIndex = _ctrlList lbValue (lbCurSel _ctrlList); +if (((lnbCurSelRow 200) >= 0) && {(lnbCurSelRow 200) < ((lnbSize 200) select 0)}) then { + _settingIndex = lnbValue [200, [(lnbCurSelRow 200), 0]]; }; -TRACE_3("Selected",_settingIndex,(lbCurSel _ctrlList),((lbSize _ctrlList)/2)); - if ((_settingIndex >= 0) && {_settingIndex <= (count _collection)}) then { _setting = _collection select _settingIndex; diff --git a/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf index ea31e4b759..ccab920501 100644 --- a/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf +++ b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf @@ -16,23 +16,22 @@ #include "script_component.hpp" -private ["_added", "_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView", "_settingsValue", "_selectedCategory"]; +private ["_settingName", "_added", "_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView", "_settingsValue", "_selectedCategory"]; DEFAULT_PARAM(0,_updateKeyView,true); disableSerialization; _settingsMenu = uiNamespace getVariable 'ACE_settingsMenu'; _ctrlList = _settingsMenu displayCtrl 200; -lbclear _ctrlList; +lnbClear _ctrlList; _selectedCategory = GVAR(categories) select GVAR(currentCategorySelection); -_added = 0; switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_OPTIONS): { { if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then { - _ctrlList lbadd (_x select 3); + _settingName = (_x select 3); _settingsValue = _x select 9; // Created disable/enable options for bools @@ -41,10 +40,8 @@ switch (GVAR(optionMenu_openTab)) do { } else { (_x select 5) select _settingsValue; }; - _ctrlList lbadd (_settingsText); - - _ctrlList lbSetValue [_added, _forEachIndex]; - _added = _added + 1; + _added = _ctrlList lnbAddRow [_settingName, _settingsText]; + _ctrlList lnbSetValue [[_added, 0], _forEachIndex]; }; } foreach GVAR(clientSideOptions); }; @@ -56,12 +53,11 @@ switch (GVAR(optionMenu_openTab)) do { _color set [_forEachIndex, ((round (_x * 100))/100)]; } forEach _color; _settingsColor = str _color; - _ctrlList lbadd (_x select 3); - _ctrlList lbadd (_settingsColor); + _settingName = (_x select 3); + + _added = _ctrlList lnbAddRow [_settingName, _settingsColor]; _ctrlList lnbSetColor [[_forEachIndex, 1], (_x select 9)]; - - _ctrlList lbSetValue [_added, _forEachIndex]; - _added = _added + 1; + _ctrlList lnbSetValue [[_added, 0], _forEachIndex]; }; }foreach GVAR(clientSideColors); }; From 763f793d0e74cd2d96014e4de59204cabc5ee470 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 13 Aug 2015 13:20:37 -0500 Subject: [PATCH 4/5] Localize Catagoires in loadSettingsLocalizedText Minor, but allows us to use CSTRINGS in configs for consistancy --- .../fnc_loadSettingsLocalizedText.sqf | 1 + addons/interact_menu/ACE_Settings.hpp | 26 +++---- addons/medical/ACE_Settings.hpp | 76 +++++++++---------- .../fnc_onServerSettingsMenuOpen.sqf | 1 - .../functions/fnc_onSettingsMenuOpen.sqf | 1 - 5 files changed, 52 insertions(+), 53 deletions(-) diff --git a/addons/common/functions/fnc_loadSettingsLocalizedText.sqf b/addons/common/functions/fnc_loadSettingsLocalizedText.sqf index 280a1e9907..0e92833e88 100644 --- a/addons/common/functions/fnc_loadSettingsLocalizedText.sqf +++ b/addons/common/functions/fnc_loadSettingsLocalizedText.sqf @@ -20,6 +20,7 @@ _parseConfigForDisplayNames = { if !(isClass _optionEntry) exitwith {false}; _x set [3, getText (_optionEntry >> "displayName")]; _x set [4, getText (_optionEntry >> "description")]; + _x set [8, getText (_optionEntry >> "category")]; private "_values"; _values = _x select 5; diff --git a/addons/interact_menu/ACE_Settings.hpp b/addons/interact_menu/ACE_Settings.hpp index 48f32ed13b..381405987c 100644 --- a/addons/interact_menu/ACE_Settings.hpp +++ b/addons/interact_menu/ACE_Settings.hpp @@ -3,14 +3,14 @@ class ACE_Settings { value = 0; typeName = "BOOL"; isClientSettable = 1; - category = LSTRING(Category_InteractionMenu); + category = CSTRING(Category_InteractionMenu); displayName = CSTRING(AlwaysUseCursorSelfInteraction); }; class GVAR(cursorKeepCentered) { value = 0; typeName = "BOOL"; isClientSettable = 1; - category = LSTRING(Category_InteractionMenu); + category = CSTRING(Category_InteractionMenu); displayName = CSTRING(cursorKeepCentered); description = CSTRING(cursorKeepCenteredDescription); }; @@ -18,49 +18,49 @@ class ACE_Settings { value = 0; typeName = "BOOL"; isClientSettable = 1; - category = LSTRING(Category_InteractionMenu); + category = CSTRING(Category_InteractionMenu); displayName = CSTRING(AlwaysUseCursorInteraction); }; class GVAR(UseListMenu) { value = 0; typeName = "BOOL"; isClientSettable = 1; - category = LSTRING(Category_InteractionMenu); + category = CSTRING(Category_InteractionMenu); displayName = CSTRING(UseListMenu); }; class GVAR(colorTextMax) { value[] = {1, 1, 1, 1}; typeName = "COLOR"; isClientSettable = 1; - category = LSTRING(Category_InteractionMenu); + category = CSTRING(Category_InteractionMenu); displayName = CSTRING(ColorTextMax); }; class GVAR(colorTextMin) { value[] = {1, 1, 1, 0.25}; typeName = "COLOR"; isClientSettable = 1; - category = LSTRING(Category_InteractionMenu); + category = CSTRING(Category_InteractionMenu); displayName = CSTRING(ColorTextMin); }; class GVAR(colorShadowMax) { value[] = {0, 0, 0, 1}; typeName = "COLOR"; isClientSettable = 1; - category = LSTRING(Category_InteractionMenu); + category = CSTRING(Category_InteractionMenu); displayName = CSTRING(ColorShadowMax); }; class GVAR(colorShadowMin) { value[] = {0, 0, 0, 0.25}; typeName = "COLOR"; isClientSettable = 1; - category = LSTRING(Category_InteractionMenu); + category = CSTRING(Category_InteractionMenu); displayName = CSTRING(ColorShadowMin); }; class GVAR(textSize) { value = 2; typeName = "SCALAR"; isClientSettable = 1; - category = LSTRING(Category_InteractionMenu); + category = CSTRING(Category_InteractionMenu); displayName = CSTRING(textSize); values[] = {"$str_very_small", "$str_small", "$str_medium", "$str_large", "$str_very_large"}; }; @@ -68,7 +68,7 @@ class ACE_Settings { value = 2; typeName = "SCALAR"; isClientSettable = 1; - category = LSTRING(Category_InteractionMenu); + category = CSTRING(Category_InteractionMenu); displayName = CSTRING(shadowSetting); description = CSTRING(shadowSettingDescription); values[] = {"$STR_A3_OPTIONS_DISABLED", "$STR_A3_OPTIONS_ENABLED", CSTRING(shadowOutline)}; @@ -77,14 +77,14 @@ class ACE_Settings { value = 1; typeName = "BOOL"; isClientSettable = 1; - category = LSTRING(Category_InteractionMenu); + category = CSTRING(Category_InteractionMenu); displayName = CSTRING(ActionOnKeyRelease); }; class GVAR(menuBackground) { value = 0; typeName = "SCALAR"; isClientSettable = 1; - category = LSTRING(Category_InteractionMenu); + category = CSTRING(Category_InteractionMenu); displayName = CSTRING(background); values[] = {"$STR_A3_OPTIONS_DISABLED", CSTRING(backgroundBlur), CSTRING(backgroundBlack)}; }; @@ -92,7 +92,7 @@ class ACE_Settings { value = 0; typeName = "BOOL"; isClientSettable = 1; - category = LSTRING(Category_InteractionMenu); + category = CSTRING(Category_InteractionMenu); displayName = CSTRING(addBuildingActions); description = CSTRING(addBuildingActionsDescription); }; diff --git a/addons/medical/ACE_Settings.hpp b/addons/medical/ACE_Settings.hpp index 23b7cf8a4f..910f152292 100644 --- a/addons/medical/ACE_Settings.hpp +++ b/addons/medical/ACE_Settings.hpp @@ -1,116 +1,116 @@ class ACE_Settings { class GVAR(level) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); value = 1; typeName = "SCALAR"; values[] = {"Disabled", "Basic", "Advanced"}; }; class GVAR(medicSetting) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); value = 1; typeName = "SCALAR"; values[] = {"Disabled", "Normal", "Advanced"}; }; class GVAR(enableFor) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); value = 0; typeName = "SCALAR"; values[] = {"Players only", "Players and AI"}; }; class GVAR(enableOverdosing) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); typeName = "BOOL"; value = 1; }; class GVAR(bleedingCoefficient) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); typeName = "SCALAR"; value = 1; }; class GVAR(painCoefficient) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); typeName = "SCALAR"; value = 1; }; class GVAR(enableAirway) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); typeName = "BOOL"; value = false; }; class GVAR(enableFractures) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); typeName = "BOOL"; value = false; }; class GVAR(enableAdvancedWounds) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); typeName = "BOOL"; value = false; }; class GVAR(enableVehicleCrashes) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); typeName = "BOOL"; value = 1; }; class GVAR(enableScreams) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); typeName = "BOOL"; value = 1; }; class GVAR(playerDamageThreshold) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); typeName = "SCALAR"; value = 1; }; class GVAR(AIDamageThreshold) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); typeName = "SCALAR"; value = 1; }; class GVAR(enableUnconsciousnessAI) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); value = 1; typeName = "SCALAR"; values[] = {"Disabled", "50/50", "Enabled"}; }; class GVAR(remoteControlledAI) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); typeName = "BOOL"; value = 1; }; class GVAR(preventInstaDeath) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); typeName = "BOOL"; value = 0; }; class GVAR(enableRevive) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); typeName = "SCALAR"; value = 0; values[] = {"Disabled", "Players only", "Players and AI"}; }; class GVAR(maxReviveTime) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); typeName = "SCALAR"; value = 120; }; class GVAR(amountOfReviveLives) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); typeName = "SCALAR"; value = -1; }; class GVAR(allowDeadBodyMovement) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); typeName = "BOOL"; value = 0; }; class GVAR(allowLitterCreation) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); typeName = "BOOL"; value = 1; }; class GVAR(litterSimulationDetail) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); displayName = CSTRING(litterSimulationDetail); description = CSTRING(litterSimulationDetail_Desc); typeName = "SCALAR"; @@ -122,48 +122,48 @@ class ACE_Settings { isClientSettable = 1; }; class GVAR(litterCleanUpDelay) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); typeName = "SCALAR"; value = 0; }; class GVAR(medicSetting_PAK) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); typeName = "SCALAR"; value = 1; values[] = {"Anyone", "Medics only", "Doctors only"}; }; class GVAR(medicSetting_SurgicalKit) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); typeName = "SCALAR"; value = 1; values[] = {"Anyone", "Medics only", "Doctors only"}; }; class GVAR(consumeItem_PAK) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); typeName = "SCALAR"; value = 0; values[] = {"No", "Yes"}; }; class GVAR(consumeItem_SurgicalKit) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); typeName = "SCALAR"; value = 0; values[] = {"No", "Yes"}; }; class GVAR(useLocation_PAK) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); typeName = "SCALAR"; value = 3; values[] = {"Anywhere", "Medical vehicles", "Medical facility", "vehicle & facility", "Disabled"}; }; class GVAR(useLocation_SurgicalKit) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); typeName = "SCALAR"; value = 2; values[] = {"Anywhere", "Medical vehicles", "Medical facility", "vehicle & facility", "Disabled"}; }; class GVAR(useCondition_PAK) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); displayName = CSTRING(AdvancedMedicalSettings_useCondition_PAK_DisplayName); description = CSTRING(AdvancedMedicalSettings_useCondition_PAK_Description); typeName = "SCALAR"; @@ -171,7 +171,7 @@ class ACE_Settings { values[] = {"Anytime", "Stable"}; }; class GVAR(useCondition_SurgicalKit) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); displayName = CSTRING(AdvancedMedicalSettings_useCondition_SurgicalKit_DisplayName); description = CSTRING(AdvancedMedicalSettings_useCondition_SurgicalKit_Description); typeName = "SCALAR"; @@ -179,24 +179,24 @@ class ACE_Settings { values[] = {"Anytime", "Stable"}; }; class GVAR(keepLocalSettingsSynced) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); typeName = "BOOL"; value = 1; }; class GVAR(healHitPointAfterAdvBandage) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); displayName = CSTRING(healHitPointAfterAdvBandage); typeName = "BOOL"; value = 0; }; class GVAR(painIsOnlySuppressed) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); displayName = CSTRING(painIsOnlySuppressed); typeName = "BOOL"; value = 1; }; class GVAR(painEffectType) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); displayName = CSTRING(painEffectType); typeName = "SCALAR"; value = 0; @@ -204,18 +204,18 @@ class ACE_Settings { isClientSettable = 1; }; class GVAR(allowUnconsciousAnimationOnTreatment) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); typeName = "BOOL"; value = 0; }; class GVAR(moveUnitsFromGroupOnUnconscious) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); typeName = "BOOL"; value = 0; }; class GVAR(menuTypeStyle) { - category = LSTRING(Category_Medical); + category = CSTRING(Category_Medical); displayName = CSTRING(menuTypeDisplay); description = CSTRING(menuTypeDescription); typeName = "SCALAR"; diff --git a/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf b/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf index 621493967e..6c0cb56519 100644 --- a/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf +++ b/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf @@ -72,7 +72,6 @@ lbClear (_menu displayCtrl 14); if (_x == "") then { _x = localize (LSTRING(category_all)); }; - if (isLocalized _x) then {_x = localize _x}; (_menu displayCtrl 14) lbAdd _x; } forEach GVAR(categories); diff --git a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf index 4feace3b55..c71a26a6e7 100644 --- a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf +++ b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf @@ -58,7 +58,6 @@ lbClear (_menu displayCtrl 14); if (_x == "") then { _x = localize LSTRING(category_all); }; - if (isLocalized _x) then {_x = localize _x}; (_menu displayCtrl 14) lbAdd _x; } forEach GVAR(categories); From 4f0dab23b84b63cd3a84baaae0437f5d864f3434 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 13 Aug 2015 13:27:24 -0500 Subject: [PATCH 5/5] Nametag category --- addons/nametags/ACE_Settings.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/addons/nametags/ACE_Settings.hpp b/addons/nametags/ACE_Settings.hpp index 2270c93f0a..354d5748bf 100644 --- a/addons/nametags/ACE_Settings.hpp +++ b/addons/nametags/ACE_Settings.hpp @@ -4,6 +4,7 @@ class ACE_Settings { typeName = "COLOR"; isClientSettable = 1; displayName = CSTRING(DefaultNametagColor); + category = CSTRING(Module_DisplayName); }; class GVAR(showPlayerNames) { value = 1; @@ -12,29 +13,34 @@ class ACE_Settings { displayName = CSTRING(ShowPlayerNames); description = CSTRING(ShowPlayerNames_Desc); values[] = {ECSTRING(common,Disabled), ECSTRING(common,Enabled), CSTRING(OnlyCursor), CSTRING(OnlyKeypress), CSTRING(OnlyCursorAndKeypress)}; + category = CSTRING(Module_DisplayName); }; class GVAR(showPlayerRanks) { value = 1; typeName = "BOOL"; isClientSettable = 1; displayName = CSTRING(ShowPlayerRanks); + category = CSTRING(Module_DisplayName); }; class GVAR(showVehicleCrewInfo) { value = 1; typeName = "BOOL"; isClientSettable = 1; displayName = CSTRING(ShowVehicleCrewInfo); + category = CSTRING(Module_DisplayName); }; class GVAR(showNamesForAI) { value = 0; typeName = "BOOL"; isClientSettable = 1; displayName = CSTRING(ShowNamesForAI); + category = CSTRING(Module_DisplayName); }; class GVAR(showCursorTagForVehicles) { value = 0; typeName = "BOOL"; isClientSettable = 0; + category = CSTRING(Module_DisplayName); }; class GVAR(showSoundWaves) { value = 1; @@ -43,16 +49,19 @@ class ACE_Settings { displayName = CSTRING(ShowSoundWaves); description = CSTRING(ShowSoundWaves_Desc); values[] = {ECSTRING(common,Disabled), CSTRING(NameTagSettings), CSTRING(AlwaysShowAll)}; + category = CSTRING(Module_DisplayName); }; class GVAR(playerNamesViewDistance) { value = 5; typeName = "SCALAR"; isClientSettable = 0; + category = CSTRING(Module_DisplayName); }; class GVAR(playerNamesMaxAlpha) { value = 0.8; typeName = "SCALAR"; isClientSettable = 0; + category = CSTRING(Module_DisplayName); }; class GVAR(tagSize) { value = 2; @@ -61,5 +70,6 @@ class ACE_Settings { displayName = CSTRING(TagSize_Name); description = CSTRING(TagSize_Description); values[] = {"$str_very_small", "$str_small", "$str_medium", "$str_large", "$str_very_large"}; + category = CSTRING(Module_DisplayName); }; };