summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Chabora <kobewi4e@gmail.com>2020-07-20 01:09:36 +0200
committerkobewi <kobewi4e@gmail.com>2021-06-14 19:48:15 +0200
commit5e7f9639238ed9dc4cd2ee22ffbec9dae02925b5 (patch)
tree7de52f008d43b6e8e3adf852663a47c9f8c6d67c
parent16027e7cf412140c128e7c002ce0be533b94db00 (diff)
Make closing current scene faster
-rw-r--r--editor/editor_node.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index d8c5a14d4f..f92803039f 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -2403,11 +2403,13 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
}
} break;
- case FILE_CLOSE_ALL_AND_QUIT:
- case FILE_CLOSE_ALL_AND_RUN_PROJECT_MANAGER:
case FILE_CLOSE: {
+ _scene_tab_closed(editor_data.get_edited_scene());
+ } break;
+ case FILE_CLOSE_ALL_AND_QUIT:
+ case FILE_CLOSE_ALL_AND_RUN_PROJECT_MANAGER: {
if (!p_confirmed) {
- tab_closing = p_option == FILE_CLOSE ? editor_data.get_edited_scene() : _next_unsaved_scene(false);
+ tab_closing = _next_unsaved_scene(false);
_scene_tab_changed(tab_closing);
if (unsaved_cache || p_option == FILE_CLOSE_ALL_AND_QUIT || p_option == FILE_CLOSE_ALL_AND_RUN_PROJECT_MANAGER) {
@@ -2420,8 +2422,6 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
break;
}
}
- } else if (p_option == FILE_CLOSE) {
- tab_closing = editor_data.get_edited_scene();
}
if (!editor_data.get_edited_scene_root(tab_closing)) {
// empty tab