From f119259e676ae8c823ccac3d3d2d2a7cd8f1ef6e Mon Sep 17 00:00:00 2001 From: Nicu Date: Fri, 24 May 2024 20:35:13 +0000 Subject: [PATCH] Updated the sleeping formspec for a better look (#4319) This PR deals with the UI side of #3645 - no logic was changed to prevent the spam related to the `zzZ` button. The chatbox now only shows in multiplayer, where it belongs. The buttons have also been resized and moved into positions that make them look nicer. Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4319 Reviewed-by: the-real-herowl Co-authored-by: Nicu Co-committed-by: Nicu --- mods/ITEMS/mcl_beds/functions.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mods/ITEMS/mcl_beds/functions.lua b/mods/ITEMS/mcl_beds/functions.lua index 69f69f17e..b1c3f0830 100644 --- a/mods/ITEMS/mcl_beds/functions.lua +++ b/mods/ITEMS/mcl_beds/functions.lua @@ -225,11 +225,9 @@ local function update_formspecs(finished, players) local button_abort = "button_exit[4,3;4,0.75;leave;"..F(S("Abort sleep")).."]" local bg_presleep = "bgcolor[#00000080;true]" local bg_sleep = "bgcolor[#000000FF;true]" - local chatbox = "field[0.2,4.5;9,1;chatmessage;"..F(S("Chat:"))..";]" - local chatsubmit = "button[9.2,3.75;1,2;chatsubmit;"..F(S("send!")).."]" - local defaultmessagebutton = "button[10.2,3.75;1,2;defaultmessage;zzZzzZ]" - - form_n = form_n .. chatbox .. chatsubmit --because these should be in the formspec in ANY case, they might as well be added here already + local chatbox = "field[0.3,4.5;10,1;chatmessage;"..F(S("Chat:"))..";]" + local chatsubmit = "button[10,3.73;2,2;chatsubmit;"..F(S("Send")).."]" + local defaultmessagebutton = "button[10.98,2.93;1,2;defaultmessage;zzZ]" if finished then for name,_ in pairs(mcl_beds.player) do @@ -237,6 +235,7 @@ local function update_formspecs(finished, players) end return elseif not is_sp then + form_n = form_n .. chatbox .. chatsubmit --because these should be in the formspec in ANY case, they might as well be added here already local text = S("Players in bed: @1/@2", player_in_bed, ges) if not night_skip then text = text .. "\n" .. S("Note: Night skip is disabled.")