From 55a11f3a65e5d9f4b9e45c9a0fd776db30147165 Mon Sep 17 00:00:00 2001 From: jordon <29447509+jordonwow@users.noreply.github.com> Date: Fri, 3 Feb 2023 04:16:41 -0800 Subject: [PATCH] fix normal debuffs not displaying when there are no big debuffs --- BigDebuffs.lua | 61 +++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/BigDebuffs.lua b/BigDebuffs.lua index 7e359b2..a47aeda 100755 --- a/BigDebuffs.lua +++ b/BigDebuffs.lua @@ -2011,8 +2011,7 @@ if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then local size = self:GetDebuffSize(aura.spellId, isDispellable) if size and not friendlySmokeBomb then tinsert(debuffs, { aura, size, self:GetDebuffPriority(aura.spellId) }) - elseif self.db.profile.raidFrames.redirectBliz or - (self.db.profile.raidFrames.anchor == "INNER" and not self.db.profile.raidFrames.hideBliz) then + 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 @@ -2041,40 +2040,40 @@ if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then end end - -- moved it outsdie of the check if there are any debuffs to always function as otherwise it casues a weird feeling that some buffs are appearing all of a sudden + if #debuffs < 1 then return end + + -- sort by priority > size > duration > index + table.sort(debuffs, function(a, b) + if a[3] == b[3] then + if a[2] == b[2] then + return a[1].spellId > b[1].spellId + end + return a[2] > b[2] + end + return a[3] > b[3] + end) + + local index = 1 + if self.db.profile.raidFrames.hideBliz or - self.db.profile.raidFrames.anchor == "INNER" or - self.db.profile.raidFrames.redirectBliz then + self.db.profile.raidFrames.anchor == "INNER" or + self.db.profile.raidFrames.redirectBliz then CompactUnitFrame_HideAllDebuffs(frame) end - if #debuffs > 0 then - -- sort by priority > size > duration > index - table.sort(debuffs, function(a, b) - if a[3] == b[3] then - if a[2] == b[2] then - return a[1].spellId > b[1].spellId - end - return a[2] > b[2] - end - return a[3] > b[3] - end) - local index = 1 - - for i = 1, #debuffs do -- math.min maybe? - if index <= self.db.profile.raidFrames.maxDebuffs then - if not frame.BigDebuffs[index] then break end - local frameHeight = frame:GetHeight() - frame.BigDebuffs[index].baseSize = frameHeight * debuffs[i][2] * 0.01 - local debuffFrame = frame.BigDebuffs[index]; - debuffFrame.spellId = debuffs[i][1].spellId; - if not debuffFrame.maxHeight then - debuffFrame.maxHeight = frameHeight; - end - CompactUnitFrame_UtilSetDebuff(debuffFrame, debuffs[i][1]) - frame.BigDebuffs[index].cooldown:SetSwipeColor(0, 0, 0, 0.7) - index = index + 1 + for i = 1, #debuffs do -- math.min maybe? + if index <= self.db.profile.raidFrames.maxDebuffs then + if not frame.BigDebuffs[index] then break end + local frameHeight = frame:GetHeight() + frame.BigDebuffs[index].baseSize = frameHeight * debuffs[i][2] * 0.01 + local debuffFrame = frame.BigDebuffs[index]; + debuffFrame.spellId = debuffs[i][1].spellId; + if not debuffFrame.maxHeight then + debuffFrame.maxHeight = frameHeight; end + CompactUnitFrame_UtilSetDebuff(debuffFrame, debuffs[i][1]) + frame.BigDebuffs[index].cooldown:SetSwipeColor(0, 0, 0, 0.7) + index = index + 1 end end end