private void UpdateWhisper()
 {
     if (this.m_whisper != null)
     {
         if (this.m_whisper.GetSpeakerId() == BnetPresenceMgr.Get().GetMyGameAccountId())
         {
             this.m_MyDecoration.SetActive(true);
             this.m_TheirDecoration.SetActive(false);
             BnetPlayer receiver = this.m_whisper.GetReceiver();
             object[]   args     = new object[] { receiver.GetBestName() };
             this.m_NameText.Text = GameStrings.Format("GLOBAL_CHAT_BUBBLE_RECEIVER_NAME", args);
         }
         else
         {
             this.m_MyDecoration.SetActive(false);
             this.m_TheirDecoration.SetActive(true);
             BnetPlayer speaker = this.m_whisper.GetSpeaker();
             if (speaker.IsOnline())
             {
                 this.m_NameText.TextColor = GameColors.PLAYER_NAME_ONLINE;
             }
             else
             {
                 this.m_NameText.TextColor = GameColors.PLAYER_NAME_OFFLINE;
             }
             this.m_NameText.Text = speaker.GetBestName();
         }
         this.m_MessageText.Text = ChatUtils.GetMessage(this.m_whisper);
     }
 }
    private void AddWhisperMessage(BnetWhisper whisper)
    {
        string message = ChatUtils.GetMessage(whisper);
        MobileChatLogMessageFrame prefab = !whisper.IsSpeaker(this.receiver) ? this.prefabs.myMessage : this.prefabs.theirMessage;
        MobileChatLogMessageFrame item   = this.CreateMessage(prefab, message);

        this.messageFrames.Add(item);
    }
    private void AddMyMessage(string message)
    {
        string str = ChatUtils.GetMessage(message);
        MobileChatLogMessageFrame item = this.CreateMessage(this.prefabs.myMessage, str);

        this.messageFrames.Add(item);
        this.OnMessagesAdded();
    }
 private void GetMessage()
 {
     try
     {
         ChatUtils.GetMessage(_requests, _system, _client);
     }
     catch (Exception e)
     {
     }
 }
Ejemplo n.º 5
0
 private void UpdateLastMessage()
 {
     if (this.m_chatLogFrame != null)
     {
         this.HideLastMessage();
     }
     else
     {
         BnetWhisper whisper = this.FindLastWhisperFromReceiver();
         if (whisper == null)
         {
             this.HideLastMessage();
         }
         else
         {
             this.m_LastMessageText.gameObject.SetActive(true);
             this.m_LastMessageText.Text = ChatUtils.GetMessage(whisper);
             TransformUtil.SetPoint((Component)this.m_LastMessageText, Anchor.BOTTOM_LEFT, (Component)this.m_Bones.m_LastMessage, Anchor.TOP_LEFT);
             this.m_ReceiverNameText.gameObject.SetActive(true);
             if (this.m_receiver.IsOnline())
             {
                 this.m_ReceiverNameText.TextColor = GameColors.PLAYER_NAME_ONLINE;
             }
             else
             {
                 this.m_ReceiverNameText.TextColor = GameColors.PLAYER_NAME_OFFLINE;
             }
             this.m_ReceiverNameText.Text = FriendUtils.GetUniqueName(this.m_receiver);
             TransformUtil.SetPoint((Component)this.m_ReceiverNameText, Anchor.BOTTOM_LEFT, (Component)this.m_LastMessageText, Anchor.TOP_LEFT);
             this.m_LastMessageShadow.SetActive(true);
             Bounds textWorldSpaceBounds = this.m_LastMessageText.GetTextWorldSpaceBounds();
             Bounds bounds2 = this.m_ReceiverNameText.GetTextWorldSpaceBounds();
             float  num     = Mathf.Max(textWorldSpaceBounds.max.y, bounds2.max.y);
             float  num2    = Mathf.Min(textWorldSpaceBounds.min.y, bounds2.min.y);
             float  num3    = num - num2;
             float  z       = (num3 * this.m_initialLastMessageShadowScaleZ) / this.m_initialLastMessageTextHeight;
             TransformUtil.SetLocalScaleZ(this.m_LastMessageShadow, z);
         }
     }
 }
 private void GetMessage()
 {
     ChatUtils.GetMessage(_requests, _system, _client);
 }