2017-05-05 21:58:07 +02:00
|
|
|
|
# Since MT is no real-time application and Lua isn't super
|
|
|
|
|
# fast when accessed through the API there is no need in
|
|
|
|
|
# setting this to 1 second. The default of 30 seconds is
|
|
|
|
|
# absolutely fine.
|
2017-07-27 21:00:04 +02:00
|
|
|
|
mtimer_update_interval (Seconds between updates) int 30
|
2017-05-05 21:58:07 +02:00
|
|
|
|
|
|
|
|
|
# The string will be displayed as provided here. There
|
|
|
|
|
# are some variables.
|
|
|
|
|
#
|
|
|
|
|
# +s = Session start time as formatted
|
|
|
|
|
# +c = Current time as formatted
|
|
|
|
|
# +r = Runtime of the current session
|
|
|
|
|
# +i = Current ingame time in 24h format
|
|
|
|
|
# +n = Following output will be in a new line
|
2017-07-29 16:36:07 +02:00
|
|
|
|
mtimer_format (Output string formatting) string Session from +s+nCurrent time: +c+nPlaytime: +r, Ingame time: +i
|
2017-05-05 21:58:07 +02:00
|
|
|
|
|
|
|
|
|
# A placeholder text that is shown before the timer
|
|
|
|
|
# function gets executed the first time
|
2017-07-29 16:36:07 +02:00
|
|
|
|
mtimer_placeholder (Placeholder for the timer) string [Initializing MTimer]
|
2017-05-05 21:58:07 +02:00
|
|
|
|
|
|
|
|
|
# The font color for the timer text
|
|
|
|
|
#
|
|
|
|
|
# Because the timer text is shown all the time the default
|
|
|
|
|
# color is not white but a bit darker so it doesn’t
|
|
|
|
|
# distract too much from the game.
|
|
|
|
|
#
|
|
|
|
|
# Use the hexadecimal color notation here (“HTML notation”
|
|
|
|
|
# but without the `#` sign in front).
|
2017-07-27 21:00:04 +02:00
|
|
|
|
mtimer_font_color (Font color for the timer text) string babdb6
|
2017-05-05 21:58:07 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Time Formatting]
|
|
|
|
|
|
|
|
|
|
# Time when the current session was started. The session
|
|
|
|
|
# is based on when the user connected to the world. The
|
|
|
|
|
# format is this: https://www.lua.org/pil/22.1.html
|
2017-07-29 16:36:07 +02:00
|
|
|
|
mtimer_start ([+s] Session start time) string %c
|
2017-05-05 21:58:07 +02:00
|
|
|
|
|
|
|
|
|
# A hours:minutes timer that allows tracking of the
|
|
|
|
|
# current play time. The timer breaks if game time
|
|
|
|
|
# exceeds 24 hours.
|
|
|
|
|
#
|
|
|
|
|
# +h = Hours
|
|
|
|
|
# +m = Minutes
|
|
|
|
|
# +s = Seconds
|
2017-07-29 16:36:07 +02:00
|
|
|
|
mtimer_runtime ([+r] Session runtime) string +h:+m
|
2017-05-05 21:58:07 +02:00
|
|
|
|
|
|
|
|
|
# The current real-world time according to what the OS
|
|
|
|
|
# provides. Formatting this string is quite easy by using
|
|
|
|
|
# those tags: https://www.lua.org/pil/22.1.html
|
2017-07-27 21:26:43 +02:00
|
|
|
|
mtimer_current_time ([+c] Current time) string %c
|
2017-05-05 21:58:07 +02:00
|
|
|
|
|
|
|
|
|
# Ingame time in 24 hours format that was converted
|
|
|
|
|
# the provided decimal number and might not be 100
|
|
|
|
|
# percent exact.
|
|
|
|
|
#
|
|
|
|
|
# +h = hours with leading zeros
|
|
|
|
|
# +m = minutes with leading zeros
|
2017-07-27 21:00:04 +02:00
|
|
|
|
mtimer_ingame_time ([+i] Ingame time) string +h:+m Uhr
|
2017-05-05 21:58:07 +02:00
|
|
|
|
|
|
|
|
|
# Locale that will be used for the time formatting. The
|
|
|
|
|
# locale has to be provided by your system. On Linux see
|
|
|
|
|
# command `locale` for valid locales to use.
|
2017-07-27 21:26:43 +02:00
|
|
|
|
mtimer_locale (Format output locale) string C
|
2017-05-05 21:58:07 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Positioning]
|
|
|
|
|
|
2017-07-29 16:36:07 +02:00
|
|
|
|
# Regardless of all other configuration: Show the timer
|
|
|
|
|
# in the GUI of the players - or do noit show it.
|
|
|
|
|
mtimer_show (Show at all) bool true
|
|
|
|
|
|
2017-05-05 21:58:07 +02:00
|
|
|
|
# "To account for differing resolutions, the position
|
|
|
|
|
# coordinates are the percentage of the screen, ranging
|
|
|
|
|
# in value from 0 to 1. 0 means left/top, 1 means
|
|
|
|
|
# right/bottom." Separate the numbers with a comma but
|
|
|
|
|
# without spaces.
|
|
|
|
|
#
|
|
|
|
|
# See http://dev.minetest.net/HUD#Fields
|
2017-07-27 21:00:04 +02:00
|
|
|
|
mtimer_position (Position) string 0,1
|
2017-05-05 21:58:07 +02:00
|
|
|
|
|
|
|
|
|
# "Specifies how the item will be aligned. It ranges
|
|
|
|
|
# from -1 to 1, with 0 being the center, -1 is moved to
|
|
|
|
|
# the left/up, and 1 is to the right/down." Separate the
|
|
|
|
|
# numbers with a comma but without spaces.
|
|
|
|
|
#
|
|
|
|
|
# See http://dev.minetest.net/HUD#Fields
|
2017-07-27 21:00:04 +02:00
|
|
|
|
mtimer_alignment (Alignment) string 1,-1
|
2017-05-05 21:58:07 +02:00
|
|
|
|
|
|
|
|
|
# "Specifies a pixel offset from the position. Not scaled
|
|
|
|
|
# to the screen size. [It adapts] to screen DPI as well
|
|
|
|
|
# as the user defined scaling factor!" Separate the
|
|
|
|
|
# numbers with a comma but without spaces.
|
|
|
|
|
#
|
|
|
|
|
# See http://dev.minetest.net/HUD#Fields
|
2017-07-27 21:00:04 +02:00
|
|
|
|
mtimer_offset (Offset) string 4,0
|