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; };