Add setting for temporary message display duration

master
Nils Dagsson Moskopp 2022-02-09 02:46:03 +01:00
parent 18e299d923
commit e7070c034c
No known key found for this signature in database
GPG Key ID: A3BC671C35191080
2 changed files with 9 additions and 2 deletions

View File

@ -1,4 +1,8 @@
mcl_tmp_message = {}
mcl_tmp_message = {
hud_hide_timeout = tonumber(
minetest.settings:get("mcl_tmp_message_hud_hide_timeout")
) or 3
}
local huds = {}
local hud_hide_timeouts = {}
@ -6,7 +10,7 @@ local hud_hide_timeouts = {}
function mcl_tmp_message.message(player, message)
local name = player:get_player_name()
player:hud_change(huds[name], "text", message)
hud_hide_timeouts[name] = 3
hud_hide_timeouts[name] = mcl_tmp_message.hud_hide_timeout
end
minetest.register_on_joinplayer(function(player)

View File

@ -102,6 +102,9 @@ animated_chests (Animated chests) bool true
# Whether to preview the player in inventory in 3D (requires Minetest 5.4)
3d_player_preview (3D Player preview) bool true
# How long a temporary message will be shown in the HUD
mcl_tmp_message_hud_hide_timeout (Temporary message display duration) int 3 0 60
[Experimental]
# Whether ice is translucent. If disabled, ice is fully opaque.
#