panel: add option to hide seconds on clock

This commit is contained in:
jmgibson1981
2025-02-14 22:44:40 +01:00
committed by GitHub
parent 44b76727e0
commit 9514a535d7
3 changed files with 14 additions and 2 deletions
+2
View File
@@ -575,6 +575,7 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("panel", nil, "hide_rightchat", "0")
pfUI:UpdateConfig("panel", nil, "hide_minimap", "0")
pfUI:UpdateConfig("panel", nil, "hide_microbar", "0")
pfUI:UpdateConfig("panel", nil, "seconds", "1")
pfUI:UpdateConfig("panel", "left", "left", "guild")
pfUI:UpdateConfig("panel", "left", "center", "durability")
pfUI:UpdateConfig("panel", "left", "right", "friends")
@@ -607,6 +608,7 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("panel", "xp", "rep_anchor", "pfChatRight")
pfUI:UpdateConfig("panel", "xp", "rep_position", "LEFT")
pfUI:UpdateConfig("panel", "xp", "dont_overlap", "0")
pfUI:UpdateConfig("castbar", "player", "hide_blizz", "1")
pfUI:UpdateConfig("castbar", "player", "hide_pfui", "0")
+1
View File
@@ -2076,6 +2076,7 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
CreateConfig(nil, T["Only Count Bagspace On Regular Bags"], C.panel.bag, "ignorespecial", "checkbox")
CreateConfig(nil, T["Enable Micro Bar"], C.panel.micro, "enable", "checkbox")
CreateConfig(nil, T["Enable 24h Clock"], C.global, "twentyfour", "checkbox")
CreateConfig(nil, T["Enable Seconds"], C.panel, "seconds", "checkbox")
CreateConfig(nil, T["Servertime"], C.global, "servertime", "checkbox")
CreateConfig(U["panel"], T["Show FPS and Latency Colors"], C.panel, "fpscolors", "checkbox")
+11 -2
View File
@@ -64,6 +64,7 @@ pfUI:RegisterModule("panel", "vanilla:tbc", function()
local h, m = GetGameTime()
local noon = "AM"
local time = ""
local secondsenabled = C.panel.seconds == "1"
if C.global.twentyfour == "0" then
if C.global.servertime == "1" then
if h > 12 then
@@ -72,13 +73,21 @@ pfUI:RegisterModule("panel", "vanilla:tbc", function()
end
time = string.format("%.2d:%.2d %s", h, m, noon)
else
time = date("%I:%M:%S %p")
if secondsenabled then
time = date("%I:%M:%S %p")
else
time = date("%I:%M %p")
end
end
else
if C.global.servertime == "1" then
time = string.format("%.2d:%.2d", h, m)
else
time = date("%H:%M:%S")
if secondsenabled then
time = date("%H:%M:%S")
else
time = date("%H:%M")
end
end
end
pfUI.panel:OutputPanel("time", time, widget.Tooltip, widget.Click)