summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorTomasz Chabora <kobewi4e@gmail.com>2019-09-10 14:43:46 +0200
committerTomasz Chabora <kobewi4e@gmail.com>2019-09-10 14:43:46 +0200
commit7e89ec2cd84faf27d53e82ec7fccd8a22e2ba6a2 (patch)
tree0d945f58ca8bec4b0376faaf512be81ca4d172c1 /editor
parent24e1039eb6fe32115e8d1a62a84965e9be19a2ed (diff)
Preserve folding when sub-scene is changed
Diffstat (limited to 'editor')
-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 a1998a1d7c..d50f31374c 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");
}