浏览代码

Merge pull request #30962 from silvanocerza/remote-tree-collapse-fix

Fixed remote scene tree not collapsing
Rémi Verschelde 6 年之前
父节点
当前提交
dfa324eb8e
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      editor/script_editor_debugger.cpp

+ 7 - 0
editor/script_editor_debugger.cpp

@@ -418,6 +418,13 @@ int ScriptEditorDebugger::_update_scene_tree(TreeItem *parent, const Array &node
 	}
 	}
 	item->set_metadata(0, id);
 	item->set_metadata(0, id);
 
 
+	// Set current item as collapsed if necessary
+	if (parent) {
+		if (!unfold_cache.has(id)) {
+			item->set_collapsed(true);
+		}
+	}
+
 	int children_count = nodes[current_index];
 	int children_count = nodes[current_index];
 	// Tracks the total number of items parsed in nodes, this is used to skips nodes that
 	// Tracks the total number of items parsed in nodes, this is used to skips nodes that
 	// are not direct children of the current node since we can't know in advance the total
 	// are not direct children of the current node since we can't know in advance the total