-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Remove bevy_camera and bevy_ui deps from bevy_input_focus, no feature flag needed
#22340
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
base: main
Are you sure you want to change the base?
Conversation
| )); | ||
| ``` | ||
|
|
||
| That's it! The `DirectionalNavigationPlugin` includes a system that automatically maintains the navigation graph as your UI changes. |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
fc4ac63 to
95aa4ee
Compare
|
I think this is fine for now, but ultimately I think we are going to want auto-navigation to be it's own crate. The reason is because auto-navigation is very useful for diagetic UIs, which means that the navigator will need to be able to work with UI, 2D and 3D entities, possible mixed together on the same window. This will likely require multiple dependencies. Ultimately all the auto navigator should care about is where on the screen the center of the object is, regardless of what kind of entity it is. The input focus crate and manual navigation is not limited to UI entities, any entity can be focused as long as it has some way to display a highlight. |
c729257 to
0491f01
Compare
0491f01 to
e96d120
Compare
| @@ -0,0 +1,111 @@ | |||
| --- | |||
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, release notes for the 0.18 should be updated directly on the release-0.18 branch
|
This PR is a breaking change so it should not target the 0.18. We can accept some breaking changes, but I'm not a UI navigation user yet so I don't know if it's OK. @alice-i-cecile ? |
This is intended as a correction for the 0.18 milestone, to avoid regressing our crate structure. I think a breaking change is warranted here, to avoid fully shipping in a bad state. Simply moving around code is an acceptable level of breakage during the release-candidate process IMO: imports are easy to fix. |
Looking at how the example was updated, it's more than just moving code around, some resources and components have been renamed |
jbuehler23
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mockersf The base changes for this fix is new anyway for 0.18, there would be no users of automatic directional navigation at the moment AFAIK - unless they were working against the dev branch for testing the changes.
IMO these are necessary if we want to land automatic navigation anyway, as my initial implementation broke the modularity and brought in more unnecessary crates/baggage for users which we should avoid.
|
@mockersf It's either this or revert the feature from the 0.18 milestone entirely. |
Objective
Solution
Taking inspiration from #22309 and building off of #22333, this moves the auto directional navigation to
bevy_uiand creates a new system parameter to be used when including automatic navigation.bevy_input_focusstill contains theDirectionalNavigationsystem parameter, but it now only contains logic to do manual navigation. TheDirectionalNavigationPluginis still there, as well as the manual edge map.bevy_uiwhich contains the automatic navigation code. There is a new system parameter now,AutoDirectionalNavigator, that wraps theDirectionalNavigationsystem parameter and does automatic navigation if manual navigation fails.If you think a feature is better for this, then let me know whether #22333 should be considered instead.
If this gets merged, I’ll open up a pull request against
release-0.18to update the release notes, basically saying that users who want to leverageAutoDirectionalNavigationneed to use theAutoDirectionalNavigatorinstead of the existingDirectionalNavigationsystem param.Testing
To ensure no regressions, I tested the directional navigation examples and both work as they did before.
cargo run --example directional_navigation- uses the existingDirectionalNavigationsystem parametercargo run --example auto_directional_navigation- uses the newAutoDirectionalNavigatorsystem parameter