mirror of
https://github.com/brues-code/SuperCleveRoidMacros.git
synced 2026-09-16 03:38:00 +00:00
Support #showtooltip spell:<id> and item:<id>
GetSpell/GetItem now resolve explicit spell:/item: ID forms. spell:<id> prefers the player's spellbook entry via FindSpellBookSlotByID (per-rank and pet aware) for full cost/cooldown/usability, falling back to an id-only entry rendered via SetSpellByID for spells not in the book. item:<id> reuses the existing numeric lookup for location-aware tooltips. Guard the id-only path against nil spellSlot/cost in TestForActiveAction and GetActionCooldown so display-only spell references don't crash. Remove the dead, no-op GetSpellSlotByID stub.
This commit is contained in:
-12
@@ -117,18 +117,6 @@ local cachedSpellDurations = {}
|
||||
local spellDurationCacheTime = {}
|
||||
local SPELL_CACHE_DURATION = 0.5 -- Re-scan every 0.5 seconds (haste can change mid-fight)
|
||||
|
||||
-- Get a spell's slot in the spellbook by spell ID
|
||||
local function GetSpellSlotByID(targetSpellID)
|
||||
local i = 1
|
||||
while true do
|
||||
local spellName = GetSpellName(i, BOOKTYPE_SPELL)
|
||||
if not spellName then break end
|
||||
-- Note: spell ID matching done via GetSpellTexture comparison if needed
|
||||
i = i + 1
|
||||
end
|
||||
return nil, nil
|
||||
end
|
||||
|
||||
-- Get a spell's slot in the spellbook by name (finds highest rank by default)
|
||||
-- If targetRank is specified (e.g., "Rank 5"), finds that specific rank
|
||||
local function GetSpellSlotByName(targetSpellName, targetRank)
|
||||
|
||||
Reference in New Issue
Block a user