diff --git a/Cargo.toml b/Cargo.toml index ac192f3..10508eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_console" -version = "0.14.1" +version = "0.15.0" edition = "2021" authors = ["RichoDemus "] homepage = "https://github.com/RichoDemus/bevy-console" @@ -16,7 +16,7 @@ bevy = { version = "0.16", default-features = false, features = [ ] } clap = { version = "4.5", features = ["derive"] } bevy_console_derive = { path = "./bevy_console_derive", version = "0.5.0" } -bevy_egui = { version = "0.34", default-features = false, features = [ +bevy_egui = { version = "0.35", default-features = false, features = [ "render", "default_fonts", ] } diff --git a/src/console.rs b/src/console.rs index 81c5674..3312dca 100644 --- a/src/console.rs +++ b/src/console.rs @@ -496,7 +496,7 @@ pub(crate) fn console_ui( let keyboard_input_events = keyboard_input_events.read().collect::>(); // If there is no egui context, return, this can happen when exiting the app - let ctx = if let Some(ctxt) = egui_context.try_ctx_mut() { + let ctx = if let Ok(ctxt) = egui_context.ctx_mut() { ctxt } else { return; @@ -765,7 +765,7 @@ pub fn block_mouse_input( return; } - let Some(context) = contexts.try_ctx_mut() else { + let Ok(context) = contexts.ctx_mut() else { return; }; @@ -783,7 +783,7 @@ pub fn block_keyboard_input( return; } - let Some(context) = contexts.try_ctx_mut() else { + let Ok(context) = contexts.ctx_mut() else { return; }; diff --git a/src/lib.rs b/src/lib.rs index 99d6e42..5610f99 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,7 +3,7 @@ use bevy::prelude::*; pub use bevy_console_derive::ConsoleCommand; -use bevy_egui::{EguiContextPass, EguiPlugin, EguiPreUpdateSet}; +use bevy_egui::{EguiPlugin, EguiPreUpdateSet, EguiPrimaryContextPass}; use console::{block_keyboard_input, block_mouse_input, ConsoleCache}; use trie_rs::TrieBuilder; @@ -86,14 +86,14 @@ impl Plugin for ConsolePlugin { .before(EguiPreUpdateSet::BeginPass), ) .add_systems( - EguiContextPass, + EguiPrimaryContextPass, ( console_ui.in_set(ConsoleSet::ConsoleUI), receive_console_line.in_set(ConsoleSet::PostCommands), ), ) .configure_sets( - EguiContextPass, + EguiPrimaryContextPass, ( ConsoleSet::Commands .after(ConsoleSet::ConsoleUI) @@ -105,9 +105,7 @@ impl Plugin for ConsolePlugin { // Don't initialize an egui plugin if one already exists. // This can happen if another plugin is using egui and was installed before us. if !app.is_plugin_added::() { - app.add_plugins(EguiPlugin { - enable_multipass_for_primary_context: true, - }); + app.add_plugins(EguiPlugin::default()); } } }