Created
June 25, 2020 09:03
-
-
Save andrew-wilkes/719569b241fe470555e16e1e2f4b204f to your computer and use it in GitHub Desktop.
Scan Tree and save a list of collapsed TreeItems
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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