@@ -3012,16 +3012,19 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
30123012 break ;
30133013 }
30143014
3015- if (unsaved_cache && !p_confirmed) {
3016- confirmation->set_ok_button_text (TTR (" Save & Reload" ));
3017- unsaved_message = _get_unsaved_scene_dialog_text (scene_filename, started_timestamp);
3018- confirmation->set_text (unsaved_message + " \n\n " + TTR (" Save before reloading the scene?" ));
3019- confirmation->popup_centered ();
3020- break ;
3015+ if (unsaved_cache) {
3016+ if (!p_confirmed) {
3017+ confirmation->set_ok_button_text (TTRC (" Save & Reload" ));
3018+ unsaved_message = _get_unsaved_scene_dialog_text (scene_filename, started_timestamp);
3019+ confirmation->set_text (unsaved_message + " \n\n " + TTR (" Save before reloading the scene?" ));
3020+ confirmation->popup_centered ();
3021+ confirmation_button->grab_focus ();
3022+ break ;
3023+ } else {
3024+ _save_scene_with_preview (scene_filename);
3025+ }
30213026 }
30223027
3023- _save_scene_with_preview (scene_filename);
3024-
30253028 _discard_changes ();
30263029 } break ;
30273030
@@ -7814,7 +7817,7 @@ EditorNode::EditorNode() {
78147817 gui_base->add_child (orphan_resources);
78157818
78167819 confirmation = memnew (ConfirmationDialog);
7817- confirmation->add_button (TTRC (" Don't Save" ), DisplayServer::get_singleton ()->get_swap_cancel_ok (), " discard" );
7820+ confirmation_button = confirmation->add_button (TTRC (" Don't Save" ), DisplayServer::get_singleton ()->get_swap_cancel_ok (), " discard" );
78187821 gui_base->add_child (confirmation);
78197822 confirmation->set_min_size (Vector2 (450.0 * EDSCALE, 0 ));
78207823 confirmation->connect (SceneStringName (confirmed), callable_mp (this , &EditorNode::_menu_confirm_current));
0 commit comments