From f3f91e40dd843af0af35bd0bcf8f062b7821e1eb Mon Sep 17 00:00:00 2001 From: Mats391 Date: Sat, 14 Mar 2026 19:35:33 +0100 Subject: [PATCH 1/2] Adding options for different config for max and progress timer --- api/config.lua | 1 + modules/castbar.lua | 10 +++++----- modules/gui.lua | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/api/config.lua b/api/config.lua index 904cbfda..76a34189 100644 --- a/api/config.lua +++ b/api/config.lua @@ -264,6 +264,7 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("unitframes", nil, "raidmarkercolor_skull", "1,1,1,1") pfUI:UpdateConfig("unitframes", nil, "abbrevnum", "1") pfUI:UpdateConfig("unitframes", nil, "castbardecimals", "2") + pfUI:UpdateConfig("unitframes", nil, "castbardecimalscur","2") pfUI:UpdateConfig("unitframes", nil, "abbrevname", "1") -- Nampower Settings diff --git a/modules/castbar.lua b/modules/castbar.lua index f8bdd99d..643df274 100644 --- a/modules/castbar.lua +++ b/modules/castbar.lua @@ -6,8 +6,8 @@ pfUI:RegisterModule("castbar", "vanilla", function () local cbtexture = pfUI.media[C.appearance.castbar.texture] -- Helper function for castbar timer formatting - local function FormatCastbarTime(value) - if C.unitframes.castbardecimals == "1" then + local function FormatCastbarTime(value, decimals) + if decimals == "1" then -- 1 decimal, round half up (matches Blizzard spellbook display) return string.format("%.1f", floor(value * 10 + 0.5) / 10) else @@ -223,10 +223,10 @@ pfUI:RegisterModule("castbar", "vanilla", function () if this.showtimer then if this.delay and this.delay > 0 then - local delay = "|cffffaaaa" .. (channel and "-" or "+") .. FormatCastbarTime(this.delay) .. " |r " - this.bar.right:SetText(delay .. FormatCastbarTime(cur) .. " / " .. FormatCastbarTime(max)) + local delay = "|cffffaaaa" .. (channel and "-" or "+") .. FormatCastbarTime(this.delay, C.unitframes.castbardecimalscur) .. " |r " + this.bar.right:SetText(delay .. FormatCastbarTime(cur, C.unitframes.castbardecimalscur) .. " / " .. FormatCastbarTime(maxC.unitframes.castbardecimals)) else - this.bar.right:SetText(FormatCastbarTime(cur) .. " / " .. FormatCastbarTime(max)) + this.bar.right:SetText(FormatCastbarTime(cur, C.unitframes.castbardecimalscur) .. " / " .. FormatCastbarTime(max, C.unitframes.castbardecimals)) end end diff --git a/modules/gui.lua b/modules/gui.lua index 186537c5..33665e67 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -1514,7 +1514,8 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function () CreateConfig(nil, T["Highlight Settings That Require Reload"], C.gui, "reloadmarker", "checkbox") CreateConfig(nil, T["Show Incompatible Config Entries"], C.gui, "showdisabled", "checkbox") CreateConfig(nil, T["Abbreviate Numbers"], C.unitframes, "abbrevnum", "dropdown", pfUI.gui.dropdowns.abbrevnum) - CreateConfig(nil, T["Castbar Timer Decimals"], C.unitframes, "castbardecimals", "dropdown", pfUI.gui.dropdowns.castbardecimals) + CreateConfig(nil, T["Castbar Timer Decimals Maximum"], C.unitframes, "castbardecimals", "dropdown", pfUI.gui.dropdowns.castbardecimals) + CreateConfig(nil, T["Castbar Timer Decimals Progress"], C.unitframes, "castbardecimalscur", "dropdown", pfUI.gui.dropdowns.castbardecimals) CreateConfig(nil, T["Abbreviate Unit Names"], C.unitframes, "abbrevname", "checkbox") CreateConfig(nil, T["Health Point Estimation"], nil, nil, "header") CreateConfig(nil, T["Estimate Enemy Health Points"], C.global, "libhealth", "checkbox") From 703431071fde05693c10dfc9514bebfdae8306a8 Mon Sep 17 00:00:00 2001 From: Mats391 Date: Sat, 14 Mar 2026 20:13:35 +0100 Subject: [PATCH 2/2] Fixing typo --- modules/castbar.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/castbar.lua b/modules/castbar.lua index 643df274..e0f23321 100644 --- a/modules/castbar.lua +++ b/modules/castbar.lua @@ -224,7 +224,7 @@ pfUI:RegisterModule("castbar", "vanilla", function () if this.showtimer then if this.delay and this.delay > 0 then local delay = "|cffffaaaa" .. (channel and "-" or "+") .. FormatCastbarTime(this.delay, C.unitframes.castbardecimalscur) .. " |r " - this.bar.right:SetText(delay .. FormatCastbarTime(cur, C.unitframes.castbardecimalscur) .. " / " .. FormatCastbarTime(maxC.unitframes.castbardecimals)) + this.bar.right:SetText(delay .. FormatCastbarTime(cur, C.unitframes.castbardecimalscur) .. " / " .. FormatCastbarTime(max, C.unitframes.castbardecimals)) else this.bar.right:SetText(FormatCastbarTime(cur, C.unitframes.castbardecimalscur) .. " / " .. FormatCastbarTime(max, C.unitframes.castbardecimals)) end