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..e0f23321 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(max, C.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")