Skip to content

Commit

Permalink
Added option to wrap debuffs on raid frames. This is useful for added
Browse files Browse the repository at this point in the history
clarity so debuffs dont go too far from the unit frame.
  • Loading branch information
Miho Dalic committed Jul 16, 2023
1 parent d6f936d commit f04180f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
14 changes: 11 additions & 3 deletions BigDebuffs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 9 additions & 0 deletions Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down

0 comments on commit f04180f

Please sign in to comment.