diff --git a/addons/interact_menu/functions/fnc_compileMenu.sqf b/addons/interact_menu/functions/fnc_compileMenu.sqf index 58e13ee481..816d06ef72 100644 --- a/addons/interact_menu/functions/fnc_compileMenu.sqf +++ b/addons/interact_menu/functions/fnc_compileMenu.sqf @@ -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 diff --git a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf index b4d969667b..54f5867e0d 100644 --- a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf @@ -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"); diff --git a/addons/interact_menu/functions/fnc_compileMenuZeus.sqf b/addons/interact_menu/functions/fnc_compileMenuZeus.sqf index a5987d411f..b2a95c510e 100644 --- a/addons/interact_menu/functions/fnc_compileMenuZeus.sqf +++ b/addons/interact_menu/functions/fnc_compileMenuZeus.sqf @@ -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"); diff --git a/addons/interact_menu/functions/fnc_createAction.sqf b/addons/interact_menu/functions/fnc_createAction.sqf index 27d6d5bc3d..5129482771 100644 --- a/addons/interact_menu/functions/fnc_createAction.sqf +++ b/addons/interact_menu/functions/fnc_createAction.sqf @@ -6,7 +6,7 @@ * Arguments: * 0: Action name * 1: Name of the action shown in the menu - * 2: Icon + * 2: Icon file path or Array of icon file path and hex color ("" for default icon) * 3: Statement * 4: Condition * 5: Insert children code (Optional) diff --git a/addons/interact_menu/functions/fnc_renderIcon.sqf b/addons/interact_menu/functions/fnc_renderIcon.sqf index 4d9892ed2c..6c97f96693 100644 --- a/addons/interact_menu/functions/fnc_renderIcon.sqf +++ b/addons/interact_menu/functions/fnc_renderIcon.sqf @@ -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 - * 1: Icon + * 1: Icon file path or Array of icon file path and hex color * 2: 2d position * 3: Text Settings * @@ -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 ["%3", _icon, _textSettings, _text] + format ["%4", _iconFile, _iconColor, _textSettings, _text] } else { - format ["
%3", _icon, _textSettings, "ace_break_line" callExtension _text]; + format ["
%4", _iconFile, _iconColor, _textSettings, "ace_break_line" callExtension _text]; }; [_ctrl, GVAR(iconCount), _text] call FUNC(ctrlSetParsedTextCached);