summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-08-29 07:39:35 +0200
committerGitHub <noreply@github.com>2017-08-29 07:39:35 +0200
commit672ab5dbcbd415c83278337784a25e3c3ae5b4d3 (patch)
tree6c3c64f907b0b5734297a12f84cd930c1dd622ae /editor
parenta91d12ab945222b0fc89d4634e3e781ba8941f33 (diff)
parentd25ea73822d7391da4d2c8746fb244c892ee6e92 (diff)
Merge pull request #10731 from Noshyaar/pr-save
EditorNode: fix scene save over others
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_node.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index c376efca34..a8edeca931 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -908,8 +908,10 @@ void EditorNode::_save_all_scenes() {
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_filename() != "") {
- // save in background if in the script editor
- _save_scene_with_preview(scene->get_filename());
+ if (i != editor_data.get_edited_scene())
+ _save_scene(scene->get_filename(), i);
+ else
+ _save_scene_with_preview(scene->get_filename());
} // else: ignore new scenes
}
@@ -983,7 +985,10 @@ void EditorNode::_dialog_action(String p_file) {
if (file->get_mode() == EditorFileDialog::MODE_SAVE_FILE) {
_save_default_environment();
- _save_scene_with_preview(p_file);
+ if (scene_idx != editor_data.get_edited_scene())
+ _save_scene(p_file, scene_idx);
+ else
+ _save_scene_with_preview(p_file);
if (scene_idx != -1)
_discard_changes();
@@ -1660,8 +1665,10 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
Node *scene = editor_data.get_edited_scene_root(scene_idx);
if (scene && scene->get_filename() != "") {
- // save in background if in the script editor
- _save_scene_with_preview(scene->get_filename());
+ if (scene_idx != editor_data.get_edited_scene())
+ _save_scene(scene->get_filename(), scene_idx);
+ else
+ _save_scene_with_preview(scene->get_filename());
if (scene_idx != -1)
_discard_changes();