Ensure icon always falls back to macro icon, never question mark

Updated fallback logic to always use the macro's chosen icon (from the
macro frame) when no action is active. The priority is now:
1. Tooltip texture (from first action if #showtooltip is present)
2. Macro's icon (from macro frame)
3. Never question mark (unless GetMacroInfo fails, which shouldn't happen)

This ensures the icon properly shows the macro's icon when all
conditionals fail, instead of showing a question mark.
This commit is contained in:
Claude
2025-11-17 18:10:09 +00:00
parent 852d3691c2
commit f99b985395
+15 -12
View File
@@ -2420,25 +2420,28 @@ function GetActionTexture(slot)
if actions and (actions.active or actions.tooltip) then
-- This block handles the case where all conditionals fail and no explicit
-- #showtooltip was set. It defaults to the macro's chosen icon (e.g., the red '?')
-- #showtooltip was set. It defaults to the macro's chosen icon.
if not actions.active and not actions.explicitTooltip and actions.list and table.getn(actions.list) > 0 then
-- First try to use the tooltip texture if it exists
if actions.tooltip and actions.tooltip.texture then
return actions.tooltip.texture
end
-- Then try to get the macro's own icon
-- Get the macro's own icon as fallback
local macroTexture = nil
local macroName = GetActionText(slot)
if macroName then
local macroID = GetMacroIndexByName(macroName)
if macroID and macroID > 0 then
local _, macroTexture = GetMacroInfo(macroID)
if macroTexture then
return macroTexture
end
local _, texture = GetMacroInfo(macroID)
macroTexture = texture
end
end
return CleveRoids.unknownTexture
-- Prefer tooltip texture if it exists, otherwise use macro icon
if actions.tooltip and actions.tooltip.texture then
return actions.tooltip.texture
elseif macroTexture then
return macroTexture
end
-- Should never reach here, but return macro texture or unknown as last resort
return macroTexture or CleveRoids.unknownTexture
end
-- Prioritize active action, fall back to tooltip