Ejemplo n.º 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);
            }
        }
    }
Ejemplo n.º 2
0
    private void SetComposeSolBase(bool setting, NkSoldierInfo solInfo)
    {
        if (solInfo == null)
        {
            return;
        }
        this.btnBaseSelect.SetButtonTextureKey("Win_B_Change");
        this.lblBaseGuideText.Visible = false;
        if (this.GetListBox() != null && this.GetListBox().Count == 0)
        {
            this.btnSubSelectMain.Visible = true;
            this.btnSubSelect.Visible     = true;
            this.btnSubSelect.SetButtonTextureKey("Win_B_Addlist");
            this.dtExpBG.Visible              = false;
            this.lblExp.Visible               = false;
            this.lblGradeText.Visible         = false;
            this.lblMaterialGuideText.Visible = true;
        }
        else
        {
            this.btnSubSelect.SetButtonTextureKey("Win_B_Change");
            this.btnSubSelectMain.Visible     = false;
            this.dtExpBG.Visible              = true;
            this.lblExp.Visible               = true;
            this.lblGradeText.Visible         = true;
            this.lblMaterialGuideText.Visible = false;
        }
        this.lblComposeText.Visible = true;
        if (solInfo != null)
        {
            this.dtBase.SetTexture(eCharImageType.LARGE, solInfo.GetCharKind(), (int)(solInfo.GetGrade() + 2), string.Empty);
        }
        this.dtBase.Visible = setting;
        if (solInfo != null)
        {
            UIBaseInfoLoader solLargeGradeImg = NrTSingleton <NrCharKindInfoManager> .Instance.GetSolLargeGradeImg(solInfo.GetCharKind(), (int)solInfo.GetGrade());

            if (0 < NrTSingleton <NrCharKindInfoManager> .Instance.GetLegendType(solInfo.GetCharKind(), (int)solInfo.GetGrade()))
            {
                this.SolRank.SetSize(solLargeGradeImg.UVs.width, solLargeGradeImg.UVs.height);
            }
            this.SolRank.SetTexture(solLargeGradeImg);
        }
        this.SolRank.Visible = setting;
        if (solInfo != null)
        {
            string empty = string.Empty;
            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
            {
                NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("3274"),
                "season",
                solInfo.GetSeason() + 1
            });

            this.lblBaseSeasonText.SetText(empty);
        }
        this.lblBaseSeasonText.Visible = setting;
        this.lblExp.Visible            = setting;
        this.lblExp.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("286"));
        this.lblComposeCost.SetText(string.Format("{0:###,###,###,##0}", 0));
        this.lblComposeCost.Visible = setting;
        if (solInfo != null)
        {
            string empty2 = string.Empty;
            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty2, new object[]
            {
                NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("290"),
                "targetname",
                solInfo.GetName(),
                "count1",
                solInfo.GetLevel().ToString(),
                "count2",
                solInfo.GetSolMaxLevel().ToString()
            });

            this.lbBaseName.SetText(empty2);
        }
        this.lbBaseName.Visible = setting;
        float num = 1f;

        this.dtGage.SetSize(this.GAGE_SRC_WIDTH * num, this.dtGage.GetSize().y);
        this.dtGage.Visible       = setting;
        this.GradeExpBG.Visible   = setting;
        this.GradeExpGage.Visible = setting;
        this.GradeExpText.Visible = setting;
        this.lblGradeText.Visible = setting;
        float num2 = 0.8f;

        if (this.GetListBox() != null && 0 < this.GetListBox().Count)
        {
            this.GradeExpGage.SetSize(414f, this.GradeExpGage.height);
        }
        else
        {
            this.GradeExpGage.SetSize(414f * num2, this.GradeExpGage.height);
        }
        if (solInfo != null)
        {
            int  num3 = 2000;
            long num4 = solInfo.GetNextEvolutionExp() - solInfo.GetCurBaseEvolutionExp();
            long num5 = num4 - (long)num3;
            if (this.GetListBox() != null && 0 < this.GetListBox().Count)
            {
                num5 = num4;
            }
            string empty3 = string.Empty;
            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty3, new object[]
            {
                NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1871"),
                "exp",
                num5.ToString(),
                "maxexp",
                num4.ToString()
            });

            this.GradeExpText.SetText(empty3);
            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty3, new object[]
            {
                NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("3273"),
                "evolexp",
                num3.ToString()
            });

            this.lblGradeText.SetText(empty3);
        }
        this.GradeExpText.Visible = setting;
        this.lblGradeText.Visible = setting;
        this.btnOk.Visible        = (solInfo != null);
    }