It updates internally every second, however the display is
rounded.
For example, if your cooldown is in 4 hours you don’t really care if
it is 4 hours and 15 seconds do you?
The display works like this:
Over a day
Displays: 3d, 2d, 1d, etc.
Less than a day but more
than an hour
Displays: 23h, 22h, 21h etc.
Less than an hour but
more than a minute
Displays: 59m, 58m, 57m etc.
Less than a minute
Displays: 59s, 58s, 57s etc.
You could conceivably make the display change colour when time is
almost up, for example change:
-- add the text
WindowText (win, font_id, contents, MARGIN / 2, MARGIN / 2, 0, 0, ColourNameToRGB ("black"))
to:
color = "black"
if details.cooldown and details.cooldown < 60 and details.cooldown > 0 then
color = "darkred"
end -- if soon
-- add the text
WindowText (win, font_id, contents, MARGIN / 2, MARGIN / 2, 0, 0, color)
|