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

enable_state_scoped_entities() as a derive attribute #16180

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mockersf
Copy link
Member

@mockersf mockersf commented Oct 30, 2024

Objective

  • I got tired of calling enable_state_scoped_entities, and though it would make more sense to define that at the place where the state is defined

Solution

  • add a derive attribute #[states(scoped_entities)] when derive States or SubStates that enables it automatically when adding the state

Testing

  • Ran the examples using it, they still work

@mockersf mockersf added the A-States App-level states machines label Oct 30, 2024
@alice-i-cecile alice-i-cecile added 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-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Oct 30, 2024
@mockersf mockersf force-pushed the statescoped-as-derive-attribute branch from 3a5fba2 to fcd778b Compare October 30, 2024 23:55
crates/bevy_state/src/state/states.rs Outdated Show resolved Hide resolved
crates/bevy_state/src/app.rs Show resolved Hide resolved
@BenjaminBrienen BenjaminBrienen added S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Oct 31, 2024
@mockersf mockersf added S-Needs-Review Needs reviewer attention (from anyone!) to move forward and removed S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-States App-level states machines 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-Needs-Review Needs reviewer attention (from anyone!) to move forward
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants