make sure the edit options formspec can't be closed accidentally

This commit is contained in:
Sokomine 2021-05-03 21:03:19 +02:00
parent 5e0b15389c
commit 8ecdff27ed

View File

@ -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