Change of file structure for scenes #38

Merged
tipragot merged 11 commits from restruct-menus into main 2024-02-10 17:26:09 +00:00
Showing only changes of commit 601490023b - Show all commits

View file

@ -17,7 +17,7 @@ impl Plugin for MenuPlugin {
fn menu_ui( fn menu_ui(
mut ctx: EguiContexts, mut ctx: EguiContexts,
mut connection_string: Local<String>, mut connection_string: Local<String>,
mut next_state: ResMut<NextState<CurrentScene>>, mut next_scene: ResMut<NextState<CurrentScene>>,
) { ) {
egui::CentralPanel::default().show(ctx.ctx_mut(), |ui| { egui::CentralPanel::default().show(ctx.ctx_mut(), |ui| {
ui.heading("Border Wars"); ui.heading("Border Wars");
@ -30,7 +30,7 @@ fn menu_ui(
ui.text_edit_singleline(&mut *connection_string); ui.text_edit_singleline(&mut *connection_string);
if ui.button("Join").clicked() { if ui.button("Join").clicked() {
next_state.set(CurrentScene::Game); next_scene.set(CurrentScene::Game);
// TODO: connect to the game // TODO: connect to the game
} }
}); });
@ -38,7 +38,7 @@ fn menu_ui(
ui.separator(); ui.separator();
if ui.button("Create new game").clicked() { if ui.button("Create new game").clicked() {
next_state.set(CurrentScene::Lobby); next_scene.set(CurrentScene::Lobby);
// TODO: create a new game // TODO: create a new game
} }
}); });