private void updateInput(string newInput) { Player player = GameLogic.Binder.GameState.Player; LocaSystem locaSystem = App.Binder.LocaSystem; if (locaSystem.IsRightToLeft(locaSystem.selectedLanguage)) { newInput = RTLConverter.Reverse(newInput); this.RTLText.text = newInput; } this.m_customName = newInput; this.validateCustomName(player); }
protected override void onPreShow([Optional, DefaultParameterValue(null)] object param) { LocaSystem locaSystem = App.Binder.LocaSystem; bool flag = locaSystem.IsRightToLeft(locaSystem.selectedLanguage); this.RTLText.enabled = flag; Color color = this.InputText.color; color.a = !flag ? color.a : 0f; this.InputText.color = color; this.Title.text = StringExtensions.ToUpperLoca(_.L(ConfigLoca.HERONAMING_TITLE, null, false)); Player player = GameLogic.Binder.GameState.Player; if (!player.SocialData.HasGivenCustomName) { this.Input.text = string.Empty; } else if (!string.IsNullOrEmpty(player.SocialData.Name)) { Debug.Log(string.Concat(new object[] { "is ", player.SocialData.Name, " arabic letters? - ", App.Binder.LocaSystem.IsArabic(player.SocialData.Name) })); if (App.Binder.LocaSystem.IsArabic(player.SocialData.Name)) { this.Input.text = RTLConverter.Reverse(player.SocialData.Name); } else { this.Input.text = player.SocialData.Name; } } else { this.Input.text = string.Empty; } bool flag2 = player.SocialData.HeroNamingCount <= 1; this.DescriptionRoot.SetActive(flag2); this.Input.interactable = flag2; this.WarningRoot.SetActive(player.SocialData.HeroNamingCount > 0); if (player.SocialData.HeroNamingCount == 1) { this.WarningText.text = _.L(ConfigLoca.HERONAMING_WARNING_ONE_REMAINING, null, false); } else if (!flag2) { this.WarningText.text = _.L(ConfigLoca.HERONAMING_WARNING_NONE_REMAINING, null, false); } this.validateCustomName(player); this.m_doAutoFocus = true; PlayerView.Binder.InputSystem.setInputRequirement(InputSystem.Layer.MenuHeroNamingPopup, InputSystem.Requirement.MustBeEnabled); }