Skip to content

Commit 0bfacec

Browse files
authored
bump to 0.18.0-rc.2 (#729)
* bump to 0.18.0-rc.1 * add release notes * updaet RELEASES doc * bump to rc.2 and remove unnecessary feature flag * update release notes * readd gamepad flag by default for placeholder entity queries * Format imports in gamepad_axis.rs
1 parent f76137f commit 0bfacec

32 files changed

+110
-93
lines changed

Cargo.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[package]
22
name = "leafwing-input-manager"
33
description = "A powerful, flexible and ergonomic way to manage action-input keybindings for the Bevy game engine."
4-
version = "0.19.0"
4+
version = "0.20.0"
55
authors = ["Leafwing Studios"]
66
homepage = "https://leafwing-studios.com/"
77
repository = "https://github.com/leafwing-studios/leafwing-input-manager"
88
license = "MIT OR Apache-2.0"
9-
edition = "2021"
9+
edition = "2024"
1010
categories = ["games", "game-development"]
1111
keywords = ["bevy"]
1212
exclude = ["assets/**/*", "tools/**/*", ".github/**/*"]
@@ -49,10 +49,11 @@ docs = ['winit/x11', 'winit/wayland']
4949

5050
[dependencies]
5151
leafwing_input_manager_macros = { path = "macros", version = "0.17" }
52-
bevy = { version = "0.17.0", default-features = false, features = [
52+
bevy = { version = "0.18.0-rc.2", default-features = false, features = [
5353
"serialize",
5454
"std",
5555
"bevy_log",
56+
"gamepad"
5657
] }
5758
# Needed for the `docs` feature. Must be kept in sync with Bevy's version
5859
winit = { version = "0.30", default-features = false, optional = true }
@@ -65,7 +66,7 @@ dyn-eq = "0.1"
6566
dyn-hash = "1.0"
6667

6768
[dev-dependencies]
68-
bevy = { version = "0.17.0-rc.1", default-features = false, features = [
69+
bevy = { version = "0.18.0-rc.2", default-features = false, features = [
6970
"std",
7071
"bevy_asset",
7172
"bevy_sprite",

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and a single input can result in multiple actions being triggered, which can be
1616

1717
| Bevy | leafwing-input-manager |
1818
| ---- | ---------------------- |
19+
| 0.18 | 0.20 (Unreleased) |
1920
| 0.17 | 0.18..0.19 |
2021
| 0.16 | 0.17 |
2122
| 0.15 | 0.16 |

RELEASES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Release Notes
22

3+
## Version 0.20.0 (Unreleased)
4+
5+
### Dependencies (0.20.0)
6+
7+
- updated to Bevy 0.18.rc.2 (this should be compatible with Bevy 0.18 more broadly, assuming no further relevant breaking changes occur upstream)
8+
39
## Version 0.19.0
410

511
### Breaking Changes (0.19.0)

src/action_diff.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use bevy::{
1818
use serde::{Deserialize, Serialize};
1919

2020
use crate::buttonlike::ButtonValue;
21-
use crate::{action_state::ActionKindData, prelude::ActionState, Actionlike};
21+
use crate::{Actionlike, action_state::ActionKindData, prelude::ActionState};
2222

2323
/// Stores presses and releases of buttons without timing information
2424
///

src/action_state/action_data.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use serde::{Deserialize, Serialize};
1010
use crate::buttonlike::ButtonValue;
1111
#[cfg(feature = "timing")]
1212
use crate::timing::Timing;
13-
use crate::{buttonlike::ButtonState, InputControlKind};
13+
use crate::{InputControlKind, buttonlike::ButtonState};
1414

1515
/// Data about the state of an action.
1616
///

src/action_state/mod.rs

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
33
use crate::buttonlike::ButtonValue;
44
use crate::input_map::UpdatedValue;
5-
use crate::{action_diff::ActionDiff, input_map::UpdatedActions};
65
use crate::{Actionlike, InputControlKind};
6+
use crate::{action_diff::ActionDiff, input_map::UpdatedActions};
77

88
use bevy::platform::{collections::HashMap, time::Instant};
99
use bevy::prelude::Resource;
@@ -310,7 +310,7 @@ impl<A: Actionlike> ActionState<A> {
310310
pub fn button_data_mut(&mut self, action: &A) -> Option<&mut ButtonData> {
311311
match self.action_data_mut(action) {
312312
Some(action_data) => match &mut action_data.kind_data {
313-
ActionKindData::Button(ref mut button_data) => Some(button_data),
313+
ActionKindData::Button(button_data) => Some(button_data),
314314
_ => None,
315315
},
316316
None => None,
@@ -380,7 +380,7 @@ impl<A: Actionlike> ActionState<A> {
380380
pub fn axis_data_mut(&mut self, action: &A) -> Option<&mut AxisData> {
381381
match self.action_data_mut(action) {
382382
Some(action_data) => match &mut action_data.kind_data {
383-
ActionKindData::Axis(ref mut axis_data) => Some(axis_data),
383+
ActionKindData::Axis(axis_data) => Some(axis_data),
384384
_ => None,
385385
},
386386
None => None,
@@ -453,7 +453,7 @@ impl<A: Actionlike> ActionState<A> {
453453

454454
match self.action_data_mut(action) {
455455
Some(action_data) => match &mut action_data.kind_data {
456-
ActionKindData::DualAxis(ref mut dual_axis_data) => Some(dual_axis_data),
456+
ActionKindData::DualAxis(dual_axis_data) => Some(dual_axis_data),
457457
_ => None,
458458
},
459459
None => None,
@@ -526,7 +526,7 @@ impl<A: Actionlike> ActionState<A> {
526526

527527
match self.action_data_mut(action) {
528528
Some(action_data) => match &mut action_data.kind_data {
529-
ActionKindData::TripleAxis(ref mut triple_axis_data) => Some(triple_axis_data),
529+
ActionKindData::TripleAxis(triple_axis_data) => Some(triple_axis_data),
530530
_ => None,
531531
},
532532
None => None,
@@ -1370,9 +1370,9 @@ mod tests {
13701370
fn press_lifecycle() {
13711371
use std::time::{Duration, Instant};
13721372

1373-
use crate::prelude::updating::CentralInputStore;
13741373
use crate::prelude::Buttonlike;
13751374
use crate::prelude::ClashStrategy;
1375+
use crate::prelude::updating::CentralInputStore;
13761376

13771377
let ctx = TestContext::new();
13781378
let mut app = ctx.app;
@@ -1466,8 +1466,8 @@ mod tests {
14661466
fn update_with_clashes_prioritizing_longest() {
14671467
use std::time::{Duration, Instant};
14681468

1469-
use crate::prelude::updating::CentralInputStore;
14701469
use crate::prelude::ClashStrategy;
1470+
use crate::prelude::updating::CentralInputStore;
14711471
use crate::user_input::Buttonlike;
14721472
use bevy::prelude::KeyCode::*;
14731473

@@ -1780,17 +1780,21 @@ mod tests {
17801780
}),
17811781
},
17821782
);
1783-
assert!(action_state
1784-
.dual_axis_data_mut(&TestAction::DualAxis)
1785-
.is_some());
1783+
assert!(
1784+
action_state
1785+
.dual_axis_data_mut(&TestAction::DualAxis)
1786+
.is_some()
1787+
);
17861788
}
17871789

17881790
#[test]
17891791
fn test_dual_axis_data_mut_for_dual_axis_action_without_data() {
17901792
let mut action_state = ActionState::<TestAction>::default();
1791-
assert!(action_state
1792-
.dual_axis_data_mut(&TestAction::DualAxis)
1793-
.is_none());
1793+
assert!(
1794+
action_state
1795+
.dual_axis_data_mut(&TestAction::DualAxis)
1796+
.is_none()
1797+
);
17941798
}
17951799

17961800
#[test]
@@ -1803,9 +1807,11 @@ mod tests {
18031807
#[test]
18041808
fn test_triple_axis_data_for_triple_axis_action_without_data() {
18051809
let action_state = ActionState::<TestAction>::default();
1806-
assert!(action_state
1807-
.triple_axis_data(&TestAction::TripleAxis)
1808-
.is_none());
1810+
assert!(
1811+
action_state
1812+
.triple_axis_data(&TestAction::TripleAxis)
1813+
.is_none()
1814+
);
18091815
}
18101816

18111817
#[test]
@@ -1822,9 +1828,11 @@ mod tests {
18221828
}),
18231829
},
18241830
);
1825-
assert!(action_state
1826-
.triple_axis_data_mut(&TestAction::TripleAxis)
1827-
.is_some());
1831+
assert!(
1832+
action_state
1833+
.triple_axis_data_mut(&TestAction::TripleAxis)
1834+
.is_some()
1835+
);
18281836
}
18291837

18301838
#[test]

src/clashing_inputs.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -480,8 +480,8 @@ mod tests {
480480
plugin::CentralInputStorePlugin,
481481
prelude::{ModifierKey, VirtualDPad},
482482
};
483-
use bevy::{input::InputPlugin, prelude::*};
484483
use Action::*;
484+
use bevy::{input::InputPlugin, prelude::*};
485485

486486
#[test]
487487
#[ignore = "Figuring out how to handle the length of chords with group inputs is out of scope."]
@@ -572,9 +572,11 @@ mod tests {
572572
assert!(input_map.possible_clash(&One, &OneAndTwo).is_some());
573573
assert!(input_map.possible_clash(&One, &OneAndTwoAndThree).is_some());
574574
assert!(input_map.possible_clash(&One, &TwoAndThree).is_none());
575-
assert!(input_map
576-
.possible_clash(&OneAndTwo, &OneAndTwoAndThree)
577-
.is_some());
575+
assert!(
576+
input_map
577+
.possible_clash(&OneAndTwo, &OneAndTwoAndThree)
578+
.is_some()
579+
);
578580
}
579581

580582
#[test]
@@ -728,9 +730,11 @@ mod tests {
728730
.first()
729731
.unwrap();
730732

731-
assert!(chord_input
732-
.decompose()
733-
.clashes_with(&dpad_input.decompose()));
733+
assert!(
734+
chord_input
735+
.decompose()
736+
.clashes_with(&dpad_input.decompose())
737+
);
734738

735739
// Triple check that the inputs are clashing
736740
input_map

src/common_conditions.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Run conditions for actions.
22
3-
use crate::{prelude::ActionState, Actionlike};
3+
use crate::{Actionlike, prelude::ActionState};
44
use bevy::{
55
ecs::system::{Single, SystemParam},
66
log::warn,
@@ -27,7 +27,9 @@ where
2727
Some(self.action_state_component.as_ref().unwrap())
2828
} else {
2929
let type_name = std::any::type_name::<A>();
30-
warn!("No ActionState found for {type_name}. Please ensure that an ActionState resource is added, or that an InputMap component exists to provide an ActionState.");
30+
warn!(
31+
"No ActionState found for {type_name}. Please ensure that an ActionState resource is added, or that an InputMap component exists to provide an ActionState."
32+
);
3133
None
3234
}
3335
}

src/input_map.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ use std::hash::Hash;
55

66
#[cfg(feature = "asset")]
77
use bevy::asset::Asset;
8+
use bevy::input::gamepad::Gamepad;
89
use bevy::platform::collections::HashMap;
9-
use bevy::prelude::{Component, Deref, DerefMut, Entity, Gamepad, Query, Reflect, Resource, With};
10+
use bevy::prelude::{Component, Deref, DerefMut, Entity, Query, Reflect, Resource, With};
1011
use bevy::{log::error, prelude::ReflectComponent};
1112
use bevy::{
1213
math::{Vec2, Vec3},
@@ -1213,7 +1214,7 @@ mod tests {
12131214
#[test]
12141215
fn input_map_serde() {
12151216
use bevy::prelude::{App, KeyCode};
1216-
use serde_test::{assert_tokens, Token};
1217+
use serde_test::{Token, assert_tokens};
12171218

12181219
let mut app = App::new();
12191220

src/input_processing/dual_axis/custom.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ use bevy::app::App;
66
use bevy::prelude::{FromReflect, Reflect, ReflectDeserialize, ReflectSerialize, TypePath, Vec2};
77
use bevy::reflect::utility::{GenericTypePathCell, NonGenericTypeInfoCell};
88
use bevy::reflect::{
9-
erased_serde, FromType, GetTypeRegistration, OpaqueInfo, PartialReflect, ReflectFromPtr,
10-
ReflectKind, ReflectMut, ReflectOwned, ReflectRef, TypeInfo, TypeRegistration, Typed,
9+
FromType, GetTypeRegistration, OpaqueInfo, PartialReflect, ReflectFromPtr, ReflectKind,
10+
ReflectMut, ReflectOwned, ReflectRef, TypeInfo, TypeRegistration, Typed, erased_serde,
1111
};
1212
use dyn_clone::DynClone;
1313
use dyn_eq::DynEq;
1414
use dyn_hash::DynHash;
1515
use serde::{Deserialize, Deserializer, Serialize, Serializer};
1616
use serde_flexitos::ser::require_erased_serialize_impl;
17-
use serde_flexitos::{serialize_trait_object, Registry};
17+
use serde_flexitos::{Registry, serialize_trait_object};
1818

1919
use crate::input_processing::DualAxisProcessor;
2020
use crate::typetag::{InfallibleMapRegistry, RegisterTypeTag};
@@ -310,7 +310,7 @@ mod tests {
310310
use super::*;
311311
use crate as leafwing_input_manager;
312312
use leafwing_input_manager_macros::serde_typetag;
313-
use serde_test::{assert_tokens, Token};
313+
use serde_test::{Token, assert_tokens};
314314

315315
#[test]
316316
fn test_custom_dual_axis_processor() {

0 commit comments

Comments
 (0)