Skip to content

Commit 463a73d

Browse files
authored
Remove bevy_camera and bevy_ui deps from bevy_input_focus, no feature flag needed (#22340)
# Objective - Fixes #22305 - Avoid feature flagging ## Solution Taking inspiration from #22309 and building off of #22333, this moves the auto directional navigation to `bevy_ui` and creates a new system parameter to be used when including automatic navigation. - directional_navigation.rs of `bevy_input_focus` still contains the `DirectionalNavigation` system parameter, but it now only contains logic to do manual navigation. The `DirectionalNavigationPlugin` is still there, as well as the manual edge map. - I separated out some code from directional_navigation.rs into two separate files: 1) directional_navigation.rs in `bevy_ui` which contains the automatic navigation code. There is a new system parameter now, `AutoDirectionalNavigator`, that wraps the `DirectionalNavigation` system parameter and does automatic navigation if manual navigation fails. 2) navigator.rs which contains some structs and functions that are used by both the automatic navigation system and the manual navigation code in directional_navigation.rs. This particular refactoring wasn’t particularly necessary, but I feel like the code is little more cleaner for it… I can revert this change if desired 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.18` to update the release notes, basically saying that users who want to leverage `AutoDirectionalNavigation` need to use the `AutoDirectionalNavigator` instead of the existing `DirectionalNavigation` system 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 existing `DirectionalNavigation` system parameter `cargo run --example auto_directional_navigation` - uses the new `AutoDirectionalNavigator` system parameter
1 parent 53ae507 commit 463a73d

File tree

8 files changed

+555
-506
lines changed

8 files changed

+555
-506
lines changed

crates/bevy_input_focus/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,10 @@ libm = ["bevy_math/libm", "bevy_window/libm"]
7171
[dependencies]
7272
# bevy
7373
bevy_app = { path = "../bevy_app", version = "0.18.0-dev", default-features = false }
74-
bevy_camera = { path = "../bevy_camera", version = "0.18.0-dev", default-features = false }
7574
bevy_ecs = { path = "../bevy_ecs", version = "0.18.0-dev", default-features = false }
7675
bevy_input = { path = "../bevy_input", version = "0.18.0-dev", default-features = false }
7776
bevy_math = { path = "../bevy_math", version = "0.18.0-dev", default-features = false }
7877
bevy_picking = { path = "../bevy_picking", version = "0.18.0-dev", default-features = false, optional = true }
79-
bevy_ui = { path = "../bevy_ui", version = "0.18.0-dev", default-features = false }
8078
bevy_window = { path = "../bevy_window", version = "0.18.0-dev", default-features = false }
8179
bevy_reflect = { path = "../bevy_reflect", version = "0.18.0-dev", features = [
8280
"glam",

0 commit comments

Comments
 (0)