mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Options for Shadow/Outline and Text Size
This commit is contained in:
parent
e40a2a524d
commit
9aa2e3130a
@ -68,6 +68,22 @@ class ACE_Settings {
|
|||||||
isClientSettable = 1;
|
isClientSettable = 1;
|
||||||
displayName = "$STR_ACE_Interact_Menu_ColorShadowMin";
|
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 {
|
class ACE_Extensions {
|
||||||
|
@ -6,9 +6,7 @@
|
|||||||
* 0: Text <STRING>
|
* 0: Text <STRING>
|
||||||
* 1: Icon <STRING>
|
* 1: Icon <STRING>
|
||||||
* 2: 2d position <ARRAY>
|
* 2: 2d position <ARRAY>
|
||||||
* 3: Color <STRING>
|
* 3: Text Settings <STRING>
|
||||||
* 4: Shadow Color <STRING>
|
|
||||||
* 5: Icon Color <STRING>
|
|
||||||
*
|
*
|
||||||
* Return value:
|
* Return value:
|
||||||
* None
|
* None
|
||||||
@ -18,7 +16,7 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
#define DEFAULT_ICON QUOTE(\z\ace\addons\interaction\ui\dot_ca.paa)
|
#define DEFAULT_ICON QUOTE(\z\ace\addons\interaction\ui\dot_ca.paa)
|
||||||
private ["_ctrl", "_pos", "_displayNum"];
|
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];
|
//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 {
|
_text = if (GVAR(UseListMenu)) then {
|
||||||
format ["<img image='%1' color='%2' align='left'/><t color='%3' size='0.80' shadow='2' shadowColor='%4' shadowOffset='0.06'>%5</t>", _icon, _iconColor, _textColor, _shadowColor, _text]
|
format ["<img image='%1' align='left'/><t %2>%3</t>", _icon, _textSettings, _text]
|
||||||
} else {
|
} else {
|
||||||
format ["<img image='%1' color='%2' align='center'/><br/><t color='%3' size='0.80' align='center' shadow='2' shadowColor='%4' shadowOffset='0.06'>%5</t>", _icon, _iconColor, _textColor, _shadowColor, "ace_breakLine" callExtension _text];
|
format ["<img image='%1' align='center'/><br/><t %2 align='center'>%3</t>", _icon, _textSettings, "ace_breakLine" callExtension _text];
|
||||||
};
|
};
|
||||||
|
|
||||||
//_ctrl ctrlSetStructuredText parseText _text;
|
//_ctrl ctrlSetStructuredText parseText _text;
|
||||||
|
@ -43,19 +43,16 @@ _menuInSelectedPath = true;
|
|||||||
//END_COUNTER(constructing_paths);
|
//END_COUNTER(constructing_paths);
|
||||||
//BEGIN_COUNTER(constructing_colors);
|
//BEGIN_COUNTER(constructing_colors);
|
||||||
|
|
||||||
// Render icon
|
//Get text color settings string
|
||||||
// ARGB Color (First Hex Pair is transparancy)
|
_textSettings = GVAR(colorSelectedSettings);
|
||||||
_textColor = GVAR(colorSelected);
|
|
||||||
_shadowColor = GVAR(colorSelectedShadow);
|
|
||||||
if(!_menuInSelectedPath) then {
|
if(!_menuInSelectedPath) then {
|
||||||
_textColor = (GVAR(colorNotSelectedMatrix) select (count _path)) select _menuDepth;
|
_textSettings = (GVAR(textSettingsMatrix) select (count _path)) select _menuDepth;
|
||||||
_shadowColor = (GVAR(colorShadowNotSelectedMatrix) select (count _path)) select _menuDepth;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//END_COUNTER(constructing_colors);
|
//END_COUNTER(constructing_colors);
|
||||||
//BEGIN_COUNTER(fnc_renderIcons);
|
//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);
|
//END_COUNTER(fnc_renderIcons);
|
||||||
|
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_mixColor", "_rowT", "_rowS", "_menuDepth", "_pathCount"];
|
|
||||||
|
|
||||||
//Mixes 2 colors (number arrays) and makes a color string "#AARRGGBB" for structured text
|
//Mixes 2 colors (number arrays) and makes a color string "#AARRGGBB" for structured text
|
||||||
_mixColor = {
|
_mixColor = {
|
||||||
@ -30,23 +29,30 @@ _mixColor = {
|
|||||||
_return
|
_return
|
||||||
};
|
};
|
||||||
|
|
||||||
GVAR(colorSelected) = [GVAR(colorTextMin), GVAR(colorTextMax), 1] call _mixColor;
|
_textColor = [GVAR(colorTextMin), GVAR(colorTextMax), 1] call _mixColor;
|
||||||
GVAR(colorSelectedShadow) = [GVAR(colorShadowMin), GVAR(colorShadowMax), 1] call _mixColor;
|
_shadowColor = [GVAR(colorShadowMin), GVAR(colorShadowMax), 1] call _mixColor;
|
||||||
GVAR(colorNotSelectedMatrix) = [];
|
_textSize = switch (GVAR(textSize)) do {
|
||||||
GVAR(colorShadowNotSelectedMatrix) = [];
|
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 {
|
for "_pathCount" from 0 to 15 do {
|
||||||
_rowT = [];
|
_row = [];
|
||||||
_rowS = [];
|
|
||||||
for "_menuDepth" from 0 to 15 do {
|
for "_menuDepth" from 0 to 15 do {
|
||||||
if (_menuDepth > 0) then {
|
if (_menuDepth > 0) then {
|
||||||
_rowT pushBack ([GVAR(colorTextMin), GVAR(colorTextMax), (((_pathCount - 1) / _menuDepth) max 0.25)] call _mixColor);
|
_textColor = [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);
|
_shadowColor = [GVAR(colorShadowMin), GVAR(colorShadowMax), (((_pathCount - 1) / _menuDepth) max 0.25)] call _mixColor;
|
||||||
} else {
|
} else {
|
||||||
_rowT pushBack ([GVAR(colorTextMin), GVAR(colorTextMax), 0] call _mixColor);
|
_textColor = [GVAR(colorTextMin), GVAR(colorTextMax), 0] call _mixColor;
|
||||||
_rowS pushBack ([GVAR(colorShadowMin), GVAR(colorShadowMax), 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(textSettingsMatrix) pushBack _row;
|
||||||
GVAR(colorShadowNotSelectedMatrix) pushBack _rowS;
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user