private async Task CreateUserAndShowAnonPanel() { var waitDialog = new HUDIconMessageBox { Text = "Contacting server", TextColor = FlatColors.TextHUD, Background = HUDBackgroundDefinition.CreateRounded(FlatColors.BelizeHole, 16), IconColor = FlatColors.Clouds, Icon = Textures.CannonCogBig, RotationSpeed = 1f, CloseOnClick = false, }; MainGame.Inst.DispatchBeginInvoke(() => { AddModal(waitDialog, false, 0.7f); }); await MainGame.Inst.Backend.CreateUser(MainGame.Inst.Profile); waitDialog.Remove(); MainGame.Inst.DispatchBeginInvoke(() => { if (MainGame.Inst.Profile.AccountType == AccountType.Anonymous) { AddModal(new AnonymousAccountPanel(), true); } }); }
public void DoPlayTest() { SetMode(LevelEditorMode.Mouse); LevelData.UpdateAndSave(this); var success = LevelData.ValidateWithToasts(HUD); if (success) { var waitDialog = new HUDIconMessageBox { L10NText = L10NImpl.STR_LVLED_COMPILING, TextColor = FlatColors.TextHUD, Background = HUDBackgroundDefinition.CreateRounded(FlatColors.BelizeHole, 16), IconColor = FlatColors.Clouds, Icon = Textures.CannonCogBig, RotationSpeed = 1f, CloseOnClick = false, }; HUD.AddModal(waitDialog, false, 0.7f); DoCompileAndTest(waitDialog).RunAsync(); } }
private void OnCreateAccount(HUDTextButton sender, HUDButtonEventArgs e) { if (editUsername.Text == "" || editPassword.Text == "") { return; } if (MainGame.Inst.Profile.AccountType != AccountType.Anonymous) { return; } var waitDialog = new HUDIconMessageBox { L10NText = L10NImpl.STR_AAP_ACCCREATING, TextColor = FlatColors.TextHUD, Background = HUDBackgroundDefinition.CreateRounded(FlatColors.BelizeHole, 16), IconColor = FlatColors.Clouds, Icon = Textures.CannonCog, RotationSpeed = 1f, CloseOnClick = false, }; HUD.AddModal(waitDialog, false, 0.7f); DoSignup(waitDialog, editUsername.Text, editPassword.Text).RunAsync(); }
private void OnLogin(HUDTextButton sender, HUDButtonEventArgs e) { if (editUsername.Text == "") { editUsername.AddOperation(new HUDTextBoxBlinkOperation(Color.Red)); return; } if (editPassword.Text == "") { editPassword.AddOperation(new HUDTextBoxBlinkOperation(Color.Red)); return; } var waitDialog = new HUDIconMessageBox { L10NText = L10NImpl.STR_AAP_LOGGINGIN, TextColor = FlatColors.TextHUD, Background = HUDBackgroundDefinition.CreateRounded(FlatColors.BelizeHole, 16), IconColor = FlatColors.Clouds, Icon = Textures.CannonCogBig, RotationSpeed = 1f, CloseOnClick = false, }; HUD.AddModal(waitDialog, false, 0.7f); DoLogin(waitDialog, editUsername.Text, editPassword.Text).RunAsync(); }
private void OnChangePassword(HUDTextButton sender, HUDButtonEventArgs e) { if (editPassword.Text == "") { editPassword.AddHUDOperation(new HUDTextBoxBlinkOperation(Color.Red)); return; } if (MainGame.Inst.Profile.AccountType != AccountType.Full) { return; } var waitDialog = new HUDIconMessageBox { L10NText = L10NImpl.STR_CPP_CHANGING, TextColor = FlatColors.TextHUD, Background = HUDBackgroundDefinition.CreateRounded(FlatColors.BelizeHole, 16), IconColor = FlatColors.Clouds, Icon = Textures.CannonCogBig, RotationSpeed = 1f, CloseOnClick = false, }; HUD.AddModal(waitDialog, false, 0.7f); DoChangePassword(waitDialog, editPassword.Text).RunAsync(); }
private void CreateNewUserLevel(HUDTextButton sender, HUDButtonEventArgs e) { if (MainGame.Inst.Profile.AccountType == AccountType.Local) { CreateUserAndShowAnonPanel().EnsureNoError(); return; } else if (MainGame.Inst.Profile.AccountType == AccountType.Anonymous) { ShowAnonPanel(); HUD.ShowToast(null, L10N.T(L10NImpl.STR_SCCM_NEEDS_ACC), 40, FlatColors.Orange, FlatColors.Foreground, 2f); return; } var waitDialog = new HUDIconMessageBox { L10NText = L10NImpl.STR_GENERIC_SERVER_QUERY, TextColor = FlatColors.TextHUD, Background = HUDBackgroundDefinition.CreateRounded(FlatColors.BelizeHole, 16), IconColor = FlatColors.Clouds, Icon = Textures.CannonCogBig, RotationSpeed = 1f, CloseOnClick = false, }; HUD.AddModal(waitDialog, false, 0.7f); CreateNewUserLevelInternal(waitDialog).RunAsync(); }
private void DoUpload(HUDIconTextButton sender, HUDButtonEventArgs e) { var waitDialog = new HUDIconMessageBox { L10NText = L10NImpl.STR_LVLED_UPLOADING, TextColor = FlatColors.TextHUD, Background = HUDBackgroundDefinition.CreateRounded(FlatColors.BelizeHole, 16), IconColor = FlatColors.Clouds, Icon = Textures.CannonCogBig, RotationSpeed = 1f, CloseOnClick = false, }; HUD.AddModal(waitDialog, false, 0.7f); DoUploadInternal(waitDialog).RunAsync(); }