From 1b1d4fe94b2b101e14abe802589b4c187b24f66d Mon Sep 17 00:00:00 2001 From: Jrc13245 Date: Mon, 10 Nov 2025 19:59:13 -0500 Subject: [PATCH] revert some changes --- Extensions/Tooltip/Generic.lua | 50 +++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/Extensions/Tooltip/Generic.lua b/Extensions/Tooltip/Generic.lua index 3eb6479..0029301 100644 --- a/Extensions/Tooltip/Generic.lua +++ b/Extensions/Tooltip/Generic.lua @@ -192,36 +192,55 @@ function CleveRoids.ClearSlot(slots, slot) slots[slot] = nil end +-- Local helper for 1.12.1: safely get action button info via tooltip +function CleveRoids.GetActionButtonInfo(slot) + if not CleveRoidsActionTooltip then + CreateFrame("GameTooltip", "CleveRoidsActionTooltip", UIParent, "GameTooltipTemplate") + end + + local tooltip = CleveRoidsActionTooltip + tooltip:SetOwner(UIParent, "ANCHOR_NONE") + tooltip:ClearLines() + tooltip:SetAction(slot) + + local name, rank + local text = _G["CleveRoidsActionTooltipTextLeft1"] + if text then name = text:GetText() end + local text2 = _G["CleveRoidsActionTooltipTextLeft2"] + if text2 then + local maybeRank = text2:GetText() + -- Rank lines usually start with "Rank" + if maybeRank and string.find(maybeRank, "Rank") then + rank = maybeRank + end + end + + -- Determine if it's an item or spell based on texture (heuristic) + local tex = GetActionTexture(slot) + local actionType = tex and "SPELL" or "ITEM" + + return actionType, tex, name, rank +end + function CleveRoids.IndexActionSlot(slot) if not HasAction(slot) then CleveRoids.Actions[slot] = nil CleveRoids.ClearSlot(CleveRoids.reactiveSlots, slot) CleveRoids.ClearSlot(CleveRoids.actionSlots, slot) else - -- 1.12.1 API: GetActionInfo - local actionType, id, subType = GetActionInfo(slot) - local name, rank - - if actionType == "spell" then - name, rank = GetSpellName(id, BOOKTYPE_SPELL) - elseif actionType == "item" then - name = GetItemInfo(id) - end - + local actionType, _, name, rank = CleveRoids.GetActionButtonInfo(slot) if name then local reactiveName = CleveRoids.reactiveSpells[name] and name - local actionSlotName = name .. (rank and ("(" .. rank .. ")") or "") - + local actionSlotName = name..(rank and ("("..rank..")") or "") if reactiveName then if not CleveRoids.reactiveSlots[reactiveName] then CleveRoids.reactiveSlots[reactiveName] = slot CleveRoids.reactiveSlots[slot] = reactiveName end - else + elseif not reactiveName then CleveRoids.ClearSlot(CleveRoids.reactiveSlots, slot) end - - if actionType == "spell" or actionType == "item" then + if actionType == "SPELL" or actionType == "ITEM" then if not CleveRoids.actionSlots[actionSlotName] then CleveRoids.actionSlots[actionSlotName] = slot CleveRoids.actionSlots[slot] = actionSlotName @@ -229,7 +248,6 @@ function CleveRoids.IndexActionSlot(slot) end end end - CleveRoids.TestForActiveAction(CleveRoids.GetAction(slot)) CleveRoids.SendEventForAction(slot, "ACTIONBAR_SLOT_CHANGED", slot) end