From f04180f8ff1c8ebc11ea7c308e0aeff36974551f Mon Sep 17 00:00:00 2001 From: Miho Dalic Date: Sun, 16 Jul 2023 20:38:52 +0200 Subject: [PATCH] Added option to wrap debuffs on raid frames. This is useful for added clarity so debuffs dont go too far from the unit frame. --- BigDebuffs.lua | 14 +++++++++++--- Options.lua | 9 +++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/BigDebuffs.lua b/BigDebuffs.lua index 61c91eb..d48042d 100755 --- a/BigDebuffs.lua +++ b/BigDebuffs.lua @@ -1289,19 +1289,27 @@ function BigDebuffs:AddBigDebuffs(frame) frame.BigDebuffs = frame.BigDebuffs or {} local max = self.db.profile.raidFrames.maxDebuffs + 1 -- add a frame for warning debuffs + local wrapAt = self.db.profile.raidFrames.wrapAt for i = 1, max do local big = frame.BigDebuffs[i] or CreateFrame("Button", frameName .. "BigDebuffsRaid" .. i, frame, "BigDebuffsDebuffTemplate") big:ClearAllPoints() - if i > 1 then - if self.db.profile.raidFrames.anchor == "INNER" or self.db.profile.raidFrames.anchor == "RIGHT" or - self.db.profile.raidFrames.anchor == "TOP" then + if i > 1 and i ~= wrapAt + 1 then + if self.db.profile.raidFrames.anchor == "INNER" or self.db.profile.raidFrames.anchor == "RIGHT" or self.db.profile.raidFrames.anchor == "TOP" then big:SetPoint("BOTTOMLEFT", frame.BigDebuffs[i - 1], "BOTTOMRIGHT", 0, 0) elseif self.db.profile.raidFrames.anchor == "LEFT" then big:SetPoint("BOTTOMRIGHT", frame.BigDebuffs[i - 1], "BOTTOMLEFT", 0, 0) elseif self.db.profile.raidFrames.anchor == "BOTTOM" then big:SetPoint("TOPLEFT", frame.BigDebuffs[i - 1], "TOPRIGHT", 0, 0) end + elseif i == wrapAt + 1 and wrapAt ~= 0 then + if self.db.profile.raidFrames.anchor == "INNER" or self.db.profile.raidFrames.anchor == "RIGHT" or self.db.profile.raidFrames.anchor == "TOP" then + big:SetPoint("BOTTOMLEFT", frame.BigDebuffs[1], "TOPLEFT",0, 1) + elseif self.db.profile.raidFrames.anchor == "LEFT" then + big:SetPoint("BOTTOMRIGHT", frame.BigDebuffs[1], "TOPRIGHT", 0,1) + elseif self.db.profile.raidFrames.anchor == "BOTTOM" then + big:SetPoint("TOPLEFT", frame.BigDebuffs[1], "BOTTOMLEFT", 0, -1) + end else if self.db.profile.raidFrames.anchor == "INNER" then big:SetPoint("BOTTOMLEFT", frame.debuffFrames[1], "BOTTOMLEFT", 0, 0) diff --git a/Options.lua b/Options.lua index a195077..79f5b0e 100755 --- a/Options.lua +++ b/Options.lua @@ -366,6 +366,15 @@ function BigDebuffs:SetupOptions() step = 1, order = 10, }, + wrapAt = { + type = "range", + name = L["Wrap After"], + desc = L["Begin a new row or column after this many debuffs"], + min = 0, + max = 10, + step = 1, + order = 11, + }, anchor = { name = L["Anchor"], desc = L["Anchor to attach the BigDebuffs frames"],