-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Improve SceneTreeEditor usability #85386
Improve SceneTreeEditor usability #85386
Conversation
2e23445
to
c10f52e
Compare
What's the "marked" Node in this context? |
All nodes that use the theme's accent color as their text color. It's not the same as the selected node. For example, if you have a script on node X that contains Similar goes for e.g. adding a new track in AnimationPlayer. The marked node there is the animation root. |
8206493
to
c39c125
Compare
c39c125
to
865bf59
Compare
- Mark contextually relevant node - Remember/Clear selection as appropriate - Scroll to marked/selected node
865bf59
to
9cd3020
Compare
Thanks! |
|
||
if (item) { | ||
// Must wait until tree is properly sized before scrolling. | ||
callable_mp(tree, &Tree::scroll_to_item).call_deferred(item, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR seems to be causing crashes. Probably deferred call should use ObjectID
instead of raw pointer, otherwise the tree item might be removed before callback execution and pointer will become invalid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you show me other code locations that do something like this? Also if there's a reliable way to reproduce the crash would help.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #90235.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you show me other code locations that do something like this?
Not sure if there's exactly same situations, buy you can do something like:
Add a new callback:
void Tree::_scroll_to_item_id(ObjectID p_item_id, bool p_center_on_item) {
TreeItem *item = Object::cast_to<TreeItem>(ObjectDB::get_instance(p_item_id));
if (item) {
scroll_to_item(item, p_center_on_item);
}
}
And call it like this
if (item) {
ObjectID item_id = item->get_instance_id();
callable_mp(tree, &Tree::_scroll_to_item_id).call_deferred(item_id, true);
}
Closes godotengine/godot-proposals#5480
A mix of usability improvements and bug fixes for the SceneTreeEditor and SceneTreeDialog. Here's an overview of the changes:
An example of how the dialog now starts out when assigning an
@export var x: Node
variable: