mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-07 06:00:00 +00:00
panel: add option for 12 hour clock
This commit is contained in:
@@ -15,6 +15,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("global", nil, "errors_hide", "0")
|
||||
pfUI:UpdateConfig("global", nil, "hidebuff", "0")
|
||||
pfUI:UpdateConfig("global", nil, "hidewbuff", "0")
|
||||
pfUI:UpdateConfig("global", nil, "twentyfour", "1")
|
||||
|
||||
pfUI:UpdateConfig("appearance", "border", "background", "0,0,0,1")
|
||||
pfUI:UpdateConfig("appearance", "border", "color", "0.3,0.3,0.3,1")
|
||||
|
||||
@@ -740,6 +740,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
pfUI.gui:CreateConfig(pfUI.gui.global, "Disable UIErrors", pfUI_config.global, "errors_hide", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.global, "Hide Buffs", pfUI_config.global, "hidebuff", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.global, "Hide Weapon Buffs", pfUI_config.global, "hidewbuff", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.global, "Use 24h Clock", pfUI_config.global, "twentyfour", "checkbox")
|
||||
|
||||
pfUI.gui:CreateConfig(pfUI.gui.global, "Profile", nil, nil, "header")
|
||||
local values = {}
|
||||
|
||||
+20
-3
@@ -79,9 +79,22 @@ pfUI:RegisterModule("panel", function ()
|
||||
GameTooltip:ClearLines()
|
||||
GameTooltip_SetDefaultAnchor(GameTooltip, this)
|
||||
local h, m = GetGameTime()
|
||||
local servertime = string.format("%.2d:%.2d", h, m)
|
||||
local noon = " AM"
|
||||
local servertime
|
||||
local time
|
||||
if pfUI_config.global.twentyfour == "0" then
|
||||
if h > 12 then
|
||||
h = h - 12
|
||||
noon = " PM"
|
||||
end
|
||||
time = date("%I:%M %p")
|
||||
servertime = string.format("%.2d:%.2d", h, m) .. noon
|
||||
else
|
||||
time = date("%H:%M")
|
||||
servertime = string.format("%.2d:%.2d", h, m)
|
||||
end
|
||||
GameTooltip:AddLine("|cff555555Time")
|
||||
GameTooltip:AddDoubleLine("Localtime", "|cffffffff" .. date("%H:%M"))
|
||||
GameTooltip:AddDoubleLine("Localtime", "|cffffffff" .. time)
|
||||
GameTooltip:AddDoubleLine("Servertime", "|cffffffff".. servertime)
|
||||
GameTooltip:AddLine(" ")
|
||||
GameTooltip:AddDoubleLine("Left Click", "|cffffffffShow/Hide Timer")
|
||||
@@ -103,7 +116,11 @@ pfUI:RegisterModule("panel", function ()
|
||||
end
|
||||
|
||||
pfUI.panel.clock.tick = GetTime()
|
||||
pfUI.panel:OutputPanel("time", date("%H:%M:%S"), tooltip, click)
|
||||
if pfUI_config.global.twentyfour == "0" then
|
||||
pfUI.panel:OutputPanel("time", date("%I:%M:%S %p"), tooltip, click)
|
||||
else
|
||||
pfUI.panel:OutputPanel("time", date("%H:%M:%S"), tooltip, click)
|
||||
end
|
||||
|
||||
-- lag fps
|
||||
local tooltip = function ()
|
||||
|
||||
Reference in New Issue
Block a user