mirror of
https://github.com/brues-code/SuperCleveRoidMacros.git
synced 2026-09-16 03:38:00 +00:00
Use C_Spell.GetSpellTexture in GetCachedIcon
This commit is contained in:
+1
-14
@@ -866,20 +866,7 @@ function lib:GetCachedIcon(spellId)
|
||||
if not spellId then return nil end
|
||||
if lib.iconCache[spellId] then return lib.iconCache[spellId] end
|
||||
|
||||
local texture = nil
|
||||
|
||||
-- Try Nampower DBC lookup first (fast)
|
||||
if GetSpellRecField and GetSpellIconTexture then
|
||||
local iconId = GetSpellRecField(spellId, "spellIconID")
|
||||
if iconId and type(iconId) == "number" and iconId > 0 then
|
||||
texture = GetSpellIconTexture(iconId)
|
||||
end
|
||||
end
|
||||
|
||||
-- Final fallback
|
||||
if not texture then
|
||||
texture = "Interface\\Icons\\INV_Misc_QuestionMark"
|
||||
end
|
||||
local texture = C_Spell.GetSpellTexture(spellId) or "Interface\\Icons\\INV_Misc_QuestionMark"
|
||||
|
||||
lib.iconCache[spellId] = texture
|
||||
return texture
|
||||
|
||||
Reference in New Issue
Block a user