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/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); }; }; 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..b122d0da0e 100644 --- a/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf @@ -18,24 +18,28 @@ private ["_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 (((lnbCurSelRow 200) >= 0) && {(lnbCurSelRow 200) < ((lnbSize 200) select 0)}) then { + _settingIndex = lnbValue [200, [(lnbCurSelRow 200), 0]]; +}; +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_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 11aadc76e4..fde370426f 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 (((lnbCurSelRow 200) >= 0) && {(lnbCurSelRow 200) < ((lnbSize 200) select 0)}) then { + _settingIndex = lnbValue [200, [(lnbCurSelRow 200), 0]]; +}; + 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_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 af3e2232f3..c71a26a6e7 100644 --- a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf +++ b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf @@ -56,9 +56,8 @@ 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; } forEach GVAR(categories); diff --git a/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf b/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf index b69d8bd734..7df198cc5f 100644 --- a/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf @@ -18,7 +18,11 @@ private ["_newColor", "_settingIndex"]; -_settingIndex = lbCurSel 200; +_settingIndex = -1; +if (((lnbCurSelRow 200) >= 0) && {(lnbCurSelRow 200) < ((lnbSize 200) select 0)}) then { + _settingIndex = lnbValue [200, [(lnbCurSelRow 200), 0]]; +}; +if (_settingIndex == -1) exitWith {}; switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_COLORS): { 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 ac25d719e1..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)}; @@ -29,24 +28,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 (((lnbCurSelRow 200) >= 0) && {(lnbCurSelRow 200) < ((lnbSize 200) select 0)}) then { + _settingIndex = lnbValue [200, [(lnbCurSelRow 200), 0]]; +}; -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..39a036828a 100644 --- a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf +++ b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf @@ -16,26 +16,26 @@ #include "script_component.hpp" -private ["_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); - +_added = 0; 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); + if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then { + _settingName = if ((_x select 3) != "") then { + (_x select 3); } else { - _ctrlList lbadd (_x select 0); + (_x select 0); }; _settingsValue = _x select 9; @@ -47,41 +47,45 @@ switch (GVAR(optionMenu_openTab)) do { (_x select 5) select _settingsValue; }; - _ctrlList lbadd (_settingsText); + _added = _ctrlList lnbAddRow [_settingName, _settingsText]; + _ctrlList lnbSetValue [[_added, 0], _forEachIndex]; }; }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)]; } 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 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); + if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then { + _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 { + if (typeName _settingsValue != "STRING") then { _settingsValue = format["%1", _settingsValue]; }; - _ctrlList lbadd (_settingsValue); + _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 442a1ceb50..64f45121e5 100644 --- a/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf +++ b/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf @@ -28,24 +28,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 (((lnbCurSelRow 200) >= 0) && {(lnbCurSelRow 200) < ((lnbSize 200) select 0)}) then { + _settingIndex = lnbValue [200, [(lnbCurSelRow 200), 0]]; +}; -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_settingsMenuUpdateList.sqf b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf index 18075a1844..ccab920501 100644 --- a/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf +++ b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf @@ -16,22 +16,22 @@ #include "script_component.hpp" -private ["_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); switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_OPTIONS): { { - if (_selectedCategory == "" || _selectedCategory == (_X select 8)) then { - _ctrlList lbadd (_x select 3); + if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then { + _settingName = (_x select 3); _settingsValue = _x select 9; // Created disable/enable options for bools @@ -40,21 +40,24 @@ switch (GVAR(optionMenu_openTab)) do { } else { (_x select 5) select _settingsValue; }; - _ctrlList lbadd (_settingsText); + _added = _ctrlList lnbAddRow [_settingName, _settingsText]; + _ctrlList lnbSetValue [[_added, 0], _forEachIndex]; }; - }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)]; } 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 lnbSetValue [[_added, 0], _forEachIndex]; }; }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..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;