TreeItem.get_next_visible(...) seems to iterate through children just fine, so use it for selecting only one item.

This commit is contained in:
Nolan Darilek 2019-09-21 09:47:15 -05:00
parent 45c44352ba
commit 8f9a0cd4d7

View File

@ -220,14 +220,10 @@ func tree_item_deselect_all(item: TreeItem):
item.deselect(i)
func tree_deselect_all_but(target: TreeItem, item: TreeItem):
if item != target:
var next = item.get_next_visible()
while next and next != item:
tree_item_deselect_all(item)
if item.get_children():
tree_deselect_all_but(target, item.get_children())
var next = item.get_next()
while next:
tree_deselect_all_but(target, next)
next = next.get_next()
next = next.get_next_visible()
var prev_selected_cell