public void Set(string title, string content, string labelYes = "UI_OK", string labelNo = "UI_CANCEL", bool localize = true, float blurRadius = 1, bool submittable = true) { bool titleExists = !string.IsNullOrEmpty(title); if (localize) { if (titleExists) { this.title.text = L10nManager.Localize(title); } this.content.text = L10nManager.Localize(content); submitButton.SetSubmitText(L10nManager.Localize(labelYes)); this.labelNo.text = L10nManager.Localize(labelNo); } else { this.title.text = title; this.content.text = content; submitButton.SetSubmitText(labelYes); this.labelNo.text = labelNo; } this.title.gameObject.SetActive(titleExists); titleBorder.SetActive(titleExists); this.blurRadius = blurRadius; submitButton.SetSubmittableWithoutInteractable(submittable); }
public override void Initialize() { base.Initialize(); monstersAreaText.text = L10nManager.Localize("UI_WORLD_MAP_MONSTERS"); rewardsAreaText.text = L10nManager.Localize("UI_REWARDS"); submitButton.SetSubmitText(L10nManager.Localize("UI_WORLD_MAP_ENTER")); var tooltip = Find <ItemInformationTooltip>(); foreach (var view in rewardsAreaItemViews) { view.touchHandler.OnClick.Subscribe(_ => { AudioController.PlayClick(); var model = new Model.CountableItem( new Nekoyume.Model.Item.Material(view.Data as MaterialItemSheet.Row), 1); tooltip.Show(view.RectTransform, model); tooltip.itemInformation.iconArea.itemView.countText.enabled = false; }).AddTo(view); } foreach (var stage in world.Pages.SelectMany(page => page.Stages)) { stage.onClick.Subscribe(worldMapStage => { _sharedViewModel.SelectedStageId.Value = worldMapStage.SharedViewModel.stageId; }).AddTo(gameObject); } submitButton.OnSubmitClick .Subscribe(_ => GoToPreparation()) .AddTo(gameObject); }
protected override void Awake() { base.Awake(); openTouchHandler.OnClick.Subscribe(pointerEventData => { AudioController.PlayClick(); Animator.Play(OpenHash); }).AddTo(gameObject); closeTouchHandler.OnClick.Subscribe(pointerEventData => { Close(true); }).AddTo(gameObject); closeButton.SetSubmitText(L10nManager.Localize("UI_RECEIVE"), L10nManager.Localize("UI_RECEIVE")); closeButton.OnSubmitClick.Subscribe(_ => { Close(true); }).AddTo(gameObject); CloseWidget = null; gameObject.SetActive(false); }
private void Awake() { receiveButton.SetSubmitText( L10nManager.Localize("UI_PROGRESS"), L10nManager.Localize("UI_RECEIVE")); receiveButton.SetSubmitTextColor(ColorHelper.HexToColorRGB("955c4a")); receiveButton.OnSubmitClick .ThrottleFirst(new TimeSpan(0, 0, 1)) .Subscribe(OnReceiveClick) .AddTo(gameObject); }
protected override void Awake() { base.Awake(); if (cancelButtonText != null) { cancelButtonText.text = L10nManager.Localize("UI_CANCEL"); } submitButton.SetSubmitText(L10nManager.Localize("UI_OK")); if (informationText != null) { informationText.text = L10nManager.Localize("UI_RETRIEVE_INFO"); } if (cancelButton != null) { cancelButton.OnClickAsObservable() .Subscribe(_ => { _data?.OnClickCancel.OnNext(_data); AudioController.PlayCancel(); }) .AddTo(_disposablesForAwake); CloseWidget = cancelButton.onClick.Invoke; } submitButton.OnSubmitClick .Subscribe(_ => { _data?.OnClickSubmit.OnNext(_data); AudioController.PlayClick(); }) .AddTo(_disposablesForAwake); SubmitWidget = () => submitButton.OnSubmitClick.OnNext(submitButton); }
private void SubscribeState(States states) { titleText.gameObject.SetActive(true); contentText.gameObject.SetActive(false); passPhraseGroup.SetActive(false); retypeGroup.SetActive(false); loginGroup.SetActive(false); findPassphraseTitle.gameObject.SetActive(false); findPassphraseGroup.SetActive(false); accountGroup.SetActive(false); submitButton.SetSubmittable(false); findPassphraseButton.gameObject.SetActive(false); backToLoginButton.gameObject.SetActive(false); accountAddressText.gameObject.SetActive(false); accountAddressHolder.gameObject.SetActive(false); accountWarningText.gameObject.SetActive(false); retypeText.gameObject.SetActive(false); loginWarning.SetActive(false); findPrivateKeyWarning.SetActive(false); createSuccessGroup.SetActive(false); switch (states) { case States.Show: header.SetActive(true); contentText.gameObject.SetActive(true); incorrectText.gameObject.SetActive(false); correctText.gameObject.SetActive(false); strongText.gameObject.SetActive(false); weakText.gameObject.SetActive(false); accountGroup.SetActive(true); accountAddressHolder.gameObject.SetActive(true); passPhraseField.text = ""; retypeField.text = ""; loginField.text = ""; findPassphraseField.text = ""; submitButton.SetSubmitText(L10nManager.Localize("UI_GAME_SIGN_UP")); bg.SetActive(false); break; case States.CreatePassword: titleText.gameObject.SetActive(false); accountAddressText.gameObject.SetActive(true); submitButton.SetSubmitText(L10nManager.Localize("UI_GAME_START")); passPhraseGroup.SetActive(true); retypeGroup.SetActive(true); accountGroup.SetActive(true); passPhraseField.Select(); break; case States.CreateAccount: titleText.gameObject.SetActive(false); submitButton.SetSubmitText(L10nManager.Localize("UI_GAME_CREATE_PASSWORD")); createSuccessGroup.SetActive(true); passPhraseField.Select(); break; case States.ResetPassphrase: titleText.gameObject.SetActive(false); submitButton.SetSubmitText(L10nManager.Localize("UI_GAME_START")); passPhraseGroup.SetActive(true); retypeGroup.SetActive(true); accountGroup.SetActive(true); passPhraseField.Select(); break; case States.Login: header.SetActive(false); titleText.gameObject.SetActive(false); submitButton.SetSubmitText(L10nManager.Localize("UI_GAME_START")); loginGroup.SetActive(true); accountGroup.SetActive(true); findPassphraseButton.gameObject.SetActive(true); loginField.Select(); accountAddressText.gameObject.SetActive(true); bg.SetActive(true); break; case States.FindPassphrase: titleText.gameObject.SetActive(false); findPassphraseTitle.gameObject.SetActive(true); findPassphraseGroup.SetActive(true); backToLoginButton.gameObject.SetActive(true); submitButton.SetSubmitText(L10nManager.Localize("UI_OK")); findPassphraseField.Select(); break; case States.Failed: var upper = _prevState.ToString().ToUpper(); var format = L10nManager.Localize($"UI_LOGIN_{upper}_FAIL"); titleText.text = string.Format(format, _prevState); contentText.gameObject.SetActive(true); var contentFormat = L10nManager.Localize($"UI_LOGIN_{upper}_CONTENT"); contentText.text = string.Format(contentFormat); submitButton.SetSubmitText(L10nManager.Localize("UI_OK")); break; default: throw new ArgumentOutOfRangeException(nameof(states), states, null); } UpdateSubmitButton(); }