Merge pull request #53705 from e8newallm/53668
Fixed editor attempting to save a blank scene with save all scenes
This commit is contained in:
commit
b747063050
|
@ -1776,19 +1776,25 @@ void EditorNode::restart_editor() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorNode::_save_all_scenes() {
|
void EditorNode::_save_all_scenes() {
|
||||||
|
bool all_saved = true;
|
||||||
for (int i = 0; i < editor_data.get_edited_scene_count(); i++) {
|
for (int i = 0; i < editor_data.get_edited_scene_count(); i++) {
|
||||||
Node *scene = editor_data.get_edited_scene_root(i);
|
Node *scene = editor_data.get_edited_scene_root(i);
|
||||||
if (scene && scene->get_scene_file_path() != "" && DirAccess::exists(scene->get_scene_file_path().get_base_dir())) {
|
if (scene) {
|
||||||
if (i != editor_data.get_edited_scene()) {
|
if (scene->get_scene_file_path() != "" && DirAccess::exists(scene->get_scene_file_path().get_base_dir())) {
|
||||||
_save_scene(scene->get_scene_file_path(), i);
|
if (i != editor_data.get_edited_scene()) {
|
||||||
|
_save_scene(scene->get_scene_file_path(), i);
|
||||||
|
} else {
|
||||||
|
_save_scene_with_preview(scene->get_scene_file_path());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
_save_scene_with_preview(scene->get_scene_file_path());
|
all_saved = false;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
show_warning(TTR("Could not save one or more scenes!"), TTR("Save All Scenes"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!all_saved) {
|
||||||
|
show_warning(TTR("Could not save one or more scenes!"), TTR("Save All Scenes"));
|
||||||
|
}
|
||||||
_save_default_environment();
|
_save_default_environment();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue