confirm before quitting editor while project is running

This commit is contained in:
Hamza Ali 2024-08-11 19:45:15 +05:00
parent 1bd740d18d
commit 6773df0222
1 changed files with 13 additions and 0 deletions

View File

@ -2983,6 +2983,19 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
}
if (!p_confirmed) {
if (project_run_bar->is_playing()) {
if (p_option == RELOAD_CURRENT_PROJECT) {
confirmation->set_text(TTR("Stop running project before reloading the current project?"));
confirmation->set_ok_button_text(TTR("Stop & Reload"));
} else {
confirmation->set_text(TTR("Stop running project before exiting the editor?"));
confirmation->set_ok_button_text(TTR("Stop & Quit"));
}
confirmation->reset_size();
confirmation->popup_centered();
break;
}
bool save_each = EDITOR_GET("interface/editor/save_each_scene_on_quit");
if (_next_unsaved_scene(!save_each) == -1) {
if (EditorUndoRedoManager::get_singleton()->is_history_unsaved(EditorUndoRedoManager::GLOBAL_HISTORY)) {