mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Interaction Menu - Ability to modify icon color (#6290)
* Add ability to modify icon color * Add config support for icon color
This commit is contained in:
parent
ac3642d074
commit
3d31b6395c
@ -37,7 +37,11 @@ private _recurseFnc = {
|
||||
private _distance = _parentDistance;
|
||||
if (isNumber (_entryCfg >> "distance")) then {_distance = getNumber (_entryCfg >> "distance");};
|
||||
// if (_distance < _parentDistance) then {WARNING_3("[%1] distance %2 less than parent %3", configName _entryCfg, _distance, _parentDistance);};
|
||||
private _icon = getText (_entryCfg >> "icon");
|
||||
private _icon = if (isArray (_entryCfg >> "icon")) then {
|
||||
getArray (_entryCfg >> "icon");
|
||||
} else {
|
||||
[getText (_entryCfg >> "icon"), "#FFFFFF"];
|
||||
};
|
||||
private _statement = compile (getText (_entryCfg >> "statement"));
|
||||
|
||||
// If the position entry is present, compile it
|
||||
|
@ -37,7 +37,11 @@ private _recurseFnc = {
|
||||
if(isClass _entryCfg) then {
|
||||
private _displayName = getText (_entryCfg >> "displayName");
|
||||
|
||||
private _icon = getText (_entryCfg >> "icon");
|
||||
private _icon = if (isArray (_entryCfg >> "icon")) then {
|
||||
getArray (_entryCfg >> "icon");
|
||||
} else {
|
||||
[getText (_entryCfg >> "icon"), "#FFFFFF"];
|
||||
};
|
||||
private _statement = compile (getText (_entryCfg >> "statement"));
|
||||
|
||||
private _condition = getText (_entryCfg >> "condition");
|
||||
|
@ -27,7 +27,11 @@ private _recurseFnc = {
|
||||
if(isClass _entryCfg) then {
|
||||
private _displayName = getText (_entryCfg >> "displayName");
|
||||
|
||||
private _icon = getText (_entryCfg >> "icon");
|
||||
private _icon = if (isArray (_entryCfg >> "icon")) then {
|
||||
getArray (_entryCfg >> "icon");
|
||||
} else {
|
||||
[getText (_entryCfg >> "icon"), "#FFFFFF"];
|
||||
};
|
||||
private _statement = compile (getText (_entryCfg >> "statement"));
|
||||
|
||||
private _condition = getText (_entryCfg >> "condition");
|
||||
|
@ -6,7 +6,7 @@
|
||||
* Arguments:
|
||||
* 0: Action name <STRING>
|
||||
* 1: Name of the action shown in the menu <STRING>
|
||||
* 2: Icon <STRING>
|
||||
* 2: Icon file path or Array of icon file path and hex color ("" for default icon) <STRING|ARRAY>
|
||||
* 3: Statement <CODE>
|
||||
* 4: Condition <CODE>
|
||||
* 5: Insert children code <CODE> (Optional)
|
||||
|
@ -1,10 +1,10 @@
|
||||
/*
|
||||
* Author: NouberNou and esteldunedain
|
||||
* Render a single interaction icon
|
||||
* Author: NouberNou, esteldunedain, mharis001
|
||||
* Render a single interaction icon.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Text <STRING>
|
||||
* 1: Icon <STRING>
|
||||
* 1: Icon file path or Array of icon file path and hex color <STRING|ARRAY>
|
||||
* 2: 2d position <ARRAY>
|
||||
* 3: Text Settings <STRING>
|
||||
*
|
||||
@ -12,7 +12,7 @@
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* ["text", "icon", [5, 6], "text"] call ACE_interact_menu_fnc_renderIcon
|
||||
* ["text", "icon", [5, 6], "text"] call ace_interact_menu_fnc_renderIcon
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
@ -33,14 +33,15 @@ if(GVAR(iconCount) > (count GVAR(iconCtrls))-1) then {
|
||||
};
|
||||
private _ctrl = GVAR(iconCtrls) select GVAR(iconCount);
|
||||
|
||||
if(_icon == "") then {
|
||||
_icon = DEFAULT_ICON;
|
||||
_icon params [["_iconFile", "", [""]], ["_iconColor", "#FFFFFF", [""]]];
|
||||
if (_iconFile isEqualTo "") then {
|
||||
_iconFile = DEFAULT_ICON;
|
||||
};
|
||||
|
||||
_text = if (GVAR(UseListMenu)) then {
|
||||
format ["<img image='%1' align='left'/><t %2>%3</t>", _icon, _textSettings, _text]
|
||||
format ["<img image='%1' align='left' color='%2'/><t %3>%4</t>", _iconFile, _iconColor, _textSettings, _text]
|
||||
} else {
|
||||
format ["<img image='%1' align='center'/><br/><t %2 align='center'>%3</t>", _icon, _textSettings, "ace_break_line" callExtension _text];
|
||||
format ["<img image='%1' align='center' color='%2'/><br/><t %3 align='center'>%4</t>", _iconFile, _iconColor, _textSettings, "ace_break_line" callExtension _text];
|
||||
};
|
||||
|
||||
[_ctrl, GVAR(iconCount), _text] call FUNC(ctrlSetParsedTextCached);
|
||||
|
Loading…
Reference in New Issue
Block a user