コード例 #1
0
    public StoryChatPortrait GetCommunity_User(long _PersonID)
    {
        StoryChatPortrait result = null;

        foreach (StoryChatPortrait current in this.m_UserPortraitList)
        {
            if (current.m_i64PersonID == _PersonID)
            {
                result = current;
                break;
            }
        }
        return(result);
    }
コード例 #2
0
    private void refreshFriendPortrait()
    {
        this.m_UserPortraitList.Clear();
        foreach (USER_FRIEND_INFO uSER_FRIEND_INFO in NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.m_kFriendInfo.GetFriendInfoValues())
        {
            StoryChatPortrait storyChatPortrait = new StoryChatPortrait();
            storyChatPortrait.Set(uSER_FRIEND_INFO.nPersonID, false);
            this.m_UserPortraitList.Add(storyChatPortrait);
        }
        NrMyCharInfo myCharInfo = NrTSingleton <NkCharManager> .Instance.GetMyCharInfo();

        StoryChatPortrait storyChatPortrait2 = new StoryChatPortrait();

        storyChatPortrait2.Set(myCharInfo.m_PersonID, false);
        this.m_UserPortraitList.Add(storyChatPortrait2);
    }
コード例 #3
0
    public void UpdateUserCommunity(long _i64PersonID)
    {
        bool flag = false;

        for (int i = 0; i < this.m_UserPortraitList.Count; i++)
        {
            if (this.m_UserPortraitList[i].m_i64PersonID == _i64PersonID)
            {
                this.m_UserPortraitList[i].Set(_i64PersonID, true);
                flag = true;
            }
        }
        if (!flag)
        {
            StoryChatPortrait storyChatPortrait = new StoryChatPortrait();
            storyChatPortrait.Set(_i64PersonID, true);
            this.m_UserPortraitList.Add(storyChatPortrait);
        }
    }
コード例 #4
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);
        }
    }