Beispiel #1
0
    public void UpdateLikeNumText()
    {
        if (null == this.m_StoryChatList.SelectedItem)
        {
            return;
        }
        StoryChat_Info storyChat_Info = this.m_CurrentStoryChatInfo[this.m_StoryChatList.SelectedItem.GetIndex()];

        if (storyChat_Info == null)
        {
            return;
        }
        Label label = this.m_StoryChatList.SelectedItem.GetElement(10) as Label;

        if (null != label)
        {
            StoryChat_Info expr_5B = storyChat_Info;
            expr_5B.nLikeCount += 1;
            label.Text          = storyChat_Info.nLikeCount.ToString();
        }
        else
        {
            Label label2 = this.m_StoryChatList.SelectedItem.GetElement(7) as Label;
            if (null != label2)
            {
                StoryChat_Info expr_A3 = storyChat_Info;
                expr_A3.nLikeCount += 1;
                label2.Text         = storyChat_Info.nLikeCount.ToString();
            }
        }
    }
Beispiel #2
0
    public void UpdateCommentNumText(bool flag)
    {
        if (null == this.m_StoryChatList.SelectedItem)
        {
            return;
        }
        StoryChat_Info storyChat_Info = this.m_CurrentStoryChatInfo[this.m_StoryChatList.SelectedItem.GetIndex()];

        if (storyChat_Info == null)
        {
            return;
        }
        Label label = this.m_StoryChatList.SelectedItem.GetElement(9) as Label;

        if (null != label)
        {
            if (flag)
            {
                StoryChat_Info expr_61 = storyChat_Info;
                expr_61.nCommentCount += 1;
            }
            else
            {
                StoryChat_Info expr_75 = storyChat_Info;
                expr_75.nCommentCount -= 1;
            }
            label.Text = storyChat_Info.nCommentCount.ToString();
        }
        else
        {
            Label label2 = this.m_StoryChatList.SelectedItem.GetElement(6) as Label;
            if (null != label2)
            {
                if (flag)
                {
                    StoryChat_Info expr_C3 = storyChat_Info;
                    expr_C3.nCommentCount += 1;
                }
                else
                {
                    StoryChat_Info expr_D7 = storyChat_Info;
                    expr_D7.nCommentCount -= 1;
                }
                label2.Text = storyChat_Info.nCommentCount.ToString();
            }
        }
    }
Beispiel #3
0
    private void ClickStoryChatList(IUIObject obj)
    {
        if (obj == null)
        {
            return;
        }
        if (null == this.m_StoryChatList.SelectedItem)
        {
            return;
        }
        StoryChat_Info storyChat_Info = this.m_CurrentStoryChatInfo[this.m_StoryChatList.SelectedItem.GetIndex()];

        if (storyChat_Info != null)
        {
            StoryChatDetailDlg storyChatDetailDlg = NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.STORYCHATDETAIL_DLG) as StoryChatDetailDlg;

            if (storyChatDetailDlg != null)
            {
                storyChatDetailDlg.SetStoryChat(storyChat_Info, this.m_bBattleReplay);
            }
        }
    }
Beispiel #4
0
    public void UpdateUserPersonID(long i64PersonID)
    {
        for (int i = 0; i < this.m_StoryChatList.Count; i++)
        {
            UIListItemContainer item = this.m_StoryChatList.GetItem(i);
            if (!(item == null))
            {
                StoryChat_Info storyChat_Info = (StoryChat_Info)item.data;
                if (storyChat_Info != null)
                {
                    if (storyChat_Info.nPersonID == i64PersonID)
                    {
                        NewListItem newListItem            = new NewListItem(this.m_StoryChatList.ColumnNum, true, string.Empty);
                        Texture2D   friendPortraitPersonID = this.GetFriendPortraitPersonID(storyChat_Info.nPersonID);
                        if (friendPortraitPersonID != null)
                        {
                            newListItem.SetListItemData(1, friendPortraitPersonID, null, null, null, null);
                        }
                        else
                        {
                            EVENT_HERODATA eventHeroCharFriendCode = NrTSingleton <NrTableEvnetHeroManager> .Instance.GetEventHeroCharFriendCode(storyChat_Info.nCharKind);

                            if (eventHeroCharFriendCode != null)
                            {
                                newListItem.SetListItemData(0, "Win_I_EventSol", null, null, null);
                                newListItem.EventMark = true;
                            }
                            newListItem.SetListItemData(1, storyChat_Info.nCharKind, null, null, null);
                        }
                        string text = TKString.NEWString(storyChat_Info.szName);
                        if (0L < storyChat_Info.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") + storyChat_Info.nLevel.ToString(), null, null, null);
                        DateTime dueDate           = PublicMethod.GetDueDate(storyChat_Info.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(storyChat_Info.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, storyChat_Info.nCommentCount.ToString(), null, null, null);
                        newListItem.SetListItemData(10, storyChat_Info.nLikeCount.ToString(), null, null, null);
                        newListItem.SetListItemData(12, false);
                        NrCharBase @char = NrTSingleton <NkCharManager> .Instance.GetChar(1);

                        if (@char != null)
                        {
                            if (text == @char.GetCharName())
                            {
                                newListItem.SetListItemData(14, string.Empty, storyChat_Info.nStoryChatID, new EZValueChangedDelegate(this.DeleteStoryChat), null);
                            }
                            else
                            {
                                newListItem.SetListItemData(14, false);
                            }
                        }
                        this.m_StoryChatList.RemoveAdd(i, newListItem);
                    }
                }
            }
        }
        this.m_StoryChatList.RepositionItems();
    }
Beispiel #5
0
    public void SetStoryChat(StoryChat_Info info, bool battleReplay)
    {
        GS_STORYCOMMENT_GET_REQ gS_STORYCOMMENT_GET_REQ = new GS_STORYCOMMENT_GET_REQ();

        gS_STORYCOMMENT_GET_REQ.nStoryChatID    = info.nStoryChatID;
        gS_STORYCOMMENT_GET_REQ.nStoryCommentID = 0L;
        gS_STORYCOMMENT_GET_REQ.nLoadCount      = 10;
        SendPacket.GetInstance().SendObject(eGAME_PACKET_ID.GS_STORYCOMMENT_GET_REQ, gS_STORYCOMMENT_GET_REQ);
        this.m_CurrentStoryChat = info;
        string textFromInterface = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("322");

        string text  = string.Empty;
        string text2 = TKString.NEWString(info.szName);

        if (!battleReplay)
        {
            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
            {
                textFromInterface,
                "targetname",
                text2
            });
        }
        else if (info.nCharKind == 8)
        {
            text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1307");
        }
        else if (info.nCharKind == 6)
        {
            text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("436");
        }
        else if (info.nCharKind == 5)
        {
            text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("43");
        }
        this.m_Title.Text = text;
        this.m_DetailList.ChangeLineHeight = true;
        this.m_DetailList.LineHeight       = 160f;
        this.m_DetailList.Clear();
        NewListItem newListItem = new NewListItem(this.m_DetailList.ColumnNum, true, string.Empty);

        if (!battleReplay)
        {
            Texture2D texture2D = null;
            if (NrTSingleton <FormsManager> .Instance.IsForm(G_ID.STORYCHAT_DLG))
            {
                StoryChatDlg storyChatDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.STORYCHAT_DLG) as StoryChatDlg;

                if (storyChatDlg != null)
                {
                    texture2D = storyChatDlg.GetFriendPortraitPersonID(info.nPersonID);
                }
            }
            if (texture2D != null)
            {
                newListItem.SetListItemData(1, texture2D, null, null, null, null);
            }
            else
            {
                EVENT_HERODATA eventHeroCharFriendCode = NrTSingleton <NrTableEvnetHeroManager> .Instance.GetEventHeroCharFriendCode(info.nCharKind);

                if (eventHeroCharFriendCode != null)
                {
                    newListItem.SetListItemData(0, "Win_I_EventSol", null, null, null);
                    newListItem.EventMark = true;
                }
                newListItem.SetListItemData(1, new CostumeDrawTextureInfo
                {
                    charKind            = info.nCharKind,
                    grade               = -1,
                    costumePortraitPath = NrTSingleton <NrCharCostumeTableManager> .Instance.GetCostumePortraitPath(info.nFaceCharCostumeUnique)
                }, null, null, null);
            }
            newListItem.SetListItemData(3, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("152") + info.nLevel.ToString(), null, null, null);
            string text3 = TKString.NEWString(info.szMessage);
            text3 = text3.Replace("\n", "\r\n");
            newListItem.SetListItemData(6, text3, null, null, null);
            NrCharBase @char = NrTSingleton <NkCharManager> .Instance.GetChar(1);

            if (@char != null)
            {
                if (text2 == @char.GetCharName())
                {
                    this.m_bMyStoryChat = true;
                }
                else
                {
                    newListItem.SetListItemData(13, false);
                    this.m_bMyStoryChat = false;
                }
            }
        }
        else
        {
            char[] separator = new char[]
            {
                '/'
            };
            string[] array = TKString.NEWString(info.szMessage).Split(separator);
            if (info.nCharKind == 8)
            {
                newListItem.SetListItemData(1, NrTSingleton <UIImageInfoManager> .Instance.FindUIImageDictionary("Win_I_Challenge02"), null, null, null);
                string empty = string.Empty;
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1956"),
                    "targetname1",
                    array[1],
                    "targetname2",
                    array[2]
                });

                newListItem.SetListItemData(6, empty, null, null, null);
            }
            else if (info.nCharKind == 6)
            {
                newListItem.SetListItemData(1, NrTSingleton <UIImageInfoManager> .Instance.FindUIImageDictionary("Win_I_Challenge02"), null, null, null);
                string empty2 = string.Empty;
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty2, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1957"),
                    "targetname1",
                    array[1],
                    "targetname2",
                    array[2]
                });

                newListItem.SetListItemData(6, empty2, null, null, null);
            }
            else if (info.nCharKind == 5)
            {
                newListItem.SetListItemData(1, NrTSingleton <UIImageInfoManager> .Instance.FindUIImageDictionary("Win_I_Challenge02"), null, null, null);
                string empty3 = string.Empty;
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty3, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1957"),
                    "targetname1",
                    array[1],
                    "targetname2",
                    array[2]
                });

                newListItem.SetListItemData(6, empty3, null, null, null);
            }
            newListItem.SetListItemData(3, false);
            newListItem.SetListItemData(13, false);
            this.m_bMyStoryChat = false;
        }
        newListItem.SetListItemData(2, text2, null, null, null);
        DateTime dueDate = PublicMethod.GetDueDate(info.nTime);

        textFromInterface = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("301");

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

        newListItem.SetListItemData(4, text, null, null, null);
        newListItem.SetListItemData(9, info.nLikeCount.ToString(), null, null, null);
        newListItem.SetListItemData(10, info.nCommentCount.ToString(), null, null, null);
        newListItem.SetListItemData(11, string.Empty, info.nStoryChatID, new EZValueChangedDelegate(this.ClickLikeList), null);
        newListItem.SetListItemData(12, string.Empty, text2, new EZValueChangedDelegate(this.ClickUser), null);
        this.m_DetailList.Add(newListItem);
        this.m_DetailList.RepositionItems();
    }