You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
Focus Don't Save in Reload Saved Scene and don't save unmodified scenes
This commit is contained in:
@@ -2998,15 +2998,18 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unsaved_cache && !p_confirmed) {
|
if (unsaved_cache) {
|
||||||
confirmation->set_ok_button_text(TTR("Save & Reload"));
|
if (!p_confirmed) {
|
||||||
|
confirmation->set_ok_button_text(TTRC("Save & Reload"));
|
||||||
unsaved_message = _get_unsaved_scene_dialog_text(scene_filename, started_timestamp);
|
unsaved_message = _get_unsaved_scene_dialog_text(scene_filename, started_timestamp);
|
||||||
confirmation->set_text(unsaved_message + "\n\n" + TTR("Save before reloading the scene?"));
|
confirmation->set_text(unsaved_message + "\n\n" + TTR("Save before reloading the scene?"));
|
||||||
confirmation->popup_centered();
|
confirmation->popup_centered();
|
||||||
|
confirmation_button->grab_focus();
|
||||||
break;
|
break;
|
||||||
}
|
} else {
|
||||||
|
|
||||||
_save_scene_with_preview(scene_filename);
|
_save_scene_with_preview(scene_filename);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_discard_changes();
|
_discard_changes();
|
||||||
} break;
|
} break;
|
||||||
@@ -7788,7 +7791,7 @@ EditorNode::EditorNode() {
|
|||||||
gui_base->add_child(orphan_resources);
|
gui_base->add_child(orphan_resources);
|
||||||
|
|
||||||
confirmation = memnew(ConfirmationDialog);
|
confirmation = memnew(ConfirmationDialog);
|
||||||
confirmation->add_button(TTRC("Don't Save"), DisplayServer::get_singleton()->get_swap_cancel_ok(), "discard");
|
confirmation_button = confirmation->add_button(TTRC("Don't Save"), DisplayServer::get_singleton()->get_swap_cancel_ok(), "discard");
|
||||||
gui_base->add_child(confirmation);
|
gui_base->add_child(confirmation);
|
||||||
confirmation->set_min_size(Vector2(450.0 * EDSCALE, 0));
|
confirmation->set_min_size(Vector2(450.0 * EDSCALE, 0));
|
||||||
confirmation->connect(SceneStringName(confirmed), callable_mp(this, &EditorNode::_menu_confirm_current));
|
confirmation->connect(SceneStringName(confirmed), callable_mp(this, &EditorNode::_menu_confirm_current));
|
||||||
|
|||||||
@@ -350,6 +350,7 @@ private:
|
|||||||
Node *_last_instantiated_scene = nullptr;
|
Node *_last_instantiated_scene = nullptr;
|
||||||
|
|
||||||
ConfirmationDialog *confirmation = nullptr;
|
ConfirmationDialog *confirmation = nullptr;
|
||||||
|
Button *confirmation_button = nullptr;
|
||||||
ConfirmationDialog *save_confirmation = nullptr;
|
ConfirmationDialog *save_confirmation = nullptr;
|
||||||
ConfirmationDialog *import_confirmation = nullptr;
|
ConfirmationDialog *import_confirmation = nullptr;
|
||||||
ConfirmationDialog *pick_main_scene = nullptr;
|
ConfirmationDialog *pick_main_scene = nullptr;
|
||||||
|
|||||||
Reference in New Issue
Block a user