Skip to content

Commit

Permalink
dep-up: update leafwing-input-manager for 0.13 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
luan committed Feb 23, 2024
1 parent 4fc94eb commit 81439a8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ bevy = { version = "0.13", features = [
"bevy_render",
], default-features = false }
bevy_egui = { version = "0.25", optional = true, default-features = false }
leafwing-input-manager = { version = "0.12", optional = true }
leafwing-input-manager = { version = "0.13", optional = true }

[dev-dependencies]
bevy = { version = "0.13", default-features = false, features = [
Expand Down
2 changes: 1 addition & 1 deletion examples/egui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use rand::random;

fn main() {
App::new()
.add_plugins((DefaultPlugins, PanCamPlugin::default(), EguiPlugin))
.add_plugins((DefaultPlugins, PanCamPlugin, EguiPlugin))
.add_systems(Update, egui_ui)
.add_systems(Startup, setup)
.run();
Expand Down
6 changes: 3 additions & 3 deletions examples/inspector.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
use bevy::prelude::*;
use bevy_inspector_egui::quick::WorldInspectorPlugin;
use bevy_pancam::{PanCam, PanCamPlugin};
use bevy_pancam::{PanCamBundle, PanCamPlugin};
use rand::random;

fn main() {
App::new()
.add_plugins((
DefaultPlugins,
PanCamPlugin::default(),
PanCamPlugin,
WorldInspectorPlugin::default(),
))
.add_systems(Startup, setup)
.run();
}

fn setup(mut commands: Commands) {
commands.spawn((Camera2dBundle::default(), PanCam::default()));
commands.spawn((Camera2dBundle::default(), PanCamBundle::default()));

let n = 20;
let spacing = 50.;
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ fn max_scale_within_bounds(

#[cfg(not(feature = "leafwing-input-manager"))]
fn check_mouse_interaction<'a>(
mouse_buttons: &'a Res<Input<MouseButton>>,
mouse_buttons: &'a Res<ButtonInput<MouseButton>>,
) -> impl Fn(&'a MouseButton) -> bool {
|btn| mouse_buttons.pressed(*btn) && !mouse_buttons.just_pressed(*btn)
}
Expand Down Expand Up @@ -227,7 +227,7 @@ fn camera_movement(
&OrthographicProjection,
)>,
mut last_pos: Local<Option<Vec2>>,
#[cfg(not(feature = "leafwing-input-manager"))] mouse_buttons: Res<Input<MouseButton>>,
#[cfg(not(feature = "leafwing-input-manager"))] mouse_buttons: Res<ButtonInput<MouseButton>>,
#[cfg(feature = "leafwing-input-manager")] action_query: Query<&ActionState<PanCamAction>>,
) {
let window = primary_window.single();
Expand Down

0 comments on commit 81439a8

Please sign in to comment.