From db3e18b9c6d6773da63c0fcf5d6261a04c69bbf6 Mon Sep 17 00:00:00 2001 From: Eric M Date: Wed, 6 Jan 2021 11:17:56 +1000 Subject: [PATCH] Made save dialog open immediately when running unsaved scene. Previously there was an unneeded confirmation dialog. (cherry picked from commit a54110ba600825319552dd839fd62ebcdb449317) --- editor/editor_node.cpp | 17 ++++------------- editor/editor_node.h | 1 - 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 7c5bd2612c7..7ea08ffb1cc 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2100,7 +2100,10 @@ void EditorNode::_run(bool p_current, const String &p_custom) { if (scene->get_filename() == "") { current_option = -1; - _menu_option_confirm(FILE_SAVE_BEFORE_RUN, false); + _menu_option(FILE_SAVE_AS_SCENE); + // Set the option to save and run so when the dialog is accepted, the scene runs. + current_option = FILE_SAVE_AND_RUN; + file->set_title(TTR("Save scene before running...")); return; } @@ -2351,18 +2354,6 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { _save_all_scenes(); } break; - case FILE_SAVE_BEFORE_RUN: { - if (!p_confirmed) { - confirmation->get_cancel()->set_text(TTR("No")); - confirmation->get_ok()->set_text(TTR("Yes")); - confirmation->set_text(TTR("This scene has never been saved. Save before running?")); - confirmation->popup_centered_minsize(); - break; - } - - _menu_option(FILE_SAVE_AS_SCENE); - _menu_option_confirm(FILE_SAVE_AND_RUN, false); - } break; case FILE_EXPORT_PROJECT: { diff --git a/editor/editor_node.h b/editor/editor_node.h index 3cfe5c5553e..0a3f10b347e 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -124,7 +124,6 @@ private: FILE_SAVE_SCENE, FILE_SAVE_AS_SCENE, FILE_SAVE_ALL_SCENES, - FILE_SAVE_BEFORE_RUN, FILE_SAVE_AND_RUN, FILE_SHOW_IN_FILESYSTEM, FILE_IMPORT_SUBSCENE,