diff options
author | jsjtxietian <jsjtxietian@outlook.com> | 2024-03-28 19:22:52 +0800 |
---|---|---|
committer | jsjtxietian <jsjtxietian@outlook.com> | 2024-03-28 19:22:52 +0800 |
commit | 41dce99831196e8a0c0113699d88b703166cb8a1 (patch) | |
tree | 129609fd0f20e2359ec79ebf721747d7875e8d70 /editor | |
parent | 5d08c2631cadf29d80ca23c7d537e03c3e5edcc5 (diff) | |
download | redot-engine-41dce99831196e8a0c0113699d88b703166cb8a1.tar.gz |
Reset `tab_closing_menu_option` when cancel closing editor
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_node.cpp | 7 | ||||
-rw-r--r-- | editor/editor_node.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index edb6fee75c..df8cf863d3 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -5279,6 +5279,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; @@ -7070,6 +7076,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 b479626648..38bcc6441c 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -572,6 +572,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<String> &p_files); |