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

Add a first-party Disabled component #17458

Open
alice-i-cecile opened this issue Jan 20, 2025 · 2 comments · May be fixed by #17514
Open

Add a first-party Disabled component #17458

alice-i-cecile opened this issue Jan 20, 2025 · 2 comments · May be fixed by #17514
Labels
A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it!
Milestone

Comments

@alice-i-cecile
Copy link
Member

With #13120 merging, it's important that we ship a simple Disabled unit struct and register it as a default query filter to make sure this feature is useful to beginners out of the box.

@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it! labels Jan 20, 2025
@alice-i-cecile alice-i-cecile added this to the 0.16 milestone Jan 20, 2025
@spvky
Copy link
Contributor

spvky commented Jan 23, 2025

Taking a crack at this and #17459 currently but running into some confusion:

Seeing that QueryState::from_states_uninitialized was the only reference I saw to DefaultQueryFilters outside of tests, I figured registering Disabled here made the most sense, issue I'm running into is I'm unsure how to generate a ComponentId without mutable access to world, and changing the world param in the method to mutable seems like a pretty scary change for me haha

@NiseVoid any thoughts?

@alice-i-cecile
Copy link
Member Author

You'll need mutable access to get a ComponentId. I would probably add the standard default query filters in World::bootstrap(), but we need to be sure that defining custom DQF works too.

@NiseVoid NiseVoid linked a pull request Jan 23, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants