-
Notifications
You must be signed in to change notification settings - Fork 44
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
Template-based scene tree + inspector #167
Conversation
world.commands().entity(row_entity).despawn_recursive(); | ||
}); | ||
template! { | ||
{entity}: ( |
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.
It hadn't occurred to me that you would be able to use entities as anchors like this. Pleased to see that's not too complex.
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.
Yeah apparently entity's impl whatever trait you use for naming, which is great because otherwise the list order / hover state / etc would break when renaming an entity, if I went off of Name.
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.
Sweet! I notice you didn't end up needing the b!()
macro or conditional stuff too much. Was that something you avoided due to the constraints of the macro, or just not something that was needed?
Tbh I never tried it. I ended up writing functions returning Template, using a branch to return one of two different templates, and then splicing it into a larger template. This was just the natural way for me to write things, I didn't actually consider using conditional stuff. But also there's not much state in these widgets so far, they're pretty much all view-only. I might end up needing them later, no idea. |
TODO: Not sure how to add hover styling to rows yet. Going to remove it for now, we can figure out how to add it back later.
Things could maybe be a little more declarative to combine the setup pane and update rows into one template, but I'm fairly happy with how it's setup currently.