diff --git a/src/debug.rs b/src/debug.rs index 10cd923f2..421d586b9 100644 --- a/src/debug.rs +++ b/src/debug.rs @@ -7,11 +7,12 @@ use bones_framework::debug::frame_time_diagnostics_plugin; use bones_framework::networking::debug::network_debug_window; pub fn game_plugin(game: &mut Game) { - game.sessions.create_with(SessionNames::DEBUG, |builder| { - builder - .install_plugin(session_plugin) - .install_plugin(frame_time_diagnostics_plugin); - }); + game.sessions + .create_with(SessionNames::DEBUG, |builder: &mut SessionBuilder| { + builder + .install_plugin(session_plugin) + .install_plugin(frame_time_diagnostics_plugin); + }); } fn session_plugin(session: &mut SessionBuilder) { diff --git a/src/main.rs b/src/main.rs index aecf82253..3f0cdfbe3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -174,7 +174,7 @@ fn main() { // Create a new session for the pause menu, which sits in the background by default and only // does anything while the game is running. game.sessions - .create_with(SessionNames::PAUSE_MENU, |builder| { + .create_with(SessionNames::PAUSE_MENU, |builder: &mut SessionBuilder| { builder.install_plugin(ui::pause_menu::session_plugin); }); @@ -184,16 +184,19 @@ fn main() { .unwrap() .priority = 1; - // Scoring menu plugin, activated by game between round tarnsitions when appropriate - game.sessions.create_with(SessionNames::SCORING, |builder| { - builder.install_plugin(ui::scoring::session_plugin); - }); + // Scoring menu plugin, activated by game between round transitions when appropriate + game.sessions + .create_with(SessionNames::SCORING, |builder: &mut SessionBuilder| { + builder.install_plugin(ui::scoring::session_plugin); + }); // session for pop-ups / nofication UI - game.sessions - .create_with(SessionNames::NOTIFICATION, |builder| { + game.sessions.create_with( + SessionNames::NOTIFICATION, + |builder: &mut SessionBuilder| { builder.install_plugin(ui::notification::session_plugin); - }); + }, + ); // Create a bevy renderer for the bones game and run it. BonesBevyRenderer { diff --git a/src/profiler.rs b/src/profiler.rs index fde22b692..1bfe68f42 100644 --- a/src/profiler.rs +++ b/src/profiler.rs @@ -6,7 +6,7 @@ use crate::prelude::*; pub fn game_plugin(game: &mut Game) { game.systems.add_before_system(mark_new_frame); game.sessions - .create_with(SessionNames::PROFILER, |builder| { + .create_with(SessionNames::PROFILER, |builder: &mut SessionBuilder| { builder.install_plugin(session_plugin); }); } diff --git a/src/sessions.rs b/src/sessions.rs index 4d99eb9d0..2bdc66975 100644 --- a/src/sessions.rs +++ b/src/sessions.rs @@ -23,7 +23,7 @@ pub trait SessionExt { impl SessionExt for Sessions { fn start_menu(&mut self) { - self.create_with(SessionNames::MAIN_MENU, |builder| { + self.create_with(SessionNames::MAIN_MENU, |builder: &mut SessionBuilder| { builder.install_plugin(crate::ui::main_menu::session_plugin); }); } @@ -74,7 +74,7 @@ impl SessionExt for Sessions { score }; - self.create_with(SessionNames::GAME, |builder| { + self.create_with(SessionNames::GAME, |builder: &mut SessionBuilder| { builder.install_plugin(crate::core::MatchPlugin { maps: map_pool, player_info, @@ -89,7 +89,7 @@ impl SessionExt for Sessions { } fn start_game(&mut self, match_plugin: crate::core::MatchPlugin) { - self.create_with(SessionNames::GAME, |builder| { + self.create_with(SessionNames::GAME, |builder: &mut SessionBuilder| { builder.install_plugin(match_plugin); }); } diff --git a/src/ui/pause_menu.rs b/src/ui/pause_menu.rs index ed9874665..c52db4ae0 100644 --- a/src/ui/pause_menu.rs +++ b/src/ui/pause_menu.rs @@ -137,7 +137,7 @@ fn pause_menu_system( .deref() .clone(); sessions.end_game(); - sessions.create_with(SessionNames::GAME, |builder| { + sessions.create_with(SessionNames::GAME, |builder: &mut SessionBuilder| { builder.install_plugin(crate::core::MatchPlugin { maps, player_info: std::array::from_fn(|i| PlayerInput {