Ejemplo n.º 1
0
    public void ShowList()
    {
        this.m_bLoadComplete = false;
        this.m_kFloorInfo.Clear();
        this.m_lbFloor.Clear();
        bool  flag = true;
        short num;

        if (this.m_nFloorType == 2)
        {
            TsAudioManager.Instance.AudioContainer.RequestAudioClip("BGM", "CHAOSTOWER", "HARDMODE", new PostProcPerItem(NrAudioClipDownloaded.OnEventAudioClipDownloadedImmedatePlay), string.Empty, true);
            TsAudioManager.Instance.AudioContainer.RequestAudioClip("AMB", "CHAOSTOWER", "HARDMODE", new PostProcPerItem(NrAudioClipDownloaded.OnEventAudioClipDownloadedImmedatePlay), string.Empty, true);
            num = (short)PlayerPrefs.GetInt(NrPrefsKey.LASTPLAY_BABELFLOOR_HARD, 1);
            this.m_laTitle.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2782"));
            NrTSingleton <FormsManager> .Instance.AttachEffectKey("FX_BABEL_MAIN_HARD", this.m_dtEffect, this.m_dtEffect.GetSize());
        }
        else
        {
            TsAudioManager.Instance.AudioContainer.RequestAudioClip("BGM", "CHAOSTOWER", "START", new PostProcPerItem(NrAudioClipDownloaded.OnEventAudioClipDownloadedImmedatePlay), string.Empty, true);
            num = (short)PlayerPrefs.GetInt(NrPrefsKey.LASTPLAY_BABELFLOOR, 1);
            this.m_laTitle.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1377"));
            NrTSingleton <FormsManager> .Instance.AttachEffectKey("FX_BABEL_MAIN", this.m_dtEffect, this.m_dtEffect.GetSize());
        }
        short num2 = NrTSingleton <BabelTowerManager> .Instance.GetLastFloor(this.m_nFloorType);

        int babelTowerLastFloor = NrTSingleton <ContentsLimitManager> .Instance.GetBabelTowerLastFloor(this.m_nFloorType);

        if (0 < babelTowerLastFloor && babelTowerLastFloor < (int)num2)
        {
            num2 = (short)babelTowerLastFloor;
        }
        NrMyCharInfo myCharInfo = NrTSingleton <NkCharManager> .Instance.GetMyCharInfo();

        COMMON_CONSTANT_Manager instance = COMMON_CONSTANT_Manager.GetInstance();
        int num3 = 0;

        if (instance != null)
        {
            num3 = instance.GetValue(eCOMMON_CONSTANT.eCOMMON_CONSTANT_BABEL_REPEAT);
        }
        if (myCharInfo.GetLevel() < num3)
        {
            this.m_dtLock.Visible = true;
        }
        else
        {
            this.m_dtLock.Visible = false;
        }
        short        num4        = num2 / 5;
        string       text        = string.Empty;
        string       text2       = string.Empty;
        string       text3       = string.Empty;
        NrMyCharInfo kMyCharInfo = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo;

        for (short num5 = num4; num5 > 0; num5 -= 1)
        {
            string text4 = string.Empty;
            if (flag)
            {
                text4 = string.Format("Mobile/DLG/BabelTower/newlistbox_floor_columndata{0}", NrTSingleton <UIDataManager> .Instance.AddFilePath);
            }
            else
            {
                text4 = string.Format("Mobile/DLG/BabelTower/newlistbox_floor1_columndata{0}", NrTSingleton <UIDataManager> .Instance.AddFilePath);
            }
            this.m_lbFloor.SetColumnData(text4);
            NewListItem newListItem = new NewListItem(this.m_lbFloor.ColumnNum, true, string.Empty);
            newListItem.m_szColumnData = text4;
            if (!flag)
            {
                if (this.m_nFloorType == 2)
                {
                    newListItem.SetListItemData(0, "UI/BabelTower/babel_hard_main1", true, null, null);
                }
                else
                {
                    newListItem.SetListItemData(0, "UI/BabelTower/babel_main1", true, null, null);
                }
            }
            else if (this.m_nFloorType == 2)
            {
                newListItem.SetListItemData(0, "UI/BabelTower/babel_hard_main2", true, null, null);
            }
            else
            {
                newListItem.SetListItemData(0, "UI/BabelTower/babel_main2", true, null, null);
            }
            for (int i = 4; i >= 0; i--)
            {
                List <FRIEND_BABEL_CLEARINFO> babelFloor_FriendList = kMyCharInfo.m_kFriendInfo.GetBabelFloor_FriendList(num2, this.m_nFloorType);
                if (babelFloor_FriendList != null)
                {
                    for (int j = 0; j < 3; j++)
                    {
                        if (babelFloor_FriendList.Count >= j + 1)
                        {
                            USER_FRIEND_INFO friend = kMyCharInfo.m_kFriendInfo.GetFriend(babelFloor_FriendList[j].i64FriendPersonID);
                            if (friend != null)
                            {
                                Texture2D friendTexture = kMyCharInfo.GetFriendTexture(babelFloor_FriendList[j].i64FriendPersonID);
                                if (friendTexture == null)
                                {
                                    NkListSolInfo nkListSolInfo = new NkListSolInfo();
                                    nkListSolInfo.SolCharKind            = friend.i32FaceCharKind;
                                    nkListSolInfo.SolGrade               = -1;
                                    nkListSolInfo.SolLevel               = friend.i16Level;
                                    nkListSolInfo.SolCostumePortraitPath = NrTSingleton <NrCharCostumeTableManager> .Instance.GetCostumePortraitPath(friend.i32FaceCharCostumeUnique);

                                    newListItem.SetListItemData(i * 6 + 7 + j * 2, nkListSolInfo, num2, new EZValueChangedDelegate(this.BtClickFloorFriendList), null);
                                }
                                else
                                {
                                    newListItem.SetListItemData(i * 6 + 7 + j * 2, friendTexture, num2, null, new EZValueChangedDelegate(this.BtClickFloorFriendList), null);
                                }
                                newListItem.SetListItemData(i * 6 + 6 + j * 2, !flag);
                                newListItem.SetListItemData(i * 6 + 7 + j * 2, !flag);
                            }
                        }
                        else
                        {
                            newListItem.SetListItemData(i * 6 + 6 + j * 2, false);
                            newListItem.SetListItemData(i * 6 + 7 + j * 2, false);
                        }
                    }
                }
                else
                {
                    newListItem.SetListItemData(i * 6 + 6, false);
                    newListItem.SetListItemData(i * 6 + 6 + 2, false);
                    newListItem.SetListItemData(i * 6 + 6 + 4, false);
                    newListItem.SetListItemData(i * 6 + 7, false);
                    newListItem.SetListItemData(i * 6 + 7 + 2, false);
                    newListItem.SetListItemData(i * 6 + 7 + 4, false);
                }
                newListItem.SetListItemData(i + 36, false);
                newListItem.SetListItemData(i + 41, false);
                newListItem.SetListItemData(i + 5 + 41, false);
                if (num2 / 100 >= 1)
                {
                    short num6 = num2 / 100;
                    short num7 = num2 / 10 % 10;
                    short num8 = num2 % 10;
                    text  = "Win_Number_" + num6;
                    text2 = "Win_Number_" + num7;
                    text3 = "Win_Number_" + num8;
                    newListItem.SetListItemData(i + 6 + 41, true);
                    newListItem.SetListItemData(i + 6 + 41, text, null, null, null);
                    newListItem.SetListItemData(i + 41, true);
                    newListItem.SetListItemData(i + 41, text2, null, null, null);
                    newListItem.SetListItemData(i + 5 + 41, true);
                    newListItem.SetListItemData(i + 5 + 41, text3, null, null, null);
                }
                else if (num2 / 10 <= 0 && num2 % 10 > 0)
                {
                    text = "Win_Number_" + num2;
                    newListItem.SetListItemData(i + 36, true);
                    newListItem.SetListItemData(i + 36, text, null, null, null);
                }
                else
                {
                    short num9  = num2 / 10;
                    short num10 = num2 % 10;
                    text  = "Win_Number_" + num9;
                    text2 = "Win_Number_" + num10;
                    newListItem.SetListItemData(i + 41, true);
                    newListItem.SetListItemData(i + 41, text, null, null, null);
                    newListItem.SetListItemData(i + 5 + 41, true);
                    newListItem.SetListItemData(i + 5 + 41, text2, null, null, null);
                }
                byte             babelFloorRankInfo = kMyCharInfo.GetBabelFloorRankInfo(num2, this.m_nFloorType);
                bool             treasure           = kMyCharInfo.IsBabelTreasure(num2, this.m_nFloorType);
                UIBaseInfoLoader loader             = NrTSingleton <UIImageInfoManager> .Instance.FindUIImageDictionary(NrTSingleton <BabelTowerManager> .Instance.GetBabelRankImgText(babelFloorRankInfo, treasure));

                newListItem.SetListItemData(i + 1, loader, num2, new EZValueChangedDelegate(this.BtClickFloor), null);
                if (num2 == num)
                {
                    this.m_nSelectindex = num4 - num5;
                }
                num2 -= 1;
            }
            newListItem.Data = (int)(num5 - 1);
            flag             = !flag;
            this.m_lbFloor.Add(newListItem);
            this.m_kFloorInfo.Add((int)num5);
        }
        this.m_lbFloor.RepositionItems();
        if (!this.m_lbFloor.ReUse)
        {
            this.m_lbFloor.SetSelectedItem((int)this.m_nSelectindex);
        }
    }
Ejemplo n.º 2
0
    public NewListItem MakeFloorInfo(short floor)
    {
        short        num         = floor * 5;
        string       text        = string.Empty;
        string       text2       = string.Empty;
        string       text3       = string.Empty;
        NrMyCharInfo kMyCharInfo = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo;
        string       text4       = string.Empty;
        bool         flag        = false;

        if (floor % 2 == 0)
        {
            flag = true;
        }
        if (flag)
        {
            text4 = string.Format("Mobile/DLG/BabelTower/newlistbox_floor_columndata{0}", NrTSingleton <UIDataManager> .Instance.AddFilePath);
        }
        else
        {
            text4 = string.Format("Mobile/DLG/BabelTower/newlistbox_floor1_columndata{0}", NrTSingleton <UIDataManager> .Instance.AddFilePath);
        }
        this.m_lbFloor.SetColumnData(text4);
        NewListItem newListItem = new NewListItem(this.m_lbFloor.ColumnNum, true, string.Empty);

        newListItem.m_szColumnData = text4;
        if (!flag)
        {
            if (this.m_nFloorType == 2)
            {
                newListItem.SetListItemData(0, "UI/BabelTower/babel_hard_main1", true, null, null);
            }
            else
            {
                newListItem.SetListItemData(0, "UI/BabelTower/babel_main1", true, null, null);
            }
        }
        else if (this.m_nFloorType == 2)
        {
            newListItem.SetListItemData(0, "UI/BabelTower/babel_hard_main2", true, null, null);
        }
        else
        {
            newListItem.SetListItemData(0, "UI/BabelTower/babel_main2", true, null, null);
        }
        for (int i = 4; i >= 0; i--)
        {
            newListItem.SetListItemData(i * 6 + 6, false);
            newListItem.SetListItemData(i * 6 + 6 + 2, false);
            newListItem.SetListItemData(i * 6 + 6 + 4, false);
            newListItem.SetListItemData(i * 6 + 7, false);
            newListItem.SetListItemData(i * 6 + 7 + 2, false);
            newListItem.SetListItemData(i * 6 + 7 + 4, false);
            List <FRIEND_BABEL_CLEARINFO> babelFloor_FriendList = kMyCharInfo.m_kFriendInfo.GetBabelFloor_FriendList(num, this.m_nFloorType);
            if (babelFloor_FriendList != null)
            {
                for (int j = 0; j < 3; j++)
                {
                    if (babelFloor_FriendList.Count >= j + 1)
                    {
                        USER_FRIEND_INFO friend = kMyCharInfo.m_kFriendInfo.GetFriend(babelFloor_FriendList[j].i64FriendPersonID);
                        if (friend != null)
                        {
                            Texture2D friendTexture = kMyCharInfo.GetFriendTexture(babelFloor_FriendList[j].i64FriendPersonID);
                            if (friendTexture == null)
                            {
                                NkListSolInfo nkListSolInfo = new NkListSolInfo();
                                nkListSolInfo.SolCharKind            = friend.i32FaceCharKind;
                                nkListSolInfo.SolGrade               = -1;
                                nkListSolInfo.SolLevel               = friend.i16Level;
                                nkListSolInfo.SolCostumePortraitPath = NrTSingleton <NrCharCostumeTableManager> .Instance.GetCostumePortraitPath(friend.i32FaceCharCostumeUnique);

                                newListItem.SetListItemData(i * 6 + 7 + j * 2, nkListSolInfo, num, new EZValueChangedDelegate(this.BtClickFloorFriendList), null);
                            }
                            else
                            {
                                newListItem.SetListItemData(i * 6 + 7 + j * 2, friendTexture, num, null, new EZValueChangedDelegate(this.BtClickFloorFriendList), null);
                            }
                            newListItem.SetListItemData(i * 6 + 6 + j * 2, !flag);
                            newListItem.SetListItemData(i * 6 + 7 + j * 2, !flag);
                        }
                    }
                    else
                    {
                        newListItem.SetListItemData(i * 6 + 6 + j * 2, false);
                        newListItem.SetListItemData(i * 6 + 7 + j * 2, false);
                    }
                }
            }
            else
            {
                newListItem.SetListItemData(i * 6 + 6, false);
                newListItem.SetListItemData(i * 6 + 6 + 2, false);
                newListItem.SetListItemData(i * 6 + 6 + 4, false);
                newListItem.SetListItemData(i * 6 + 7, false);
                newListItem.SetListItemData(i * 6 + 7 + 2, false);
                newListItem.SetListItemData(i * 6 + 7 + 4, false);
            }
            newListItem.SetListItemData(i + 36, false);
            newListItem.SetListItemData(i + 41, false);
            newListItem.SetListItemData(i + 5 + 41, false);
            if (num / 100 >= 1)
            {
                short num2 = num / 100;
                short num3 = num / 10 % 10;
                short num4 = num % 10;
                text  = "Win_Number_" + num2;
                text2 = "Win_Number_" + num3;
                text3 = "Win_Number_" + num4;
                newListItem.SetListItemData(i + 6 + 41, true);
                newListItem.SetListItemData(i + 6 + 41, text, null, null, null);
                newListItem.SetListItemData(i + 41, true);
                newListItem.SetListItemData(i + 41, text2, null, null, null);
                newListItem.SetListItemData(i + 5 + 41, true);
                newListItem.SetListItemData(i + 5 + 41, text3, null, null, null);
            }
            else if (num / 10 <= 0 && num % 10 > 0)
            {
                text = "Win_Number_" + num;
                newListItem.SetListItemData(i + 36, true);
                newListItem.SetListItemData(i + 36, text, null, null, null);
                newListItem.SetListItemData(i + 6 + 41, false);
            }
            else
            {
                short num5 = num / 10;
                short num6 = num % 10;
                text  = "Win_Number_" + num5;
                text2 = "Win_Number_" + num6;
                newListItem.SetListItemData(i + 41, true);
                newListItem.SetListItemData(i + 41, text, null, null, null);
                newListItem.SetListItemData(i + 5 + 41, true);
                newListItem.SetListItemData(i + 5 + 41, text2, null, null, null);
                if (num6 == 0)
                {
                    newListItem.SetListItemData(i + 6 + 41, false);
                }
            }
            if (num >= 9)
            {
                newListItem.SetListItemData(50, true);
            }
            byte             babelFloorRankInfo = kMyCharInfo.GetBabelFloorRankInfo(num, this.m_nFloorType);
            bool             treasure           = kMyCharInfo.IsBabelTreasure(num, this.m_nFloorType);
            UIBaseInfoLoader loader             = NrTSingleton <UIImageInfoManager> .Instance.FindUIImageDictionary(NrTSingleton <BabelTowerManager> .Instance.GetBabelRankImgText(babelFloorRankInfo, treasure));

            newListItem.SetListItemData(i + 1, loader, num, new EZValueChangedDelegate(this.BtClickFloor), null);
            num -= 1;
        }
        return(newListItem);
    }