Fix for 22822 ComputedStates example#23655
Fix for 22822 ComputedStates example#23655scottgshannon wants to merge 2 commits intobevyengine:mainfrom
Conversation
Fixes bevyengine#22822 by adding ALLOW_SAME_STATE_TRANSITIONS = false to ComputedStates in example
|
Welcome, new contributor! Please make sure you've read our contributing guide, as well as our policy regarding AI usage, and we look forward to reviewing your pull request shortly ✨ |
|
|
||
| impl ComputedStates for TurboMode { | ||
| type SourceStates = AppState; | ||
| const ALLOW_SAME_STATE_TRANSITIONS: bool = false; |
There was a problem hiding this comment.
If you verify that you actually don’t need this line:
| const ALLOW_SAME_STATE_TRANSITIONS: bool = false; |
There was a problem hiding this comment.
TurboMode can be re-entered (via activating turbo then pausing). This produces duplicate UI elements that overlap and thus don't cause visual artifacts.
There was a problem hiding this comment.
Ah I see, I overlooked that, thank you for pointing that out
|
|
||
| impl ComputedStates for IsPaused { | ||
| type SourceStates = AppState; | ||
| const ALLOW_SAME_STATE_TRANSITIONS: bool = false; |
There was a problem hiding this comment.
If you verify that you actually don’t need this line:
| const ALLOW_SAME_STATE_TRANSITIONS: bool = false; |
There was a problem hiding this comment.
While IsPaused cannot be re-entered it is tied to an OnEnter system that performs command.spawn calls like the other computed states. This line could be removed and retain proper behavior but I believe the example is stronger by keeping it.
Co-authored-by: Kevin Chen <chen.kevin.f@gmail.com>
kfc35
left a comment
There was a problem hiding this comment.
Thanks for your first contribution!
Objective
Solution
Testing