Skip to content

Commit b0b80a9

Browse files
authored
Update to Bevy 0.12 (#58)
1 parent f1cf06c commit b0b80a9

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bevy_console"
3-
version = "0.9.0"
3+
version = "0.10.0"
44
edition = "2021"
55
authors = ["RichoDemus <[email protected]>"]
66
homepage = "https://github.com/RichoDemus/bevy-console"
@@ -10,14 +10,14 @@ license = "MIT"
1010
readme = "README.md"
1111

1212
[dependencies]
13-
bevy = { version = "0.11", default-features = false }
13+
bevy = { version = "0.12", default-features = false }
1414
clap = { version = "4.4.6", features = ["derive"] }
1515
bevy_console_derive = { path = "./bevy_console_derive", version = "0.5.0" }
16-
bevy_egui = "0.22"
16+
bevy_egui = "0.23"
1717
shlex = "1.1"
1818

1919
[dev-dependencies]
20-
bevy = "0.11"
20+
bevy = "0.12"
2121

2222
[workspace]
2323
members = ["bevy_console_derive"]

examples/raw_commands.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ fn main() {
99
}
1010

1111
fn raw_commands(mut console_commands: EventReader<ConsoleCommandEntered>) {
12-
for ConsoleCommandEntered { command_name, args } in console_commands.iter() {
12+
for ConsoleCommandEntered { command_name, args } in console_commands.read() {
1313
println!(r#"Entered command "{command_name}" with args {:#?}"#, args);
1414
}
1515
}

src/console.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ unsafe impl<T: Command> SystemParam for ConsoleCommand<'_, T> {
150150
change_tick,
151151
);
152152

153-
let command = event_reader.iter().find_map(|command| {
153+
let command = event_reader.read().find_map(|command| {
154154
if T::name() == command.command_name {
155155
let clap_command = T::command().no_binary_name(true);
156156
// .color(clap::ColorChoice::Always);
@@ -334,7 +334,7 @@ pub(crate) fn console_ui(
334334
mut command_entered: EventWriter<ConsoleCommandEntered>,
335335
mut console_open: ResMut<ConsoleOpen>,
336336
) {
337-
let keyboard_input_events = keyboard_input_events.iter().collect::<Vec<_>>();
337+
let keyboard_input_events = keyboard_input_events.read().collect::<Vec<_>>();
338338
let ctx = egui_context.ctx_mut();
339339

340340
let pressed = keyboard_input_events
@@ -479,7 +479,7 @@ pub(crate) fn receive_console_line(
479479
mut console_state: ResMut<ConsoleState>,
480480
mut events: EventReader<PrintConsoleLine>,
481481
) {
482-
for event in events.iter() {
482+
for event in events.read() {
483483
let event: &PrintConsoleLine = event;
484484
console_state.scrollback.push(event.line.clone());
485485
}

0 commit comments

Comments
 (0)