Fix showtooltip icon display by parsing conditionals from spell names

When #showtooltip had an argument with conditionals (e.g., #showtooltip [stance:1] Fireball),
the code was trying to find a spell named "[stance:1] Fireball" which doesn't exist.
This resulted in no texture being found for the tooltip action, causing incorrect icons.

Now the code parses the argument first using GetParsedMsg() to extract just the spell name
before creating the tooltip action info. This allows it to properly find the spell in the
spellbook and retrieve its correct texture/icon.
This commit is contained in:
Claude
2025-11-17 21:52:00 +00:00
parent 62a4b4a5e6
commit f74de5ef03
+4 -2
View File
@@ -1041,8 +1041,10 @@ function CleveRoids.ParseMacro(name)
if st and tt ~= "" then
showTooltipHasArg = true
for _, arg in ipairs(CleveRoids.splitStringIgnoringQuotes(tt)) do
macro.actions.tooltip = CleveRoids.CreateActionInfo(arg)
local action = CleveRoids.CreateActionInfo(CleveRoids.GetParsedMsg(arg))
-- Parse the arg to extract the spell name from any conditionals
local parsedArg = CleveRoids.GetParsedMsg(arg)
macro.actions.tooltip = CleveRoids.CreateActionInfo(parsedArg)
local action = CleveRoids.CreateActionInfo(parsedArg)
action.cmd = "/cast"
action.args = arg
action.isReactive = CleveRoids.reactiveSpells[action.action]