Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 39 additions & 33 deletions DandersFrames_Auras.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function DF:ApplyAuraLayout(frame)

-- Parse "PRIMARY_SECONDARY" growth strings (e.g., "LEFT_DOWN")
-- Added stackFont argument and countdown arguments
local function ApplyLayout(auraFrames, scale, alpha, anchor, growthString, limit, offX, offY, maxCount, clickThrough, stackScale, stackAnchor, stackX, stackY, stackOutline, stackFont, showCountdown, countdownScale, countdownFont, countdownOutline, countdownX, countdownY, hideSwipe)
local function ApplyLayout(auraFrames, scale, alpha, anchor, growthString, limit, offX, offY, maxCount, clickThrough, stackScale, stackAnchor, stackX, stackY, stackOutline, stackFont, showCountdown, countdownScale, countdownFont, countdownOutline, countdownX, countdownY, countdownDecimalMode, hideSwipe)
if not auraFrames then return end

-- Split growth direction string
Expand Down Expand Up @@ -141,25 +141,29 @@ function DF:ApplyAuraLayout(frame)
local text = self:GetParent().dfCountdownText

-- Use our stored values instead of API calls
if cd and cd:IsShown() and cd.dfStart and cd.dfDuration and cd.dfDuration > 0 then
local remaining = (cd.dfStart + cd.dfDuration) - GetTime()

if remaining > 0.5 then
if remaining >= 3600 then
text:SetText(math.floor(remaining / 3600) .. "h")
elseif remaining >= 60 then
text:SetText(math.floor(remaining / 60) .. "m")
elseif remaining >= 10 then
text:SetText(math.floor(remaining))
elseif remaining >= 3 then
text:SetFormattedText("%.0f", remaining)
else
text:SetFormattedText("%.1f", remaining)
end
text:Show()
else
text:Hide()
end
if cd and cd:IsShown() and cd.dfStart and cd.dfDuration and cd.dfDuration > 0 then
local remaining = (cd.dfStart + cd.dfDuration) - GetTime()

if remaining > 0.5 then
if remaining >= 3600 then
text:SetText(math.floor(remaining / 3600) .. "h")
elseif remaining >= 60 then
text:SetText(math.floor(remaining / 60) .. "m")
elseif remaining >= 10 then
text:SetText(math.floor(remaining))
elseif remaining >= 3 then
text:SetFormattedText("%.0f", remaining)
else
if countdownDecimalMode == "WHOLE" then
text:SetFormattedText("%.0f", remaining)
else
text:SetFormattedText("%.1f", remaining)
end
end
text:Show()
else
text:Hide()
end
else
text:Hide()
end
Expand Down Expand Up @@ -257,12 +261,13 @@ function DF:ApplyAuraLayout(frame)
db.raidBuffStackFont,
db.raidBuffShowCountdown,
db.raidBuffCountdownScale,
db.raidBuffCountdownFont,
db.raidBuffCountdownOutline,
db.raidBuffCountdownX,
db.raidBuffCountdownY,
db.raidBuffHideSwipe
)
db.raidBuffCountdownFont,
db.raidBuffCountdownOutline,
db.raidBuffCountdownX,
db.raidBuffCountdownY,
db.raidBuffCountdownDecimalMode,
db.raidBuffHideSwipe
)

-- Apply to Debuffs
ApplyLayout(
Expand All @@ -284,13 +289,14 @@ function DF:ApplyAuraLayout(frame)
db.raidDebuffStackFont,
db.raidDebuffShowCountdown,
db.raidDebuffCountdownScale,
db.raidDebuffCountdownFont,
db.raidDebuffCountdownOutline,
db.raidDebuffCountdownX,
db.raidDebuffCountdownY,
db.raidDebuffHideSwipe
)
end
db.raidDebuffCountdownFont,
db.raidDebuffCountdownOutline,
db.raidDebuffCountdownX,
db.raidDebuffCountdownY,
db.raidDebuffCountdownDecimalMode,
db.raidDebuffHideSwipe
)
end

-- =========================================================================
-- DEMO DISPEL ICON (Custom Preview Icon)
Expand Down
36 changes: 20 additions & 16 deletions DandersFrames_Config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,11 @@ DF.PartyDefaults = {
raidBuffShowCountdown = false,
raidBuffCountdownScale = 1.0,
raidBuffCountdownFont = "Fonts\\FRIZQT__.TTF",
raidBuffCountdownOutline = "OUTLINE",
raidBuffCountdownX = 0,
raidBuffCountdownY = 0,
raidBuffHideSwipe = false,
raidBuffCountdownOutline = "OUTLINE",
raidBuffCountdownX = 0,
raidBuffCountdownY = 0,
raidBuffCountdownDecimalMode = "TENTHS",
raidBuffHideSwipe = false,

-- Debuffs
raidDebuffScale = 1,
Expand All @@ -236,10 +237,11 @@ DF.PartyDefaults = {
raidDebuffShowCountdown = false,
raidDebuffCountdownScale = 1.0,
raidDebuffCountdownFont = "Fonts\\FRIZQT__.TTF",
raidDebuffCountdownOutline = "OUTLINE",
raidDebuffCountdownX = 0,
raidDebuffCountdownY = 0,
raidDebuffHideSwipe = false,
raidDebuffCountdownOutline = "OUTLINE",
raidDebuffCountdownX = 0,
raidDebuffCountdownY = 0,
raidDebuffCountdownDecimalMode = "TENTHS",
raidDebuffHideSwipe = false,

-- Dispel Toggles
showDispelIcon = true,
Expand Down Expand Up @@ -443,10 +445,11 @@ DF.RaidDefaults = {
raidBuffShowCountdown = false,
raidBuffCountdownScale = 1.0,
raidBuffCountdownFont = "Fonts\\FRIZQT__.TTF",
raidBuffCountdownOutline = "OUTLINE",
raidBuffCountdownX = 0,
raidBuffCountdownY = 0,
raidBuffHideSwipe = false,
raidBuffCountdownOutline = "OUTLINE",
raidBuffCountdownX = 0,
raidBuffCountdownY = 0,
raidBuffCountdownDecimalMode = "TENTHS",
raidBuffHideSwipe = false,

-- Debuffs
raidDebuffScale = 1,
Expand All @@ -468,10 +471,11 @@ DF.RaidDefaults = {
raidDebuffShowCountdown = false,
raidDebuffCountdownScale = 1.0,
raidDebuffCountdownFont = "Fonts\\FRIZQT__.TTF",
raidDebuffCountdownOutline = "OUTLINE",
raidDebuffCountdownX = 0,
raidDebuffCountdownY = 0,
raidDebuffHideSwipe = false,
raidDebuffCountdownOutline = "OUTLINE",
raidDebuffCountdownX = 0,
raidDebuffCountdownY = 0,
raidDebuffCountdownDecimalMode = "TENTHS",
raidDebuffHideSwipe = false,

-- Dispel Toggles
showDispelIcon = true,
Expand Down
76 changes: 42 additions & 34 deletions DandersFrames_Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -337,24 +337,30 @@ function DF:SetupGUIPages(GUI, CreateTab, BuildPage)
bStackOut.hideOn = function(d) return not d.showAdvancedBuffOptions end

-- Buff Countdown Text Options
local bCdHeader = Add(GUI:CreateHeader(self, "Buff Countdown Text"), 25, 1)
bCdHeader.hideOn = function(d) return not d.showAdvancedBuffOptions end
local bCountdown = Add(GUI:CreateCheckbox(self, "Show Countdown", db, "raidBuffShowCountdown"), 30, 1)
bCountdown.hideOn = function(d) return not d.showAdvancedBuffOptions end
local bCdScale = Add(GUI:CreateSlider(self, "Countdown Scale", 0.5, 2.0, 0.1, db, "raidBuffCountdownScale"), 60, 1)
bCdScale.hideOn = function(d) return not d.showAdvancedBuffOptions or not d.raidBuffShowCountdown end
local bCdFont = Add(GUI:CreateDropdown(self, "Countdown Font", DF:GetFontList(), db, "raidBuffCountdownFont"), 60, 1)
bCdFont.hideOn = function(d) return not d.showAdvancedBuffOptions or not d.raidBuffShowCountdown end
local bCdOutline = Add(GUI:CreateDropdown(self, "Countdown Outline", {
["NONE"] = "None", ["OUTLINE"] = "Outline", ["THICKOUTLINE"] = "Thick"
}, db, "raidBuffCountdownOutline"), 60, 1)
bCdOutline.hideOn = function(d) return not d.showAdvancedBuffOptions or not d.raidBuffShowCountdown end
local bCdOffX = Add(GUI:CreateSlider(self, "Countdown X", -20, 20, 1, db, "raidBuffCountdownX"), 60, 1)
bCdOffX.hideOn = function(d) return not d.showAdvancedBuffOptions or not d.raidBuffShowCountdown end
local bCdOffY = Add(GUI:CreateSlider(self, "Countdown Y", -20, 20, 1, db, "raidBuffCountdownY"), 60, 1)
bCdOffY.hideOn = function(d) return not d.showAdvancedBuffOptions or not d.raidBuffShowCountdown end
local bHideSwipe = Add(GUI:CreateCheckbox(self, "Hide Cooldown Swipe", db, "raidBuffHideSwipe"), 30, 1)
bHideSwipe.hideOn = function(d) return not d.showAdvancedBuffOptions end
local bCdHeader = Add(GUI:CreateHeader(self, "Buff Countdown Text"), 25, 1)
bCdHeader.hideOn = function(d) return not d.showAdvancedBuffOptions end
local bCountdown = Add(GUI:CreateCheckbox(self, "Show Countdown", db, "raidBuffShowCountdown"), 30, 1)
bCountdown.hideOn = function(d) return not d.showAdvancedBuffOptions end
local countdownFormats = {
["TENTHS"] = "Tenths (<3s)",
["WHOLE"] = "Whole Seconds",
}
local bCdScale = Add(GUI:CreateSlider(self, "Countdown Scale", 0.5, 2.0, 0.1, db, "raidBuffCountdownScale"), 60, 1)
bCdScale.hideOn = function(d) return not d.showAdvancedBuffOptions or not d.raidBuffShowCountdown end
local bCdFont = Add(GUI:CreateDropdown(self, "Countdown Font", DF:GetFontList(), db, "raidBuffCountdownFont"), 60, 1)
bCdFont.hideOn = function(d) return not d.showAdvancedBuffOptions or not d.raidBuffShowCountdown end
local bCdOutline = Add(GUI:CreateDropdown(self, "Countdown Outline", {
["NONE"] = "None", ["OUTLINE"] = "Outline", ["THICKOUTLINE"] = "Thick"
}, db, "raidBuffCountdownOutline"), 60, 1)
bCdOutline.hideOn = function(d) return not d.showAdvancedBuffOptions or not d.raidBuffShowCountdown end
local bCdOffX = Add(GUI:CreateSlider(self, "Countdown X", -20, 20, 1, db, "raidBuffCountdownX"), 60, 1)
bCdOffX.hideOn = function(d) return not d.showAdvancedBuffOptions or not d.raidBuffShowCountdown end
local bCdOffY = Add(GUI:CreateSlider(self, "Countdown Y", -20, 20, 1, db, "raidBuffCountdownY"), 60, 1)
bCdOffY.hideOn = function(d) return not d.showAdvancedBuffOptions or not d.raidBuffShowCountdown end
local bCdFormat = Add(GUI:CreateDropdown(self, "Countdown Decimals", countdownFormats, db, "raidBuffCountdownDecimalMode"), 60, 1)
bCdFormat.hideOn = function(d) return not d.showAdvancedBuffOptions or not d.raidBuffShowCountdown end
local bHideSwipe = Add(GUI:CreateCheckbox(self, "Hide Cooldown Swipe", db, "raidBuffHideSwipe"), 30, 1)
bHideSwipe.hideOn = function(d) return not d.showAdvancedBuffOptions end

-- COLUMN 2: Debuffs
Add(GUI:CreateHeader(self, "Debuffs"), 30, 2)
Expand Down Expand Up @@ -398,25 +404,27 @@ function DF:SetupGUIPages(GUI, CreateTab, BuildPage)
dStackOut.hideOn = function(d) return not d.showAdvancedDebuffOptions end

-- Debuff Countdown Text Options
local dCdHeader = Add(GUI:CreateHeader(self, "Debuff Countdown Text"), 25, 2)
dCdHeader.hideOn = function(d) return not d.showAdvancedDebuffOptions end
local dCountdown = Add(GUI:CreateCheckbox(self, "Show Countdown", db, "raidDebuffShowCountdown"), 30, 2)
dCountdown.hideOn = function(d) return not d.showAdvancedDebuffOptions end
local dCdScale = Add(GUI:CreateSlider(self, "Countdown Scale", 0.5, 2.0, 0.1, db, "raidDebuffCountdownScale"), 60, 2)
local dCdHeader = Add(GUI:CreateHeader(self, "Debuff Countdown Text"), 25, 2)
dCdHeader.hideOn = function(d) return not d.showAdvancedDebuffOptions end
local dCountdown = Add(GUI:CreateCheckbox(self, "Show Countdown", db, "raidDebuffShowCountdown"), 30, 2)
dCountdown.hideOn = function(d) return not d.showAdvancedDebuffOptions end
local dCdScale = Add(GUI:CreateSlider(self, "Countdown Scale", 0.5, 2.0, 0.1, db, "raidDebuffCountdownScale"), 60, 2)
dCdScale.hideOn = function(d) return not d.showAdvancedDebuffOptions or not d.raidDebuffShowCountdown end
local dCdFont = Add(GUI:CreateDropdown(self, "Countdown Font", DF:GetFontList(), db, "raidDebuffCountdownFont"), 60, 2)
dCdFont.hideOn = function(d) return not d.showAdvancedDebuffOptions or not d.raidDebuffShowCountdown end
local dCdOutline = Add(GUI:CreateDropdown(self, "Countdown Outline", {
["NONE"] = "None", ["OUTLINE"] = "Outline", ["THICKOUTLINE"] = "Thick"
}, db, "raidDebuffCountdownOutline"), 60, 2)
dCdOutline.hideOn = function(d) return not d.showAdvancedDebuffOptions or not d.raidDebuffShowCountdown end
local dCdOffX = Add(GUI:CreateSlider(self, "Countdown X", -20, 20, 1, db, "raidDebuffCountdownX"), 60, 2)
dCdOffX.hideOn = function(d) return not d.showAdvancedDebuffOptions or not d.raidDebuffShowCountdown end
local dCdOffY = Add(GUI:CreateSlider(self, "Countdown Y", -20, 20, 1, db, "raidDebuffCountdownY"), 60, 2)
dCdOffY.hideOn = function(d) return not d.showAdvancedDebuffOptions or not d.raidDebuffShowCountdown end
local dHideSwipe = Add(GUI:CreateCheckbox(self, "Hide Cooldown Swipe", db, "raidDebuffHideSwipe"), 30, 2)
dHideSwipe.hideOn = function(d) return not d.showAdvancedDebuffOptions end
end)
local dCdOutline = Add(GUI:CreateDropdown(self, "Countdown Outline", {
["NONE"] = "None", ["OUTLINE"] = "Outline", ["THICKOUTLINE"] = "Thick"
}, db, "raidDebuffCountdownOutline"), 60, 2)
dCdOutline.hideOn = function(d) return not d.showAdvancedDebuffOptions or not d.raidDebuffShowCountdown end
local dCdOffX = Add(GUI:CreateSlider(self, "Countdown X", -20, 20, 1, db, "raidDebuffCountdownX"), 60, 2)
dCdOffX.hideOn = function(d) return not d.showAdvancedDebuffOptions or not d.raidDebuffShowCountdown end
local dCdOffY = Add(GUI:CreateSlider(self, "Countdown Y", -20, 20, 1, db, "raidDebuffCountdownY"), 60, 2)
dCdOffY.hideOn = function(d) return not d.showAdvancedDebuffOptions or not d.raidDebuffShowCountdown end
local dCdFormat = Add(GUI:CreateDropdown(self, "Countdown Decimals", countdownFormats, db, "raidDebuffCountdownDecimalMode"), 60, 2)
dCdFormat.hideOn = function(d) return not d.showAdvancedDebuffOptions or not d.raidDebuffShowCountdown end
local dHideSwipe = Add(GUI:CreateCheckbox(self, "Hide Cooldown Swipe", db, "raidDebuffHideSwipe"), 30, 2)
dHideSwipe.hideOn = function(d) return not d.showAdvancedDebuffOptions end
end)

-- TAB 2.5: DISPELS
BuildPage(CreateTab("dispels", "Dispels"), function(self, db, Add, AddSpace)
Expand Down