Skip to content

bevy_input_focus: Ability to manually set “no navigation in a given direction” for an entity #22378

@kfc35

Description

@kfc35

What problem does this solve or what need does it fill?

Currently, automatic navigation occurs when the manual navigation map does not have an entity in a given direction from a given origin (i.e. Option is None). However, there is currently no way to specify that there should NOT be a navigable entity in that given direction, despite there being an AutoDirectionalNavigation entity in that direction.

What solution would you like?

This feature request is for the ability to override navigation such that one can say there should be “no navigation” from one AutoDirectionalNavigation entity to another in a given direction.

This probably entails changing the NavNeighbors struct to also encode whether a “None” value for a given direction is user-specified versus uninitialized. Uninitialized means that automatic navigation can occur in that direction. A user-specified None value means that automatic navigation should not occur.

What alternative(s) have you considered?

Not pursuing this feature. It is totally possible this feature request is not useful, in which case we can decide not to do this work. This is something I simply ran into while trying to create an example of utilizing both manual and automatic navigation.

Additional context

I ran into this while creating an example utilizing both manual and automatic navigation. I wanted to invert the controls of navigation in a column manually (without looping) such that pressing up would go down and pressing down would go up. These nodes all have automatic navigation enabled to show that left and right automatic navigation works as normal. However, I am unable to override the automatic navigation going CompassOctant::South at the very top of each column and CompassOctant::North at the very bottom of each column to instead do nothing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-UIGraphical user interfaces, styles, layouts, and widgetsC-FeatureA new feature, making something new possibleD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!X-UncontroversialThis work is generally agreed upon

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions