public void LoginResult() { if (InvokeRequired) { LoginResultCallback d = LoginResult; Invoke(d, new object[] { }); } else { var isNewUser = false; if (string.IsNullOrEmpty(UserProfile.Profile.Name)) { CreatePlayerForm cpf = new CreatePlayerForm(); cpf.BringToFront(); cpf.ShowDialog(); isNewUser = true; if (cpf.Result == DialogResult.Cancel) { return; } } MainTipManager.Refresh(); SystemMenuManager.Reload(); UserProfile.Profile.OnLogin(); page = 1; viewStack1.SelectedIndex = page; } }
public void ChangePage(int pg) { if (pg == 0) { textBoxPasswd.Text = ""; SoundManager.PlayBGM("TOM000.mp3"); } else if (pg == 1) { UserProfile.ProfileName = textBoxName.Text; if (!UserProfile.LoadFromDB(textBoxName.Text)) { UserProfile.Profile = new Profile(); CreatePlayerForm cpf = new CreatePlayerForm(); cpf.ShowDialog(); if (cpf.Result == DialogResult.Cancel) { return; } } MainTipManager.Refresh(); SoundManager.PlayBGM("TOM001.mp3"); Scene.Instance.ChangeMap(UserProfile.InfoBasic.MapId, false); UserProfile.Profile.OnLogin(); } page = pg; viewStack1.SelectedIndex = page; }