From 649d93a455a4374d62da1e6f8674d9af36c96492 Mon Sep 17 00:00:00 2001 From: Torsten Brendgen Date: Sun, 12 Apr 2026 16:53:11 +0200 Subject: [PATCH] feat: Enhance debuff tracking in Personal Auras module with AuraUtil support --- .gitignore | 1 + Modules/PersonalAuras/PersonalAuras.lua | 26 +++++++++++++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 569ec13..f51f56a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .git .gitea .vscode +*.txt *.zip \ No newline at end of file diff --git a/Modules/PersonalAuras/PersonalAuras.lua b/Modules/PersonalAuras/PersonalAuras.lua index 5df4fad..74a0b2a 100644 --- a/Modules/PersonalAuras/PersonalAuras.lua +++ b/Modules/PersonalAuras/PersonalAuras.lua @@ -151,6 +151,27 @@ local function GetPlayerTrackedDebuff(spellId) return nil end + if AuraUtil and type(AuraUtil.ForEachAura) == "function" then + local foundAura = nil + AuraUtil.ForEachAura("player", "HARMFUL", nil, function(auraData) + if type(auraData) == "table" and tonumber(auraData.spellId) == sid then + foundAura = auraData + return true + end + return false + end, true) + if foundAura and IsAuraDataHarmful(foundAura) then + return { + spellId = sid, + name = tostring(foundAura.name or GetSpellName(sid) or ("Spell " .. tostring(sid))), + icon = foundAura.icon or foundAura.iconFileID or GetSpellIcon(sid), + applications = NormalizeAuraApplications(foundAura), + duration = tonumber(foundAura.duration) or 0, + expirationTime = tonumber(foundAura.expirationTime) or 0, + } + end + end + if C_UnitAuras and type(C_UnitAuras.GetPlayerAuraBySpellID) == "function" then local auraData = C_UnitAuras.GetPlayerAuraBySpellID(sid) if auraData and IsAuraDataHarmful(auraData) then @@ -230,10 +251,7 @@ function PA:AddTrackedDebuff(spellId) if not sid or sid <= 0 then return false, "invalid" end - local name = GetSpellName(sid) - if not name then - return false, "invalid" - end + local name = GetSpellName(sid) or ("Spell " .. tostring(sid)) local settings = self:GetSettings() settings.trackedDebuffs[sid] = true self:Refresh()