Esempio n. 1
0
 private bool OnAvatarSubSkillLevelUpRsp(AvatarSubSkillLevelUpRsp rsp)
 {
     if (rsp.get_retcode() == null)
     {
         AvatarSkillDataItem selectedSkillData = (this._showingSkillId != 0) ? this.avatarData.GetAvatarSkillBySkillID(this._showingSkillId) : null;
         base.view.transform.Find("SkillTab").GetComponent <MonoAvatarDetailSkillTab>().SetupView(this.avatarData, selectedSkillData);
     }
     return(false);
 }
        private bool OnAvatarSubSkillLevelUpRsp(AvatarSubSkillLevelUpRsp rsp)
        {
            if (rsp.get_retcode() != null)
            {
                string desc = string.Empty;
                if (rsp.get_retcode() == 5)
                {
                    int      num           = !this.subSkillData.UnLocked ? this.subSkillData.UnlockLv : this.subSkillData.LvUpNeedAvatarLevel;
                    object[] replaceParams = new object[] { num };
                    desc = LocalizationGeneralLogic.GetNetworkErrCodeOutput(rsp.get_retcode(), replaceParams);
                }
                else if (rsp.get_retcode() == 6)
                {
                    int      num2      = !this.subSkillData.UnLocked ? this.subSkillData.UnlockStar : this.subSkillData.GetUpLevelStarNeed();
                    string   str2      = MiscData.Config.AvatarStarName[num2];
                    object[] objArray2 = new object[] { str2 };
                    desc = LocalizationGeneralLogic.GetNetworkErrCodeOutput(rsp.get_retcode(), objArray2);
                }
                else
                {
                    desc = LocalizationGeneralLogic.GetNetworkErrCodeOutput(rsp.get_retcode(), new object[0]);
                }
                Singleton <MainUIManager> .Instance.ShowDialog(new GeneralHintDialogContext(desc, 2f), UIType.Any);
            }
            else
            {
                Dictionary <int, SubSkillStatus> subSkillStatusDict = Singleton <MiHoYoGameData> .Instance.LocalData.SubSkillStatusDict;
                switch (this.subSkillData.Status)
                {
                case SubSkillStatus.CanUnlock:
                case SubSkillStatus.CanUpLevel:
                    subSkillStatusDict[this.subSkillData.subSkillID] = this.subSkillData.Status;
                    break;

                default:
                    subSkillStatusDict.Remove(this.subSkillData.subSkillID);
                    break;
                }
                Singleton <MiHoYoGameData> .Instance.Save();

                Singleton <NotifyManager> .Instance.FireNotify(new Notify(NotifyTypes.SubSkillStatusCacheUpdate, null));

                this.Close();
            }
            return(false);
        }