Skip to content

Instantly share code, notes, and snippets.

@andrew-wilkes
Created June 25, 2020 09:03
Show Gist options
  • Select an option

  • Save andrew-wilkes/719569b241fe470555e16e1e2f4b204f to your computer and use it in GitHub Desktop.

Select an option

Save andrew-wilkes/719569b241fe470555e16e1e2f4b204f to your computer and use it in GitHub Desktop.
Scan Tree and save a list of collapsed TreeItems
func _on_Tree_item_collapsed(_item):
if ready:
g.state.ci[cid] = []
scan_children(tree.get_root())
g.save_state()
func scan_children(root):
var item = root.get_children()
while item:
scan_children(item)
if item.collapsed:
g.state.ci[cid].append(item.get_text(0))
item = item.get_next()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment