Пример #1
0
 // Token: 0x0600C33A RID: 49978 RVA: 0x00361F9C File Offset: 0x0036019C
 public BigExpressionItem(ConfigDataBigExpressionInfo bigExpressionInfo, GameObject expression, Action <int> click)
 {
     this.m_bigExpressionInfo = bigExpressionInfo;
     this.m_expression        = expression;
     this.m_onClick           = click;
     this.imageIcon           = expression.GetComponent <Image>();
     this.imageIcon.sprite    = AssetUtility.Instance.GetSprite(bigExpressionInfo.ExpressionIconPath);
     expression.GetComponent <ButtonEx>().onClick.AddListener(new UnityAction(this.OnClick));
     if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_ctorConfigDataBigExpressionInfoGameObjectAction ` 1_hotfix != null)
     {
         this.m_ctorConfigDataBigExpressionInfoGameObjectAction ` 1_hotfix.call(new object[]
         {
             this,
             bigExpressionInfo,
             expression,
             click
         });
         return;
     }
     BJLuaObjHelper.IsSkipLuaHotfix = false;
 }
        // Token: 0x0600B2A3 RID: 45731 RVA: 0x00316630 File Offset: 0x00314830
        public void ShowBigExpression(int id)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_ShowBigExpressionInt32_hotfix != null)
            {
                this.m_ShowBigExpressionInt32_hotfix.call(new object[]
                {
                    this,
                    id
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            this.m_dialogText.gameObject.SetActive(false);
            this.m_expressionImage.gameObject.SetActive(true);
            this.m_voiceButton.gameObject.SetActive(false);
            IConfigDataLoader           configDataLoader            = GameManager.Instance.ConfigDataLoader as IConfigDataLoader;
            ConfigDataBigExpressionInfo configDataBigExpressionInfo = configDataLoader.GetConfigDataBigExpressionInfo(id);

            this.m_expressionImage.sprite = AssetUtility.Instance.GetSprite(configDataBigExpressionInfo.ExpressionIconPath);
            this.m_chatUIStateController.SetToUIState("Show", false, true);
            this.m_hideChatTime = (float)configDataLoader.UtilityGetConfigableConst(ConfigableConstId.ConfigableConstId_TeamChatBubbleStayTime) * 0.001f;
        }
        // Token: 0x0600C457 RID: 50263 RVA: 0x00365A10 File Offset: 0x00363C10
        public void UpdateChatInfo(ChatComponent.ChatMessageClient chatClientInfo, bool isPlaying = false)
        {
            if (!BJLuaObjHelper.IsSkipLuaHotfix && this.TryInitHotFix("") && this.m_UpdateChatInfoChatMessageClientBoolean_hotfix != null)
            {
                this.m_UpdateChatInfoChatMessageClientBoolean_hotfix.call(new object[]
                {
                    this,
                    chatClientInfo,
                    isPlaying
                });
                return;
            }
            BJLuaObjHelper.IsSkipLuaHotfix = false;
            this.m_currChatInfo            = chatClientInfo;
            ChatMessage     chatMessageInfo = chatClientInfo.ChatMessageInfo;
            ChatContentType chatContentType = chatMessageInfo.ChatContentType;

            if (chatContentType != ChatContentType.Text)
            {
                if (chatContentType != ChatContentType.Voice)
                {
                    if (chatContentType == ChatContentType.CustomBigExpression)
                    {
                        this.PlayerNameText.text = chatMessageInfo.SrcName;
                        ProjectLPlayerContext projectLPlayerContext = GameManager.Instance.PlayerContext as ProjectLPlayerContext;
                        this.SendTimeText.text = this.SetChatMsgTime(projectLPlayerContext.ServerTimeToLocalTime(chatMessageInfo.SendTime));
                        ChatChannel channelId = chatMessageInfo.ChannelId;
                        if (channelId != ChatChannel.Sys)
                        {
                            this.PlayerIconImage.sprite = AssetUtility.Instance.GetSprite(UIUtility.GetPlayerSmallHeadIconImageName(HeadIconTools.GetHeadPortrait(chatMessageInfo.AvatarId)));
                            UIUtility.SetPlayerHeadFrame(this.PlayerHeadFrameTransform, HeadIconTools.GetHeadFrame(chatMessageInfo.AvatarId), true, "Normal");
                            this.PlayerLevelText.text = chatMessageInfo.SrcPlayerLevel.ToString();
                        }
                        string                      text                        = (chatMessageInfo as ChatTextMessage).Text;
                        int                         key                         = int.Parse(text);
                        IConfigDataLoader           configDataLoader            = GameManager.Instance.ConfigDataLoader as IConfigDataLoader;
                        ConfigDataBigExpressionInfo configDataBigExpressionInfo = configDataLoader.GetConfigDataBigExpressionInfo(key);
                        this.FaceIcon.sprite = AssetUtility.Instance.GetSprite(configDataBigExpressionInfo.ExpressionIconPath);
                        this.SetToBigExpressionMode();
                    }
                }
                else
                {
                    this.PlayerNameText.text = chatMessageInfo.SrcName;
                    ProjectLPlayerContext projectLPlayerContext2 = GameManager.Instance.PlayerContext as ProjectLPlayerContext;
                    this.SendTimeText.text = this.SetChatMsgTime(projectLPlayerContext2.ServerTimeToLocalTime(chatMessageInfo.SendTime));
                    ChatChannel channelId2 = chatMessageInfo.ChannelId;
                    if (channelId2 != ChatChannel.Sys)
                    {
                        this.PlayerIconImage.sprite = AssetUtility.Instance.GetSprite(UIUtility.GetPlayerSmallHeadIconImageName(HeadIconTools.GetHeadPortrait(chatMessageInfo.AvatarId)));
                        UIUtility.SetPlayerHeadFrame(this.PlayerHeadFrameTransform, HeadIconTools.GetHeadFrame(chatMessageInfo.AvatarId), true, "Normal");
                        this.PlayerLevelText.text = chatMessageInfo.SrcPlayerLevel.ToString();
                    }
                    ChatVoiceMessage chatVoiceMessage = chatMessageInfo as ChatVoiceMessage;
                    this.VoiceLengthText.text  = chatVoiceMessage.VoiceLength.ToString() + "'";
                    this.VoiceContentText.text = chatVoiceMessage.TranslateText;
                    if (string.IsNullOrEmpty(chatVoiceMessage.TranslateText))
                    {
                        this.VoiceContentText.gameObject.SetActive(false);
                    }
                    else
                    {
                        this.VoiceContentText.gameObject.SetActive(true);
                    }
                    this.SetToVoiceMode();
                }
            }
            else
            {
                this.PlayerNameText.text = chatMessageInfo.SrcName;
                ProjectLPlayerContext projectLPlayerContext3 = GameManager.Instance.PlayerContext as ProjectLPlayerContext;
                this.SendTimeText.text = this.SetChatMsgTime(projectLPlayerContext3.ServerTimeToLocalTime(chatMessageInfo.SendTime));
                ChatChannel channelId3 = chatMessageInfo.ChannelId;
                if (channelId3 != ChatChannel.Sys)
                {
                    this.PlayerIconImage.sprite = AssetUtility.Instance.GetSprite(UIUtility.GetPlayerSmallHeadIconImageName(HeadIconTools.GetHeadPortrait(chatMessageInfo.AvatarId)));
                    UIUtility.SetPlayerHeadFrame(this.PlayerHeadFrameTransform, HeadIconTools.GetHeadFrame(chatMessageInfo.AvatarId), true, "Normal");
                    this.PlayerLevelText.text = chatMessageInfo.SrcPlayerLevel.ToString();
                }
                string text2 = (chatMessageInfo as ChatTextMessage).Text;
                if (this.m_isEmojiTextInit)
                {
                    this.ContentText.SetContent(text2);
                }
                else
                {
                    this.ContentText.text = text2;
                }
                this.SetToTextMode();
            }
            base.gameObject.SetActive(true);
        }