@@ -3007,16 +3007,19 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
30073007 break ;
30083008 }
30093009
3010- if (unsaved_cache && !p_confirmed) {
3011- confirmation->set_ok_button_text (TTR (" Save & Reload" ));
3012- unsaved_message = _get_unsaved_scene_dialog_text (scene_filename, started_timestamp);
3013- confirmation->set_text (unsaved_message + " \n\n " + TTR (" Save before reloading the scene?" ));
3014- confirmation->popup_centered ();
3015- break ;
3010+ if (unsaved_cache) {
3011+ if (!p_confirmed) {
3012+ confirmation->set_ok_button_text (TTRC (" Save & Reload" ));
3013+ unsaved_message = _get_unsaved_scene_dialog_text (scene_filename, started_timestamp);
3014+ confirmation->set_text (unsaved_message + " \n\n " + TTR (" Save before reloading the scene?" ));
3015+ confirmation->popup_centered ();
3016+ confirmation_button->grab_focus ();
3017+ break ;
3018+ } else {
3019+ _save_scene_with_preview (scene_filename);
3020+ }
30163021 }
30173022
3018- _save_scene_with_preview (scene_filename);
3019-
30203023 _discard_changes ();
30213024 } break ;
30223025
@@ -7809,7 +7812,7 @@ EditorNode::EditorNode() {
78097812 gui_base->add_child (orphan_resources);
78107813
78117814 confirmation = memnew (ConfirmationDialog);
7812- confirmation->add_button (TTRC (" Don't Save" ), DisplayServer::get_singleton ()->get_swap_cancel_ok (), " discard" );
7815+ confirmation_button = confirmation->add_button (TTRC (" Don't Save" ), DisplayServer::get_singleton ()->get_swap_cancel_ok (), " discard" );
78137816 gui_base->add_child (confirmation);
78147817 confirmation->set_min_size (Vector2 (450.0 * EDSCALE, 0 ));
78157818 confirmation->connect (SceneStringName (confirmed), callable_mp (this , &EditorNode::_menu_confirm_current));
0 commit comments