godot icon indicating copy to clipboard operation
godot copied to clipboard

Tree refactor

Open KoBeWi opened this issue 3 years ago • 1 comments

Closes https://github.com/godotengine/godot-proposals/issues/4579

Here's the progress so far:

var item = tree.create_item()
item.get_cell(0).text = "hello"

item = tree.create_item(item)
item.get_cell(0).text = "world"

image

For now I created class Tree2 to make it easier to compile and test. I'm just copy-pasting the code from the old Tree to the new classes and adjusting it to the new API. Half of the code is commented-out and I'm slowly implementing the missing parts. So far it can apparently draw text items, so there's some hope that this refactor can be finished.

KoBeWi avatar Jul 29 '22 22:07 KoBeWi

Status update: the progress was very slow, because I don't work on this consistently and recently I've been thinking about abandoning it. Originally I thought that I could just move the code around and then do a cleanup, and while this proved to be possible (based on the current progress), I haven't even touched 5% of the class. It's just ultra time-consuming and I'd rather spend the time on something else. It could've been much easier to just rewrite the class from scratch (similar to what happened to Tweens), but unfortunately I don't know the Tree enough to do that while preserving all of the important functionality.

I'll leave the PR open for now, feel free to take over. Also I don't want to block anyone's work. I've seen some comments mentioning this refactor; just ignore it, as it's uncertain if it even gets finished.

KoBeWi avatar Aug 24 '22 11:08 KoBeWi