Skip to content
1 change: 1 addition & 0 deletions Core/Defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ local Defaults = {
Layout = {"CENTER", "CENTER", 0, 0},
ShowStaggerDPS = false,
},
StaggerDisplayMode = "AMOUNT",
},
CastBar = {
Enabled = true,
Expand Down
52 changes: 43 additions & 9 deletions Core/GUI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,19 @@ local PowerNames = {
}
}

local StaggerDisplayModes = {
{
["AMOUNT"] = LL("Amount"),
["PERCENTAGE"] = LL("Percentage"),
["BOTH"] = LL("Both")
},
{
"AMOUNT",
"PERCENTAGE",
"BOTH"
}
}

local ClassToPrettyClass = {
["DEATHKNIGHT"] = "|cFFC41E31" .. LL("DEATHKNIGHT") .. "|r",
["DRUID"] = "|cFFFF7C0A" .. LL("DRUID") .. "|r",
Expand Down Expand Up @@ -2528,13 +2541,43 @@ local function CreateSecondaryPowerBarTextSettings(parentContainer)
fontSizeSlider:SetRelativeWidth(0.33)
textContainer:AddChild(fontSizeSlider)

local staggerContainer, staggerDropdown, showStaggerDPSCheckbox
if isUnitMonk then
staggerContainer = AG:Create("InlineGroup")
staggerContainer:SetTitle(LL("Stagger Settings"))
staggerContainer:SetFullWidth(true)
staggerContainer:SetLayout("Flow")
textContainer:AddChild(staggerContainer)

staggerDropdown = AG:Create("Dropdown")
staggerDropdown:SetLabel(LL("Displayed As"))
staggerDropdown:SetList(StaggerDisplayModes[1], StaggerDisplayModes[2], StaggerDisplayModes[3])
staggerDropdown:SetValue(BCDM.db.profile.SecondaryPowerBar.StaggerDisplayMode)
staggerDropdown:SetCallback("OnValueChanged", function(self, _, value) BCDM.db.profile.SecondaryPowerBar.StaggerDisplayMode = value BCDM:UpdateSecondaryPowerBar() end)
staggerDropdown:SetRelativeWidth(0.5)
staggerContainer:AddChild(staggerDropdown)

showStaggerDPSCheckbox = AG:Create("CheckBox")
showStaggerDPSCheckbox:SetLabel(LL("Show Stagger Damage Per Second"))
showStaggerDPSCheckbox:SetValue(BCDM.db.profile.SecondaryPowerBar.Text.ShowStaggerDPS)
showStaggerDPSCheckbox:SetCallback("OnValueChanged", function(self, _, value) BCDM.db.profile.SecondaryPowerBar.Text.ShowStaggerDPS = value BCDM:UpdateSecondaryPowerBar() RefreshSecondaryPowerBarGUISettings() end)
showStaggerDPSCheckbox:SetRelativeWidth(0.5)
staggerContainer:AddChild(showStaggerDPSCheckbox)
end

function RefreshSecondaryPowerBarTextGUISettings()
local enabled = BCDM.db.profile.SecondaryPowerBar.Text.Enabled
anchorFromDropdown:SetDisabled(not enabled)
anchorToDropdown:SetDisabled(not enabled)
xOffsetSlider:SetDisabled(not enabled)
yOffsetSlider:SetDisabled(not enabled)
fontSizeSlider:SetDisabled(not enabled)
if staggerDropdown then
staggerDropdown:SetDisabled(not enabled)
end
if showStaggerDPSCheckbox then
showStaggerDPSCheckbox:SetDisabled(not enabled)
end
end

RefreshSecondaryPowerBarTextGUISettings()
Expand All @@ -2549,8 +2592,6 @@ local function CreateSecondaryPowerBarSettings(parentContainer)
ScrollFrame:SetFullHeight(true)
parentContainer:AddChild(ScrollFrame)

local isUnitMonkorDeathKnight = isUnitDeathKnight or isUnitMonk

local toggleContainer = AG:Create("InlineGroup")
toggleContainer:SetTitle(LL("Toggles & Colours"))
toggleContainer:SetFullWidth(true)
Expand Down Expand Up @@ -2603,13 +2644,6 @@ local function CreateSecondaryPowerBarSettings(parentContainer)
colourStaggerByStateCheckbox:SetCallback("OnValueChanged", function(self, _, value) BCDM.db.profile.SecondaryPowerBar.ColourByState = value BCDM:UpdateSecondaryPowerBar() RefreshSecondaryPowerBarGUISettings() end)
colourStaggerByStateCheckbox:SetRelativeWidth(1)
toggleContainer:AddChild(colourStaggerByStateCheckbox)

local showStaggerDPSCheckbox = AG:Create("CheckBox")
showStaggerDPSCheckbox:SetLabel(LL("Stagger Damage Per Second"))
showStaggerDPSCheckbox:SetValue(BCDM.db.profile.SecondaryPowerBar.Text.ShowStaggerDPS)
showStaggerDPSCheckbox:SetCallback("OnValueChanged", function(self, _, value) BCDM.db.profile.SecondaryPowerBar.Text.ShowStaggerDPS = value BCDM:UpdateSecondaryPowerBar() RefreshSecondaryPowerBarGUISettings() end)
showStaggerDPSCheckbox:SetRelativeWidth(1)
toggleContainer:AddChild(showStaggerDPSCheckbox)
end

local matchAnchorWidthCheckbox = AG:Create("CheckBox")
Expand Down
7 changes: 7 additions & 0 deletions Locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,10 @@ L["Use Global Profile Settings"] = "Use Global Profile Settings"
L["Join the Discord Community!"] = "Join the Discord Community!"
L["Report Issues / Feedback on GitHub!"] = "Report Issues / Feedback on GitHub!"
L["Support is truly appreciated"] = "Support is truly appreciated"

-- [[ Stagger Settings ]]
L["Amount"] = "Amount"
L["Percentage"] = "Percentage"
L["Both"] = "Both"
L["Displayed As"] = "Stagger Display As"
L["Stagger Damage Per Second"] = "Stagger Damage Per Second"
5 changes: 5 additions & 0 deletions Modules/SecondaryPowerBar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,11 @@ local function UpdatePowerValues()
secondaryPowerBar.Status:SetStatusBarColor(GetPowerBarColor())
end
local textDisplay = AbbreviateLargeNumbers(powerCurrent)
if secondaryPowerBarDB.StaggerDisplayMode == "PERCENTAGE" then
textDisplay = string.format("%.0f%%", staggerPercentage)
elseif secondaryPowerBarDB.StaggerDisplayMode == "BOTH" then
textDisplay = string.format("%s (%.0f%%)", textDisplay, staggerPercentage)
end
if secondaryPowerBarDB.Text.ShowStaggerDPS and powerCurrent > 0 then
local damagePerTick = powerCurrent / 20
textDisplay = textDisplay .. " (" .. AbbreviateLargeNumbers(damagePerTick) .. " / 0.5s)"
Expand Down