summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-09-23 10:32:02 +0200
committerGitHub <noreply@github.com>2019-09-23 10:32:02 +0200
commitfb12f54721ad4b6ab3755624ea912de3af8c12b3 (patch)
tree39ff45785365c4654f431b0bacd110034315447f
parent393a0152eaccaf21313b6186adeea1cf6a7f0623 (diff)
parent7e89ec2cd84faf27d53e82ec7fccd8a22e2ba6a2 (diff)
Merge pull request #32074 from KoBeWi/ninja_reload
Preserve folding when sub-scene is changed
-rw-r--r--editor/editor_node.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 1d22de7679..e1bbe4b923 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -3133,7 +3133,14 @@ void EditorNode::_clear_undo_history() {
void EditorNode::set_current_scene(int p_idx) {
+ //Save the folding in case the scene gets reloaded.
+ if (editor_data.get_scene_path(p_idx) != "")
+ editor_folding.save_scene_folding(editor_data.get_edited_scene_root(p_idx), editor_data.get_scene_path(p_idx));
+
if (editor_data.check_and_update_scene(p_idx)) {
+ if (editor_data.get_scene_path(p_idx) != "")
+ editor_folding.load_scene_folding(editor_data.get_edited_scene_root(p_idx), editor_data.get_scene_path(p_idx));
+
call_deferred("_clear_undo_history");
}