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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* (Fonts) Bundled **Roboto Mono** (SemiBold/Bold) — a monospaced option for perfectly static countdown text. (by Krathe)
* (Icons) New **in-combat indicator** — a small crossed-swords icon lights up when a unit is in combat, so you can spot who's engaged at a glance. Off by default, with its own position and size controls. (by Krathe)
* (Auto Layouts) Added `/df clearoverride <key|prefix|all>` to **remove a stuck per-layout override** directly — for overrides the settings UI can't reach (e.g. a pinned-players override while not in a raid). (by Krathe)
* (Resource Bar) Added a **Color Mode** (Power Type / Class / **Custom**) with a custom-colour picker, and a **Texture** dropdown so the resource bar can use any statusbar texture. (by Krathe)

### Improvements

Expand All @@ -28,6 +29,7 @@
* (Test Mode) The separate **Status / Ready** and **Role / Leader** preview toggles are now a single **Icons** toggle, matching the live status-icon grouping. (by Krathe)
* (Auto Layouts) The **override tooltip and `/df overrides` now read clearly** — each changed setting shows as a breadcrumb path with its value, only values that differ from global are listed, Text Designer elements show their names, and the override counts agree across the badge, status line and chat. (by Krathe)
* (Aura Designer) Expiring health-bar highlights now **pulse in unison** across all frames — and tint and replace modes share one pulse engine — instead of each frame pulsing on its own timing. (by Krathe)
* (Resource Bar) Added **Maelstrom** and **Pain** to the per-power resource colour options, so Shaman and Vengeance Demon Hunter resource bars can be recoloured. (by Krathe)

### Bug Fixes

Expand Down
6 changes: 6 additions & 0 deletions Config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1905,6 +1905,8 @@ DF.PartyDefaults = {
WARRIOR = true,
},
resourceBarClassColor = false,
resourceBarColorMode = "POWER_TYPE",
resourceBarCustomColor = {r = 0, g = 0.5, b = 1, a = 1},
resourceBarEnabled = true,
resourceBarFrameLevel = 20,
resourceBarHeight = 4,
Expand All @@ -1916,6 +1918,7 @@ DF.PartyDefaults = {
resourceBarShowInSoloMode = true,
resourceBarShowTank = false,
resourceBarSmooth = true,
resourceBarTexture = "Interface\\AddOns\\DandersFrames\\Media\\DF_Minimalist",
resourceBarWidth = 60,
resourceBarX = 0,
resourceBarY = 1,
Expand Down Expand Up @@ -3491,6 +3494,8 @@ DF.RaidDefaults = {
WARRIOR = true,
},
resourceBarClassColor = false,
resourceBarColorMode = "POWER_TYPE",
resourceBarCustomColor = {r = 0, g = 0.5, b = 1, a = 1},
resourceBarEnabled = true,
resourceBarFrameLevel = 20,
resourceBarHeight = 4,
Expand All @@ -3502,6 +3507,7 @@ DF.RaidDefaults = {
resourceBarShowInSoloMode = true,
resourceBarShowTank = false,
resourceBarSmooth = true,
resourceBarTexture = "Interface\\AddOns\\DandersFrames\\Media\\DF_Minimalist",
resourceBarWidth = 60,
resourceBarX = 0,
resourceBarY = 1,
Expand Down
48 changes: 48 additions & 0 deletions Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1777,6 +1777,49 @@ function DF:GetPowerColor(powerToken, powerType)
return DEFAULT_CLASS_COLOR
end

-- Resolve the resource bar's fill colour for a unit per the configured colour
-- mode. Returns r, g, b (0-1).
-- POWER_TYPE → the power-type colour (user override or Blizzard default)
-- CLASS → the unit's class colour
-- CUSTOM → the user's resourceBarCustomColor
-- Honours the legacy resourceBarClassColor boolean when resourceBarColorMode
-- isn't set yet (pre-migration profiles). Uses the same UnitClass/UnitPowerType
-- calls the old inline logic did, so it carries no new secret-value risk.
function DF:GetResourceBarColor(unit, db)
local mode = db.resourceBarColorMode
if not mode then
mode = db.resourceBarClassColor and "CLASS" or "POWER_TYPE"
end

if mode == "CUSTOM" then
local c = db.resourceBarCustomColor or {r = 0, g = 0.5, b = 1, a = 1}
return c.r or 0, c.g or 0.5, c.b or 1
elseif mode == "CLASS" then
local _, classToken = UnitClass(unit)
local cc = classToken and DF:GetClassColor(classToken)
if cc then return cc.r, cc.g, cc.b end
-- No class colour available — fall through to the power-type colour.
end

-- POWER_TYPE (and the CLASS fallback above)
local pType, pToken, altR, altG, altB = UnitPowerType(unit)
local info = DF:GetPowerColor(pToken, pType)
if info then return info.r, info.g, info.b end
if altR then return altR, altG, altB end
return 0, 0, 1
end

-- Migrate the legacy resourceBarClassColor boolean to the new
-- resourceBarColorMode tri-state. Idempotent; leaves the legacy key in place
-- (the render helper still honours it as a fallback) — same pattern as the
-- border-key migrations.
function DF:MigrateResourceBarColorMode(modeDb)
if not modeDb then return end
if modeDb.resourceBarColorMode == nil and modeDb.resourceBarClassColor ~= nil then
modeDb.resourceBarColorMode = modeDb.resourceBarClassColor and "CLASS" or "POWER_TYPE"
end
end

-- ============================================================
-- STATE DRIVERS FOR TEST MODE COMBAT SAFETY
-- When test mode is active, state drivers are registered on all
Expand Down Expand Up @@ -3416,6 +3459,11 @@ DF._MainEventDispatcher = function(self, event, arg1)
DF:MigrateResourceBarBorderKeys(DF.db.party)
DF:MigrateResourceBarBorderKeys(DF.db.raid)
end
-- Resource Bar: resourceBarClassColor (bool) → resourceBarColorMode (tri-state).
if DF.MigrateResourceBarColorMode then
DF:MigrateResourceBarColorMode(DF.db.party)
DF:MigrateResourceBarColorMode(DF.db.raid)
end
-- Aura icons: buff/debuffBorderEnabled → ShowBorder, BorderThickness →
-- BorderSize (Stage 5.5 Phase 2 — full toolkit for buff/debuff borders).
if DF.MigrateAuraBorderKeys then
Expand Down
3 changes: 3 additions & 0 deletions ExportCategories.lua
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ DF.ExportCategories = {

-- Resource/Power Bar
"resourceBarClassColor",
"resourceBarColorMode",
"resourceBarCustomColor",
"resourceBarTexture",
"resourceBarEnabled",
"resourceBarAnchor",
"resourceBarX",
Expand Down
38 changes: 8 additions & 30 deletions Frames/Bars.lua
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ function DF:ApplyResourceBarLayout(frame)
bar:Show()
bar:ClearAllPoints()

-- Fill texture (configurable; defaults to the DF house texture)
DF:SafeSetStatusBarTexture(bar, db.resourceBarTexture or "Interface\\AddOns\\DandersFrames\\Media\\DF_Minimalist")

-- Orientation & Fill Direction
bar:SetOrientation(db.resourceBarOrientation or "HORIZONTAL")
bar:SetReverseFill(db.resourceBarReverseFill)
Expand Down Expand Up @@ -206,19 +209,8 @@ function DF:ApplyResourceBarLayout(frame)
local maxPower = UnitPowerMax(unit)
bar:SetMinMaxValues(0, maxPower)
bar:SetValue(power)
local pType, pToken, altR, altG, altB = UnitPowerType(unit)
local info = DF:GetPowerColor(pToken, pType)
local _, classToken = UnitClass(unit)
local classColor = db.resourceBarClassColor and classToken and DF:GetClassColor(classToken)
if classColor then
bar:SetStatusBarColor(classColor.r, classColor.g, classColor.b, 1)
elseif info then
bar:SetStatusBarColor(info.r, info.g, info.b, 1)
elseif altR then
bar:SetStatusBarColor(altR, altG, altB, 1)
else
bar:SetStatusBarColor(0, 0, 1, 1)
end
local cr, cg, cb = DF:GetResourceBarColor(unit, db)
bar:SetStatusBarColor(cr, cg, cb, 1)
end
end
end
Expand Down Expand Up @@ -254,23 +246,9 @@ function DF:UpdateResourceBar(frame)
bar:SetMinMaxValues(0, maxPower)
DF.SetBarValue(bar, power, frame)

-- Get power type for coloring
local pType, pToken, altR, altG, altB = UnitPowerType(unit)

-- Get color from custom overrides or Blizzard defaults
local info = DF:GetPowerColor(pToken, pType)

local _, classToken = UnitClass(unit)
local classColor = db.resourceBarClassColor and classToken and DF:GetClassColor(classToken)
if classColor then
bar:SetStatusBarColor(classColor.r, classColor.g, classColor.b, 1)
elseif info then
bar:SetStatusBarColor(info.r, info.g, info.b, 1)
elseif altR then
bar:SetStatusBarColor(altR, altG, altB, 1)
else
bar:SetStatusBarColor(0, 0, 1, 1) -- Default to blue (mana)
end
-- Resolve fill colour per the configured colour mode (power / class / custom).
local cr, cg, cb = DF:GetResourceBarColor(unit, db)
bar:SetStatusBarColor(cr, cg, cb, 1)
else
bar:Hide()
end
Expand Down
3 changes: 3 additions & 0 deletions Locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,7 @@ L["Logged Categories"] = true
L["Low"] = true
L["Low Health (0%)"] = true
L["Lunar Power"] = true
L["Maelstrom"] = true
L["Mage"] = true
L["Magic"] = true
L["Major defensive cooldowns like Divine Shield, Ice Block, or Barkskin."] = true
Expand Down Expand Up @@ -1270,6 +1271,8 @@ L["Rows"] = true
L["Rows Grow From"] = true
L["Run"] = true
L["Run Script"] = true
L["Pain"] = true
L["Power Type"] = true
L["Run Setup Wizard"] = true
L["Runic Power"] = true
L["Runtime"] = true
Expand Down
42 changes: 32 additions & 10 deletions Options/Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3667,7 +3667,6 @@ function DF:SetupGUIPages(GUI, CreateCategory, CreateSubTab, BuildPage)
settingsGroup:AddWidget(GUI:CreateCheckbox(self.child, L["DPS"], db, "resourceBarShowDPS", function() DF:UpdateAllFrames() end), 30)
local showInSolo = settingsGroup:AddWidget(GUI:CreateCheckbox(self.child, L["Show in Solo Mode"], db, "resourceBarShowInSoloMode", function() DF:UpdateAllFrames() end), 30)
showInSolo.hideOn = function() return GUI.SelectedMode == "raid" end
settingsGroup:AddWidget(GUI:CreateCheckbox(self.child, L["Smooth Bar Animation"], db, "resourceBarSmooth", function() DF:UpdateAllFrames() end), 30)
Add(settingsGroup, nil, 1)

-- ===== CLASS FILTER GROUP (Column 1) =====
Expand Down Expand Up @@ -3719,13 +3718,21 @@ function DF:SetupGUIPages(GUI, CreateCategory, CreateSubTab, BuildPage)
positionGroup:AddWidget(GUI:CreateSlider(self.child, L["Offset Y"], -50, 50, 1, db, "resourceBarY", nil, function() DF:LightweightUpdatePowerBarPosition() end, true), 55)
Add(positionGroup, nil, 2)

-- ===== ORIENTATION GROUP (Column 1) =====
local orientGroup = GUI:CreateSettingsGroup(self.child, 280)
orientGroup:AddWidget(GUI:CreateHeader(self.child, L["Orientation"]), 40)
local orientOptions = { HORIZONTAL= L["Horizontal"], VERTICAL= L["Vertical"] }
orientGroup:AddWidget(GUI:CreateDropdown(self.child, L["Orientation"], orientOptions, db, "resourceBarOrientation", function() DF:UpdateAllFrames() end), 55)
orientGroup:AddWidget(GUI:CreateCheckbox(self.child, L["Reverse Fill Direction"], db, "resourceBarReverseFill", function() DF:UpdateAllFrames() end), 30)
Add(orientGroup, nil, 1)
-- ===== TEXTURE GROUP (Column 1) — mirrors the Health Bar's Texture group:
-- Texture, Orientation / Reverse Fill, and Smooth Bar Animation in one place. =====
local textureGroup = GUI:CreateSettingsGroup(self.child, 280)
textureGroup:AddWidget(GUI:CreateHeader(self.child, L["Texture"]), 40)
textureGroup:AddWidget(GUI:CreateTextureDropdown(self.child, L["Texture"], db, "resourceBarTexture", function() DF:UpdateAllFrames() end), 55)

-- Keep Orientation (Horizontal/Vertical) and Reverse Fill as two explicit
-- controls — clearer than a combined "Fill Direction" dropdown, where an
-- option like "Bottom to Top" silently changes the orientation too.
local orientOptions = { HORIZONTAL = L["Horizontal"], VERTICAL = L["Vertical"] }
textureGroup:AddWidget(GUI:CreateDropdown(self.child, L["Orientation"], orientOptions, db, "resourceBarOrientation", function() DF:UpdateAllFrames() end), 55)
textureGroup:AddWidget(GUI:CreateCheckbox(self.child, L["Reverse Fill Direction"], db, "resourceBarReverseFill", function() DF:UpdateAllFrames() end), 30)

textureGroup:AddWidget(GUI:CreateCheckbox(self.child, L["Smooth Bar Animation"], db, "resourceBarSmooth", function() DF:UpdateAllFrames() end), 30)
Add(textureGroup, nil, 1)

-- ===== BACKGROUND GROUP (Column 2) =====
local bgGroup = GUI:CreateSettingsGroup(self.child, 280)
Expand Down Expand Up @@ -3782,8 +3789,21 @@ function DF:SetupGUIPages(GUI, CreateCategory, CreateSubTab, BuildPage)
local colorGroup = GUI:CreateSettingsGroup(self.child, 280)
colorGroup:AddWidget(GUI:CreateHeader(self.child, L["Resource Colors"]), 40)
colorGroup:AddWidget(GUI:CreateLabel(self.child, L["Customize resource bar colors per power type. Shared across party and raid frames."], 260), 40)
colorGroup:AddWidget(GUI:CreateCheckbox(self.child, L["Use Class Color"], db, "resourceBarClassColor", function() DF:RefreshAllVisibleFrames() end), 30)

-- Colour mode: Power Type (per-power colours below) / Class / Custom.
local RESOURCE_COLOR_MODES = {
POWER_TYPE = L["Power Type"], CLASS = L["Class"], CUSTOM = L["Custom"],
_order = { "POWER_TYPE", "CLASS", "CUSTOM" },
}
colorGroup:AddWidget(GUI:CreateDropdown(self.child, L["Color Mode"], RESOURCE_COLOR_MODES, db, "resourceBarColorMode", function()
DF:RefreshAllVisibleFrames()
self:RefreshStates() -- re-evaluate the custom colour picker's hideOn
end), 54)

-- Custom colour — only shown in Custom mode.
local resourceCustomColor = GUI:CreateColorPicker(self.child, L["Custom Color"], db, "resourceBarCustomColor", false, function() DF:RefreshAllVisibleFrames() end, function() DF:RefreshAllVisibleFrames() end, true)
resourceCustomColor.hideOn = function() return (db.resourceBarColorMode or "POWER_TYPE") ~= "CUSTOM" end
colorGroup:AddWidget(resourceCustomColor, 30)

local powerColorsDB = DF.db.powerColors
if not powerColorsDB then
DF.db.powerColors = {}
Expand All @@ -3798,7 +3818,9 @@ function DF:SetupGUIPages(GUI, CreateCategory, CreateSubTab, BuildPage)
{ token = "RUNIC_POWER", name = L["Runic Power"] },
{ token = "INSANITY", name = L["Insanity"] },
{ token = "FURY", name = L["Fury"] },
{ token = "PAIN", name = L["Pain"] },
{ token = "LUNAR_POWER", name = L["Lunar Power"] },
{ token = "MAELSTROM", name = L["Maelstrom"] },
}

for _, info in ipairs(POWER_LIST) do
Expand Down