Exemple #1
0
    public void SetSolderinfo()
    {
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null)
        {
            return;
        }
        for (int i = 0; i < 6; i++)
        {
            NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(i);
            if (!soldierInfo.IsValid())
            {
                base.SetShowLayer(i, false);
            }
            else
            {
                this.m_itSolPortrait[i].SetSolImageTexure(eCharImageType.SMALL, soldierInfo.GetCharKind(), (int)soldierInfo.GetGrade());
                this.m_pbSolHP[i].Value = (float)soldierInfo.GetHP() / (float)soldierInfo.GetMaxHP();
                this.SetToolTip(i, soldierInfo);
                this.m_pbSolHP[i].Visible = false;
                this.m_pbBG[i].Visible    = false;
            }
        }
    }
Exemple #2
0
    public void UpdateHP(int nSolIndex)
    {
        if (nSolIndex < 0 || nSolIndex >= 6)
        {
            return;
        }
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null)
        {
            return;
        }
        NkSoldierInfo soldierInfo = charPersonInfo.GetSoldierInfo(nSolIndex);

        if (soldierInfo != null && soldierInfo.IsValid())
        {
            this.m_pbSolHP[nSolIndex].Value = (float)soldierInfo.GetHP() / (float)soldierInfo.GetMaxHP();
            this.SetToolTip(nSolIndex, soldierInfo);
        }
    }
Exemple #3
0
    private void SetToolTip(int solposindex, NkSoldierInfo pkSolinfo)
    {
        if (pkSolinfo == null)
        {
            this.m_btSol[solposindex].ToolTip = null;
        }
        else
        {
            NrTSingleton <UIDataManager> .Instance.InitStringBuilder();

            string value = string.Empty;
            NrTSingleton <UIDataManager> .Instance.GetStringBuilder().Append(pkSolinfo.GetName());

            NrTSingleton <UIDataManager> .Instance.GetStringBuilder().AppendLine();

            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref value, new object[]
            {
                NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("167"),
                "count1",
                pkSolinfo.GetLevel().ToString(),
                "count2",
                pkSolinfo.GetSolMaxLevel().ToString()
            });

            NrTSingleton <UIDataManager> .Instance.GetStringBuilder().Append(value);

            NrTSingleton <UIDataManager> .Instance.GetStringBuilder().AppendLine();

            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref value, new object[]
            {
                NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1854"),
                "curhp",
                pkSolinfo.GetHP(),
                "maxhp",
                pkSolinfo.GetMaxHP()
            });

            NrTSingleton <UIDataManager> .Instance.GetStringBuilder().Append(value);

            NrTSingleton <UIDataManager> .Instance.GetStringBuilder().AppendLine();

            if (pkSolinfo.IsMaxLevel())
            {
                value = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("286");
            }
            else
            {
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref value, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1855"),
                    "curexp",
                    pkSolinfo.GetExp(),
                    "nextexp",
                    pkSolinfo.GetNextExp()
                });
            }
            NrTSingleton <UIDataManager> .Instance.GetStringBuilder().Append(value);

            this.m_btSol[solposindex].ToolTip = NrTSingleton <UIDataManager> .Instance.GetString();
        }
    }