From 18f7828c26289ba732531940b38e00c29b5df97d Mon Sep 17 00:00:00 2001 From: Jrc13245 Date: Sun, 26 Oct 2025 12:48:29 -0400 Subject: [PATCH] fix non-letter or number characters in item or spell names --- Core.lua | 13 ++++++++++++- Extensions/Tooltip/Generic.lua | 28 ++++++++++++++++++++++++++-- README.md | 3 ++- 3 files changed, 40 insertions(+), 4 deletions(-) diff --git a/Core.lua b/Core.lua index 7c15d20..2f1c995 100644 --- a/Core.lua +++ b/Core.lua @@ -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 diff --git a/Extensions/Tooltip/Generic.lua b/Extensions/Tooltip/Generic.lua index 0abdb1c..2b68241 100644 --- a/Extensions/Tooltip/Generic.lua +++ b/Extensions/Tooltip/Generic.lua @@ -136,6 +136,8 @@ function CleveRoids.IndexItems() slotsIndex = 1, } items[itemID] = name + -- ADDED: Also index by lowercase name for case-insensitive lookup + items[string.lower(name)] = name else items[name].count = (items[name].count or 0) + (count or 0) table.insert(items[name].bagSlots, {bagID, slot}) @@ -162,6 +164,8 @@ function CleveRoids.IndexItems() link = link, } items[itemID] = name + -- ADDED: Also index by lowercase name for case-insensitive lookup + items[string.lower(name)] = name else items[name].inventoryID = inventoryID items[name].count = (items[name].count or 0) + (count or 0) @@ -249,7 +253,17 @@ end function CleveRoids.GetItem(text) if not text or text == "" then return end + -- IMPROVED: Try exact match first, then lowercase match local item = CleveRoids.Items[text] or CleveRoids.Items[tostring(text)] + if not item then + -- Try lowercase lookup + local lowerText = string.lower(text) + local canonicalName = CleveRoids.Items[lowerText] + if canonicalName and type(canonicalName) == "string" then + item = CleveRoids.Items[canonicalName] + end + end + if item then if type(item) == "table" then return item @@ -277,7 +291,11 @@ function CleveRoids.GetItem(text) link = link, count = count } - if name then CleveRoids.Items[name] = it end + if name then + CleveRoids.Items[name] = it + -- ADDED: Also cache by lowercase + CleveRoids.Items[string.lower(name)] = name + end if itemID then CleveRoids.Items[itemID] = name end return it end @@ -310,7 +328,11 @@ function CleveRoids.GetItem(text) bagSlots = { { bagID, slot } }, slotsIndex = 1 } - if name then CleveRoids.Items[name] = it end + if name then + CleveRoids.Items[name] = it + -- ADDED: Also cache by lowercase + CleveRoids.Items[string.lower(name)] = name + end if itemID then CleveRoids.Items[itemID] = name end return it end @@ -374,6 +396,8 @@ function CleveRoids.GetItem(text) if not name then return end local fallback = { id = text, name = name, link = link, texture = texture } CleveRoids.Items[name] = fallback + -- ADDED: Also cache by lowercase + CleveRoids.Items[string.lower(name)] = name return fallback end diff --git a/README.md b/README.md index cfa0c32..b1bce44 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,9 @@ Check slash command and all conditional lists for new usages! 2. Unzip the file and place the folder into your `Interface/Addons` folder. 3. Rename the `SuperCleveRoidMacros-main` folder to `SuperCleveRoidMacros` 4. Check that it is enabled in your addon list in-game. -5. Make sure you don't have other macro addons that may interfere. SuperMacro should be compatible. +5. Make sure you don't have other macro addons that may interfere. 6. SUPERWOW and NAMPOWER are REQUIRED! +7. Disable Macrotweak module in pfui, and disable macrotweak in shagutweaks! * [SuperWoW](https://github.com/balakethelock/SuperWoW) dll mod is required