Пример #1
0
        private void DisplayData(ChatMessageNew chatMessage, bool isSelf)
        {
            string        str = chatMessage.Message;
            AgentBaseInfo abi = chatMessage.Client;

            if (chatMessage.ChatType == 8)
            {
                str = "#e062" + str;
                if (Singleton <TrumpetView> .Instance != null && isSelf)
                {
                    Singleton <TrumpetView> .Instance.ClearContent();
                }
                CtrlManager.CloseWindow(WindowID.TrumpetView);
            }
            GridHelper.AddToGrid <ChatItem>(this.transGrid, (!isSelf) ? this.otherChatItem : this.myChatItem, isSelf, delegate(int idx, ChatItem comp)
            {
                comp.Init(abi, str, idx, isSelf, (ChatType)chatMessage.ChatType);
                comp.name = idx.ToString();
                this.queueChat.Enqueue(comp);
            });
            if (this.queueChat.Count > 99)
            {
                ChatItem chatItem = this.queueChat.Dequeue();
                UnityEngine.Object.Destroy(chatItem.gameObject);
            }
            this.usv.contentPivot = UIWidget.Pivot.Bottom;
            this.usv.ResetPosition();
            this.JudgePosition();
        }
Пример #2
0
        private void DisplayData(ChatMessageNew chatMessage, bool isSelf)
        {
            string        str = chatMessage.Message;
            AgentBaseInfo abi = chatMessage.Client;

            GridHelper.AddToGrid <ChatItem>(this.mChatGrid, (!isSelf) ? this.normalChatItem : this.selfChatItem, isSelf, delegate(int idx, ChatItem comp)
            {
                comp.Init(abi, str, idx, isSelf, (ChatType)chatMessage.ChatType);
                comp.name = idx.ToString();
                this.queueChat.Enqueue(comp);
            });
            if (this.queueChat.Count > 99)
            {
                ChatItem chatItem = this.queueChat.Dequeue();
                UnityEngine.Object.Destroy(chatItem.gameObject);
            }
        }
Пример #3
0
 private void OnMsg_chatviewFillChatHistory(MobaMessage msg)
 {
     if (msg.Param != null)
     {
         bool flag = (bool)msg.Param;
         long num  = long.Parse(ModelManager.Instance.Get_userData_X().UserId);
         Queue <ChatMessageNew> source = new Queue <ChatMessageNew>();
         source = ModelManager.Instance.Get_TempHallChatView();
         List <ChatMessageNew> chatMessageArray = (!flag) ? source.ToList <ChatMessageNew>() : ModelManager.Instance.Get_Hall_Chat_DataX().ToList <ChatMessageNew>();
         int i;
         for (i = 0; i != chatMessageArray.Count; i++)
         {
             string        str = chatMessageArray[i].Message;
             AgentBaseInfo abi = chatMessageArray[i].Client;
             if (chatMessageArray[i].ChatType == 8)
             {
                 str = "#e062" + str;
             }
             bool isSelf = chatMessageArray[i].Client.UserId == num;
             GridHelper.AddToGrid <ChatItem>(this.transGrid, (!isSelf) ? this.otherChatItem : this.myChatItem, isSelf, delegate(int idx, ChatItem comp)
             {
                 comp.Init(abi, str, idx, isSelf, (ChatType)chatMessageArray[i].ChatType);
                 comp.name = idx.ToString();
                 this.queueChat.Enqueue(comp);
             });
             if (this.queueChat.Count > 40)
             {
                 ChatItem chatItem = this.queueChat.Dequeue();
                 UnityEngine.Object.Destroy(chatItem.gameObject);
             }
         }
         this.usv.contentPivot = UIWidget.Pivot.Bottom;
         this.usv.ResetPosition();
         this.JudgePosition();
         ModelManager.Instance.Set_ReSetTempHallChatView();
         HomeChatCtrl.GetInstance().sendState = SendState.Nothing;
     }
 }