diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-01-06 10:09:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-06 10:09:15 +0100 |
commit | 89a83a8af263ca9e997aa6d70b5b18c5b07e5fdb (patch) | |
tree | eaa29cfd780dcb19041ac124c2cba7d474050cfe | |
parent | 598b52c1ba059f7ec21cd68f1b9035fd0fb85e76 (diff) | |
parent | a54110ba600825319552dd839fd62ebcdb449317 (diff) |
Merge pull request #44952 from EricEzaM/PR/update-run-scene-save-dialog
Made save dialog open immediately when running unsaved scene.
-rw-r--r-- | editor/editor_node.cpp | 17 | ||||
-rw-r--r-- | 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 72d9aacef3..ce579febfe 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2123,7 +2123,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; } @@ -2382,18 +2385,6 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { case FILE_SAVE_ALL_SCENES: { _save_all_scenes(); } break; - case FILE_SAVE_BEFORE_RUN: { - if (!p_confirmed) { - confirmation->get_cancel_button()->set_text(TTR("No")); - confirmation->get_ok_button()->set_text(TTR("Yes")); - confirmation->set_text(TTR("This scene has never been saved. Save before running?")); - confirmation->popup_centered(); - break; - } - - _menu_option(FILE_SAVE_AS_SCENE); - _menu_option_confirm(FILE_SAVE_AND_RUN, false); - } break; case FILE_EXPORT_PROJECT: { project_export->popup_export(); diff --git a/editor/editor_node.h b/editor/editor_node.h index 0ef2e8cbfc..12aa2a2f5d 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -125,7 +125,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, |