From 7ddf97d49d7fe4bb107f4dcc0925a737961df01e Mon Sep 17 00:00:00 2001 From: Sokomine Date: Fri, 9 Feb 2024 21:52:11 +0100 Subject: [PATCH] show_fs: save_or_discard_changes --- editor/fs/fs_save_or_discard_or_back.lua | 8 ++++++++ show_fs.lua | 10 +--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/editor/fs/fs_save_or_discard_or_back.lua b/editor/fs/fs_save_or_discard_or_back.lua index c63877d..34edd19 100644 --- a/editor/fs/fs_save_or_discard_or_back.lua +++ b/editor/fs/fs_save_or_discard_or_back.lua @@ -121,3 +121,11 @@ yl_speak_up.get_fs_save_or_discard_changes = function(player, param) "tooltip[back_to_dialog_changes;Go back to dialog ".. minetest.formspec_escape(d_id).." and continue editing it.]" end + + +yl_speak_up.register_fs("save_or_discard_changes", + yl_speak_up.input_save_or_discard_changes, + yl_speak_up.get_fs_save_or_discard_changes, + -- no special formspec required: + nil +) diff --git a/show_fs.lua b/show_fs.lua index d46ea85..de84b61 100644 --- a/show_fs.lua +++ b/show_fs.lua @@ -37,10 +37,6 @@ yl_speak_up.input_handler = function(player, formname, fields) elseif formname == "yl_speak_up:setdialog" then yl_speak_up.input_setdialog(player, formname, fields) return true - -- handled in fs_save_or_discard_or_back.lua - elseif formname == "yl_speak_up:save_or_discard_changes" then - yl_speak_up.input_save_or_discard_changes(player, formname, fields) - return true elseif formname == "yl_speak_up:talk" then yl_speak_up.input_talk(player, formname, fields) return true @@ -82,12 +78,8 @@ yl_speak_up.show_fs = function(player, fs_name, param) end local last_fs = yl_speak_up.speak_to[pname].last_fs - -- show the save or discard changes dialog - if(fs_name and fs_name == "save_or_discard_changes") then - yl_speak_up.show_fs_ver(pname, "yl_speak_up:save_or_discard_changes", - yl_speak_up.get_fs_save_or_discard_changes(player, param)) - return + if(false) then -- the player either saved or discarded; we may proceed now elseif(fs_name and fs_name == "proceed_after_save") then fs_name = yl_speak_up.speak_to[pname].next_fs