Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SceneTreeDialog: better navigation for large scene trees #5480

Closed
RedMser opened this issue Sep 23, 2022 · 1 comment · Fixed by godotengine/godot#85386
Closed

SceneTreeDialog: better navigation for large scene trees #5480

RedMser opened this issue Sep 23, 2022 · 1 comment · Fixed by godotengine/godot#85386
Milestone

Comments

@RedMser
Copy link

RedMser commented Sep 23, 2022

Describe the project you are working on

Game with large scene tree

Describe the problem or limitation you are having in your project

A note on terminology: In the following sections, "originating node" refers to the node from which the NodePaths are relative to. It is equivalent to the node that you opened the selection dialog from:
image


We use a lot of @export var x: Node etc. in our code. Our levels are large scene trees with a lot of nodes in them.

When opening the "Select a Node" dialog, it's hard to orient yourself, since it starts scrolled to the top and the originating node is not highlighted in any way:

image

Describe the feature / enhancement and how it helps to overcome the problem or limitation

  • Scroll the tree view so that the originating node is centered in the view.
  • Highlight the originating node, so it is easier to e.g. select a child or parent node.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Here I used the "Override" icon with 50% opacity to highlight the originating node. The dialog also starts with the scroll bar at the bottom.

image

If this enhancement will not be used often, can it be worked around with a few lines of script?

No, this is a UX improvement.

Is there a reason why this should be core and not an add-on in the asset library?

Can't be add-on.

@RedMser
Copy link
Author

RedMser commented Nov 26, 2023

My PR's implementation differs slightly, as the SceneTreeEditor already features a set_marked function. Instead of using an icon, it changes the text color of the item.

An additional change was to properly set and clear the node selection, as this was previously not implemented properly. Selection takes priority over marked nodes when it comes to deciding where to scroll to.

@akien-mga akien-mga added this to the 4.3 milestone Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants