DEVELOPMENT ENVIRONMENT

~liljamo/deck-builder

39d197b45dbf94216398c0d205b54cd2650ce404 — Jonni Liljamo 1 year, 11 months ago 618929c
feat(sdbclient): add states related to lobbies
2 files changed, 12 insertions(+), 1 deletions(-)

M sdbclient/src/plugins/menu/mod.rs
M sdbclient/src/plugins/menu/playscreen.rs
M sdbclient/src/plugins/menu/mod.rs => sdbclient/src/plugins/menu/mod.rs +7 -0
@@ 87,6 87,9 @@ pub enum MenuState {
    None,
    Main,
    Play,
    Lobby,
    CreateGame,
    JoinGame,
    Settings,
    SettingsDisplay,
    SettingsAudio,


@@ 114,6 117,8 @@ struct SelectedSettingsTab;
#[derive(Component)]
enum MenuButtonAction {
    Play,
    CreateGame,
    JoinGame,
    Settings,
    SettingsDisplay,
    SettingsAudio,


@@ 145,6 150,8 @@ fn menu_action(
            match menu_button_action {
                MenuButtonAction::Exit => app_exit_events.send(AppExit),
                MenuButtonAction::Play => menu_state.set(MenuState::Play).unwrap(),
                MenuButtonAction::CreateGame => menu_state.set(MenuState::CreateGame).unwrap(),
                MenuButtonAction::JoinGame => menu_state.set(MenuState::JoinGame).unwrap(),
                MenuButtonAction::Settings => menu_state.set(MenuState::Settings).unwrap(),
                MenuButtonAction::SettingsDisplay => {
                    menu_state.set(MenuState::SettingsDisplay).unwrap()

M sdbclient/src/plugins/menu/playscreen.rs => sdbclient/src/plugins/menu/playscreen.rs +5 -1
@@ 76,7 76,11 @@ pub fn play_setup(mut commands: Commands, asset_server: Res<AssetServer>) {
                    ..default()
                })
                .with_children(|parent| {
                    for (action, text) in [(MenuButtonAction::BackToMainMenu, "Back")] {
                    for (action, text) in [
                        (MenuButtonAction::CreateGame, "Create"),
                        (MenuButtonAction::JoinGame, "Join"),
                        (MenuButtonAction::BackToMainMenu, "Back"),
                    ] {
                        parent
                            .spawn((
                                ButtonBundle {