Use C_Spell/C_Item APIs for spell name and item icon lookups

GetSpellNameFromId now calls C_Spell.GetSpellName instead of the SuperWoW/Nampower pcall chain. FindItemIcon iterates equipped slots and bags via ItemLocation and C_Item.GetItemName/GetItemIcon. AddAnimation hoists strlower(name) into a local lowerName to avoid repeated calls and feeds the lowercased name to FindItemIcon.
This commit is contained in:
Brues
2026-06-22 18:00:24 -05:00
parent 6a9dd18ce0
commit bf5be40e78
2 changed files with 27 additions and 30 deletions
@@ -817,15 +817,7 @@ local function GetSpellNameFromId(spellId)
if not spellId or spellId == 0 then return nil end
if spellNameCache[spellId] then return spellNameCache[spellId] end
local name
if hasSuperWoW and SpellInfo then
local ok, n = pcall(SpellInfo, spellId)
if ok and n then name = n end
end
if not name and hasNampower and GetSpellNameAndRankForId then
local ok, n = pcall(GetSpellNameAndRankForId, spellId)
if ok and n then name = n end
end
local name = C_Spell.GetSpellName(spellId)
if name then spellNameCache[spellId] = name end
return name