Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

63 righe
1.3 KiB

  1. using System;
  2. using CIG;
  3. using SUISS.Core;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6. public class SparkSocCreatePopupView : PopupBaseView
  7. {
  8. public override void Open()
  9. {
  10. base.Open();
  11. this.UpdateCreateButton();
  12. }
  13. public void OnToggleClicked(bool isToggled)
  14. {
  15. this._tosAccepted = isToggled;
  16. this.UpdateCreateButton();
  17. }
  18. public void OnTOSClicked()
  19. {
  20. Application.OpenURL(SingletonMonobehaviour<CIGGameConstants>.Instance.TermsOfServiceUrl);
  21. }
  22. public void OnInputChanged()
  23. {
  24. this._hasValidInput = ((SparkSocCreatePopupState)this.State).IsValidInput(this._usernameField.text, this._passwordField.text);
  25. this.UpdateCreateButton();
  26. }
  27. public void SparkSocIsBusy(bool isBusy)
  28. {
  29. this._sparkSocIsBusy = isBusy;
  30. this.UpdateCreateButton();
  31. }
  32. public void OnCreateClicked()
  33. {
  34. ((SparkSocCreatePopupState)this.State).TryCreate(this._usernameField.text, this._passwordField.text);
  35. }
  36. private void UpdateCreateButton()
  37. {
  38. this._createButton.Interactable = (this._hasValidInput && !this._sparkSocIsBusy && this._tosAccepted);
  39. }
  40. [SerializeField]
  41. private InputField _usernameField;
  42. [SerializeField]
  43. private InputField _passwordField;
  44. [SerializeField]
  45. private InteractableButton _createButton;
  46. private bool _tosAccepted;
  47. private bool _hasValidInput;
  48. private bool _sparkSocIsBusy;
  49. }