mirror of
https://github.com/brues-code/Vanilla_MikScrollingBattleText.git
synced 2026-10-16 02:10:49 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user