|
- using System;
- using CIG;
- using SUISS.Core;
- using UnityEngine;
- using UnityEngine.UI;
-
- public class SparkSocCreatePopupView : PopupBaseView
- {
- public override void Open()
- {
- base.Open();
- this.UpdateCreateButton();
- }
-
- public void OnToggleClicked(bool isToggled)
- {
- this._tosAccepted = isToggled;
- this.UpdateCreateButton();
- }
-
- public void OnTOSClicked()
- {
- Application.OpenURL(SingletonMonobehaviour<CIGGameConstants>.Instance.TermsOfServiceUrl);
- }
-
- public void OnInputChanged()
- {
- this._hasValidInput = ((SparkSocCreatePopupState)this.State).IsValidInput(this._usernameField.text, this._passwordField.text);
- this.UpdateCreateButton();
- }
-
- public void SparkSocIsBusy(bool isBusy)
- {
- this._sparkSocIsBusy = isBusy;
- this.UpdateCreateButton();
- }
-
- public void OnCreateClicked()
- {
- ((SparkSocCreatePopupState)this.State).TryCreate(this._usernameField.text, this._passwordField.text);
- }
-
- private void UpdateCreateButton()
- {
- this._createButton.Interactable = (this._hasValidInput && !this._sparkSocIsBusy && this._tosAccepted);
- }
-
- [SerializeField]
- private InputField _usernameField;
-
- [SerializeField]
- private InputField _passwordField;
-
- [SerializeField]
- private InteractableButton _createButton;
-
- private bool _tosAccepted;
-
- private bool _hasValidInput;
-
- private bool _sparkSocIsBusy;
- }
|