fix non-letter or number characters in item or spell names

This commit is contained in:
Jrc13245
2025-10-26 12:48:29 -04:00
parent 6db708f40b
commit 18f7828c26
3 changed files with 40 additions and 4 deletions
+12 -1
View File
@@ -744,7 +744,7 @@ function CleveRoids.ParseMacro(name)
_, texture, body = GetMacroInfo(macroID)
end
-- Fallback: SuperMacro “Super” tab
-- Fallback: SuperMacro "Super" tab
if (not body) and GetSuperMacroInfo then
_, texture, body = GetSuperMacroInfo(name)
end
@@ -761,6 +761,9 @@ function CleveRoids.ParseMacro(name)
macro.actions.list = {}
-- build a list of testable actions for the macro
local hasShowTooltip = false
local showTooltipHasArg = false
for i, line in ipairs(CleveRoids.splitString(body, "\n")) do
line = CleveRoids.Trim(line)
local cmd, args = CleveRoids.SplitCommandAndArgs(line)
@@ -773,10 +776,13 @@ function CleveRoids.ParseMacro(name)
if not st then
break
end
hasShowTooltip = true
tt = CleveRoids.Trim(tt)
-- #showtooltip and item/spell/macro specified, only use this tooltip
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))
@@ -803,6 +809,11 @@ function CleveRoids.ParseMacro(name)
action.args = arg
action.isReactive = CleveRoids.reactiveSpells[action.action]
table.insert(macro.actions.list, action)
-- NEW FIX: If #showtooltip with no args, use first action as tooltip
if hasShowTooltip and not showTooltipHasArg and not macro.actions.tooltip then
macro.actions.tooltip = action
end
end
end
end