Display movement notice in HUD instead of chat

This commit is contained in:
Mikita Wiśniewski 2022-04-29 15:23:06 +07:00
parent c5fafbb2ce
commit 87253ca16a
2 changed files with 8 additions and 3 deletions

View File

@ -5,9 +5,14 @@ local S = minetest.get_translator(minetest.get_current_modname())
-- originally from the ts_furniture mod (which is from cozy) by Thomas--S // <https://github.com/minetest-mods/ts_furniture/>
mcl_decor.sit = function(pos, _, player)
local name = player:get_player_name()
if not player or not name then
return false
end
if not mcl_player.player_attached[name] then
if vector.length(player:get_player_velocity()) > 0 then
minetest.chat_send_player(player:get_player_name(), S("You have to stop moving before sitting down!"))
-- check movement
if vector.length(player:get_velocity() or player:get_player_velocity()) > 0.125 then
--minetest.chat_send_player(name, S("You have to stop moving before sitting down!"))
mcl_title.set(player, "actionbar", {text=S("You have to stop moving before sitting down!"), color="white", stay=60})
return
end
player:move_to(pos)

View File

@ -1,4 +1,4 @@
name = mcl_decor
description = Adds more decoration and furniture blocks to MineClone 2 (5)
depends = mcl_core, mcl_torches, mcl_player, mcl_sounds, mcl_dye, mcl_nether, mcl_stairs
depends = mcl_core, mcl_torches, mcl_player, mcl_sounds, mcl_dye, mcl_nether, mcl_stairs, mcl_title
optional_depends = mcl_cozy, mcl_mushroom