mirror of
https://gitlab.com/4w/mtimer.git
synced 2024-11-28 10:13:50 +01:00
89cd1f6212
Convert ingame time to millihours and calculate the timestamp from this. It results in a default timestampo that is parsed by default date and time functions. Replacement variables: {24h} = 24 hours time {12h} = 12 hours time {min} = minutes {its} = ingame timestamp For some reason I was not able to get the am/pm indicator (`%p`) so 12 hours format is only the time and no optional indicator.
25 lines
789 B
Lua
25 lines
789 B
Lua
local modpath = minetest.get_modpath('mtimer')..DIR_DELIM
|
|
local syspath = modpath..'system'..DIR_DELIM
|
|
|
|
|
|
mtimer = {
|
|
translator = minetest.get_translator('mtimer'),
|
|
show_formspec = {},
|
|
meta = {
|
|
visible = { key = 'mtimer:visible', default = 'true' },
|
|
position = { key = 'mtimer:position', default = 'bl' },
|
|
color = { key = 'mtimer:color', default = '#ffffffFF' },
|
|
timezone_offset = { key = 'mtimer:timezone_offset', default = '0' },
|
|
ingame_time = {key='mtimer:ingame_time_format',default='{24h}:{min}'},
|
|
}
|
|
}
|
|
|
|
|
|
dofile(syspath..'chat_command.lua')
|
|
dofile(syspath..'formspec_creation.lua')
|
|
dofile(syspath..'timer_update.lua')
|
|
dofile(syspath..'on_receive_fields.lua')
|
|
dofile(syspath..'on_joinplayer.lua')
|
|
dofile(syspath..'get_times.lua')
|
|
|