diff --git a/Cargo.toml b/Cargo.toml index d8d0bd1..99b64b0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ repository = "https://github.com/nicopap/ui-navigation" homepage = "https://github.com/nicopap/ui-navigation" exclude = ["assets", ".github"] version = "0.32.0" -rust-version = "1.70" +rust-version = "1.73" edition = "2021" [features] @@ -21,18 +21,24 @@ pointer_focus = ["bevy_mod_picking"] cuicui_chirp = ["cuicui_dsl", "dep:cuicui_chirp"] [dependencies] -bevy = { version = "0.11", default-features = false, features = ["bevy_asset"] } -bevy_mod_picking = { version = "0.15.0", optional = true, default-features = false } -cuicui_chirp = { version = "0.10.0", optional = true, default-features = false, features = ["macros"] } -cuicui_dsl = { version = "0.10.0", optional = true } +bevy = { version = "0.12", default-features = false, features = ["bevy_asset"] } +bevy_mod_picking = { version = "0.17.0", optional = true, default-features = false } +cuicui_chirp = { version = "0.12.0", optional = true, default-features = false, features = ["macros"] } +cuicui_dsl = { version = "0.12.0", optional = true } non-empty-vec = { version = "0.2.2", default-features = false } [dev-dependencies] fastrand = "1.7" -cuicui_layout_bevy_ui = { version = "0.10.0", default-features = false } -cuicui_layout = { version = "0.10.0", default-features = false } -bevy = { version = "0.11", default-features = false, features = ["bevy_asset", "png", "x11", "default_font"] } +cuicui_layout_bevy_ui = { version = "0.12.0", default-features = false } +cuicui_layout = { version = "0.12.0", default-features = false } +bevy = { version = "0.12", default-features = false, features = ["bevy_asset", "png", "x11", "default_font", "bevy_gilrs"] } + +[package.metadata.release] +pre-release-replacements = [ + {search="\\| 0.12 \\| [0-9.]* \\|",replace="| 0.12 | {{version}} |",file="Readme.md"}, + {search="bevy-ui-navigation = \"[0-9.]*\"",replace="bevy-ui-navigation = \"{{version}}\"",file="Readme.md"}, +] [[example]] name = "ultimate_menu_navigation" -required-features = ["cuicui_chirp", "bevy/filesystem_watcher", "cuicui_layout_bevy_ui/chirp", "cuicui_layout/reflect"] +required-features = ["cuicui_chirp", "cuicui_layout_bevy_ui/chirp"] diff --git a/Makefile b/Makefile index bbf6ec0..9d774d4 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ check: cargo clippy --examples run: - cargo run --example ultimate_menu_navigation --features cuicui_dsl + cargo run --example ultimate_menu_navigation --features="cuicui_chirp cuicui_layout_bevy_ui/chirp" pre-hook: cargo fmt --all -- --check @@ -10,4 +10,4 @@ pre-hook: RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features cargo clippy --all-features -- --deny clippy::all -D warnings cargo test --all-features - cargo clippy --all-features --features="cuicui_chirp bevy/filesystem_watcher cuicui_layout_bevy_ui/chirp cuicui_layout/reflect" --example ultimate_menu_navigation + cargo clippy --all-features --features="cuicui_chirp cuicui_layout_bevy_ui/chirp" --example ultimate_menu_navigation diff --git a/Readme.md b/Readme.md index a35a889..03d0dd7 100644 --- a/Readme.md +++ b/Readme.md @@ -581,6 +581,9 @@ fn return_trigger_action(mut requests: EventWriter, input: Res, input: Res, input: Res() .init_resource::() .run(); } @@ -134,15 +133,6 @@ impl MenuMap { } } -#[derive(Resource)] -struct MenuFont(Handle); -impl FromWorld for MenuFont { - fn from_world(world: &mut World) -> Self { - let assets = world.get_resource::().unwrap(); - MenuFont(assets.load("font.ttf")) - } -} - /// Animate anything. Used to move the camera smoothly. /// /// See the `animate_system` for how this is used. @@ -380,7 +370,7 @@ const QUALIFICATIVES: &[&str] = &[ // // === === === -fn setup(mut commands: Commands, font: Res, mut menus: ResMut) { +fn setup(mut commands: Commands, mut menus: ResMut) { let name = NAMES[fastrand::usize(0..NAMES.len())]; let upgrade = if fastrand::bool() { Upgrade::Roman(1) @@ -390,7 +380,7 @@ fn setup(mut commands: Commands, font: Res, mut menus: ResMut let weapon = Weapon::new(name, upgrade); commands.spawn((Camera2dBundle::default(), Animate::default())); let at = IVec2::ZERO; - let menu = spawn_weapon_upgrade_menu(&mut commands, at, &weapon, &font, None); + let menu = spawn_weapon_upgrade_menu(&mut commands, at, &weapon, None); menus.grid.insert(at, menu); } @@ -452,7 +442,7 @@ fn handle_menu_change( menu_position: Query<&GlobalTransform, With>, menu_query: Query<&ParentMenu>, ) { - for event in nav_events.iter() { + for event in nav_events.read() { if let NavEvent::FocusChanged { to, from } = event { let menu_query = (menu_query.get(*from.first()), menu_query.get(*to.first())); if let (Ok(from), Ok(to)) = menu_query { @@ -481,7 +471,7 @@ fn upgrade_weapon( mut commands: Commands, mut events: EventReader, mut requests: EventWriter, - (mut menus, time, font): (ResMut, Res