Align Minimap Clock updates to minute boundaries

This commit is contained in:
Dusk-92
2026-09-05 15:31:58 +02:00
parent 635178fc5a
commit 0dd7b0ed4c
+10 -2
View File
@@ -67,8 +67,16 @@ module.enable = function(self)
MinimapClock.text:SetText(date("%H:%M"))
end
updateclock()
MinimapClock.ticker = C_Timer.NewTicker(1, updateclock)
local function scheduleclock()
updateclock()
-- Recalculate the next minute boundary every time so delayed callbacks,
-- alt-tab stalls or local clock adjustments cannot accumulate drift.
local seconds = tonumber(date("%S")) or 0
C_Timer.After(60 - seconds, scheduleclock)
end
scheduleclock()
local timertext = MinimapTimer:CreateFontString(nil, "LOW", "GameFontNormal")
timertext:SetFont(STANDARD_TEXT_FONT, 12, "OUTLINE")