public void OnLvUpBtnClick() { PlayerDataItem playerData = Singleton <PlayerModule> .Instance.playerData; bool flag = Singleton <StorageModule> .Instance.GetAllAvatarExpAddMaterial().Count > 0; bool flag2 = (this._avatarData.level < playerData.AvatarLevelLimit) || (this._avatarData.exp < this._avatarData.MaxExp); if (flag && flag2) { Singleton <MainUIManager> .Instance.ShowDialog(new MaterialUseDialogContext(this._avatarData), UIType.Any); } else { string text = LocalizationGeneralLogic.GetText("Err_Unknown", new object[0]); if (!flag) { text = LocalizationGeneralLogic.GetText("Err_NoLvUpItem", new object[0]); } else if (!flag2) { object[] replaceParams = new object[] { playerData.teamLevel, playerData.AvatarLevelLimit }; text = LocalizationGeneralLogic.GetText("Err_AvatarLevelLimit", replaceParams); } GeneralDialogContext dialogContext = new GeneralDialogContext { type = GeneralDialogContext.ButtonType.SingleButton, title = LocalizationGeneralLogic.GetText("Menu_Title_Tips", new object[0]), desc = text }; Singleton <MainUIManager> .Instance.ShowDialog(dialogContext, UIType.Any); } }
public void SetupView(AvatarDataItem avatarData) { this._isRemoteAvatar = false; this._avatarData = avatarData; this.SetupAvatarBasicStatus(base.transform.Find("BasicStatus/InfoPanel/BasicStatus")); base.transform.Find("BasicStatus/InfoPanel/StarPanel/AvatarStar").GetComponent <MonoAvatarStar>().SetupView(this._avatarData.star); base.transform.Find("Introduction").gameObject.SetActive(false); base.transform.Find("Star").gameObject.SetActive(true); this.SetupTiltSlider(base.transform.Find("Star/InfoRowFragment/Fragment"), (float)avatarData.fragment, (float)avatarData.MaxFragment); base.transform.Find("Star/StarUpBtn").GetComponent <Button>().interactable = avatarData.CanStarUp; base.transform.Find("Star/StarUpBtn/PopUp").gameObject.SetActive(avatarData.CanStarUp); MonoButtonWwiseEvent component = null; component = base.transform.Find("Star/StarUpBtn").GetComponent <MonoButtonWwiseEvent>(); if (component == null) { component = base.transform.Find("Star/StarUpBtn").gameObject.AddComponent <MonoButtonWwiseEvent>(); } component.eventName = !base.transform.Find("Star/StarUpBtn").GetComponent <Button>().interactable ? "UI_Gen_Select_Negative" : "UI_Click"; base.transform.Find("Lv").gameObject.SetActive(true); this.SetupTiltSlider(base.transform.Find("Lv/InfoRowLv/Exp"), (float)avatarData.exp, (float)avatarData.MaxExp); PlayerDataItem playerData = Singleton <PlayerModule> .Instance.playerData; base.transform.Find("Lv/LvUpBtn").GetComponent <Button>().interactable = (this._avatarData.level < playerData.AvatarLevelLimit) || (this._avatarData.exp < this._avatarData.MaxExp); component = base.transform.Find("Lv/LvUpBtn").GetComponent <MonoButtonWwiseEvent>(); if (component == null) { component = base.transform.Find("Lv/LvUpBtn").gameObject.AddComponent <MonoButtonWwiseEvent>(); } component.eventName = !base.transform.Find("Lv/LvUpBtn").GetComponent <Button>().interactable ? "UI_Gen_Select_Negative" : "UI_Click"; }
private bool CanShowInviteHintDialog() { if (!MiscData.Config.BasicConfig.IsInviteFeatureEnable) { return(false); } if (Singleton <NetworkManager> .Instance.DispatchSeverData.isReview) { return(false); } if (!Singleton <AccountManager> .Instance.manager.IsAccountBind()) { return(false); } PlayerDataItem playerData = Singleton <PlayerModule> .Instance.playerData; if (playerData.teamLevel >= playerData.maxLevelToAcceptInvite) { return(false); } if (Singleton <MiHoYoGameData> .Instance.LocalData.HasShowInviteHintDialog) { return(false); } return(Singleton <TutorialModule> .Instance.IsTutorialIDFinish(0x439)); }
public bool CanUnlock(AvatarDataItem avatar) { if (!this.UnLocked) { PlayerDataItem playerData = Singleton <PlayerModule> .Instance.playerData; return((((avatar.level >= this.UnlockLv) && (avatar.star >= this.UnlockStar)) && ((playerData.skillPoint >= this.UnlockPoint) && (playerData.scoin >= this.UnlockSCoin))) && this.UnlockHasEnoughItems()); } return(false); }
public bool CanLvUp(AvatarDataItem avatar) { if (this.UnLocked) { PlayerDataItem playerData = Singleton <PlayerModule> .Instance.playerData; return(((((avatar.level >= this.LvUpNeedAvatarLevel) && (this.level < this.MaxLv)) && ((playerData.skillPoint >= this.LvUpPoint) && (playerData.scoin >= this.LvUpSCoin))) && this.LvUpHasEnoughItems()) && (avatar.star >= this.GetUpLevelStarNeed())); } return(false); }
private void SetupStaminaInfo() { PlayerDataItem playerData = Singleton <PlayerModule> .Instance.playerData; base.view.transform.Find("Dialog/Content/StaminaInfo/NumText").GetComponent <Text>().text = playerData.stamina + "/" + playerData.MaxStamina; if (!Singleton <PlayerModule> .Instance.playerData.IsStaminaFull()) { DateTime now = TimeUtil.Now; TimeSpan span = Singleton <PlayerModule> .Instance.playerData.nextStaminaRecoverDatetime.Subtract(now); if (span.TotalSeconds > 0.0) { this._nextRecoverTimeText.gameObject.SetActive(true); this._nextRecoverTimeText.text = string.Format("( {0:D2} : {1:D2} )", span.Minutes, span.Seconds); } } else { this._nextRecoverTimeText.gameObject.SetActive(false); } }
private ChatMsgDataItem GenerateMsgSendByMe(string msg) { PlayerDataItem playerData = Singleton <PlayerModule> .Instance.playerData; return(new ChatMsgDataItem(playerData.userId, playerData.NickNameText, TimeUtil.Now, msg, ChatMsgDataItem.Type.MSG)); }