public void SetListItemData(int index, CostumeDrawTextureInfo costumeInfo, object data = null, EZValueChangedDelegate eventDelegate = null, EZValueChangedDelegate downDelegate = null)
 {
     if (0 <= index && this.m_nMaxCoulmnNum > index)
     {
         this.m_itemDataList[index].realData      = costumeInfo;
         this.m_itemDataList[index].data          = data;
         this.m_itemDataList[index].eventDelegate = eventDelegate;
         this.m_itemDataList[index].downDelegate  = downDelegate;
     }
 }
        private void SetCostumePortrait(NewListItem item, CharCostumeInfo_Data costumeData)
        {
            CostumeDrawTextureInfo costumeDrawTextureInfo = new CostumeDrawTextureInfo();

            costumeDrawTextureInfo.imageType = eCharImageType.MIDDLE;
            NrCharKindInfo charKindInfoFromCode = NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindInfoFromCode(costumeData.m_CharCode);

            if (charKindInfoFromCode != null)
            {
                costumeDrawTextureInfo.charKind = charKindInfoFromCode.GetCharKind();
            }
            costumeDrawTextureInfo.costumePortraitPath = costumeData.m_PortraitPath;
            item.SetListItemData(3, costumeDrawTextureInfo, costumeData, null, null);
        }
Esempio n. 3
0
    public void SetStoryChatList(int type, StoryChat_Info[] array)
    {
        this.m_nOldTabIndex = this.m_nCurrentTabInex;
        long guildID = NrTSingleton <NewGuildManager> .Instance.GetGuildID();

        this.m_StoryChatList.SetColumnData("Mobile/DLG/StoryChat/NLB_Talk_ColumnData" + NrTSingleton <UIDataManager> .Instance.AddFilePath);
        for (int i = 0; i < StoryChatDlg.MAX_STORYCHAT_LIST_NUM; i++)
        {
            this.m_CurrentStoryChatInfo[i].Init();
        }
        for (int j = 0; j < array.Length; j++)
        {
            this.m_CurrentStoryChatInfo[j] = array[j];
        }
        this.refreshFriendPortrait();
        if (array.Length != StoryChatDlg.MAX_STORYCHAT_LIST_NUM)
        {
            this.m_Next.controlIsEnabled = false;
        }
        else
        {
            this.m_Next.controlIsEnabled = true;
        }
        if (this.m_nCurrentPage == 1)
        {
            this.m_Prev.controlIsEnabled = false;
        }
        else
        {
            this.m_Prev.controlIsEnabled = true;
        }
        this.m_StoryChatList.Clear();
        NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

        if (charPersonInfo == null)
        {
            return;
        }
        string key      = charPersonInfo.GetCharName() + "LastFriendStoryChatID";
        string key2     = charPersonInfo.GetCharName() + "LastGuildStoryChatID";
        string charName = charPersonInfo.GetCharName();
        string s        = string.Empty;
        long   num      = 0L;

        if (type == 0)
        {
            string key3 = charName + "NewStoryChatID";
            if (PlayerPrefs.HasKey(key3))
            {
                s   = PlayerPrefs.GetString(key3);
                num = long.Parse(s);
            }
            string s2   = string.Empty;
            long   num2 = 0L;
            if (PlayerPrefs.HasKey(key))
            {
                s2   = PlayerPrefs.GetString(key);
                num2 = long.Parse(s2);
            }
            if (num2 < array[0].nLastCommentID)
            {
                PlayerPrefs.SetString(key, array[0].nLastCommentID.ToString());
            }
        }
        else if (type == 1)
        {
            string key4 = charName + NrTSingleton <NewGuildManager> .Instance.GetGuildName();

            if (PlayerPrefs.HasKey(key4))
            {
                s   = PlayerPrefs.GetString(key4);
                num = long.Parse(s);
            }
            string s3   = string.Empty;
            long   num3 = 0L;
            if (PlayerPrefs.HasKey(key2))
            {
                s3   = PlayerPrefs.GetString(key2);
                num3 = long.Parse(s3);
            }
            if (num3 < array[0].nLastCommentID)
            {
                if (guildID != 0L)
                {
                    PlayerPrefs.SetString(key2, array[0].nLastCommentID.ToString());
                }
                else
                {
                    PlayerPrefs.SetString(key2, "0");
                }
            }
        }
        for (int k = 0; k < array.Length; k++)
        {
            NewListItem       newListItem    = new NewListItem(this.m_StoryChatList.ColumnNum, true, string.Empty);
            StoryChatPortrait community_User = this.GetCommunity_User(array[k].nPersonID);
            if (community_User != null)
            {
                Texture2D friendPortraitPersonID = this.GetFriendPortraitPersonID(array[k].nPersonID);
                if (friendPortraitPersonID != null)
                {
                    newListItem.SetListItemData(1, friendPortraitPersonID, null, null, null, null);
                }
                else
                {
                    EVENT_HERODATA eventHeroCharFriendCode = NrTSingleton <NrTableEvnetHeroManager> .Instance.GetEventHeroCharFriendCode(array[k].nCharKind);

                    if (eventHeroCharFriendCode != null)
                    {
                        newListItem.SetListItemData(0, "Win_I_EventSol", null, null, null);
                        newListItem.EventMark = true;
                    }
                    newListItem.SetListItemData(1, new CostumeDrawTextureInfo
                    {
                        imageType           = eCharImageType.SMALL,
                        charKind            = array[k].nCharKind,
                        costumePortraitPath = NrTSingleton <NrCharCostumeTableManager> .Instance.GetCostumePortraitPath(array[k].nFaceCharCostumeUnique)
                    }, null, null, null);
                }
            }
            else
            {
                CostumeDrawTextureInfo costumeDrawTextureInfo = new CostumeDrawTextureInfo();
                costumeDrawTextureInfo.imageType           = eCharImageType.SMALL;
                costumeDrawTextureInfo.charKind            = array[k].nCharKind;
                costumeDrawTextureInfo.costumePortraitPath = NrTSingleton <NrCharCostumeTableManager> .Instance.GetCostumePortraitPath(array[k].nFaceCharCostumeUnique);

                newListItem.SetListItemData(1, costumeDrawTextureInfo, null, null, null);
                if (costumeDrawTextureInfo.costumePortraitPath == string.Empty)
                {
                    StoryChatPortrait storyChatPortrait = new StoryChatPortrait();
                    storyChatPortrait.Set(array[k].nPersonID, true);
                    this.m_UserPortraitList.Add(storyChatPortrait);
                }
            }
            string text = TKString.NEWString(array[k].szName);
            if (0L < array[k].nGuildID)
            {
                newListItem.SetListItemData(2, NrTSingleton <CTextParser> .Instance.GetTextColor("1105") + text, null, null, null);
            }
            else
            {
                newListItem.SetListItemData(2, text, null, null, null);
            }
            newListItem.SetListItemData(3, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("152") + array[k].nLevel.ToString(), null, null, null);
            DateTime dueDate           = PublicMethod.GetDueDate(array[k].nTime);
            string   textFromInterface = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("301");

            string empty = string.Empty;
            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
            {
                textFromInterface,
                "month",
                dueDate.Month,
                "day",
                dueDate.Day,
                "hour",
                dueDate.Hour,
                "min",
                dueDate.Minute
            });

            newListItem.SetListItemData(4, empty, null, null, null);
            string text2 = TKString.NEWString(array[k].szMessage);
            text2 = text2.Replace("\n", " ");
            if (89 < text2.Length)
            {
                text2  = text2.Substring(0, 89);
                text2 += "...";
            }
            newListItem.SetListItemData(6, text2, null, null, null);
            newListItem.SetListItemData(9, array[k].nCommentCount.ToString(), null, null, null);
            newListItem.SetListItemData(10, array[k].nLikeCount.ToString(), null, null, null);
            if (type == 0 || type == 1)
            {
                if (array[k].nStoryChatID > num)
                {
                    newListItem.SetListItemData(12, true);
                }
                else
                {
                    newListItem.SetListItemData(12, false);
                }
            }
            else
            {
                newListItem.SetListItemData(12, false);
            }
            NrCharBase @char = NrTSingleton <NkCharManager> .Instance.GetChar(1);

            if (@char != null)
            {
                if (text == @char.GetCharName())
                {
                    newListItem.SetListItemData(14, string.Empty, array[k].nStoryChatID, new EZValueChangedDelegate(this.DeleteStoryChat), null);
                }
                else
                {
                    newListItem.SetListItemData(14, false);
                }
            }
            this.m_StoryChatList.Add(newListItem);
        }
        this.m_StoryChatList.RepositionItems();
        this.m_Page.Text = this.m_nCurrentPage.ToString();
        if (type == 1 && guildID <= 0L)
        {
            this.InitStoryChatList(type);
        }
    }
Esempio n. 4
0
    private void SetStageList()
    {
        this.m_fScrollPos = this.m_nlbStage.scrollPos;
        this.m_fScrollPos = ((this.m_fScrollPos < 0f) ? 0f : this.m_fScrollPos);
        this.m_nlbStage.Clear();
        string empty = string.Empty;

        NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
        {
            NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("3424"),
            "count",
            (int)this.m_bSelectedFloor
        });

        this.m_lbTitle.SetText(empty);
        for (int i = 0; i < 2; i++)
        {
            string text = string.Empty;
            if (i == 0)
            {
                text = string.Format("Mobile/DLG/NewExploration/NLB_NewExploration_columndata{0}", NrTSingleton <UIDataManager> .Instance.AddFilePath);
            }
            else
            {
                text = string.Format("Mobile/DLG/NewExploration/NLB_NewExploration2_columndata{0}", NrTSingleton <UIDataManager> .Instance.AddFilePath);
            }
            this.m_nlbStage.SetColumnData(text);
            NewListItem newListItem = new NewListItem(this.m_nlbStage.ColumnNum, true, string.Empty);
            newListItem.m_szColumnData = text;
            newListItem.SetListItemData(0, string.Format("ui/NewExploration/NewExploration_{0}_{1}", (int)this.m_bSelectedFloor, i + 1), true, null, null);
            int num = 0;
            for (int j = 0; j < 5; j++)
            {
                int num2 = j * 9 + 1;
                int num3 = j + i * 5 + 1;
                newListItem.SetListItemData(num2, string.Empty, (sbyte)num3, new EZValueChangedDelegate(this.OnClickStageList), null);
                newListItem.SetListItemData(num2 + 3, string.Format("{0}-{1}", this.m_bSelectedFloor, num3), null, null, null);
                if (num3 != 10)
                {
                    NEWEXPLORATION_DATA data = NrTSingleton <NewExplorationManager> .Instance.GetData(this.m_bSelectedFloor, (sbyte)num3);

                    if (data != null)
                    {
                        NrCharKindInfo charKindInfo = NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindInfo(data.i32BossCharKind);

                        if (charKindInfo == null)
                        {
                            break;
                        }
                        CostumeDrawTextureInfo costumeDrawTextureInfo = new CostumeDrawTextureInfo();
                        costumeDrawTextureInfo.imageType = eCharImageType.SMALL;
                        costumeDrawTextureInfo.charKind  = charKindInfo.GetCharKind();
                        newListItem.SetListItemData(num2 + 4, costumeDrawTextureInfo, null, null, null);
                    }
                }
                else
                {
                    num2--;
                }
                bool visibe = NrTSingleton <NewExplorationManager> .Instance.IsClear(this.m_bSelectedFloor, (sbyte)num3);

                newListItem.SetListItemData(num2 + 5, visibe);
                newListItem.SetListItemData(num2 + 6, visibe);
                bool flag = (int)this.m_bSelectedFloor == (int)NrTSingleton <NewExplorationManager> .Instance.GetFloor() && (int)((sbyte)num3) == (int)NrTSingleton <NewExplorationManager> .Instance.GetSubFloor();

                newListItem.SetListItemData(num2 + 7, flag);
                newListItem.SetListItemData(num2 + 8, flag);
                if (flag)
                {
                    NrPersonInfoUser charPersonInfo = NrTSingleton <NkCharManager> .Instance.GetCharPersonInfo(1);

                    if (charPersonInfo != null && charPersonInfo.GetLeaderSoldierInfo().IsValid())
                    {
                        NrCharKindInfo charKindInfo2 = charPersonInfo.GetLeaderSoldierInfo().GetCharKindInfo();
                        if (charKindInfo2 != null)
                        {
                            CostumeDrawTextureInfo costumeDrawTextureInfo2 = new CostumeDrawTextureInfo();
                            costumeDrawTextureInfo2.imageType = eCharImageType.SMALL;
                            costumeDrawTextureInfo2.charKind  = charKindInfo2.GetCharKind();
                            newListItem.SetListItemData(num2 + 8, costumeDrawTextureInfo2, null, null, null);
                        }
                    }
                }
                num = num2 + 8;
            }
            num++;
            int num4 = (i != 0) ? 3 : 2;
            for (int k = 0; k < num4; k++)
            {
                int num5 = (k + 1) * 2;
                if (i != 0)
                {
                    num5 += 4;
                }
                bool flag2 = NrTSingleton <NewExplorationManager> .Instance.IsOpenTreasureBox(this.m_bSelectedFloor, (sbyte)num5);

                newListItem.SetListItemData(num, !flag2);
                newListItem.SetListItemData(num, string.Empty, (sbyte)num5, new EZValueChangedDelegate(this.OnClickTreasureList), null);
                newListItem.SetListItemData(num + 1, flag2);
                newListItem.SetListItemData(num + 1, string.Empty, (sbyte)num5, new EZValueChangedDelegate(this.OnClickTreasureList), null);
                newListItem.SetListItemData(num + 4, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("3425"), null, null, null);
                newListItem.SetListItemData(num + 5, NrTSingleton <NewExplorationManager> .Instance.CanGetTreasure(this.m_bSelectedFloor, (sbyte)num5));
                num += 6;
            }
            this.m_nlbStage.Add(newListItem);
        }
        this.m_nlbStage.RepositionItems();
        this.m_nlbStage.ScrollPosition = this.m_fScrollPos;
    }