From 73f387d3e3778d8ac3b92d532602204918c58377 Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 25 Apr 2015 11:55:39 +0200 Subject: [PATCH 1/5] outline interaction menu text --- addons/interact_menu/functions/fnc_renderIcon.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/interact_menu/functions/fnc_renderIcon.sqf b/addons/interact_menu/functions/fnc_renderIcon.sqf index 9107b6d998..91a200ee89 100644 --- a/addons/interact_menu/functions/fnc_renderIcon.sqf +++ b/addons/interact_menu/functions/fnc_renderIcon.sqf @@ -33,9 +33,9 @@ if(_icon == "") then { }; _text = if (GVAR(UseListMenu)) then { - format ["%5", _icon, _iconColor, _textColor, _shadowColor, _text] + format ["%5", _icon, _iconColor, _textColor, _shadowColor, _text] } else { - format ["
%5", _icon, _iconColor, _textColor, _shadowColor, "ace_breakLine" callExtension _text]; + format ["
%5", _icon, _iconColor, _textColor, _shadowColor, "ace_breakLine" callExtension _text]; }; _ctrl ctrlSetStructuredText (parseText _text); From 9aa2e3130acd654f49d477bde9ec8923a9da8f80 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Wed, 29 Apr 2015 23:37:52 -0500 Subject: [PATCH 2/5] Options for Shadow/Outline and Text Size --- addons/interact_menu/config.cpp | 16 ++++++++++ .../functions/fnc_renderIcon.sqf | 10 +++--- .../functions/fnc_renderMenu.sqf | 11 +++---- .../functions/fnc_setupTextColors.sqf | 32 +++++++++++-------- 4 files changed, 43 insertions(+), 26 deletions(-) diff --git a/addons/interact_menu/config.cpp b/addons/interact_menu/config.cpp index 36172d734f..04a7db9791 100644 --- a/addons/interact_menu/config.cpp +++ b/addons/interact_menu/config.cpp @@ -68,6 +68,22 @@ class ACE_Settings { isClientSettable = 1; displayName = "$STR_ACE_Interact_Menu_ColorShadowMin"; }; + class GVAR(textSize) { + value = 2; + typeName = "SCALAR"; + isClientSettable = 1; + displayName = "Interaction Text Size"; + description = "Interaction Text Size 2"; + values[] = {"$str_very_small", "$str_small", "$str_medium", "$str_large", "$str_very_large"}; + }; + class GVAR(shadowSetting) { + value = 1; + typeName = "SCALAR"; + isClientSettable = 1; + displayName = "Text Shadow"; + description = "Interaction Text Size 2"; + values[] = {"Disabled", "Enabled", "Outline"}; + }; }; class ACE_Extensions { diff --git a/addons/interact_menu/functions/fnc_renderIcon.sqf b/addons/interact_menu/functions/fnc_renderIcon.sqf index f98e41f18a..f001917b27 100644 --- a/addons/interact_menu/functions/fnc_renderIcon.sqf +++ b/addons/interact_menu/functions/fnc_renderIcon.sqf @@ -6,9 +6,7 @@ * 0: Text * 1: Icon * 2: 2d position - * 3: Color - * 4: Shadow Color - * 5: Icon Color + * 3: Text Settings * * Return value: * None @@ -18,7 +16,7 @@ #include "script_component.hpp" #define DEFAULT_ICON QUOTE(\z\ace\addons\interaction\ui\dot_ca.paa) private ["_ctrl", "_pos", "_displayNum"]; -PARAMS_6(_text,_icon,_sPos,_textColor,_shadowColor,_iconColor); +PARAMS_4(_text,_icon,_sPos,_textSettings); //systemChat format ["Icon %1 - %2,%3", _text, _sPos select 0, _sPos select 1]; @@ -33,9 +31,9 @@ if(_icon == "") then { }; _text = if (GVAR(UseListMenu)) then { - format ["%5", _icon, _iconColor, _textColor, _shadowColor, _text] + format ["%3", _icon, _textSettings, _text] } else { - format ["
%5", _icon, _iconColor, _textColor, _shadowColor, "ace_breakLine" callExtension _text]; + format ["
%3", _icon, _textSettings, "ace_breakLine" callExtension _text]; }; //_ctrl ctrlSetStructuredText parseText _text; diff --git a/addons/interact_menu/functions/fnc_renderMenu.sqf b/addons/interact_menu/functions/fnc_renderMenu.sqf index a050374786..29759557c5 100644 --- a/addons/interact_menu/functions/fnc_renderMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderMenu.sqf @@ -43,19 +43,16 @@ _menuInSelectedPath = true; //END_COUNTER(constructing_paths); //BEGIN_COUNTER(constructing_colors); -// Render icon -// ARGB Color (First Hex Pair is transparancy) -_textColor = GVAR(colorSelected); -_shadowColor = GVAR(colorSelectedShadow); +//Get text color settings string +_textSettings = GVAR(colorSelectedSettings); if(!_menuInSelectedPath) then { - _textColor = (GVAR(colorNotSelectedMatrix) select (count _path)) select _menuDepth; - _shadowColor = (GVAR(colorShadowNotSelectedMatrix) select (count _path)) select _menuDepth; + _textSettings = (GVAR(textSettingsMatrix) select (count _path)) select _menuDepth; }; //END_COUNTER(constructing_colors); //BEGIN_COUNTER(fnc_renderIcons); -[_actionData select 1, _actionData select 2, _sPos, _textColor, _shadowColor, "#FFFFFFFF"] call FUNC(renderIcon); +[_actionData select 1, _actionData select 2, _sPos, _textSettings] call FUNC(renderIcon); //END_COUNTER(fnc_renderIcons); diff --git a/addons/interact_menu/functions/fnc_setupTextColors.sqf b/addons/interact_menu/functions/fnc_setupTextColors.sqf index 58f9995985..ed45f4799f 100644 --- a/addons/interact_menu/functions/fnc_setupTextColors.sqf +++ b/addons/interact_menu/functions/fnc_setupTextColors.sqf @@ -12,7 +12,6 @@ */ #include "script_component.hpp" -private ["_mixColor", "_rowT", "_rowS", "_menuDepth", "_pathCount"]; //Mixes 2 colors (number arrays) and makes a color string "#AARRGGBB" for structured text _mixColor = { @@ -30,23 +29,30 @@ _mixColor = { _return }; -GVAR(colorSelected) = [GVAR(colorTextMin), GVAR(colorTextMax), 1] call _mixColor; -GVAR(colorSelectedShadow) = [GVAR(colorShadowMin), GVAR(colorShadowMax), 1] call _mixColor; -GVAR(colorNotSelectedMatrix) = []; -GVAR(colorShadowNotSelectedMatrix) = []; +_textColor = [GVAR(colorTextMin), GVAR(colorTextMax), 1] call _mixColor; +_shadowColor = [GVAR(colorShadowMin), GVAR(colorShadowMax), 1] call _mixColor; +_textSize = switch (GVAR(textSize)) do { + case (0): {0.6}; + case (1): {0.7}; + case (2): {0.8}; + case (3): {0.9}; + case (4): {1}; +}; +GVAR(colorSelectedSettings) = format ["color='%1' size='%2' shadow='%3' shadowColor='%4' shadowOffset='0.06'", _textColor, _textSize, GVAR(shadowSetting), _shadowColor]; + +GVAR(textSettingsMatrix) = []; for "_pathCount" from 0 to 15 do { - _rowT = []; - _rowS = []; + _row = []; for "_menuDepth" from 0 to 15 do { if (_menuDepth > 0) then { - _rowT pushBack ([GVAR(colorTextMin), GVAR(colorTextMax), (((_pathCount - 1) / _menuDepth) max 0.25)] call _mixColor); - _rowS pushBack ([GVAR(colorShadowMin), GVAR(colorShadowMax), (((_pathCount - 1) / _menuDepth) max 0.25)] call _mixColor); + _textColor = [GVAR(colorTextMin), GVAR(colorTextMax), (((_pathCount - 1) / _menuDepth) max 0.25)] call _mixColor; + _shadowColor = [GVAR(colorShadowMin), GVAR(colorShadowMax), (((_pathCount - 1) / _menuDepth) max 0.25)] call _mixColor; } else { - _rowT pushBack ([GVAR(colorTextMin), GVAR(colorTextMax), 0] call _mixColor); - _rowS pushBack ([GVAR(colorShadowMin), GVAR(colorShadowMax), 0] call _mixColor); + _textColor = [GVAR(colorTextMin), GVAR(colorTextMax), 0] call _mixColor; + _shadowColor = [GVAR(colorShadowMin), GVAR(colorShadowMax), 0] call _mixColor; }; + _row pushBack format ["color='%1' size='%2' shadow='%3' shadowColor='%4' shadowOffset='0.06'", _textColor, _textSize, GVAR(shadowSetting), _shadowColor]; }; - GVAR(colorNotSelectedMatrix) pushBack _rowT; - GVAR(colorShadowNotSelectedMatrix) pushBack _rowS; + GVAR(textSettingsMatrix) pushBack _row; }; From 11aafe013be5e756abc9e96c9bb716d9a333398a Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Wed, 29 Apr 2015 23:53:00 -0500 Subject: [PATCH 3/5] Localization --- addons/interact_menu/XEH_clientInit.sqf | 4 ++-- addons/interact_menu/config.cpp | 11 +++++------ addons/interact_menu/functions/fnc_renderMenu.sqf | 2 +- .../functions/fnc_setupTextColors.sqf | 1 + addons/interact_menu/stringtable.xml | 14 +++++++++++++- 5 files changed, 22 insertions(+), 10 deletions(-) diff --git a/addons/interact_menu/XEH_clientInit.sqf b/addons/interact_menu/XEH_clientInit.sqf index 5714b77e16..039bccfe25 100644 --- a/addons/interact_menu/XEH_clientInit.sqf +++ b/addons/interact_menu/XEH_clientInit.sqf @@ -5,11 +5,11 @@ if (!hasInterface) exitWith {}; GVAR(ParsedTextCached) = []; -//Setup text/shadow color matrix +//Setup text/shadow/size/color settings matrix [] call FUNC(setupTextColors); ["SettingChanged", { PARAMS_1(_name); - if ((_name == QGVAR(colorTextMax)) || {_name == QGVAR(colorTextMin)} || {_name == QGVAR(colorShadowMax)} || {_name == QGVAR(colorShadowMin)}) then { + if (_name in [QGVAR(colorTextMax), QGVAR(colorTextMin), QGVAR(colorShadowMax), QGVAR(colorShadowMin), QGVAR(textSize), QGVAR(shadowSetting)]) then { [] call FUNC(setupTextColors); }; }] call EFUNC(common,addEventhandler); diff --git a/addons/interact_menu/config.cpp b/addons/interact_menu/config.cpp index 04a7db9791..1b654531e9 100644 --- a/addons/interact_menu/config.cpp +++ b/addons/interact_menu/config.cpp @@ -72,17 +72,16 @@ class ACE_Settings { value = 2; typeName = "SCALAR"; isClientSettable = 1; - displayName = "Interaction Text Size"; - description = "Interaction Text Size 2"; + displayName = "$STR_ACE_Interact_textSize"; values[] = {"$str_very_small", "$str_small", "$str_medium", "$str_large", "$str_very_large"}; }; class GVAR(shadowSetting) { - value = 1; + value = 2; typeName = "SCALAR"; isClientSettable = 1; - displayName = "Text Shadow"; - description = "Interaction Text Size 2"; - values[] = {"Disabled", "Enabled", "Outline"}; + displayName = "$STR_ACE_Interact_shadowSetting"; + description = "$STR_ACE_Interact_shadowSettingDescription"; + values[] = {"$STR_A3_OPTIONS_DISABLED", "$STR_A3_OPTIONS_ENABLED", "$STR_ACE_Interact_shadowOutline"}; }; }; diff --git a/addons/interact_menu/functions/fnc_renderMenu.sqf b/addons/interact_menu/functions/fnc_renderMenu.sqf index 29759557c5..c4615d8337 100644 --- a/addons/interact_menu/functions/fnc_renderMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderMenu.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -private ["_menuInSelectedPath", "_path", "_menuDepth", "_x", "_offset", "_newPos", "_forEachIndex", "_player", "_pos", "_shadowColor", "_target", "_textColor"]; +private ["_menuInSelectedPath", "_path", "_menuDepth", "_x", "_offset", "_newPos", "_forEachIndex", "_player", "_pos", "_target", "_textSettings"]; EXPLODE_4_PVT(_this,_parentPath,_action,_sPos,_angles); EXPLODE_3_PVT(_action,_actionData,_activeChildren,_actionObject); diff --git a/addons/interact_menu/functions/fnc_setupTextColors.sqf b/addons/interact_menu/functions/fnc_setupTextColors.sqf index ed45f4799f..0183e9e50b 100644 --- a/addons/interact_menu/functions/fnc_setupTextColors.sqf +++ b/addons/interact_menu/functions/fnc_setupTextColors.sqf @@ -12,6 +12,7 @@ */ #include "script_component.hpp" +private ["_menuDepth", "_mixColor", "_pathCount", "_row", "_shadowColor", "_textColor", "_textSize"]; //Mixes 2 colors (number arrays) and makes a color string "#AARRGGBB" for structured text _mixColor = { diff --git a/addons/interact_menu/stringtable.xml b/addons/interact_menu/stringtable.xml index b8913ce1c9..5f3f26f1f1 100644 --- a/addons/interact_menu/stringtable.xml +++ b/addons/interact_menu/stringtable.xml @@ -115,5 +115,17 @@ Keeps cursor centered and pans the option menu around. Useful if screen size is limited. Garde le curseur au milieu et dispose le menu des options autour. Utile si la taille de l'écran est limitée. + + Interaction Text Size + + + Interaction Text Shadow + + + Allows controlling the text's shadow. Outline ignores custom shadow colors. + + + Outline + - + \ No newline at end of file From ba18f8b43002748576e9c044d57c293a46355ab1 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 30 Apr 2015 14:07:19 -0500 Subject: [PATCH 4/5] Handle Scaling --- .../functions/fnc_renderMenu.sqf | 37 +++++++++++++------ .../functions/fnc_setupTextColors.sqf | 8 ++-- 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/addons/interact_menu/functions/fnc_renderMenu.sqf b/addons/interact_menu/functions/fnc_renderMenu.sqf index c4615d8337..c88b6cb862 100644 --- a/addons/interact_menu/functions/fnc_renderMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderMenu.sqf @@ -68,7 +68,7 @@ if !(_menuInSelectedPath) exitWith {true}; //BEGIN_COUNTER(children); -private ["_numChildren","_angleSpan","_angle","_angleInterval","_scale","_offset"]; +private ["_numChildren","_angleSpan","_angle","_angleInterval","_scaleX", "_scaleY", "_offset", "_textSize"]; _numChildren = count _activeChildren; _angleSpan = _maxAngleSpan min (55 * ((_numChildren) - 1)); if (_angleSpan >= 305) then { @@ -87,15 +87,30 @@ if (_numChildren == 1) then { }; // Scale menu based on the amount of children -_scale = if (GVAR(UseListMenu)) then { - 0.17 +_scaleX = if (GVAR(UseListMenu)) then { + _textSize = switch (GVAR(textSize)) do { + case (0): {0.75}; + case (1): {0.875}; + case (2): {1}; + case (3): {1.2}; + case (4): {1.4}; + }; + 0.17 * _textSize * 1.1 } else { - 0.17 * (((0.8 * (0.46 / sin (0.5 * _angleInterval))) min 1.1) max 0.5) + _textSize = if (GVAR(textSize) > 2) then {1.3} else {1}; + _textSize * 0.17 * (((0.8 * (0.46 / sin (0.5 * _angleInterval))) min 1.1) max 0.5) +}; +_scaleY = if (GVAR(UseListMenu)) then { + 0.17 * 0.30 * 4/3 +} else { + _textSize = if (GVAR(textSize) > 2) then {1.3} else {1}; + _textSize * 0.17 * 4/3 * (((0.8 * (0.46 / sin (0.5 * _angleInterval))) min 1.1) max 0.5) }; // Animate menu scale if (_menuInSelectedPath && (_menuDepth == count _path)) then { - _scale = _scale * (0.3 + 0.7 * (((diag_tickTime - GVAR(expandedTime)) * 8) min 1)); + _scaleX = _scaleX * (0.3 + 0.7 * (((diag_tickTime - GVAR(expandedTime)) * 8) min 1)); + _scaleY = _scaleY * (0.3 + 0.7 * (((diag_tickTime - GVAR(expandedTime)) * 8) min 1)); }; _target = _actionObject; @@ -107,12 +122,12 @@ _angle = _centerAngle - _angleSpan / 2; //BEGIN_COUNTER(children); private ["_offset","_newPos"]; _newPos = if (GVAR(UseListMenu)) then { - [(_sPos select 0) + _scale * 1.10, - (_sPos select 1) + _scale * 0.30 * 4/3 * (_foreachindex - _numChildren/2 + 0.5)]; - } else { - [(_sPos select 0) -_scale * cos _angle, - (_sPos select 1) +_scale * (sin _angle) * 4/3]; - }; + [(_sPos select 0) + _scaleX, + (_sPos select 1) + _scaleY * (_foreachindex - _numChildren/2 + 0.5)]; + } else { + [(_sPos select 0) - _scaleX * (cos _angle), + (_sPos select 1) + _scaleY * (sin _angle)]; + }; //drawLine3D [_pos, _newPos, [1,0,0,0.8]]; //END_COUNTER(children); diff --git a/addons/interact_menu/functions/fnc_setupTextColors.sqf b/addons/interact_menu/functions/fnc_setupTextColors.sqf index 0183e9e50b..e26ef9dad8 100644 --- a/addons/interact_menu/functions/fnc_setupTextColors.sqf +++ b/addons/interact_menu/functions/fnc_setupTextColors.sqf @@ -33,11 +33,11 @@ _mixColor = { _textColor = [GVAR(colorTextMin), GVAR(colorTextMax), 1] call _mixColor; _shadowColor = [GVAR(colorShadowMin), GVAR(colorShadowMax), 1] call _mixColor; _textSize = switch (GVAR(textSize)) do { - case (0): {0.6}; - case (1): {0.7}; + case (0): {0.4}; + case (1): {0.6}; case (2): {0.8}; - case (3): {0.9}; - case (4): {1}; + case (3): {1}; + case (4): {1.2}; }; GVAR(colorSelectedSettings) = format ["color='%1' size='%2' shadow='%3' shadowColor='%4' shadowOffset='0.06'", _textColor, _textSize, GVAR(shadowSetting), _shadowColor]; From fc02bb4e066050ae3eb49dae52d5ec826d638e32 Mon Sep 17 00:00:00 2001 From: esteldunedain Date: Fri, 1 May 2015 00:32:16 -0300 Subject: [PATCH 5/5] Stylistic changes --- .../functions/fnc_renderIcon.sqf | 10 +++---- .../functions/fnc_renderMenu.sqf | 29 +++++++------------ .../functions/fnc_renderSelector.sqf | 14 ++++----- 3 files changed, 23 insertions(+), 30 deletions(-) diff --git a/addons/interact_menu/functions/fnc_renderIcon.sqf b/addons/interact_menu/functions/fnc_renderIcon.sqf index 2910cb2d03..180b5a3c36 100644 --- a/addons/interact_menu/functions/fnc_renderIcon.sqf +++ b/addons/interact_menu/functions/fnc_renderIcon.sqf @@ -25,7 +25,7 @@ if(GVAR(iconCount) > (count GVAR(iconCtrls))-1) then { GVAR(iconCtrls) pushBack ((findDisplay _displayNum) ctrlCreate ["RscStructuredText", 54021+GVAR(iconCount)]); }; _ctrl = GVAR(iconCtrls) select GVAR(iconCount); -GVAR(iconCount) = GVAR(iconCount) + 1; + if(_icon == "") then { _icon = DEFAULT_ICON; }; @@ -38,12 +38,12 @@ _text = if (GVAR(UseListMenu)) then { //_ctrl ctrlSetStructuredText parseText _text; [_ctrl, GVAR(iconCount), _text] call FUNC(ctrlSetParsedTextCached); +GVAR(iconCount) = GVAR(iconCount) + 1; -_pos = []; -if (GVAR(UseListMenu)) then { - _pos = [(_sPos select 0)-(0.0095*SafeZoneW), (_sPos select 1)-(0.0095*SafeZoneW), 0.20*SafeZoneW, 0.035*SafeZoneW]; +_pos = if (GVAR(UseListMenu)) then { + [(_sPos select 0)-(0.0095*SafeZoneW), (_sPos select 1)-(0.0095*SafeZoneW), 0.20*SafeZoneW, 0.035*SafeZoneW] } else { - _pos = [(_sPos select 0)-(0.0750*SafeZoneW), (_sPos select 1)-(0.0095*SafeZoneW), 0.15*SafeZoneW, 0.100*SafeZoneW]; + [(_sPos select 0)-(0.0750*SafeZoneW), (_sPos select 1)-(0.0095*SafeZoneW), 0.15*SafeZoneW, 0.100*SafeZoneW] }; if (GVAR(cursorKeepCentered) && {uiNamespace getVariable [QGVAR(cursorMenuOpened),false]}) then { diff --git a/addons/interact_menu/functions/fnc_renderMenu.sqf b/addons/interact_menu/functions/fnc_renderMenu.sqf index c88b6cb862..84c7799684 100644 --- a/addons/interact_menu/functions/fnc_renderMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderMenu.sqf @@ -87,24 +87,17 @@ if (_numChildren == 1) then { }; // Scale menu based on the amount of children -_scaleX = if (GVAR(UseListMenu)) then { - _textSize = switch (GVAR(textSize)) do { - case (0): {0.75}; - case (1): {0.875}; - case (2): {1}; - case (3): {1.2}; - case (4): {1.4}; - }; - 0.17 * _textSize * 1.1 +_scaleX = 1; +_scaleY = 1; + +if (GVAR(UseListMenu)) then { + _textSize = [0.75, 0.875, 1, 1.2, 1.4] select GVAR(textSize); + _scaleX = _textSize * 0.17 * 1.1; + _scaleY = 0.17 * 0.30 * 4/3; } else { _textSize = if (GVAR(textSize) > 2) then {1.3} else {1}; - _textSize * 0.17 * (((0.8 * (0.46 / sin (0.5 * _angleInterval))) min 1.1) max 0.5) -}; -_scaleY = if (GVAR(UseListMenu)) then { - 0.17 * 0.30 * 4/3 -} else { - _textSize = if (GVAR(textSize) > 2) then {1.3} else {1}; - _textSize * 0.17 * 4/3 * (((0.8 * (0.46 / sin (0.5 * _angleInterval))) min 1.1) max 0.5) + _scaleX = _textSize * 0.17 * (((0.8 * (0.46 / sin (0.5 * _angleInterval))) min 1.1) max 0.5); + _scaleY = _textSize * 0.17 * 4/3 * (((0.8 * (0.46 / sin (0.5 * _angleInterval))) min 1.1) max 0.5); }; // Animate menu scale @@ -123,10 +116,10 @@ _angle = _centerAngle - _angleSpan / 2; private ["_offset","_newPos"]; _newPos = if (GVAR(UseListMenu)) then { [(_sPos select 0) + _scaleX, - (_sPos select 1) + _scaleY * (_foreachindex - _numChildren/2 + 0.5)]; + (_sPos select 1) + _scaleY * (_foreachindex - _numChildren/2 + 0.5)]; } else { [(_sPos select 0) - _scaleX * (cos _angle), - (_sPos select 1) + _scaleY * (sin _angle)]; + (_sPos select 1) + _scaleY * (sin _angle)]; }; //drawLine3D [_pos, _newPos, [1,0,0,0.8]]; diff --git a/addons/interact_menu/functions/fnc_renderSelector.sqf b/addons/interact_menu/functions/fnc_renderSelector.sqf index 569fa79198..7ac9559297 100644 --- a/addons/interact_menu/functions/fnc_renderSelector.sqf +++ b/addons/interact_menu/functions/fnc_renderSelector.sqf @@ -23,17 +23,17 @@ if(GVAR(iconCount) > (count GVAR(iconCtrls))-1) then { }; _ctrl = GVAR(iconCtrls) select GVAR(iconCount); -GVAR(iconCount) = GVAR(iconCount) + 1; -_pos = []; -if (GVAR(UseListMenu)) then { - [_ctrl, GVAR(iconCount), format ["", _icon]] call FUNC(ctrlSetParsedTextCached); - _pos = [(_sPos select 0)-(0.014*SafeZoneW), (_sPos select 1)-(0.014*SafeZoneW), 0.05*SafeZoneW, 0.035*SafeZoneW]; +_pos = if (GVAR(UseListMenu)) then { + [_ctrl, GVAR(iconCount), format ["", _icon]] call FUNC(ctrlSetParsedTextCached); + [(_sPos select 0)-(0.014*SafeZoneW), (_sPos select 1)-(0.014*SafeZoneW), 0.05*SafeZoneW, 0.035*SafeZoneW] } else { - [_ctrl, GVAR(iconCount), format ["", _icon]] call FUNC(ctrlSetParsedTextCached); - _pos = [(_sPos select 0)-(0.050*SafeZoneW), (_sPos select 1)-(0.014*SafeZoneW), 0.1*SafeZoneW, 0.035*SafeZoneW]; + [_ctrl, GVAR(iconCount), format ["", _icon]] call FUNC(ctrlSetParsedTextCached); + [(_sPos select 0)-(0.050*SafeZoneW), (_sPos select 1)-(0.014*SafeZoneW), 0.1*SafeZoneW, 0.035*SafeZoneW] }; +GVAR(iconCount) = GVAR(iconCount) + 1; + if (GVAR(cursorKeepCentered) && {uiNamespace getVariable [QGVAR(cursorMenuOpened),false]}) then { _pos set [0, ((_pos select 0) - (GVAR(cursorPos) select 0) + 0.5)]; _pos set [1, ((_pos select 1) - (GVAR(cursorPos) select 1) + 0.5)];