少年修仙传客户端代码仓库
client_linchunjie
2019-01-04 55118ed2b7934185592f182f8dcf061df6036daa
5375 【前端】【1.4.100】玩家私人聊天,打开对话框时,提示防诈骗内容
2个文件已修改
37 ■■■■ 已修改文件
System/Chat/ChatCenter.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Chat/ChatContentBehaviour.cs 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Chat/ChatCenter.cs
@@ -1087,12 +1087,6 @@
            return clientBanned;
        }
        #endregion
        //private void OnApplicationQuit()
        //{
        //    LocalChatHistory.Save();
        //}
    }
}
System/Chat/ChatContentBehaviour.cs
@@ -17,7 +17,10 @@
        [SerializeField] Button m_NewInfoBtn;
        [SerializeField] Button m_LockAreaBtn;
        [SerializeField] Image m_LockAreaCheck;
        [SerializeField, Header("显示区域大小")] float m_ContentDisplaySize = 630;
        [SerializeField] RectTransform m_ContainerDisplay;
        [SerializeField] RectTransform m_ContainerPrivateChatRemind;
        [SerializeField] RectTransform m_Scroller;
        [SerializeField, Header("锁定当前区域比例"), Range(0, 1)] float m_Percent = 0.3f;
        [SerializeField] ChatPlayerMineCell m_ChatMineCell;
@@ -34,9 +37,14 @@
            }
            set
            {
                bool isChange = m_ChatType != value;
                ResetNewInfo();
                m_ChatType = value;
                DisplayChatContent();
                if (isChange)
                {
                    DisplayChatRemind();
                }
            }
        }
@@ -80,6 +88,7 @@
        private void OnEnable()
        {
            DisplayChatContent();
            DisplayChatRemind();
            ChatCtrl.OnRefreshChat += OnRefreshChat;
            ChatCtrl.OnRefreshPteChat += OnRefreshPteChat;
            ChatCtrl.OnRefreshSelf += OnRefreshSelf;
@@ -100,6 +109,7 @@
            if (m_ChatType == ChatInfoType.Friend)
            {
                DisplayChatContent();
                DisplayChatRemind();
                JumpPteChatBottom();
            }
        }
@@ -310,6 +320,25 @@
            m_LockAreaBtn.gameObject.SetActive(m_ChatType != ChatInfoType.Friend);
        }
        private void DisplayChatRemind()
        {
            if (m_ContainerPrivateChatRemind != null)
            {
                bool requireRemind = false;
                if (m_ChatType == ChatInfoType.Friend)
                {
                    requireRemind = true;
                }
                var displayAreaHeight = m_ContainerDisplay.rect.height;
                m_ContainerPrivateChatRemind.gameObject.SetActive(requireRemind);
                if (requireRemind)
                {
                    displayAreaHeight = m_ContainerDisplay.rect.height - m_ContainerPrivateChatRemind.rect.height;
                }
                m_Scroller.sizeDelta = m_Scroller.sizeDelta.SetY(displayAreaHeight);
            }
        }
        float KeepArea()
        {
            if (m_ChatContentControl.GetNumberOfCells(m_ChatContentControl.m_Scorller) == ChatCtrl.Inst.CHAT_INFO_CNT)