feat: Enhance debuff tracking in Personal Auras module with AuraUtil support
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user