Пример #1
0
    public void SetData(byte bPreGrade, int lPreLevel, long lExp, NkSoldierInfo kSolInfo, long nAddEvolutionExp, long nMaxLvEvolution)
    {
        this.m_TargetSolInfo = kSolInfo;
        if (kSolInfo != null)
        {
            string textFromInterface = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1731");

            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref textFromInterface, new object[]
            {
                textFromInterface,
                "count",
                lExp
            });

            this.lbExp.SetText(textFromInterface);
            this.lbName.SetText(kSolInfo.GetName());
            if (!NrTSingleton <ContentsLimitManager> .Instance.IsReincarnation())
            {
                if (kSolInfo.IsLeader())
                {
                    this.SolRank.Visible = false;
                }
                else
                {
                    UIBaseInfoLoader solLargeGradeImg = NrTSingleton <NrCharKindInfoManager> .Instance.GetSolLargeGradeImg(kSolInfo.GetCharKind(), (int)kSolInfo.GetGrade());

                    if (solLargeGradeImg != null)
                    {
                        if (0 < NrTSingleton <NrCharKindInfoManager> .Instance.GetLegendType(kSolInfo.GetCharKind(), (int)kSolInfo.GetGrade()))
                        {
                            this.SolRank.SetSize(solLargeGradeImg.UVs.width, solLargeGradeImg.UVs.height);
                        }
                        this.SolRank.SetTexture(solLargeGradeImg);
                    }
                }
            }
            else
            {
                UIBaseInfoLoader solLargeGradeImg2 = NrTSingleton <NrCharKindInfoManager> .Instance.GetSolLargeGradeImg(kSolInfo.GetCharKind(), (int)kSolInfo.GetGrade());

                if (solLargeGradeImg2 != null)
                {
                    if (0 < NrTSingleton <NrCharKindInfoManager> .Instance.GetLegendType(kSolInfo.GetCharKind(), (int)kSolInfo.GetGrade()))
                    {
                        this.SolRank.SetSize(solLargeGradeImg2.UVs.width, solLargeGradeImg2.UVs.height);
                    }
                    this.SolRank.SetTexture(solLargeGradeImg2);
                }
            }
            int costumeUnique = (int)kSolInfo.GetSolSubData(eSOL_SUBDATA.SOL_SUBDATA_COSTUME);
            this.dtImg.SetTexture(eCharImageType.LARGE, kSolInfo.GetCharKind(), (int)kSolInfo.GetGrade(), NrTSingleton <NrCharCostumeTableManager> .Instance.GetCostumePortraitPath(costumeUnique));
            long  num  = kSolInfo.GetNextExp() - kSolInfo.GetCurBaseExp();
            float num2 = ((float)num - (float)kSolInfo.GetRemainExp()) / (float)num;
            if (num2 > 1f)
            {
                num2 = 1f;
            }
            if (kSolInfo.IsMaxLevel())
            {
                string textFromInterface2 = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("286");

                this.lbExpRate.SetText(textFromInterface2);
                num2 = 1f;
            }
            else
            {
                this.lbExpRate.SetText(string.Format("{0:F2}%", num2 * 100f));
            }
            this.pbGage.Value = num2;
            BASE_SOLGRADEINFO cHARKIND_SOLGRADEINFO  = kSolInfo.GetCharKindInfo().GetCHARKIND_SOLGRADEINFO((int)kSolInfo.GetGrade());
            BASE_SOLGRADEINFO cHARKIND_SOLGRADEINFO2 = kSolInfo.GetCharKindInfo().GetCHARKIND_SOLGRADEINFO((int)bPreGrade);
            if (cHARKIND_SOLGRADEINFO != null && cHARKIND_SOLGRADEINFO2 != null)
            {
                int  level = (int)kSolInfo.GetLevel();
                bool flag  = lPreLevel != level;
                this.lbLevel[1].SetText(lPreLevel.ToString());
                this.lbLevel[2].Visible = flag;
                this.lbLevel[3].Visible = flag;
                this.lbLevel[3].SetText(level.ToString());
                this.m_bLevelUP = (lPreLevel != level);
                if (flag)
                {
                    base.SetShowLayer(2, true);
                }
                else
                {
                    base.SetShowLayer(2, false);
                }
                if (flag)
                {
                    int[] levelChangeValue = this.GetLevelChangeValue(kSolInfo, (short)lPreLevel, (short)level, (int)bPreGrade);
                    this.SetTextShowOrNot(ref this.m_lbLevelUpStat, levelChangeValue);
                }
            }
            if (nAddEvolutionExp > 0L)
            {
                textFromInterface = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1731");

                if (nMaxLvEvolution > 0L)
                {
                    textFromInterface = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2593");

                    NrTSingleton <CTextParser> .Instance.ReplaceParam(ref textFromInterface, new object[]
                    {
                        textFromInterface,
                        "count",
                        nAddEvolutionExp,
                        "count1",
                        nAddEvolutionExp - nMaxLvEvolution,
                        "count2",
                        nMaxLvEvolution
                    });
                }
                else
                {
                    NrTSingleton <CTextParser> .Instance.ReplaceParam(ref textFromInterface, new object[]
                    {
                        textFromInterface,
                        "count",
                        nAddEvolutionExp
                    });
                }
                if (!kSolInfo.IsMaxGrade())
                {
                    this.m_lbGetGradeExpText.SetText(textFromInterface);
                }
                else
                {
                    this.m_lbGetGradeExpText.SetText(string.Empty);
                }
                base.SetShowLayer(3, true);
                bool flag2 = kSolInfo.GetGrade() != bPreGrade;
                this.dtGradeUpImg.Visible = flag2;
                bool flag3 = false;
                if (COMMON_CONSTANT_Manager.GetInstance().GetValue(eCOMMON_CONSTANT.eCOMMON_CONSTANT_TRADECOUNT_USE) == 1 && flag2 && kSolInfo.IsMaxGrade())
                {
                    int num3 = (int)kSolInfo.GetSolSubData(eSOL_SUBDATA.SOL_SUBDATA_TRADE_COUNT);
                    this.lbGradeUpText.Visible = true;
                    string empty = string.Empty;
                    NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
                    {
                        NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2127"),
                        "count",
                        num3
                    });

                    this.lbGradeUpText.SetText(empty);
                    flag3 = true;
                }
                if (!flag3)
                {
                    this.lbGradeUpText.Visible = false;
                }
                if (flag2)
                {
                    short legendType = NrTSingleton <NrCharKindInfoManager> .Instance.GetLegendType(kSolInfo.GetCharKind(), (int)bPreGrade);

                    UIBaseInfoLoader solLargeGradeImg3 = NrTSingleton <NrCharKindInfoManager> .Instance.GetSolLargeGradeImg(kSolInfo.GetCharKind(), (int)bPreGrade);

                    if (0 < legendType)
                    {
                        this.m_txPreRank.SetSize(solLargeGradeImg3.UVs.width, solLargeGradeImg3.UVs.height);
                    }
                    this.m_txPreRank.SetTexture(solLargeGradeImg3);
                    legendType = NrTSingleton <NrCharKindInfoManager> .Instance.GetLegendType(kSolInfo.GetCharKind(), (int)(bPreGrade + 1));

                    solLargeGradeImg3 = NrTSingleton <NrCharKindInfoManager> .Instance.GetSolLargeGradeImg(kSolInfo.GetCharKind(), (int)(bPreGrade + 1));

                    if (0 < legendType)
                    {
                        this.m_txCurRank.SetSize(solLargeGradeImg3.UVs.width, solLargeGradeImg3.UVs.height);
                    }
                    this.m_txCurRank.SetTexture(solLargeGradeImg3);
                    base.SetShowLayer(4, true);
                    int[] gradeChangeValue = this.GetGradeChangeValue(kSolInfo, kSolInfo.GetLevel(), (int)bPreGrade, (int)kSolInfo.GetGrade());
                    this.SetTextShowOrNot(ref this.m_lbRankUpStat, gradeChangeValue);
                }
                else
                {
                    base.SetShowLayer(4, false);
                }
                this.GradeExpBG.Visible   = true;
                this.GradeExpGage.Visible = true;
                this.GradeExpText.Visible = true;
                long   num4 = kSolInfo.GetEvolutionExp() - kSolInfo.GetCurBaseEvolutionExp();
                long   num5 = kSolInfo.GetNextEvolutionExp() - kSolInfo.GetCurBaseEvolutionExp();
                float  evolutionExpPercent = kSolInfo.GetEvolutionExpPercent();
                string text = string.Empty;
                this.GradeExpGage.SetSize(228f * evolutionExpPercent, this.GradeExpGage.height);
                if (!kSolInfo.IsMaxGrade())
                {
                    NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
                    {
                        NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1871"),
                        "exp",
                        num4.ToString(),
                        "maxexp",
                        num5.ToString()
                    });
                }
                else
                {
                    text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("484");
                }
                this.GradeExpText.SetText(text);
            }
            else
            {
                base.SetShowLayer(3, false);
                base.SetShowLayer(4, false);
            }
        }
    }
Пример #2
0
 private void GetSolGradeCheck(ref NkSoldierInfo pkSolinfo, ref eElement_MsgType eElement_Msg, NkSoldierInfo pkReadySolinfo, byte bCharGrade)
 {
     if (NrTSingleton <ContentsLimitManager> .Instance.IsSolGuideCharKindInfo(pkReadySolinfo.GetCharKind()))
     {
         eElement_Msg = eElement_MsgType.eElement_NOTSOL;
         TsLog.LogOnlyEditor("!!!! CONTENTLIMIT SOL CHARKIND ERROR {0}" + this.m_SelectSlotData.i32KindInfo + " !!");
         return;
     }
     if (pkReadySolinfo == null)
     {
         return;
     }
     if (pkReadySolinfo.IsCostumeEquip())
     {
         return;
     }
     if (pkReadySolinfo.GetMaxSkillLevel())
     {
         if (pkReadySolinfo.GetGrade() >= bCharGrade)
         {
             if (pkReadySolinfo.GetGrade() == bCharGrade)
             {
                 if (eElement_Msg == eElement_MsgType.eElement_OK)
                 {
                     if (pkSolinfo.GetEvolutionExp() > pkReadySolinfo.GetEvolutionExp())
                     {
                         pkSolinfo = pkReadySolinfo;
                     }
                 }
                 else
                 {
                     eElement_Msg = eElement_MsgType.eElement_OK;
                     pkSolinfo    = pkReadySolinfo;
                 }
             }
             else if (eElement_Msg < eElement_MsgType.eElement_NEEDGRADE)
             {
                 eElement_Msg = eElement_MsgType.eElement_SOLHEIGHT;
                 pkSolinfo    = pkReadySolinfo;
             }
             else if (eElement_Msg == eElement_MsgType.eElement_SOLHEIGHT && pkSolinfo.GetEvolutionExp() > pkReadySolinfo.GetEvolutionExp())
             {
                 pkSolinfo = pkReadySolinfo;
             }
         }
         else if (eElement_Msg < eElement_MsgType.eElement_NEEDGRADE)
         {
             eElement_Msg = eElement_MsgType.eElement_NEEDGRADE;
             pkSolinfo    = pkReadySolinfo;
         }
         else if (eElement_Msg == eElement_MsgType.eElement_NEEDGRADE && pkSolinfo.GetEvolutionExp() > pkReadySolinfo.GetEvolutionExp())
         {
             pkSolinfo = pkReadySolinfo;
         }
     }
     else if (eElement_Msg < eElement_MsgType.eElement_NEEDEXP)
     {
         eElement_Msg = eElement_MsgType.eElement_NEEDEXP;
         pkSolinfo    = pkReadySolinfo;
     }
     else if (eElement_Msg == eElement_MsgType.eElement_NEEDEXP && pkSolinfo.GetEvolutionExp() > pkReadySolinfo.GetEvolutionExp())
     {
         pkSolinfo = pkReadySolinfo;
     }
 }