mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
cache ctrlSetStructedText parseText
This commit is contained in:
parent
6fdaf4c400
commit
73b17efa2f
@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
if (!hasInterface) exitWith {};
|
if (!hasInterface) exitWith {};
|
||||||
|
|
||||||
|
GVAR(ParsedTextCached) = [];
|
||||||
|
|
||||||
//Setup text/shadow color matrix
|
//Setup text/shadow color matrix
|
||||||
[] call FUNC(setupTextColors);
|
[] call FUNC(setupTextColors);
|
||||||
["SettingChanged", {
|
["SettingChanged", {
|
||||||
|
@ -8,6 +8,7 @@ PREP(compileMenu);
|
|||||||
PREP(compileMenuSelfAction);
|
PREP(compileMenuSelfAction);
|
||||||
PREP(collectActiveActionTree);
|
PREP(collectActiveActionTree);
|
||||||
PREP(createAction);
|
PREP(createAction);
|
||||||
|
PREP(ctrlSetParsedTextCached);
|
||||||
PREP(findActionNode);
|
PREP(findActionNode);
|
||||||
PREP(handlePlayerChanged);
|
PREP(handlePlayerChanged);
|
||||||
PREP(isSubPath);
|
PREP(isSubPath);
|
||||||
|
@ -0,0 +1,13 @@
|
|||||||
|
// by commy2
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
private ["_ctrl", "_index", "_text"];
|
||||||
|
|
||||||
|
_ctrl = _this select 0;
|
||||||
|
_index = _this select 1;
|
||||||
|
_text = _this select 2;
|
||||||
|
|
||||||
|
if (_text != ARR_SELECT(GVAR(ParsedTextCached),_index,"")) then {
|
||||||
|
GVAR(ParsedTextCached) set [_index, _text];
|
||||||
|
_ctrl ctrlSetStructuredText parseText _text;
|
||||||
|
};
|
@ -33,12 +33,12 @@ 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='1' shadowColor='%4' shadowOffset='0.06'>%5</t>", _icon, _iconColor, _textColor, _shadowColor, _text]
|
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]
|
||||||
} else {
|
} else {
|
||||||
format ["<img image='%1' color='%2' align='center'/><br/><t color='%3' size='0.80' align='center' shadow='1' shadowColor='%4' shadowOffset='0.06'>%5</t>", _icon, _iconColor, _textColor, _shadowColor, "ace_breakLine" callExtension _text];
|
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];
|
||||||
};
|
};
|
||||||
|
|
||||||
_ctrl ctrlSetStructuredText (parseText _text);
|
[_ctrl, GVAR(iconCount), _text] call FUNC(ctrlSetParsedTextCached);
|
||||||
_text = if (GVAR(UseListMenu)) then {
|
_text = if (GVAR(UseListMenu)) then {
|
||||||
_ctrl ctrlSetPosition [(_sPos select 0)-(0.0095*SafeZoneW), (_sPos select 1)-(0.0095*SafeZoneW), 0.20*SafeZoneW, 0.035*SafeZoneW];
|
_ctrl ctrlSetPosition [(_sPos select 0)-(0.0095*SafeZoneW), (_sPos select 1)-(0.0095*SafeZoneW), 0.20*SafeZoneW, 0.035*SafeZoneW];
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user