From 8ae34d052d0798cfe89625a151cd9a94c8ac36f3 Mon Sep 17 00:00:00 2001 From: Meow <30401521+me0wg4ming@users.noreply.github.com> Date: Tue, 3 Mar 2026 08:46:50 +0100 Subject: [PATCH] nampower fallback for icon textures Icons that return no icon texture by the server are now recieved by GetUnitField and GetSpellRecField with nampower. --- api/unitframes.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/api/unitframes.lua b/api/unitframes.lua index d01cdeb9..f47893a8 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -466,6 +466,28 @@ function pfUI.uf:DetectBuff(name, id) if name == detect_name then return icon, 1 end end + -- try GetUnitField spellId -> libdebuff icon (Nampower, for custom spells) + if GetUnitField and GetUnitGUID and pfUI.libdebuff_GetSpellIcon then + local guid = GetUnitGUID(name) + if guid then + local auras = GetUnitField(guid, "aura") + if auras then + for _, spellId in pairs(auras) do + if type(spellId) == "number" and spellId > 0 then + local sname = GetSpellRecField and GetSpellRecField(spellId, "name") + if sname == detect_name then + local tex = pfUI.libdebuff_GetSpellIcon(spellId) + if tex and not string.find(tex, "QuestionMark") then + pfUI_cache.buff_icons[tex] = detect_name + return tex, 1 + end + end + end + end + end + end + end + -- return fallback image return "interface\\icons\\inv_misc_questionmark", 1 end