Merge pull request #51 from jrc13245/claude/wow-macro-script-01528arN7dwrRwDNpdCVjcwE

Fix all icon fallback paths to use macro icon instead of question mark
This commit is contained in:
Torio
2025-11-17 13:33:19 -05:00
committed by GitHub
+32 -2
View File
@@ -2454,14 +2454,44 @@ function GetActionTexture(slot)
if currentTexture then
return currentTexture
end
-- Slot is empty, fall back to macro icon
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
end
end
return CleveRoids.unknownTexture
end
-- *** THIS IS THE FIX ***
-- If an action is active, return its texture directly.
-- If no action is active, return the tooltip's texture.
-- This bypasses the 'proxySlot' check that required the spell to be on the action bar.
return (actions.active and actions.active.texture) or (actions.tooltip and actions.tooltip.texture) or CleveRoids.unknownTexture
-- If neither has a texture, fall back to the macro's icon.
local texture = (actions.active and actions.active.texture) or (actions.tooltip and actions.tooltip.texture)
if texture then
return texture
end
-- Final fallback: get the macro's icon
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
end
end
-- Should never reach here
return CleveRoids.unknownTexture
end