Exemple #1
0
    private void _SetSolInfo()
    {
        COMMON_CONSTANT_Manager instance = COMMON_CONSTANT_Manager.GetInstance();

        if (instance == null)
        {
            return;
        }
        int value = instance.GetValue(eCOMMON_CONSTANT.eCOMMON_CONSTANT_EXPLORATION_EXP);
        int num   = 0;
        List <NkSoldierInfo> solInfo = NrTSingleton <ExplorationManager> .Instance.GetSolInfo();

        foreach (NkSoldierInfo current in solInfo)
        {
            if (NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindInfo(current.GetCharKind()) != null)
            {
                NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

                if (charPersonInfo == null)
                {
                    return;
                }
                NewListItem newListItem = new NewListItem(this.m_nlSolInfo.ColumnNum, true, string.Empty);
                string      text        = string.Empty;
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("471"),
                    "targetname",
                    current.GetName(),
                    "count",
                    current.GetLevel()
                });

                int num2 = 0;
                if (!current.IsMaxLevel())
                {
                    num2 = value * (int)current.GetLevel() * NrTSingleton <ExplorationManager> .Instance.GetExpCount();
                }
                string text2 = text;
                text = string.Concat(new string[]
                {
                    text2,
                    " ",
                    NrTSingleton <CTextParser> .Instance.GetTextColor("1107"),
                    "+",
                    num2.ToString()
                });
                newListItem.SetListItemData(1, current.GetListSolInfo(false), null, null, null);
                newListItem.SetListItemData(2, text, null, null, null);
                NkSoldierInfo soldierInfoFromSolID = charPersonInfo.GetSoldierInfoFromSolID(current.GetSolID());
                if (soldierInfoFromSolID != null)
                {
                    float  num3  = soldierInfoFromSolID.GetExpPercent();
                    string empty = string.Empty;
                    if (num3 < 0f)
                    {
                        num3 = 0f;
                    }
                    NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
                    {
                        NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("672"),
                        "Count",
                        ((int)(num3 * 100f)).ToString()
                    });

                    newListItem.SetListItemData(4, "Com_T_GauWaPr4", 400f * num3, null, null);
                    newListItem.SetListItemData(5, empty, null, null, null);
                }
                this.m_nlSolInfo.Add(newListItem);
                num++;
            }
        }
        this.m_nlSolInfo.RepositionItems();
    }
    private void _LinkSolData()
    {
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null)
        {
            return;
        }
        int num = 0;

        this.m_lbSolList.Clear();
        foreach (GS_BATTLE_RESULT_SOLDIER current in this.m_SolInfoList)
        {
            NewListItem    newListItem  = new NewListItem(this.m_lbSolList.ColumnNum, true, string.Empty);
            NrCharKindInfo charKindInfo = NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindInfo(current.CharKind);

            if (charKindInfo != null)
            {
                newListItem.SetListItemData(1, new NkListSolInfo
                {
                    SolCharKind            = current.CharKind,
                    SolGrade               = current.SolGrade,
                    SolInjuryStatus        = current.bInjury,
                    SolLevel               = current.i16Level,
                    ShowLevel              = true,
                    SolCostumePortraitPath = NrTSingleton <NrCharCostumeTableManager> .Instance.GetCostumePortraitPath(current.i32CostumeUnique)
                }, null, null, null);
                string text = string.Empty;
                text = charKindInfo.GetName();
                string text2 = string.Empty;
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text2, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("471"),
                    "targetname",
                    text,
                    "count",
                    current.i16Level
                });

                newListItem.SetListItemData(2, text2, null, null, null);
                NkSoldierInfo soldierInfoFromSolID = charPersonInfo.GetSoldierInfoFromSolID(current.SolID);
                short         num2 = 0;
                if (soldierInfoFromSolID != null)
                {
                    num2 = charKindInfo.GetGradeMaxLevel((short)soldierInfoFromSolID.GetGrade());
                    float  num3  = soldierInfoFromSolID.GetExpPercent();
                    string empty = string.Empty;
                    if (num3 < 0f)
                    {
                        num3 = 0f;
                    }
                    NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
                    {
                        NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("672"),
                        "Count",
                        ((int)(num3 * 100f)).ToString()
                    });

                    newListItem.SetListItemData(4, "Com_T_GauWaPr4", 400f * num3, null, null);
                    newListItem.SetListItemData(5, empty, null, null, null);
                }
                if (num2 == current.i16Level)
                {
                    newListItem.SetListItemData(6, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("286"), null, null, null);
                }
                else
                {
                    string empty2 = string.Empty;
                    NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty2, new object[]
                    {
                        NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1802"),
                        "exp",
                        ANNUALIZED.Convert(current.i32AddExp)
                    });

                    text2 += "\r\n";
                    text2 += empty2;
                    newListItem.SetListItemData(6, empty2, null, null, null);
                }
                this.m_lbSolList.Add(newListItem);
                num++;
            }
        }
        this.m_lbSolList.RepositionItems();
    }
    private void MakeSolListItem(ref NewListItem item, NkSoldierInfo pkSolinfo)
    {
        string text = string.Empty;

        if (pkSolinfo != null)
        {
            item.SetListItemData(1, pkSolinfo.GetListSolInfo(false), null, null, null);
            item.SetListItemData(2, pkSolinfo.GetName(), null, null, null);
            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
            {
                NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("167"),
                "count1",
                pkSolinfo.GetLevel().ToString(),
                "count2",
                pkSolinfo.GetSolMaxLevel().ToString()
            });

            item.SetListItemData(3, text, null, null, null);
            int num = pkSolinfo.GetEquipWeaponOrigin();
            if (num > 0)
            {
                item.SetListItemData(4, string.Format("Win_I_Weapon{0}", num.ToString()), null, null, null);
            }
            num = pkSolinfo.GetEquipWeaponExtention();
            if (num > 0)
            {
                item.SetListItemData(5, string.Format("Win_I_Weapon{0}", num.ToString()), null, null, null);
            }
            else
            {
                item.SetListItemData(5, false);
            }
            long  exp        = pkSolinfo.GetExp();
            long  curBaseExp = pkSolinfo.GetCurBaseExp();
            long  nextExp    = pkSolinfo.GetNextExp();
            long  num2       = exp - curBaseExp;
            long  num3       = nextExp - curBaseExp;
            float num4       = pkSolinfo.GetExpPercent();
            if (num4 < 0f)
            {
                num4 = 0f;
            }
            item.SetListItemData(6, "Win_T_ReputelPrgBG", null, null, null);
            item.SetListItemData(7, "Com_T_GauWaPr4", 250f * num4, null, null);
            item.SetListItemData(8, string.Empty, pkSolinfo.GetSolID(), new EZValueChangedDelegate(this.OnClickSoldierDelete), null);
            if (pkSolinfo.IsMaxLevel())
            {
                text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("286");
            }
            else
            {
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1871"),
                    "exp",
                    num2.ToString(),
                    "maxexp",
                    num3.ToString()
                });
            }
            item.SetListItemData(9, text, null, null, null);
            item.SetListItemData(10, false);
            item.Data = pkSolinfo.GetSolID();
        }
        else
        {
            for (int i = 0; i < this.m_kSolList.ColumnNum; i++)
            {
                item.SetListItemData(i, false);
            }
            item.SetListItemData(10, true);
            item.SetListItemData(10, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("859"), null, null, null);
            item.Data = 0L;
        }
    }