DEVELOPMENT ENVIRONMENT

~liljamo/deck-builder

0162b4cee5e9e84a4ad055b48a2a5066920d6a64 — Jonni Liljamo 1 year, 10 months ago 655bd78
feat(sdbclient): disallow play if not logged in
1 files changed, 8 insertions(+), 2 deletions(-)

M sdbclient/src/plugins/menu/mainmenuscreen.rs
M sdbclient/src/plugins/menu/mainmenuscreen.rs => sdbclient/src/plugins/menu/mainmenuscreen.rs +8 -2
@@ 18,7 18,9 @@ use super::MenuState;
pub(super) struct ToAccountEvent;
pub(super) struct ExitEvent;

pub(super) fn main_menu_setup(mut commands: Commands) {
pub(super) fn main_menu_setup(mut commands: Commands, cfg_user: Res<CfgUser>) {
    let logged_in = cfg_user.logged_in.clone();

    // TODO: Change the title to a fancy image logo thingy
    commands.add(eml! {
        <body>


@@ 27,7 29,11 @@ pub(super) fn main_menu_setup(mut commands: Commands) {
                    "Deck Builder"
                </span>
                <button c:menubutton s:width="250px" on:press=connect!(|ctx| {
                    ctx.commands().insert_resource(NextState(MenuState::Play))
                    // FIXME: I guess hiding the button would be better, but this is something for
                    // now.
                    if logged_in {
                        ctx.commands().insert_resource(NextState(MenuState::Play))
                    }
                })>
                    "Play"
                </button>