From 8ecdff27ed2c20e88bd2b4fa5c8e05e068c1918a Mon Sep 17 00:00:00 2001 From: Sokomine Date: Mon, 3 May 2021 21:03:19 +0200 Subject: [PATCH] make sure the edit options formspec can't be closed accidentally --- functions.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/functions.lua b/functions.lua index dc67059..e8b6e97 100644 --- a/functions.lua +++ b/functions.lua @@ -864,9 +864,7 @@ local function get_fs_optiondialog(player, n_id, d_id, o_id, p_id, r_id) end --- TODO: display and allow to edit sort order (o_sort) -- TODO: actually add functionality for this formspec --- TODO: make sure the formspec doesn't get closed when there are unsaved modifications -- -- edit options (not via staff but via the "I am your owner" dialog) local function get_fs_edit_option_dialog(player, n_id, d_id, o_id) @@ -2136,12 +2134,12 @@ minetest.register_on_player_receive_fields( -- this meny is specific to an option for a dialog; if no dialog is selected, we really -- can't know what to do - if(not(d_id) or not(d_option)) then + if(not(d_id)) then return end -- back to the main dialog window? - if(fields.show_current_dialog) then + if(fields.show_current_dialog or fields.quit or fields.button_exit or not(d_option)) then minetest.show_formspec(pname, "yl_speak_up:talk", get_fs_talkdialog(player, n_id, d_id)) return end