DEVELOPMENT ENVIRONMENT

~liljamo/deck-builder

7da1929c3c248ab8eaf0aecfbeccf8e8cd8310b9 — Jonni Liljamo 1 year, 10 months ago d1f6dd6
feat(sdbclient): center play menus, placeholders
1 files changed, 26 insertions(+), 16 deletions(-)

M sdbclient/src/plugins/menu/play/ui.rs
M sdbclient/src/plugins/menu/play/ui.rs => sdbclient/src/plugins/menu/play/ui.rs +26 -16
@@ 29,28 29,38 @@ pub(super) fn show(
        .show(egui_context.ctx_mut(), |ui| {
            match rtdmenu.play_menu_ui_state {
                PlayMenuUIState::Main => {
                    if ui.button("Create").clicked() {
                        rtdmenu.play_menu_ui_state = PlayMenuUIState::CreateGame
                    }
                    ui.vertical_centered(|ui| {
                        if ui.button("Create").clicked() {
                            rtdmenu.play_menu_ui_state = PlayMenuUIState::CreateGame
                        }

                    if ui.button("Browse").clicked() {
                        rtdmenu.play_menu_ui_state = PlayMenuUIState::BrowseGames
                    }
                        if ui.button("Browse").clicked() {
                            rtdmenu.play_menu_ui_state = PlayMenuUIState::BrowseGames
                        }

                    if ui.button("Back").clicked() {
                        commands.insert_resource(NextState(PlayMenuState::None));
                        commands.insert_resource(NextState(MenuState::Main));
                    }
                        if ui.button("Back").clicked() {
                            commands.insert_resource(NextState(PlayMenuState::None));
                            commands.insert_resource(NextState(MenuState::Main));
                        }
                    });
                }
                PlayMenuUIState::CreateGame => {
                    if ui.button("Back").clicked() {
                        rtdmenu.play_menu_ui_state = PlayMenuUIState::Main
                    }
                    ui.vertical_centered(|ui| {
                        if ui.button("Confirm").clicked() {
                            todo!();
                        }

                        if ui.button("Cancel").clicked() {
                            rtdmenu.play_menu_ui_state = PlayMenuUIState::Main
                        }
                    });
                }
                PlayMenuUIState::BrowseGames => {
                    if ui.button("Back").clicked() {
                        rtdmenu.play_menu_ui_state = PlayMenuUIState::Main
                    }
                    ui.vertical_centered(|ui| {
                        if ui.button("Back").clicked() {
                            rtdmenu.play_menu_ui_state = PlayMenuUIState::Main
                        }
                    });
                }
                PlayMenuUIState::InLobbyHost => {
                    if ui.button("Back").clicked() {