Skip to content

Commit

Permalink
Reset tab_closing_menu_option when cancel closing editor
Browse files Browse the repository at this point in the history
  • Loading branch information
jsjtxietian authored and DanielSnd committed Apr 10, 2024
1 parent c4bca48 commit c2ff298
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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."));
Expand Down
1 change: 1 addition & 0 deletions editor/editor_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ class EditorNode : public Node {
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);
Expand Down

0 comments on commit c2ff298

Please sign in to comment.