summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2021-10-12 22:35:10 +0200
committerGitHub <noreply@github.com>2021-10-12 22:35:10 +0200
commitb747063050e0b19b302bd26b8c823b4eb79a88fd (patch)
tree0dca123a14ecb065769444335b5206a3bd5d767d
parentb48c6418fee1363e6d058f01d7245e33c8de6891 (diff)
parente10d0d76bc75a9a3945fa968adb647f36b411825 (diff)
Merge pull request #53705 from e8newallm/53668
Fixed editor attempting to save a blank scene with save all scenes
-rw-r--r--editor/editor_node.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 5fd0a41788..9b7dc966e6 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -1776,19 +1776,25 @@ void EditorNode::restart_editor() {
}
void EditorNode::_save_all_scenes() {
+ bool all_saved = true;
for (int i = 0; i < editor_data.get_edited_scene_count(); 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 (i != editor_data.get_edited_scene()) {
- _save_scene(scene->get_scene_file_path(), i);
+ if (scene) {
+ if (scene->get_scene_file_path() != "" && DirAccess::exists(scene->get_scene_file_path().get_base_dir())) {
+ 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 {
- _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();
}