@@ -2998,16 +2998,19 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
29982998 break ;
29992999 }
30003000
3001- if (unsaved_cache && !p_confirmed) {
3002- confirmation->set_ok_button_text (TTR (" Save & Reload" ));
3003- unsaved_message = _get_unsaved_scene_dialog_text (scene_filename, started_timestamp);
3004- confirmation->set_text (unsaved_message + " \n\n " + TTR (" Save before reloading the scene?" ));
3005- confirmation->popup_centered ();
3006- break ;
3001+ if (unsaved_cache) {
3002+ if (!p_confirmed) {
3003+ confirmation->set_ok_button_text (TTRC (" Save & Reload" ));
3004+ unsaved_message = _get_unsaved_scene_dialog_text (scene_filename, started_timestamp);
3005+ confirmation->set_text (unsaved_message + " \n\n " + TTR (" Save before reloading the scene?" ));
3006+ confirmation->popup_centered ();
3007+ confirmation_button->grab_focus ();
3008+ break ;
3009+ } else {
3010+ _save_scene_with_preview (scene_filename);
3011+ }
30073012 }
30083013
3009- _save_scene_with_preview (scene_filename);
3010-
30113014 _discard_changes ();
30123015 } break ;
30133016
@@ -7788,7 +7791,7 @@ EditorNode::EditorNode() {
77887791 gui_base->add_child (orphan_resources);
77897792
77907793 confirmation = memnew (ConfirmationDialog);
7791- confirmation->add_button (TTRC (" Don't Save" ), DisplayServer::get_singleton ()->get_swap_cancel_ok (), " discard" );
7794+ confirmation_button = confirmation->add_button (TTRC (" Don't Save" ), DisplayServer::get_singleton ()->get_swap_cancel_ok (), " discard" );
77927795 gui_base->add_child (confirmation);
77937796 confirmation->set_min_size (Vector2 (450.0 * EDSCALE, 0 ));
77947797 confirmation->connect (SceneStringName (confirmed), callable_mp (this , &EditorNode::_menu_confirm_current));
0 commit comments