Esempio n. 1
0
    public void UpdateCommentNumText(bool flag)
    {
        if (flag)
        {
            this.m_nCommentCount++;
        }
        else
        {
            int count = this.m_DetailList.Count;
            for (int i = 1; i < count; i++)
            {
                this.m_DetailList.RemoveItem(1, true);
            }
            this.m_DetailList.RepositionItems();
            this.m_nCommentCount--;
            GS_STORYCOMMENT_GET_REQ gS_STORYCOMMENT_GET_REQ = new GS_STORYCOMMENT_GET_REQ();
            gS_STORYCOMMENT_GET_REQ.nStoryChatID    = this.m_CurrentStoryChat.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);
        }
        Label label = this.m_DetailList.GetItem(0).GetElement(10) as Label;

        if (null != label)
        {
            label.Text = this.m_CurrentStoryChat.nCommentCount.ToString();
        }
        this.m_InputText.Text = string.Empty;
    }
Esempio n. 2
0
 public override void Update()
 {
     if (this.m_CurrentStoryChat != null && this.m_bAddComment && this.m_DetailList.listMoved && !this.m_bRequestComment)
     {
         GS_STORYCOMMENT_GET_REQ gS_STORYCOMMENT_GET_REQ = new GS_STORYCOMMENT_GET_REQ();
         gS_STORYCOMMENT_GET_REQ.nStoryChatID    = this.m_CurrentStoryChat.nStoryChatID;
         gS_STORYCOMMENT_GET_REQ.nStoryCommentID = this.m_nLastCommentID;
         gS_STORYCOMMENT_GET_REQ.nLoadCount      = 10;
         SendPacket.GetInstance().SendObject(eGAME_PACKET_ID.GS_STORYCOMMENT_GET_REQ, gS_STORYCOMMENT_GET_REQ);
         this.m_bRequestComment = true;
     }
     if (!this.m_DetailList.listMoved && this.m_bRequestComment)
     {
         this.m_bRequestComment = false;
     }
 }
Esempio n. 3
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();
    }