浏览代码

Preserve folding when sub-scene is changed

Tomasz Chabora 6 年之前
父节点
当前提交
7e89ec2cd8
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      editor/editor_node.cpp

+ 7 - 0
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");
 	}