Add the main menu #31

Merged
CoCo_Sol merged 25 commits from main-menu into main 2024-02-09 23:42:37 +00:00
Showing only changes of commit 73acfaddd2 - Show all commits

View file

@ -17,7 +17,11 @@ impl Plugin for MenuPlugin {
}
}
/// Display the UI of the menu to host a game or join one.
fn menu_ui(mut ctx: EguiContexts, mut connection_string: Local<String>, mut next_state: ResMut<NextState<GameState>>) {
fn menu_ui(
mut ctx: EguiContexts,
mut connection_string: Local<String>,
mut next_state: ResMut<NextState<GameState>>,
) {
egui::CentralPanel::default().show(ctx.ctx_mut(), |ui| {
ui.heading("Border Wars");
@ -37,7 +41,6 @@ fn menu_ui(mut ctx: EguiContexts, mut connection_string: Local<String>, mut next
if ui.button("Create new game").clicked() {
next_state.set(GameState::Lobby);
}
});
}