From 8064253a4d8d53e41fef2eb61b826ff9856ff599 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Fri, 6 Mar 2015 18:15:32 +0100 Subject: [PATCH 1/5] Formatting, indentation, minor refactoring + fix for opening settings menu --- .../fnc_onListBoxSettingsChanged.sqf | 21 ++-- .../fnc_onListBoxShowSelectionChanged.sqf | 22 ++-- .../functions/fnc_onSettingsMenuOpen.sqf | 49 ++++---- .../functions/fnc_onSliderPosChanged.sqf | 47 +++---- .../functions/fnc_resetSettings.sqf | 35 +++--- .../fnc_settingsMenuUpdateKeyView.sqf | 117 +++++++++--------- .../functions/fnc_settingsMenuUpdateList.sqf | 78 ++++++------ .../functions/fnc_updateSetting.sqf | 24 ++-- 8 files changed, 212 insertions(+), 181 deletions(-) diff --git a/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf b/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf index 066bc76a8f..8112f4464b 100644 --- a/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf @@ -1,12 +1,15 @@ -/** -* fnc_onListBoxSettingsChanged.sqf -* @Descr: N/A -* @Author: Glowbal -* -* @Arguments: [] -* @Return: -* @PublicAPI: false -*/ +/* + * Author: Glowbal + * Called when a listbox selection is changed. + * + * Arguments: + * + * Return Value: + * NONE + * + * Public: No + */ + #include "script_component.hpp" private ["_settingIndex", "_rightDropDownIndex"]; diff --git a/addons/optionsmenu/functions/fnc_onListBoxShowSelectionChanged.sqf b/addons/optionsmenu/functions/fnc_onListBoxShowSelectionChanged.sqf index f4d41674bd..88cf80ef96 100644 --- a/addons/optionsmenu/functions/fnc_onListBoxShowSelectionChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onListBoxShowSelectionChanged.sqf @@ -1,12 +1,16 @@ -/** -* fnc_onListBoxShowSelectionChanged.sqf -* @Descr: called when the listbox selection has changed. Updates configuration menu information -* @Author: Glowbal -* -* @Arguments: [] -* @Return: -* @PublicAPI: false -*/ +/* + * Author: Glowbal + * called when the listbox selection has changed. Updates configuration menu information + * + * Arguments: + * 0: Opened category or tab + * + * Return Value: + * NONE + * + * Public: No + */ + #include "script_component.hpp" private ["_settingsMenu", "_localizedHeader"]; diff --git a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf index e3137f8ca9..c578f2be98 100644 --- a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf +++ b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf @@ -1,33 +1,36 @@ -/** -* fnc_onSettingsMenuOpen.sqf -* @Descr: called when the settings or configuration menu has opened. Do not use anywhere else. -* @Author: Glowbal -* -* @Arguments: [] -* @Return: -* @PublicAPI: false -*/ +/* + * Author: Glowbal + * called when the settings or configuration menu has opened. Do not use anywhere else. + * + * Arguments: + * + * Return Value: + * NONE + * + * Public: No + */ + #include "script_component.hpp" // Filter only user setable setting GVAR(clientSideOptions) = []; GVAR(clientSideColors) = []; { - // If the setting is user setable and not forced - if ((_x select 2) && !(_x select 6)) then { - // Append the current value to the setting metadata - _setting = + _x; - _setting pushBack (missionNamespace getVariable (_x select 0)); + // If the setting is user setable and not forced + if ((_x select 2) && !(_x select 6)) 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 ((_x select 1) == "SCALAR" || (_x select 1) == "BOOL") then { - GVAR(clientSideOptions) pushBack _setting; - }; - if ((_x select 1) == "COLOR") then { - GVAR(clientSideColors) pushBack _setting; - }; - }; + // Categorize the setting according to types + // @todo: allow the user to modify other types of parameters? + if ((_x select 1) == "SCALAR" || (_x select 1) == "BOOL") then { + GVAR(clientSideOptions) pushBack _setting; + }; + if ((_x select 1) == "COLOR") then { + GVAR(clientSideColors) pushBack _setting; + }; + }; } forEach EGVAR(common,settings); //Delay a frame diff --git a/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf b/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf index ac6f52469c..df4dbf26c4 100644 --- a/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf @@ -1,29 +1,34 @@ -/** -* fnc_onSliderPosChanged.sqf -* @Descr: N/A -* @Author: PabstMirror -* -* @Arguments: [] -* @Return: -* @PublicAPI: false -*/ +/* + * Author: PabstMirror + * Called when a slider position is changed. + * + * Arguments: + * + * Return Value: + * NONE + * + * Public: No + */ + #include "script_component.hpp" private ["_newColor", "_settingIndex"]; -_newColor = []; -{ - _newColor pushBack ((sliderPosition _x) / 255); -} forEach [410, 411, 412, 413]; - _settingIndex = lbCurSel 200; switch (GVAR(optionMenu_openTab)) do { -case (MENU_TAB_COLORS): { - if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(clientSideColors)))) then { - _settingIndex = (GVAR(clientSideColors) select _settingIndex) select 0; - [MENU_TAB_COLORS, _settingIndex, _newColor] call FUNC(updateSetting); - }; - [false] call FUNC(settingsMenuUpdateList); - }; + case (MENU_TAB_COLORS): { + + _newColor = []; + { + _newColor pushBack ((sliderPosition _x) / 255); + } forEach [410, 411, 412, 413]; + + if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(clientSideColors)))) then { + _settingIndex = (GVAR(clientSideColors) select _settingIndex) select 0; + [MENU_TAB_COLORS, _settingIndex, _newColor] call FUNC(updateSetting); + }; + [false] call FUNC(settingsMenuUpdateList); + }; + default {}; }; diff --git a/addons/optionsmenu/functions/fnc_resetSettings.sqf b/addons/optionsmenu/functions/fnc_resetSettings.sqf index dd4b951ef5..e251b6e203 100644 --- a/addons/optionsmenu/functions/fnc_resetSettings.sqf +++ b/addons/optionsmenu/functions/fnc_resetSettings.sqf @@ -1,30 +1,33 @@ -/** -* fnc_resetSettings.sqf -* @Descr: -* @Author: Glowbal -* -* @Arguments: [] -* @Return: -* @PublicAPI: true -*/ +/* + * Author: Glowbal + * Sets all client side settings back to default. + * + * Arguments: + * + * Return Value: + * NONE + * + * Public: No + */ + #include "script_component.hpp" private ["_name", "_default", "_lastSelected"]; { - _name = _x select 0; - _default = _x select 7; - [MENU_TAB_OPTIONS, _name, _default] call FUNC(updateSetting); + _name = _x select 0; + _default = _x select 7; + [MENU_TAB_OPTIONS, _name, _default] call FUNC(updateSetting); } forEach GVAR(clientSideOptions); { - _name = _x select 0; - _default = _x select 7; - [MENU_TAB_COLORS, _name, _default] call FUNC(updateSetting); + _name = _x select 0; + _default = _x select 7; + [MENU_TAB_COLORS, _name, _default] call FUNC(updateSetting); } forEach GVAR(clientSideColors); _lastSelected = lbCurSel 200; [GVAR(optionMenu_openTab)] call FUNC(onListBoxShowSelectionChanged); if (_lastSelected != -1) then { - lbSetCurSel [200, _lastSelected]; + lbSetCurSel [200, _lastSelected]; }; diff --git a/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf b/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf index c271ecd176..460165ab1a 100644 --- a/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf +++ b/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf @@ -1,12 +1,15 @@ -/** -* fnc_settingsMenuUpdateKeyView.sqf -* @Descr: N/A -* @Author: Glowbal -* -* @Arguments: [] -* @Return: -* @PublicAPI: false -*/ +/* + * Author: Glowbal + * Updates the view on the right side with the selected settings details + * + * Arguments: + * + * Return Value: + * NONE + * + * Public: No + */ + #include "script_component.hpp" private ["_settingsMenu", "_ctrlList", "_collection", "_settingIndex", "_setting", "_entryName", "_localizedName", "_localizedDescription", "_possibleValues", "_settingsValue", "_currentColor"]; @@ -16,58 +19,58 @@ _settingsMenu = uiNamespace getVariable 'ACE_settingsMenu'; _ctrlList = _settingsMenu displayCtrl 200; _collection = switch (GVAR(optionMenu_openTab)) do { -case MENU_TAB_OPTIONS: {GVAR(clientSideOptions)}; -case MENU_TAB_COLORS: {GVAR(clientSideColors)}; - default {[]}; + case MENU_TAB_OPTIONS: {GVAR(clientSideOptions)}; + case MENU_TAB_COLORS: {GVAR(clientSideColors)}; + default {[]}; }; if (count _collection > 0) then { - _settingIndex = (lbCurSel _ctrlList); - if (_settingIndex > (count _collection)) then { - _settingIndex = count _collection - 1; - }; - - if (_settingIndex < 0) exitwith { - _settingIndex = 0; - }; - _setting = _collection select _settingIndex; - - _entryName = _setting select 0; - _localizedName = _setting select 3; - _localizedDescription = _setting select 4; - - if (_localizedName == "") then {_localizedName = _entryName;}; - (_settingsMenu displayCtrl 250) ctrlSetText _localizedName; - (_settingsMenu displayCtrl 251) ctrlSetText _localizedDescription; - (_settingsMenu displayCtrl 300) ctrlSetText _entryName; - - switch (GVAR(optionMenu_openTab)) do { - case (MENU_TAB_OPTIONS): { - _possibleValues = _setting select 5; - _settingsValue = _setting select 8; - - // Created disable/enable options for bools - if ((_setting select 1) == "BOOL") then { - lbClear 400; - lbAdd [400, (localize "STR_ACE_OptionsMenu_Disabled")]; - lbAdd [400, (localize "STR_ACE_OptionsMenu_Enabled")]; - _settingsValue = [0, 1] select _settingsValue; - } else { - lbClear 400; - { lbAdd [400, _x]; } foreach _possibleValues; - }; - (_settingsMenu displayCtrl 400) lbSetCurSel _settingsValue; + _settingIndex = (lbCurSel _ctrlList); + if (_settingIndex > (count _collection)) then { + _settingIndex = count _collection - 1; }; - case (MENU_TAB_COLORS): { - _currentColor = _setting select 8; - { - sliderSetPosition [_x, (255 * (_currentColor select _forEachIndex))]; - } forEach [410, 411, 412, 413]; + + if (_settingIndex < 0) then { + _settingIndex = 0; + }; + _setting = _collection select _settingIndex; + + _entryName = _setting select 0; + _localizedName = _setting select 3; + _localizedDescription = _setting select 4; + + if (_localizedName == "") then {_localizedName = _entryName;}; + (_settingsMenu displayCtrl 250) ctrlSetText _localizedName; + (_settingsMenu displayCtrl 251) ctrlSetText _localizedDescription; + (_settingsMenu displayCtrl 300) ctrlSetText _entryName; + + switch (GVAR(optionMenu_openTab)) do { + case (MENU_TAB_OPTIONS): { + _possibleValues = _setting select 5; + _settingsValue = _setting select 8; + + // Created disable/enable options for bools + if ((_setting select 1) == "BOOL") then { + lbClear 400; + lbAdd [400, (localize "STR_ACE_OptionsMenu_Disabled")]; + lbAdd [400, (localize "STR_ACE_OptionsMenu_Enabled")]; + _settingsValue = [0, 1] select _settingsValue; + } else { + lbClear 400; + { lbAdd [400, _x]; } foreach _possibleValues; + }; + (_settingsMenu displayCtrl 400) lbSetCurSel _settingsValue; + }; + case (MENU_TAB_COLORS): { + _currentColor = _setting select 8; + { + sliderSetPosition [_x, (255 * (_currentColor select _forEachIndex))]; + } forEach [410, 411, 412, 413]; + }; }; - }; } else { //no settings in list: - lbClear 400; - (_settingsMenu displayCtrl 250) ctrlSetText _localizedName; - (_settingsMenu displayCtrl 251) ctrlSetText _localizedDescription; - (_settingsMenu displayCtrl 300) ctrlSetText _entryName; + lbClear 400; + (_settingsMenu displayCtrl 250) ctrlSetText "No settings available"; + (_settingsMenu displayCtrl 251) ctrlSetText "No settings available"; + (_settingsMenu displayCtrl 300) ctrlSetText "No settings available"; }; diff --git a/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf index 73a6d3de3b..9e23a489eb 100644 --- a/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf +++ b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf @@ -1,12 +1,16 @@ -/** -* fnc_settingsMenuUpdateList.sqf -* @Descr: N/A -* @Author: Glowbal -* -* @Arguments: [] -* @Return: -* @PublicAPI: false -*/ +/* + * Author: Glowbal + * Updates the list with all settings in the menu. + * + * Arguments: + * 0: update The selection view + * + * Return Value: + * NONE + * + * Public: No + */ + #include "script_component.hpp" private ["_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView"]; @@ -19,35 +23,35 @@ _ctrlList = _settingsMenu displayCtrl 200; lbclear _ctrlList; switch (GVAR(optionMenu_openTab)) do { -case (MENU_TAB_OPTIONS): { + case (MENU_TAB_OPTIONS): { + { + _ctrlList lbadd (_x select 3); + + _settingsValue = _x select 8; + + // Created disable/enable options for bools + _settingsText = if ((_x select 1) == "BOOL") then { + [(localize "STR_ACE_OptionsMenu_Disabled"), (localize "STR_ACE_OptionsMenu_Enabled")] select _settingsValue; + } else { + (_x select 5) select _settingsValue; + }; + + _ctrlList lbadd (_settingsText); + }foreach GVAR(clientSideOptions); + }; + case (MENU_TAB_COLORS): { { - _ctrlList lbadd (_x select 3); - - _settingsValue = _x select 8; - - // Created disable/enable options for bools - _settingsText = if ((_x select 1) == "BOOL") then { - [(localize "STR_ACE_OptionsMenu_Disabled"), (localize "STR_ACE_OptionsMenu_Enabled")] select _settingsValue; - } else { - (_x select 5) select _settingsValue; - }; - - _ctrlList lbadd (_settingsText); - }foreach GVAR(clientSideOptions); - }; -case (MENU_TAB_COLORS): { - { - _color = +(_x select 8); - { - _color set [_forEachIndex, ((round (_x * 100))/100)]; - } forEach _color; - _settingsColor = str _color; - _ctrlList lbadd (_x select 3); - _ctrlList lbadd (_settingsColor); - _ctrlList lnbSetColor [[_forEachIndex, 1], (_x select 8)]; - }foreach GVAR(clientSideColors); - }; + _color = +(_x select 8); + { + _color set [_forEachIndex, ((round (_x * 100))/100)]; + } forEach _color; + _settingsColor = str _color; + _ctrlList lbadd (_x select 3); + _ctrlList lbadd (_settingsColor); + _ctrlList lnbSetColor [[_forEachIndex, 1], (_x select 8)]; + }foreach GVAR(clientSideColors); + }; }; if (_updateKeyView) then { - [] call FUNC(settingsMenuUpdateKeyView); + [] call FUNC(settingsMenuUpdateKeyView); }; diff --git a/addons/optionsmenu/functions/fnc_updateSetting.sqf b/addons/optionsmenu/functions/fnc_updateSetting.sqf index e4a9917f25..a2cba9bf51 100644 --- a/addons/optionsmenu/functions/fnc_updateSetting.sqf +++ b/addons/optionsmenu/functions/fnc_updateSetting.sqf @@ -1,12 +1,18 @@ -/** -* fnc_updateSetting.sqf -* @Descr: -* @Author: Glowbal -* -* @Arguments: [] -* @Return: -* @PublicAPI: true -*/ +/* + * Author: Glowbal + * Upidates a setting. + * + * Arguments: + * 0: Type Of setting + * 1: Name of setting + * 2: New value + * + * Return Value: + * NONE + * + * Public: No + */ + #include "script_component.hpp" private ["_changed"]; From 50bdc1d4c7786cc134e96d1c2cf83eaa59a810c3 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Fri, 6 Mar 2015 19:56:15 +0100 Subject: [PATCH 2/5] Disable unused buttons --- addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf index c578f2be98..64d2fc65e2 100644 --- a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf +++ b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf @@ -35,3 +35,9 @@ GVAR(clientSideColors) = []; //Delay a frame [{ [MENU_TAB_OPTIONS] call FUNC(onListBoxShowSelectionChanged) }, []] call EFUNC(common,execNextFrame); + +private "_menu"; +disableSerialization; +_menu = uiNamespace getvariable "ACE_settingsMenu"; +(_menu displayCtrl 1002) ctrlEnable false; +(_menu displayCtrl 1003) ctrlEnable false; From 8687f8d073554572eabe4d1c3eeea3c4dfaefc8e Mon Sep 17 00:00:00 2001 From: Glowbal Date: Fri, 6 Mar 2015 19:56:43 +0100 Subject: [PATCH 3/5] Changed font sizes and removed animation button. --- addons/optionsmenu/gui/settingsMenu.hpp | 36 ++++++++++++------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/addons/optionsmenu/gui/settingsMenu.hpp b/addons/optionsmenu/gui/settingsMenu.hpp index 8d99a591d5..995c7850a5 100644 --- a/addons/optionsmenu/gui/settingsMenu.hpp +++ b/addons/optionsmenu/gui/settingsMenu.hpp @@ -4,7 +4,7 @@ class ACE_settingsMenu { onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_settingsMenu', _this select 0)]; [] call FUNC(onSettingsMenuOpen);); onUnload = QUOTE(uiNamespace setVariable [ARR_2('ACE_settingsMenu', nil)]; saveProfileNamespace;); - #define SIZEX ((0.70 * safezoneW) max 1.0) + #define SIZEX (((safezoneW / safezoneH) min 1.2)) #define SIZEY (SIZEX / 1.2) #define UNITX (SIZEX / 40) #define UNITY (SIZEY / 25) @@ -42,6 +42,10 @@ class ACE_settingsMenu { x = 26.1 * UNITX + OFFSETX; w = 12.9 * UNITX; }; + class RightBackgroundHeader: RightBackground { + h = 1.4 * UNITY; + colorBackground[] = {0,0,0,1}; + }; }; class controls { @@ -85,7 +89,7 @@ class ACE_settingsMenu { colorBackgroundFocused[] = {1,1,1,1}; colorBackground[] = {1,1,1,1}; colorbackground2[] = {1,1,1,1}; - colorDisabled[] = {0.5,0.5,0.5,0.8}; + colorDisabled[] = {1,1,1,1}; colorFocused[] = {0,0,0,1}; periodFocus = 1; periodOver = 1; @@ -99,13 +103,13 @@ class ACE_settingsMenu { }; class selectionAction_3: selectionAction_1 { idc = 1002; - text = "---"; + text = ""; x = 20 * UNITX + OFFSETX; action = ""; }; class selectionAction_4: selectionAction_1 { idc = 1003; - text = "---"; + text = ""; x = 29.5 * UNITX + OFFSETX; action = ""; }; @@ -115,7 +119,7 @@ class ACE_settingsMenu { y = 5.5 * UNITY + OFFSETY; w = 23 * UNITX; h = 15 * UNITY; - SizeEx = (UNITY * 0.7); + SizeEx = (UNITY * 0.8); colorBackground[] = {0, 0, 0, 0.9}; colorSelectBackground[] = {0, 0, 0, 0.9}; columns[] = {0.0, 0.6}; @@ -128,7 +132,7 @@ class ACE_settingsMenu { w = 11 * UNITX; h = 1 * UNITY; text = ""; - SizeEx = (UNITY * 0.75); + SizeEx = (UNITY *1); }; class labelKey: ACE_gui_staticBase { //Variable Name idc = 300; @@ -137,13 +141,13 @@ class ACE_settingsMenu { w = 11 * UNITX; h = 1 * UNITY; text = ""; - SizeEx = (UNITY * 0.60); + SizeEx = (UNITY * 0.65); }; class Label2: labelKey { idc = 301; y = 7.3 * UNITY + OFFSETY; text = "$STR_ACE_OptionsMenu_Setting"; - SizeEx = (UNITY * 0.75); + SizeEx = (UNITY * 1); }; class comboBox1: ACE_gui_comboBoxBase { idc = 400; @@ -152,7 +156,7 @@ class ACE_settingsMenu { w = 7 * UNITX; h = 1 * UNITY; onLBSelChanged = QUOTE( call FUNC(onListBoxSettingsChanged)); - SizeEx = (UNITY * 0.75); + SizeEx = (UNITY * 0.9); }; class sliderBar1: RscXSliderH { idc = 410; @@ -191,15 +195,16 @@ class ACE_settingsMenu { text = ""; style = ST_LEFT + ST_MULTI; lineSpacing = 1; - SizeEx = (UNITY * 0.60); + SizeEx = (UNITY * 0.8); }; class actionClose: ACE_gui_buttonBase { idc = 10; text = "$STR_DISP_CLOSE"; x = 1 * UNITX + OFFSETX; y = 22.3 * UNITY + OFFSETY; - w = 6 * UNITX; + w = 7.5 * UNITX; h = 1 * UNITY; + style = ST_LEFT; animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.8)"; animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.5)"; animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; @@ -217,17 +222,10 @@ class ACE_settingsMenu { periodOver = 1; action = "closedialog 0;"; }; - class action_animation: actionClose { - idc = 1100; - text = "$STR_ACE_OptionsMenu_FixAnimation"; - x = 7.5 * UNITX + OFFSETX; - // action = "if ([player] call ACE_fnc_canInteract && {animationState player == 'deadState' || animationState player == 'unconscious'} && {(vehicle player == player)}) then { [player, 'amovppnemstpsnonwnondnon'] call ACE_fnc_broadcastAnim; };"; - action = "hint 'todo???'"; - }; class action_reset: actionClose { idc = 1100; text = "$STR_ACE_OptionsMenu_ResetAll"; - x = 14 * (SIZEX / 40) + OFFSETX; + x = 26.1 * (SIZEX / 40) + OFFSETX; action = QUOTE([] call FUNC(resetSettings)); }; }; From fd44f7bca6992dc1004455c6c2c9da9b21825e25 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Fri, 6 Mar 2015 19:57:45 +0100 Subject: [PATCH 4/5] Indentation --- .../functions/fnc_onSliderPosChanged.sqf | 24 +++++++++---------- .../functions/fnc_resetSettings.sqf | 14 +++++------ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf b/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf index df4dbf26c4..b8fa0408d6 100644 --- a/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf @@ -17,18 +17,18 @@ private ["_newColor", "_settingIndex"]; _settingIndex = lbCurSel 200; switch (GVAR(optionMenu_openTab)) do { - case (MENU_TAB_COLORS): { + case (MENU_TAB_COLORS): { - _newColor = []; - { - _newColor pushBack ((sliderPosition _x) / 255); - } forEach [410, 411, 412, 413]; + _newColor = []; + { + _newColor pushBack ((sliderPosition _x) / 255); + } forEach [410, 411, 412, 413]; - if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(clientSideColors)))) then { - _settingIndex = (GVAR(clientSideColors) select _settingIndex) select 0; - [MENU_TAB_COLORS, _settingIndex, _newColor] call FUNC(updateSetting); - }; - [false] call FUNC(settingsMenuUpdateList); - }; - default {}; + if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(clientSideColors)))) then { + _settingIndex = (GVAR(clientSideColors) select _settingIndex) select 0; + [MENU_TAB_COLORS, _settingIndex, _newColor] call FUNC(updateSetting); + }; + [false] call FUNC(settingsMenuUpdateList); + }; + default {}; }; diff --git a/addons/optionsmenu/functions/fnc_resetSettings.sqf b/addons/optionsmenu/functions/fnc_resetSettings.sqf index e251b6e203..07c7b5a5cc 100644 --- a/addons/optionsmenu/functions/fnc_resetSettings.sqf +++ b/addons/optionsmenu/functions/fnc_resetSettings.sqf @@ -15,19 +15,19 @@ private ["_name", "_default", "_lastSelected"]; { - _name = _x select 0; - _default = _x select 7; - [MENU_TAB_OPTIONS, _name, _default] call FUNC(updateSetting); + _name = _x select 0; + _default = _x select 7; + [MENU_TAB_OPTIONS, _name, _default] call FUNC(updateSetting); } forEach GVAR(clientSideOptions); { - _name = _x select 0; - _default = _x select 7; - [MENU_TAB_COLORS, _name, _default] call FUNC(updateSetting); + _name = _x select 0; + _default = _x select 7; + [MENU_TAB_COLORS, _name, _default] call FUNC(updateSetting); } forEach GVAR(clientSideColors); _lastSelected = lbCurSel 200; [GVAR(optionMenu_openTab)] call FUNC(onListBoxShowSelectionChanged); if (_lastSelected != -1) then { - lbSetCurSel [200, _lastSelected]; + lbSetCurSel [200, _lastSelected]; }; From fc0d6e8e1c3181ddcefa38d996e00ca19b5cfaeb Mon Sep 17 00:00:00 2001 From: Glowbal Date: Fri, 6 Mar 2015 20:04:48 +0100 Subject: [PATCH 5/5] Updated author information in the config --- addons/optionsmenu/config.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/optionsmenu/config.cpp b/addons/optionsmenu/config.cpp index 51a614bb5a..7850e5972e 100644 --- a/addons/optionsmenu/config.cpp +++ b/addons/optionsmenu/config.cpp @@ -6,8 +6,8 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; - author[] = {"Combat Space Enhancement"}; - authorUrl = "http://csemod.com"; + author[] = {"Glowbal", "PabstMirror"}; + authorUrl = "http://github.com/Glowbal"; VERSION_CONFIG; }; }; @@ -24,4 +24,4 @@ class CfgAddons { #include "CfgEventHandlers.hpp" #include "gui\define.hpp" #include "gui\settingsMenu.hpp" -#include "gui\pauseMenu.hpp" \ No newline at end of file +#include "gui\pauseMenu.hpp"