diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-01-21 23:54:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-21 23:54:31 +0100 |
commit | 2a3e771f4cb2b01d6cbd4bf09e1fbd27e3b019c0 (patch) | |
tree | 238daf1fbf6b2025ba49fde2979b97d09ef36650 /editor | |
parent | a9b151c664d00d353640e6b2c52d026347230269 (diff) | |
parent | c3abda0b13bad35eb19c9577f3132394c4ce4e60 (diff) |
Merge pull request #36355 from Dodoveloper/master
Fix remembering of an unsaved scene on exit
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_node.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index cdb899b108..0ef21d3a11 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2292,6 +2292,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { case FILE_CLOSE: { if (!p_confirmed) { tab_closing = p_option == FILE_CLOSE ? editor_data.get_edited_scene() : _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) { String scene_filename = editor_data.get_edited_scene_root(tab_closing)->get_filename(); @@ -2813,6 +2814,10 @@ void EditorNode::_discard_changes(const String &p_str) { _update_scene_tabs(); if (current_option == FILE_CLOSE_ALL_AND_QUIT || current_option == FILE_CLOSE_ALL_AND_RUN_PROJECT_MANAGER) { + // If restore tabs is enabled, reopen the scene that has just been closed, so it's remembered properly. + if (bool(EDITOR_GET("interface/scene_tabs/restore_scenes_on_load"))) { + _menu_option_confirm(FILE_OPEN_PREV, true); + } if (_next_unsaved_scene(false) == -1) { current_option = current_option == FILE_CLOSE_ALL_AND_QUIT ? FILE_QUIT : RUN_PROJECT_MANAGER; _discard_changes(); |