Exemplo n.º 1
0
 public void SelectTab()
 {
     InfiBattleDefine.eINFIBATTLE_RANKMODE showType = this.m_ShowType;
     if (showType != InfiBattleDefine.eINFIBATTLE_RANKMODE.eINFIBATTLE_RANKMODE_LASTWEEK)
     {
         this.GetRank((byte)this.m_ShowType - 1, 1);
     }
     else
     {
         for (int i = 0; i < 3; i++)
         {
             if (i == 0)
             {
                 this.m_tgRank[i].SetToggleState(true);
             }
             else
             {
                 this.m_tgRank[i].SetToggleState(false);
             }
         }
         GS_INFIBATTLE_REWARDINFO_REQ gS_INFIBATTLE_REWARDINFO_REQ = new GS_INFIBATTLE_REWARDINFO_REQ();
         gS_INFIBATTLE_REWARDINFO_REQ.i64PersonID = this.m_pkMyCharInfo.m_PersonID;
         SendPacket.GetInstance().SendObject(2011, gS_INFIBATTLE_REWARDINFO_REQ);
         this.m_GetRankTime = PublicMethod.GetCurTime();
     }
 }
Exemplo n.º 2
0
    private void ClickTabControl(IUIObject obj)
    {
        Toggle toggle = obj as Toggle;

        if (null == toggle)
        {
            return;
        }
        if (!toggle.Value)
        {
            return;
        }
        long curTime = PublicMethod.GetCurTime();

        if (curTime > this.m_GetRankTime + 1L)
        {
            if (toggle.GetToggleState())
            {
                this.m_ShowType = (InfiBattleDefine.eINFIBATTLE_RANKMODE)((int)toggle.data);
                this.SelectTab();
            }
        }
        else
        {
            toggle.Value = false;
            Main_UI_SystemMessage.ADDMessage(NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("270"), SYSTEM_MESSAGE_TYPE.NAGATIVE_MESSAGE);
        }
    }
Exemplo n.º 3
0
    public void ShowRank(GS_INFIBATTLE_RANK_ACK ACK)
    {
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo != null)
        {
            charPersonInfo.InfiBattlePersonID = 0L;
            charPersonInfo.InfiBattleRank     = 0;
        }
        NrMyCharInfo myCharInfo = NrTSingleton <NkCharManager> .Instance.GetMyCharInfo();

        if (myCharInfo == null)
        {
            return;
        }
        this.m_eRankMode = (InfiBattleDefine.eINFIBATTLE_RANKMODE)ACK.ui8Type;
        this.m_nlbRankList.Clear();
        string text  = string.Empty;
        string text2 = string.Empty;

        for (int i = 0; i < this.m_RankInfoList.Count; i++)
        {
            NewListItem newListItem = new NewListItem(this.m_nlbRankList.ColumnNum, true, string.Empty);
            this.m_strCharName = TKString.NEWString(this.m_RankInfoList[i].strName);
            this.m_strLevel    = this.m_RankInfoList[i].i16Level.ToString();
            newListItem.SetListItemData(0, this.m_strCharName, null, null, null);
            newListItem.SetListItemData(1, this.m_strLevel, null, null, null);
            if (this.m_RankInfoList[i].i32Rank != 0)
            {
                text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("3202");

                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref this.m_strRank, new object[]
                {
                    text,
                    "rank",
                    this.m_RankInfoList[i].i32Rank
                });

                if (this.m_RankInfoList[i].i32Rank == 1)
                {
                    this.m_strRank = NrTSingleton <CTextParser> .Instance.GetTextColor("1403") + this.m_strRank;
                }
                else if (this.m_RankInfoList[i].i32Rank <= 10)
                {
                    this.m_strRank = NrTSingleton <CTextParser> .Instance.GetTextColor("1107") + this.m_strRank;
                }
                newListItem.SetListItemData(5, this.GetRankImg(this.m_RankInfoList[i].i32Rank), null, null, null);
            }
            else
            {
                this.m_strRank = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("48");
            }
            newListItem.SetListItemData(3, this.m_strRank, null, null, null);
            if (this.m_RankInfoList[i].i32BattleTotalCount > 0)
            {
                float num = (float)this.m_RankInfoList[i].i32BattleWinCount / (float)this.m_RankInfoList[i].i32BattleTotalCount;
                text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("672");

                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text2, new object[]
                {
                    text,
                    "Count",
                    (int)(num * 100f)
                });
            }
            else
            {
                text2 = string.Empty;
            }
            newListItem.SetListItemData(4, text2, null, null, null);
            newListItem.Data = this.m_RankInfoList[i].i64PersonID;
            this.m_nlbRankList.Add(newListItem);
        }
        this.m_nlbRankList.RepositionItems();
        if (ACK.ui8Type == 2)
        {
            int         index        = this.m_RankInfoList.Count;
            NewListItem newListItem2 = new NewListItem(this.m_nlbRankList.ColumnNum, true, string.Empty);
            if (charPersonInfo != null)
            {
                this.m_strCharName = charPersonInfo.GetCharName();
                this.m_strLevel    = myCharInfo.GetLevel().ToString();
                this.m_strRank     = myCharInfo.InfinityBattle_Rank.ToString();
                if (myCharInfo.InfinityBattle_Rank > 0)
                {
                    for (int i = 0; i < this.m_RankInfoList.Count; i++)
                    {
                        if (this.m_RankInfoList[i].i32Rank > myCharInfo.InfinityBattle_Rank)
                        {
                            index = i;
                            break;
                        }
                        if (this.m_RankInfoList[i].i32Rank == 0)
                        {
                            index = i;
                            break;
                        }
                        newListItem2.SetListItemData(5, this.GetRankImg(this.m_RankInfoList[i].i32Rank), null, null, null);
                    }
                }
                else
                {
                    this.m_strRank = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("48");

                    for (int i = 0; i < this.m_RankInfoList.Count; i++)
                    {
                        if (this.m_RankInfoList[i].i32Rank == myCharInfo.InfinityBattle_Rank)
                        {
                            index = i;
                            break;
                        }
                    }
                }
            }
            else
            {
                this.m_strCharName = string.Empty;
                this.m_strLevel    = "0";
                this.m_strRank     = "0";
            }
            newListItem2.SetListItemData(0, this.m_strCharName, null, null, null);
            newListItem2.SetListItemData(1, this.m_strLevel, null, null, null);
            newListItem2.SetListItemData(3, this.m_strRank, null, null, null);
            if (myCharInfo.InifBattle_TotalCount > 0)
            {
                float num = (float)myCharInfo.InifBattle_WinCount / (float)myCharInfo.InifBattle_TotalCount;
                text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("672");

                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text2, new object[]
                {
                    text,
                    "Count",
                    (int)(num * 100f)
                });
            }
            else
            {
                text2 = string.Empty;
            }
            newListItem2.SetListItemData(4, text2, null, null, null);
            newListItem2.Data = charPersonInfo.GetPersonID();
            this.m_nlbRankList.InsertAdd(index, newListItem2);
            this.m_nlbRankList.RepositionItems();
        }
        int num2 = 0;
        COMMON_CONSTANT_Manager instance = COMMON_CONSTANT_Manager.GetInstance();

        if (instance != null)
        {
            num2 = instance.GetValue(eCOMMON_CONSTANT.eCOMMON_CONSTANT_INFIBATTLE_RANKLIMIT);
        }
        if (num2 < myCharInfo.InfinityBattle_Rank || 0 >= myCharInfo.InfinityBattle_Rank)
        {
            text2 = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2225");
        }
        else
        {
            text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("3202");

            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text2, new object[]
            {
                text,
                "rank",
                myCharInfo.InfinityBattle_Rank
            });

            if (myCharInfo.InfinityBattle_Rank == 1)
            {
                text2 = NrTSingleton <CTextParser> .Instance.GetTextColor("1403") + text2;
            }
            else if (myCharInfo.InfinityBattle_Rank <= 10)
            {
                text2 = NrTSingleton <CTextParser> .Instance.GetTextColor("1107") + text2;
            }
        }
        this.m_DTMyRankIcon.SetTexture(this.GetRankImg(myCharInfo.InfinityBattle_Rank));
        this.m_lbMyRank.SetText(text2);
        if (charPersonInfo != null)
        {
            this.m_lbMyCharName.SetText(charPersonInfo.GetCharName());
        }
        this.m_iCurrentPage = ACK.i32StartRank / 10 + 1;
        this.m_iMaxPage     = ACK.i32MaxRankCount / 10 + 1;
        this.m_lbMyLevel.SetText(myCharInfo.GetLevel().ToString());
        this.m_lbMyWinnig.SetText(myCharInfo.InfiBattleStraightWin.ToString());
        text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1041");

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

        if (myCharInfo.InifBattle_TotalCount > 0)
        {
            float num = (float)myCharInfo.InifBattle_WinCount / (float)myCharInfo.InifBattle_TotalCount;
            text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("672");

            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text2, new object[]
            {
                text,
                "Count",
                (int)(num * 100f)
            });
        }
        else
        {
            text2 = string.Empty;
        }
        this.m_lbMyWinningStreak.SetText(text2);
        string text3 = "/ " + this.m_iMaxPage.ToString();

        this.m_lbPage.SetText(text3);
        this.m_btPageSet.SetText(this.m_iCurrentPage.ToString());
    }