temporary enhancement hack: show debuffs in a suboptimal way
In new dungeons you don't really know what debuffs you want to see so it's hard to configure them. To deal with this I added a quick but suboptimal feature to show up to 5 debuffs automatically on the unit frames. It's not great, but it's not terrible either. A hardcoded list of debuffs to ignore is added too.
This commit is contained in:
1 parent
abeac379f3
commit
90d71a54cf
1 file changed
+72
@@ -121,6 +121,8 @@ function UnitFrame:Init(unit, config)
|
||||
|
||||
self:CreateTriggers(config.triggers)
|
||||
|
||||
self:InitDebuffs()
|
||||
|
||||
self:RegisterEvents()
|
||||
self:Enable()
|
||||
end
|
||||
@@ -489,6 +491,73 @@ function UnitFrame:GROUP_ROSTER_UPDATE()
|
||||
end
|
||||
end
|
||||
|
||||
-- FIXME: This is a total hack job, just quickly want to get debuffs rendering on my unit frames to learn new dungeons
|
||||
function UnitFrame:InitDebuffs()
|
||||
local icons = {}
|
||||
self.debuffIndicators = icons
|
||||
for i = 1, 5 do
|
||||
local icon = IconIndicator:new(self, 17, "BOTTOMRIGHT", -2 - (i - 1) * 19, 2, true, 10.0, nil, true)
|
||||
icons[i] = icon
|
||||
end
|
||||
end
|
||||
|
||||
local ignoredDebuffs = {
|
||||
[57723] = true, -- Sated, shaman lust debuff
|
||||
[80354] = true, -- Temporal displacement
|
||||
[390435] = true, -- Exhausstion
|
||||
[264689] = true, -- Fatigued
|
||||
[87024] = true, -- Cauterized
|
||||
[45181] = true, -- Cheated Death
|
||||
[41425] = true, -- hypothermia
|
||||
[124275] = true, -- Light stagger
|
||||
[124274] = true, -- moderate stagger
|
||||
[124273] = true, -- heavy stagger
|
||||
[25771] = true, -- Forbearance
|
||||
[456447] = true, -- Battle-Scarred Veteran
|
||||
[382912] = true, -- Well-Honed Instincts
|
||||
[1223611] = true, -- Ethereal Exhaustion
|
||||
[456779] = true, -- Will of the Dawn
|
||||
[448005] = true, -- Light of the Martyr
|
||||
[157131] = true, -- Recently Saved by the Light
|
||||
[387847] = true,
|
||||
[206151] = true, -- Challenger's Burden
|
||||
[113942] = true, -- Demonic Gateway
|
||||
[1216943] = true, -- void pulsar
|
||||
[462661] = true, -- Voidbinding
|
||||
[1239229] = true, -- k'areshi surge
|
||||
[449042] = true, -- Radiant Light
|
||||
-- blood draw
|
||||
}
|
||||
|
||||
function UnitFrame:UpdateDebuffs()
|
||||
local auras = {}
|
||||
local i = 1
|
||||
while #auras < 5 do
|
||||
local aura = C_UnitAuras.GetAuraDataByIndex(self.unit, i, "HARMFUL")
|
||||
if aura == nil then
|
||||
break
|
||||
end
|
||||
if not ignoredDebuffs[aura.spellId] then
|
||||
table.insert(auras, aura)
|
||||
end
|
||||
i = i + 1
|
||||
end
|
||||
for i = 1, 5 do
|
||||
local aura = auras[i]
|
||||
local icon = self.debuffIndicators[i]
|
||||
|
||||
if aura then
|
||||
if icon.frame then
|
||||
icon:Update(aura)
|
||||
else
|
||||
icon:Show(aura)
|
||||
end
|
||||
elseif icon.frame then
|
||||
icon:Hide()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function UnitFrame:UNIT_AURA(unit, info)
|
||||
if self:HasUnitChanged() then
|
||||
self:UpdateAll(true)
|
||||
@@ -497,6 +566,8 @@ function UnitFrame:UNIT_AURA(unit, info)
|
||||
if self.auras:Update(info) then
|
||||
self:UpdateHealthColor()
|
||||
end
|
||||
|
||||
self:UpdateDebuffs()
|
||||
end
|
||||
|
||||
function UnitFrame:UNIT_HEALTH()
|
||||
@@ -600,6 +671,7 @@ function UnitFrame:UpdateAll(unitChanged)
|
||||
self:UpdateRange()
|
||||
self:UpdateName()
|
||||
self:UpdateRole() -- Also calls UpdatePower if power is visible
|
||||
self:UpdateDebuffs()
|
||||
end
|
||||
|
||||
function UnitFrame:UpdateHealth()
|
||||
|
||||
Reference in new issue
Block a user