public void UpdateSolInfo(NkSoldierInfo info)
 {
     foreach (NkSoldierInfo current in this.m_kSolInfo)
     {
         if (current.GetSolID() == info.GetSolID())
         {
             current.m_kBase.Level = info.GetLevel();
             current.m_kBase.Exp   = info.GetExp();
             break;
         }
     }
 }
 private int CompareExpDESC(NkSoldierInfo a, NkSoldierInfo b)
 {
     return(b.GetExp().CompareTo(a.GetExp()));
 }
    public NewListItem UpdateSolList(NkSoldierInfo kSolInfo)
    {
        if (!kSolInfo.IsValid())
        {
            return(null);
        }
        if (this.m_eShowType != SOLCOMPOSE_TYPE.MYTHEVOLUTION)
        {
            if (SolComposeMainDlg.Instance == null)
            {
                return(null);
            }
            if (SolComposeMainDlg.Instance.ContainBaseSoldier(kSolInfo.GetSolID()))
            {
                return(null);
            }
        }
        string      text        = string.Empty;
        NewListItem newListItem = new NewListItem(this.ComposeNewListBox.ColumnNum, true, string.Empty);

        if (newListItem == null)
        {
            return(null);
        }
        EVENT_HERODATA eventHeroCharCode = NrTSingleton <NrTableEvnetHeroManager> .Instance.GetEventHeroCharCode(kSolInfo.GetCharKind(), kSolInfo.GetGrade());

        if (eventHeroCharCode != null)
        {
            newListItem.EventMark = true;
            newListItem.SetListItemData(3, "Win_I_EventSol", null, null, null);
        }
        else
        {
            UIBaseInfoLoader legendFrame = NrTSingleton <NrCharKindInfoManager> .Instance.GetLegendFrame(kSolInfo.GetCharKind(), (int)kSolInfo.GetGrade());

            if (legendFrame != null)
            {
                newListItem.SetListItemData(3, legendFrame, null, null, null);
            }
            else
            {
                newListItem.SetListItemData(3, "Win_T_ItemEmpty", null, null, null);
            }
        }
        newListItem.SetListItemData(4, kSolInfo.GetListSolInfo(false), null, null, null);
        string legendName = NrTSingleton <NrCharKindInfoManager> .Instance.GetLegendName(kSolInfo.GetCharKind(), (int)kSolInfo.GetGrade(), kSolInfo.GetName());

        newListItem.SetListItemData(5, legendName, null, null, null);
        long  num  = kSolInfo.GetExp() - kSolInfo.GetCurBaseExp();
        long  num2 = kSolInfo.GetNextExp() - kSolInfo.GetCurBaseExp();
        float num3 = 1f;

        if (!kSolInfo.IsMaxLevel())
        {
            num3 = ((float)num2 - (float)kSolInfo.GetRemainExp()) / (float)num2;
            if (num3 > 1f)
            {
                num3 = 1f;
            }
            if (0f > num3)
            {
                num3 = 0f;
            }
        }
        NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
        {
            NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("167"),
            "count1",
            kSolInfo.GetLevel().ToString(),
            "count2",
            kSolInfo.GetSolMaxLevel().ToString()
        });

        newListItem.SetListItemData(6, text, null, null, null);
        newListItem.SetListItemData(0, "Win_T_ReputelPrgBG", null, null, null);
        newListItem.SetListItemData(1, "Com_T_GauWaPr4", 270f * num3, null, null);
        if (kSolInfo.IsMaxLevel())
        {
            text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("286");
        }
        else
        {
            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
            {
                NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1871"),
                "exp",
                num.ToString(),
                "maxexp",
                num2.ToString()
            });
        }
        newListItem.SetListItemData(2, text, null, null, null);
        newListItem.SetListItemData(7, false);
        if (!this.m_bMainSelect)
        {
            foreach (long current in this.mCheckList)
            {
                if (kSolInfo.GetSolID() == current)
                {
                    newListItem.SetListItemData(7, true);
                    newListItem.SetListItemData(7, "Com_I_Check", null, null, null);
                    break;
                }
            }
        }
        if (!kSolInfo.IsAwakening())
        {
            newListItem.SetListItemData(8, false);
        }
        if (NrTSingleton <FormsManager> .Instance.GetForm(G_ID.SOLCOMPOSE_MAIN_CHALLENGEQUEST_DLG) == null)
        {
            newListItem.SetListItemData(9, string.Empty, null, new EZValueChangedDelegate(this.ClickSolDetailInfo), null);
        }
        else
        {
            newListItem.SetListItemData(9, false);
        }
        if (kSolInfo.IsAtbCommonFlag(1L))
        {
            newListItem.SetListItemData(10, true);
        }
        else
        {
            newListItem.SetListItemData(10, false);
        }
        newListItem.Data = kSolInfo;
        return(newListItem);
    }
Exemple #4
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();
        }
    }
Exemple #5
0
    protected void SetSolListInfo(NkSoldierInfo pkSolinfo)
    {
        long  num  = pkSolinfo.GetExp() - pkSolinfo.GetCurBaseExp();
        long  num2 = pkSolinfo.GetNextExp() - pkSolinfo.GetCurBaseExp();
        float num3 = ((float)num2 - (float)pkSolinfo.GetRemainExp()) / (float)num2;

        if (num3 > 1f)
        {
            num3 = 1f;
        }
        if (0f > num3)
        {
            num3 = 0f;
        }
        if (pkSolinfo.IsMaxLevel())
        {
            num3 = 1f;
        }
        string         text              = string.Empty;
        NewListItem    newListItem       = new NewListItem(this.SoldierList.ColumnNum, true, string.Empty);
        EVENT_HERODATA eventHeroCharCode = NrTSingleton <NrTableEvnetHeroManager> .Instance.GetEventHeroCharCode(pkSolinfo.GetCharKind(), pkSolinfo.GetGrade());

        newListItem.SetListItemData(9, false);
        if (eventHeroCharCode != null)
        {
            newListItem.SetListItemData(0, "Win_I_EventSol", null, null, null);
            newListItem.SetListItemData(9, true);
        }
        else
        {
            UIBaseInfoLoader legendFrame = NrTSingleton <NrCharKindInfoManager> .Instance.GetLegendFrame(pkSolinfo.GetCharKind(), (int)pkSolinfo.GetGrade());

            if (legendFrame != null)
            {
                newListItem.SetListItemData(0, legendFrame, null, null, null);
            }
        }
        newListItem.SetListItemData(1, pkSolinfo.GetListSolInfo(false), null, null, null);
        string legendName = NrTSingleton <NrCharKindInfoManager> .Instance.GetLegendName(pkSolinfo.GetCharKind(), (int)pkSolinfo.GetGrade(), pkSolinfo.GetName());

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

        newListItem.SetListItemData(3, text, null, null, null);
        int num4 = pkSolinfo.GetEquipWeaponOrigin();

        if (num4 > 0)
        {
            newListItem.SetListItemData(4, "Win_I_Weapon" + num4.ToString(), null, null, null);
        }
        num4 = pkSolinfo.GetEquipWeaponExtention();
        if (num4 > 0)
        {
            newListItem.SetListItemData(4, "Win_I_Weapon" + num4.ToString(), null, null, null);
        }
        if (pkSolinfo.IsAwakening())
        {
            newListItem.SetListItemData(5, "Win_I_DarkAlchemy", null, null, null);
        }
        else
        {
            newListItem.SetListItemData(5, false);
        }
        newListItem.SetListItemData(7, NrTSingleton <UIImageInfoManager> .Instance.FindUIImageDictionary("Com_T_GauWaPr4"), 250f * num3, null, 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",
                num.ToString(),
                "maxexp",
                num2.ToString()
            });
        }
        newListItem.SetListItemData(8, text, null, null, null);
        newListItem.Data = pkSolinfo;
        this.SoldierList.Add(newListItem);
    }
    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;
        }
    }