mtimer/init.lua
Dirk Sohler 89cd1f6212
implement ingame time format setting
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.
2019-02-21 16:16:10 +01:00

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')