Merge pull request 'HUD/mcl_tmp_message: Add setting for temporary message display duration (default: 10s)' (#266) from tmp-message-timeout-increase into master

Reviewed-on: https://git.minetest.land/Mineclonia/Mineclonia/pulls/266
Reviewed-by: cora <cora@noreply.git.minetest.land>
master
cora 2022-02-18 10:59:47 +00:00
commit de9f2479eb
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 10
}
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 10 0 60
[Experimental]
# Whether ice is translucent. If disabled, ice is fully opaque.
#