Skip to content

Commit

Permalink
fix for Hide unwanted Debuffs by ID
Browse files Browse the repository at this point in the history
  • Loading branch information
jordonwow committed Sep 9, 2023
1 parent 1f8736b commit cc347b0
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 41 deletions.
1 change: 1 addition & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ read_globals = {
"WOW_PROJECT_ID",
"WOW_PROJECT_MAINLINE",
"WOW_PROJECT_WRATH_CLASSIC",
"tContains",
}
globals = {
"BigDebuffs",
Expand Down
39 changes: 18 additions & 21 deletions BigDebuffs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ local defaults = {

BigDebuffs.WarningDebuffs = addon.WarningDebuffs or {}
BigDebuffs.Spells = addon.Spells
BigDebuffs.HiddenDebuffs = addon.HiddenDebuffs or {}
local tContains = tContains

-- create a lookup table since CombatLogGetCurrentEventInfo() returns 0 for spellId
local spellIdByName
Expand Down Expand Up @@ -1834,26 +1836,21 @@ if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then
local function addDebuffs(aura)
-- aura struct https://wowpedia.fandom.com/wiki/Struct_UnitAuraInfo
if (not aura) then return end
if (not BigDebuffsUnwantedSpell(aura.spellId)) then
if aura.spellId ~= unwantedSpellID then
local reaction = aura.sourceUnit and UnitReaction("player", aura.sourceUnit) or 0
local friendlySmokeBomb = aura.spellId == 212183 and reaction > 4
local isDispellable = self:IsDispellable(unitId, aura.dispelName);
local size = self:GetDebuffSize(aura.spellId, isDispellable)
-- make sure certain debuffs aren't dispalyed as boss auras
if size then
aura.isBossAura = false
end
if size and not friendlySmokeBomb then
tinsert(debuffs, { aura, size, self:GetDebuffPriority(aura.spellId) })
elseif self.db.profile.raidFrames.redirectBliz then
if not frame.optionTable.displayOnlyDispellableDebuffs or isDispellable then
tinsert(debuffs, { aura, self.db.profile.raidFrames.default, 0 })
end
end
if tContains(self.HiddenDebuffs, aura.spellId) then return end
local reaction = aura.sourceUnit and UnitReaction("player", aura.sourceUnit) or 0
local friendlySmokeBomb = aura.spellId == 212183 and reaction > 4
local isDispellable = self:IsDispellable(unitId, aura.dispelName);
local size = self:GetDebuffSize(aura.spellId, isDispellable)
-- make sure certain debuffs aren't dispalyed as boss auras
if size then
aura.isBossAura = false
end
if size and not friendlySmokeBomb then
tinsert(debuffs, { aura, size, self:GetDebuffPriority(aura.spellId) })
elseif self.db.profile.raidFrames.redirectBliz then
if not frame.optionTable.displayOnlyDispellableDebuffs or isDispellable then
tinsert(debuffs, { aura, self.db.profile.raidFrames.default, 0 })
end
else
CompactUnitFrame_HideAllDebuffs(frame)
end
end

Expand Down Expand Up @@ -2064,7 +2061,7 @@ function BigDebuffs:UNIT_AURA(unit)
-- Check debuffs
local _, n, _, _, d, e, caster, _, _, id = UnitDebuff(unit, i)
if id then
if self.Spells[id] then
if self.Spells[id] and (not tContains(self.HiddenDebuffs, id)) then
if LibClassicDurations then
local durationNew, expirationTimeNew = LibClassicDurations:GetAuraDurationByUnit(unit, id, caster)
if d == 0 and durationNew then
Expand Down Expand Up @@ -2195,7 +2192,7 @@ function BigDebuffs:UNIT_AURA_NAMEPLATE(unit)
-- Check debuffs
local _, n, _, _, d, e, caster, _, _, id = UnitDebuff(unit, i)
if id then
if self.Spells[id] then
if self.Spells[id] and (not tContains(self.HiddenDebuffs, id)) then
if LibClassicDurations then
local durationNew, expirationTimeNew = LibClassicDurations:GetAuraDurationByUnit(unit, id, caster)
if d == 0 and durationNew then
Expand Down
9 changes: 9 additions & 0 deletions BigDebuffs_Mainline.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ local ROOT = "roots"
local IMMUNITY = "immunities"
local IMMUNITY_SPELL = "immunities_spells"

addon.HiddenDebuffs = {
80354, -- Temporal Displacement
371070, -- Rotting From Within
390435, -- Exhaustion
57723, -- Exhaustion
206151, -- Challenger's Burden
264689, -- Fatigued
}

addon.Units = {
"player",
"pet",
Expand Down
20 changes: 0 additions & 20 deletions Custom.lua

This file was deleted.

0 comments on commit cc347b0

Please sign in to comment.