diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 6fb333d5e8e..616c5667dd5 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -5280,6 +5280,12 @@ void EditorNode::_scene_tab_closed(int p_tab) { scene_tabs->update_scene_tabs(); } +void EditorNode::_cancel_close_scene_tab() { + if (_is_closing_editor()) { + tab_closing_menu_option = -1; + } +} + void EditorNode::_toggle_distraction_free_mode() { if (EDITOR_GET("interface/editor/separate_distraction_mode")) { int screen = -1; @@ -7073,6 +7079,7 @@ EditorNode::EditorNode() { save_confirmation->set_min_size(Vector2(450.0 * EDSCALE, 0)); save_confirmation->connect("confirmed", callable_mp(this, &EditorNode::_menu_confirm_current)); save_confirmation->connect("custom_action", callable_mp(this, &EditorNode::_discard_changes)); + save_confirmation->connect("canceled", callable_mp(this, &EditorNode::_cancel_close_scene_tab)); gradle_build_manage_templates = memnew(ConfirmationDialog); gradle_build_manage_templates->set_text(TTR("Android build template is missing, please install relevant templates.")); diff --git a/editor/editor_node.h b/editor/editor_node.h index 9acd19a15ce..8bcf29811d8 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -570,6 +570,7 @@ private: int _next_unsaved_scene(bool p_valid_filename, int p_start = 0); void _discard_changes(const String &p_str = String()); void _scene_tab_closed(int p_tab); + void _cancel_close_scene_tab(); void _inherit_request(String p_file); void _instantiate_request(const Vector &p_files);