-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Add simple Disabled marker #17514
base: main
Are you sure you want to change the base?
Add simple Disabled marker #17514
Conversation
I think that this should close that issue. Would you mind fixing the description? :) |
|
||
let disabled = self.register_component::<Disabled>(); | ||
let mut filters = DefaultQueryFilters::default(); | ||
filters.set_disabled(disabled); |
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.
I'm a bit worried that users might do a
app.init_resource::<DefaultQueryFilters>()
and lose the Disabled
functionality inadvertently..
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.
init_resource
doesn't overwrite existing resources. You'd have to explicitly call .insert_resource(DefaultQueryFilters::default())
which is probably verbose enough to make it obvious what will happen. Currently it is intended that you can opt-out of entity disabling, but as the feature matures we could consider making it so that it is always there.
Objective
We have default query filters now, but there is no first-party marker for entity disabling yet
Fixes #17458
Solution
Add the marker, cool recursive features and/or potential hook changes should be follow up work
Testing
Added a unit test to check that the new marker is enabled by default