/// <summary> /// If the user Click on the login button, the login form appears /// </summary> private void btnLogin_Click(object sender, EventArgs e) { using (FormLogin formLogin = new FormLogin()) { formLogin.ShowDialog(this); string lblUsername = formLogin.UserEmail; /// TODO Call game generator /// TODO Generate player's attributes (Pos, inventory and so on) /// TODO Call event and item generator FormGame frmGame = new FormGame(lblUsername); frmGame.ShowDialog(); } }
/// <summary> /// If the user Click on the login button, the login form appears /// </summary> private void btnLogin_Click(object sender, EventArgs e) { using (FormLogin formLogin = new FormLogin()) { formLogin.ShowDialog(this); this.isLogged = formLogin.IsLogged; if (isLogged) { userEmail = formLogin.UserEmail; lblMainMenuLogged.Text = $@"Connecté avec {userEmail}"; btnLogin.Text = @"Jouer"; btnLogin.Click -= (btnLogin_Click); btnLogin.Click += (btnLogin_Play); } } }