Skip to content
Open
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
1 change: 1 addition & 0 deletions api/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions modules/castbar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion modules/gui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down