generated from tipragot/rust
Add the main menu #31
|
@ -17,7 +17,11 @@ impl Plugin for MenuPlugin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// Display the UI of the menu to host a game or join one.
|
/// 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| {
|
egui::CentralPanel::default().show(ctx.ctx_mut(), |ui| {
|
||||||
ui.heading("Border Wars");
|
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() {
|
if ui.button("Create new game").clicked() {
|
||||||
next_state.set(GameState::Lobby);
|
next_state.set(GameState::Lobby);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue