diff --git a/Cargo.toml b/Cargo.toml index 05e57f72..405f1b79 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,20 +25,33 @@ egui = ['dep:bevy_egui'] [dependencies] leafwing_input_manager_macros = { path = "macros", version = "0.7" } - -bevy = {version = "0.9", default-features = false, features = ["serialize", "bevy_gilrs"]} -bevy_egui = {version = "0.19", optional = true} - -petitset = {version = "0.2.1", features = ["serde_compat"]} -derive_more = {version = "0.99", default-features = false, features = ["display", "error"]} +bevy = { version = "0.10", default-features = false, features = [ + "serialize", + "bevy_gilrs", +] } +bevy_egui = { version = "0.20", optional = true } + +petitset = { version = "0.2.1", features = ["serde_compat"] } +derive_more = { version = "0.99", default-features = false, features = [ + "display", + "error", +] } itertools = "0.10" -serde = {version = "1.0", features = ["derive"]} -fixedbitset = "0.4.2" -once_cell = "1.17.0" +serde = { version = "1.0", features = ["derive"] } +fixedbitset = "0.4.2" +once_cell = "1.17.1" [dev-dependencies] -bevy = {version = "0.9", default-features = false, features = ["bevy_asset", "bevy_sprite", "bevy_text", "bevy_ui", "bevy_render", "bevy_core_pipeline", "x11"]} -bevy_egui = {version = "0.19"} +bevy_egui = { version = "0.20" } +bevy = { version = "0.10", default-features = false, features = [ + "bevy_asset", + "bevy_sprite", + "bevy_text", + "bevy_ui", + "bevy_render", + "bevy_core_pipeline", + "x11", +] } serde_test = "1.0" [lib] diff --git a/RELEASES.md b/RELEASES.md index 16b5df65..2559e2d1 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -5,6 +5,8 @@ ### Usability - Added `ActionState::consume_all()` to consume all actions. +- `bevy_egui` dependency has been bumped from 0.19 to 0.20. +- `bevy` dependency has been bumped from 0.9 to 0.10. ### Enhancements diff --git a/examples/arpg_indirection.rs b/examples/arpg_indirection.rs index b09f0528..eacb5377 100644 --- a/examples/arpg_indirection.rs +++ b/examples/arpg_indirection.rs @@ -19,9 +19,10 @@ fn main() { .add_plugin(InputManagerPlugin::::default()) .add_startup_system(spawn_player) // This system coordinates the state of our two actions - .add_system_to_stage( - CoreStage::PreUpdate, - copy_action_state.after(InputManagerSystem::ManualControl), + .add_system( + copy_action_state + .in_base_set(CoreSet::PreUpdate) + .after(InputManagerSystem::ManualControl), ) // Try it out, using QWER / left click / right click! .add_system(report_abilities_used) diff --git a/examples/binding_menu.rs b/examples/binding_menu.rs index 843b88e6..95d478d7 100644 --- a/examples/binding_menu.rs +++ b/examples/binding_menu.rs @@ -1,11 +1,17 @@ use bevy::{ ecs::system::SystemParam, - input::{keyboard::KeyboardInput, mouse::MouseButtonInput, ButtonState}, + input::{ + gamepad::{GamepadButtonChangedEvent, GamepadEvent}, + keyboard::KeyboardInput, + mouse::MouseButtonInput, + ButtonState, + }, prelude::*, + window::PrimaryWindow, }; use bevy_egui::{ egui::{Align2, Area, Grid, Window}, - EguiContext, EguiPlugin, + EguiContexts, EguiPlugin, }; use derive_more::Display; use leafwing_input_manager::{prelude::*, user_input::InputKind}; @@ -37,12 +43,12 @@ fn spawn_player_system(mut commands: Commands, control_settings: Res, - windows: Res, + mut egui: EguiContexts, + windows: Query<&bevy::window::Window, With>, control_settings: ResMut, ) { // The window may not exist when the application closes - let Some(main_window) = windows.get_primary() else { + let Ok(main_window) = windows.get_single() else { return; }; let window_width_margin = egui.ctx_mut().style().spacing.window_margin.left * 2.0; @@ -89,7 +95,7 @@ fn controls_window_system( } fn buttons_system( - mut egui: ResMut, + mut egui: EguiContexts, mut control_settings: ResMut, mut player_mappings: Query<&mut InputMap>, ) { @@ -109,7 +115,7 @@ fn buttons_system( fn binding_window_system( mut commands: Commands, - mut egui: ResMut, + mut egui: EguiContexts, mut input_events: InputEvents, active_binding: Option>, mut control_settings: ResMut, @@ -265,15 +271,14 @@ impl InputEvents<'_, '_> { return Some(mouse_input.button.into()); } } - if let Some(GamepadEvent { + if let Some(GamepadEvent::Button(GamepadButtonChangedEvent { gamepad: _, - event_type, - }) = self.gamepad_events.iter().next() + button_type, + value: strength, + })) = self.gamepad_events.iter().next() { - if let GamepadEventType::ButtonChanged(button, strength) = event_type.to_owned() { - if strength <= 0.5 { - return Some(button.into()); - } + if *strength <= 0.5 { + return Some((*button_type).into()); } } None diff --git a/examples/press_duration.rs b/examples/press_duration.rs index 0cdc926d..44efa706 100644 --- a/examples/press_duration.rs +++ b/examples/press_duration.rs @@ -3,7 +3,7 @@ //! //! Press Left / Right or A / D to move your character to the left and right! -use bevy::prelude::*; +use bevy::{prelude::*, window::PrimaryWindow}; use leafwing_input_manager::prelude::*; fn main() { @@ -115,8 +115,11 @@ fn drag(mut query: Query<&mut Velocity>, time: Res