Overrides for no-path in autonavigation for bevy_input_focus
#22633
+502
−85
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Objective
bevy_input_focus: Ability to manually set “no navigation in a given direction” for an entity #22378 .Solution
Turn
NavNeighborsfrom storing an array ofOption<Entity>to an array ofNavNeighbor, an enum with 3 values:Unset(no explicitly set thing in this direction),Blocked(assume there is nothing in this direction to path to), andNeighbor(Entity).Testing
Changes tested using a new test,
test_respects_set_blocks, and manually using thedirectional_navigation_overrideexample. Second page is restricted to left/right movement, as up/down are blocked.Showcase
I'm not quite sure how to showcase this, as it's a very input-oriented feature and the feature working means that nothing happens.