Skip to content

Commit 00756df

Browse files
committed
chore(deps): update bevy to v0.13 (#5)
1 parent 03882c3 commit 00756df

11 files changed

+907
-1254
lines changed

Diff for: Cargo.lock

+809-1,153
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: Cargo.toml

+5-7
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,16 @@ nalgebra = "0.32"
1818
itertools = "0.12.0"
1919
siphasher = "1.0"
2020

21-
serde = { version = "1.0", features = ["derive"] }
22-
23-
bevy = "0.12"
24-
leafwing-input-manager = "0.11"
25-
bevy_kira_audio = "0.18"
21+
bevy = "0.13"
22+
leafwing-input-manager = "0.13"
23+
bevy_kira_audio = "0.19"
2624
benimator = "4.1"
27-
bevy_editor_pls = "0.7"
2825

26+
serde = { version = "1.0", features = ["derive"] }
2927
rusqlite = { version = "0.31", features = ["bundled"] }
3028
arboard = "3.3" # 系统剪切板
3129
image = "0.24"
32-
winit = "0.28" # 版本需要与 bevy 中使用的保持一致
30+
winit = "0.29" # 版本需要与 bevy 中使用的保持一致
3331
toml = "0.8"
3432

3533
[profile.dev.package."*"]

Diff for: src/input_action_map.rs

+53-53
Original file line numberDiff line numberDiff line change
@@ -35,153 +35,153 @@ pub fn default_input_action_map() -> InputMap<Action> {
3535
use leafwing_input_manager::user_input::InputKind::*;
3636
let mouse_input_map = InputMap::new([
3737
(
38-
UserInput::Single(Mouse(MouseButton::Other(1))),
3938
Action::Undo,
39+
UserInput::Single(Mouse(MouseButton::Other(1))),
4040
),
4141
(
42-
UserInput::Single(Mouse(MouseButton::Other(2))),
4342
Action::Redo,
43+
UserInput::Single(Mouse(MouseButton::Other(2))),
4444
),
4545
(
46-
UserInput::Single(MouseWheel(MouseWheelDirection::Down)),
4746
Action::ZoomOut,
47+
UserInput::Single(MouseWheel(MouseWheelDirection::Down)),
4848
),
4949
(
50-
UserInput::Single(MouseWheel(MouseWheelDirection::Up)),
5150
Action::ZoomIn,
51+
UserInput::Single(MouseWheel(MouseWheelDirection::Up)),
5252
),
5353
]);
5454
let keyboard_input_map = InputMap::new([
55-
(UserInput::Single(Keyboard(KeyCode::W)), Action::MoveUp),
56-
(UserInput::Single(Keyboard(KeyCode::S)), Action::MoveDown),
57-
(UserInput::Single(Keyboard(KeyCode::A)), Action::MoveLeft),
58-
(UserInput::Single(Keyboard(KeyCode::D)), Action::MoveRight),
59-
(UserInput::Single(Keyboard(KeyCode::Up)), Action::MoveUp),
60-
(UserInput::Single(Keyboard(KeyCode::Down)), Action::MoveDown),
61-
(UserInput::Single(Keyboard(KeyCode::Left)), Action::MoveLeft),
62-
(
63-
UserInput::Single(Keyboard(KeyCode::Right)),
55+
(Action::MoveUp, UserInput::Single(PhysicalKey(KeyCode::KeyW))),
56+
(Action::MoveDown, UserInput::Single(PhysicalKey(KeyCode::KeyS))),
57+
(Action::MoveLeft, UserInput::Single(PhysicalKey(KeyCode::KeyA))),
58+
(Action::MoveRight, UserInput::Single(PhysicalKey(KeyCode::KeyD))),
59+
(Action::MoveUp, UserInput::Single(PhysicalKey(KeyCode::ArrowUp))),
60+
(Action::MoveDown, UserInput::Single(PhysicalKey(KeyCode::ArrowDown))),
61+
(Action::MoveLeft, UserInput::Single(PhysicalKey(KeyCode::ArrowLeft))),
62+
(
6463
Action::MoveRight,
64+
UserInput::Single(PhysicalKey(KeyCode::ArrowRight)),
6565
),
6666
(
67-
UserInput::Chord(vec![Keyboard(KeyCode::ControlLeft), Keyboard(KeyCode::Z)]),
6867
Action::Undo,
68+
UserInput::Chord(vec![PhysicalKey(KeyCode::ControlLeft), PhysicalKey(KeyCode::KeyZ)]),
6969
),
7070
(
71+
Action::Redo,
7172
UserInput::Chord(vec![
72-
Keyboard(KeyCode::ControlLeft),
73-
Keyboard(KeyCode::ShiftLeft),
74-
Keyboard(KeyCode::Z),
73+
PhysicalKey(KeyCode::ControlLeft),
74+
PhysicalKey(KeyCode::ShiftLeft),
75+
PhysicalKey(KeyCode::KeyZ),
7576
]),
76-
Action::Redo,
7777
),
7878
(
79-
UserInput::Single(Keyboard(KeyCode::Escape)),
8079
Action::ResetLevel,
80+
UserInput::Single(PhysicalKey(KeyCode::Escape)),
8181
),
8282
(
83-
UserInput::Single(Keyboard(KeyCode::BracketRight)),
8483
Action::NextLevel,
84+
UserInput::Single(PhysicalKey(KeyCode::BracketRight)),
8585
),
8686
(
87-
UserInput::Single(Keyboard(KeyCode::BracketLeft)),
8887
Action::PreviousLevel,
88+
UserInput::Single(PhysicalKey(KeyCode::BracketLeft)),
8989
),
9090
(
91+
Action::NextUnsolvedLevel,
9192
UserInput::Chord(vec![
92-
Keyboard(KeyCode::ControlLeft),
93-
Keyboard(KeyCode::BracketRight),
93+
PhysicalKey(KeyCode::ControlLeft),
94+
PhysicalKey(KeyCode::BracketRight),
9495
]),
95-
Action::NextUnsolvedLevel,
9696
),
9797
(
98+
Action::PreviousUnsolvedLevel,
9899
UserInput::Chord(vec![
99-
Keyboard(KeyCode::ControlLeft),
100-
Keyboard(KeyCode::BracketLeft),
100+
PhysicalKey(KeyCode::ControlLeft),
101+
PhysicalKey(KeyCode::BracketLeft),
101102
]),
102-
Action::PreviousUnsolvedLevel,
103103
),
104-
(UserInput::Single(Keyboard(KeyCode::Equals)), Action::ZoomIn),
105-
(UserInput::Single(Keyboard(KeyCode::Minus)), Action::ZoomOut),
104+
(Action::ZoomIn, UserInput::Single(PhysicalKey(KeyCode::Equal))),
105+
(Action::ZoomOut, UserInput::Single(PhysicalKey(KeyCode::Minus))),
106106
(
107-
UserInput::Single(Keyboard(KeyCode::I)),
108107
Action::ToggleInstantMove,
108+
UserInput::Single(PhysicalKey(KeyCode::KeyI)),
109109
),
110110
(
111-
UserInput::Single(Keyboard(KeyCode::P)),
112111
Action::ToggleAutomaticSolution,
112+
UserInput::Single(PhysicalKey(KeyCode::KeyP)),
113113
),
114114
(
115-
UserInput::Single(Keyboard(KeyCode::F11)),
116115
Action::ToggleFullscreen,
116+
UserInput::Single(PhysicalKey(KeyCode::F11)),
117117
),
118118
(
119-
UserInput::Chord(vec![Keyboard(KeyCode::ControlLeft), Keyboard(KeyCode::V)]),
120119
Action::ImportLevelsFromClipboard,
120+
UserInput::Chord(vec![PhysicalKey(KeyCode::ControlLeft), PhysicalKey(KeyCode::KeyV)]),
121121
),
122122
(
123-
UserInput::Chord(vec![Keyboard(KeyCode::ControlLeft), Keyboard(KeyCode::C)]),
124123
Action::ExportLevelToClipboard,
124+
UserInput::Chord(vec![PhysicalKey(KeyCode::ControlLeft), PhysicalKey(KeyCode::KeyC)]),
125125
),
126-
// Keyboard (Vim)
127-
(UserInput::Single(Keyboard(KeyCode::K)), Action::MoveUp),
128-
(UserInput::Single(Keyboard(KeyCode::J)), Action::MoveDown),
129-
(UserInput::Single(Keyboard(KeyCode::H)), Action::MoveLeft),
130-
(UserInput::Single(Keyboard(KeyCode::L)), Action::MoveRight),
131-
(UserInput::Single(Keyboard(KeyCode::U)), Action::Undo),
126+
// PhysicalKey (Vim)
127+
(Action::MoveUp, UserInput::Single(PhysicalKey(KeyCode::KeyK))),
128+
(Action::MoveDown, UserInput::Single(PhysicalKey(KeyCode::KeyJ))),
129+
(Action::MoveLeft, UserInput::Single(PhysicalKey(KeyCode::KeyH))),
130+
(Action::MoveRight, UserInput::Single(PhysicalKey(KeyCode::KeyL))),
131+
(Action::Undo, UserInput::Single(PhysicalKey(KeyCode::KeyU))),
132132
(
133-
UserInput::Chord(vec![Keyboard(KeyCode::ControlLeft), Keyboard(KeyCode::R)]),
134133
Action::Redo,
134+
UserInput::Chord(vec![PhysicalKey(KeyCode::ControlLeft), PhysicalKey(KeyCode::KeyR)]),
135135
),
136136
]);
137137
let gamepad_input_map = InputMap::new([
138138
(
139-
UserInput::Single(GamepadButton(GamepadButtonType::DPadUp)),
140139
Action::MoveUp,
140+
UserInput::Single(GamepadButton(GamepadButtonType::DPadUp)),
141141
),
142142
(
143-
UserInput::Single(GamepadButton(GamepadButtonType::DPadDown)),
144143
Action::MoveDown,
144+
UserInput::Single(GamepadButton(GamepadButtonType::DPadDown)),
145145
),
146146
(
147-
UserInput::Single(GamepadButton(GamepadButtonType::DPadLeft)),
148147
Action::MoveLeft,
148+
UserInput::Single(GamepadButton(GamepadButtonType::DPadLeft)),
149149
),
150150
(
151-
UserInput::Single(GamepadButton(GamepadButtonType::DPadRight)),
152151
Action::MoveRight,
152+
UserInput::Single(GamepadButton(GamepadButtonType::DPadRight)),
153153
),
154154
(
155-
UserInput::Single(GamepadButton(GamepadButtonType::East)),
156155
Action::Undo,
156+
UserInput::Single(GamepadButton(GamepadButtonType::East)),
157157
),
158158
(
159-
UserInput::Single(GamepadButton(GamepadButtonType::South)),
160159
Action::Redo,
160+
UserInput::Single(GamepadButton(GamepadButtonType::South)),
161161
),
162162
(
163-
UserInput::Single(GamepadButton(GamepadButtonType::RightTrigger)),
164163
Action::NextLevel,
164+
UserInput::Single(GamepadButton(GamepadButtonType::RightTrigger)),
165165
),
166166
(
167-
UserInput::Single(GamepadButton(GamepadButtonType::LeftTrigger)),
168167
Action::PreviousLevel,
168+
UserInput::Single(GamepadButton(GamepadButtonType::LeftTrigger)),
169169
),
170170
(
171-
UserInput::Single(GamepadButton(GamepadButtonType::RightTrigger2)),
172171
Action::ZoomIn,
172+
UserInput::Single(GamepadButton(GamepadButtonType::RightTrigger2)),
173173
),
174174
(
175-
UserInput::Single(GamepadButton(GamepadButtonType::LeftTrigger2)),
176175
Action::ZoomOut,
176+
UserInput::Single(GamepadButton(GamepadButtonType::LeftTrigger2)),
177177
),
178178
(
179-
UserInput::Single(GamepadButton(GamepadButtonType::West)),
180179
Action::ToggleInstantMove,
180+
UserInput::Single(GamepadButton(GamepadButtonType::West)),
181181
),
182182
(
183-
UserInput::Single(GamepadButton(GamepadButtonType::North)),
184183
Action::ToggleAutomaticSolution,
184+
UserInput::Single(GamepadButton(GamepadButtonType::North)),
185185
),
186186
]);
187187
InputMap::default()

Diff for: src/main.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ use systems::level::*;
3434
use systems::render::*;
3535
use systems::ui::*;
3636

37-
#[allow(unused_imports)]
38-
use bevy_editor_pls::prelude::*;
39-
4037
const CONFIG_FILE_PATH: &'static str = "config.toml";
4138

4239
fn load_config() -> Config {
@@ -80,9 +77,8 @@ fn main() {
8077
AudioPlugin,
8178
PerformanceMatrixPlugin,
8279
InputManagerPlugin::<Action>::default(),
83-
// EditorPlugin::default(),
8480
))
85-
.add_state::<AppState>()
81+
.init_state::<AppState>()
8682
.add_systems(PreStartup, (setup_camera, setup_database))
8783
.add_systems(
8884
Startup,

Diff for: src/plugins/performance_matrix.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ fn update_performance_matrix(
6262
mut query: Query<&mut Text, With<PerformanceCounter>>,
6363
) {
6464
let mut text = query.single_mut();
65-
if let Some(fps) = diagnostics.get(FrameTimeDiagnosticsPlugin::FPS) {
65+
if let Some(fps) = diagnostics.get(&FrameTimeDiagnosticsPlugin::FPS) {
6666
if let Some(raw) = fps.value() {
6767
text.sections[1].value = format!("{raw:.2}\n");
6868
}

Diff for: src/systems/auto_move.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ pub fn spawn_auto_move_marks(
1111
mut commands: Commands,
1212
mut auto_move_state: ResMut<AutoMoveState>,
1313
board: Query<&Board>,
14-
mut crates: Query<(&GridPosition, &mut TextureAtlasSprite), (With<Crate>, Without<Player>)>,
15-
mut player: Query<&mut TextureAtlasSprite, With<Player>>,
14+
mut crates: Query<(&GridPosition, &mut Sprite), (With<Crate>, Without<Player>)>,
15+
mut player: Query<&mut Sprite, With<Player>>,
1616
mut next_state: ResMut<NextState<AppState>>,
1717
) {
1818
let Board { board, tile_size } = board.single();
@@ -55,7 +55,7 @@ pub fn spawn_auto_move_marks(
5555
// highlight selected crate
5656
crates
5757
.iter_mut()
58-
.filter(|(grid_position, _)| ***grid_position == *crate_position)
58+
.filter(|(grid_position, ..)| ***grid_position == *crate_position)
5959
.for_each(|(_, mut sprite)| sprite.color = HIGHLIGHT_COLOR);
6060
}
6161
AutoMoveState::Player => {
@@ -98,8 +98,8 @@ pub fn spawn_auto_move_marks(
9898
/// Despawns the auto-move reachable marks on the board.
9999
pub fn despawn_auto_move_marks(
100100
mut commands: Commands,
101-
mut crates: Query<(&GridPosition, &mut TextureAtlasSprite), (With<Crate>, Without<Player>)>,
102-
mut player: Query<&mut TextureAtlasSprite, With<Player>>,
101+
mut crates: Query<(&GridPosition, &mut Sprite), (With<Crate>, Without<Player>)>,
102+
mut player: Query<&mut Sprite, With<Player>>,
103103
marks: Query<Entity, Or<(With<CratePushableMark>, With<PlayerMovableMark>)>>,
104104
auto_move_state: Res<AutoMoveState>,
105105
) {
@@ -116,5 +116,5 @@ pub fn despawn_auto_move_marks(
116116
}
117117
}
118118

119-
marks.for_each(|entity| commands.entity(entity).despawn());
119+
marks.iter().for_each(|entity| commands.entity(entity).despawn());
120120
}

Diff for: src/systems/auto_solve.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pub fn despawn_lowerbound_marks(
7777
mut commands: Commands,
7878
marks: Query<Entity, With<LowerBoundMark>>,
7979
) {
80-
marks.for_each(|entity| commands.entity(entity).despawn());
80+
marks.iter().for_each(|entity| commands.entity(entity).despawn());
8181
}
8282

8383
/// Resets the board to the state before automatic solution

0 commit comments

Comments
 (0)