BigClockExtra: Added hour to minute timeunit. closes #8. Also added some minor gui refinements
This commit is contained in:
parent
f41bb72fe5
commit
3a4d7aab2e
@ -107,10 +107,10 @@ function gui_init()
|
||||
rc_menu:add_item({label = "Time since previous region|",
|
||||
toggleable = true,
|
||||
selected = timeSinceRegion})
|
||||
rc_menu:add_item({label = "Minutes:Seconds.Milliseconds",
|
||||
rc_menu:add_item({label = "HH:MM:SS.xxx",
|
||||
toggleable = true,
|
||||
selected = timeUnitHMS})
|
||||
rc_menu:add_item({label = "Measures.Beats",
|
||||
rc_menu:add_item({label = "Measures.Beats.xx|",
|
||||
toggleable = true,
|
||||
selected = timeUnitMeasures})
|
||||
rc_menu:add_item({label = "Quit"})
|
||||
@ -186,6 +186,8 @@ function drawGui()
|
||||
local val
|
||||
local timeRaw
|
||||
local timeDisplay
|
||||
local timeDisplayHours
|
||||
local timeDisplayMinutes
|
||||
local timeDisplaySeconds
|
||||
local timeMeasures
|
||||
local timeBeats
|
||||
@ -220,8 +222,19 @@ function drawGui()
|
||||
timeDisplay = timeMeasures+1 .. '.' .. round(timeBeats+1, 2)
|
||||
else
|
||||
-- minutes and seconds: MM:SS.xxx (e.g. 27:08.321)
|
||||
timeDisplaySeconds = math.floor((timeRaw%60)*1000)/1000
|
||||
timeDisplay = math.floor(timeRaw/60) .. ":"
|
||||
timeDisplayHours = math.floor(timeRaw/3600)
|
||||
timeRaw = timeRaw%3600
|
||||
timeDisplayMinutes = math.floor(timeRaw/60)
|
||||
timeDisplaySeconds = round(timeRaw%60, 3)
|
||||
if timeDisplayHours > 0 then
|
||||
timeDisplay = timeDisplayHours .. ":"
|
||||
if timeDisplayMinutes < 10 then
|
||||
timeDisplay = timeDisplay .. "0"
|
||||
end
|
||||
else
|
||||
timeDisplay = ""
|
||||
end
|
||||
timeDisplay = timeDisplay .. timeDisplayMinutes .. ":"
|
||||
if timeDisplaySeconds < 10 then
|
||||
timeDisplay = timeDisplay .. "0"
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user