Skip to content

Add a first-party Disabled component #17458

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

Closed
alice-i-cecile opened this issue Jan 20, 2025 · 2 comments · Fixed by #17514
Closed

Add a first-party Disabled component #17458

alice-i-cecile opened this issue Jan 20, 2025 · 2 comments · 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.

github-merge-queue bot pushed a commit that referenced this issue Feb 2, 2025
# 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
mrchantey pushed a commit to mrchantey/bevy that referenced this issue Feb 4, 2025
# Objective

We have default query filters now, but there is no first-party marker
for entity disabling yet
Fixes bevyengine#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
joshua-holmes pushed a commit to joshua-holmes/bevy that referenced this issue Feb 5, 2025
# Objective

We have default query filters now, but there is no first-party marker
for entity disabling yet
Fixes bevyengine#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
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