From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- .../Scripts/XMainClient/Chat/ChatSystemItem.cs | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/Chat/ChatSystemItem.cs (limited to 'Client/Assets/Scripts/XMainClient/Chat/ChatSystemItem.cs') diff --git a/Client/Assets/Scripts/XMainClient/Chat/ChatSystemItem.cs b/Client/Assets/Scripts/XMainClient/Chat/ChatSystemItem.cs new file mode 100644 index 00000000..ae0a72d3 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/Chat/ChatSystemItem.cs @@ -0,0 +1,39 @@ +using System; +using UILib; +using UnityEngine; +using XMainClient.UI.UICommon; + +namespace XMainClient +{ + public class ChatSystemItem : MonoBehaviour + { + private IXUILabelSymbol m_symContent; + + private ChatInfo mChatInfo; + + private IXUISprite m_sprRoot; + + private IXUILabel m_lblContent; + + private Transform m_transTitle; + + private void Awake() + { + this.m_sprRoot = (base.GetComponent("XUISprite") as IXUISprite); + this.m_transTitle = base.transform.Find("title"); + this.m_symContent = (base.transform.Find("title/content").GetComponent("XUILabelSymbol") as IXUILabelSymbol); + this.m_lblContent = (this.m_symContent.gameObject.GetComponent("XUILabel") as IXUILabel); + } + + public void Refresh(ChatInfo info) + { + this.mChatInfo = info; + this.m_symContent.InputText = DlgBase.singleton.OnParseEmotion(info.mContent); + XLabelSymbolHelper.RegisterHyperLinkClicks(this.m_symContent); + this.m_sprRoot.spriteHeight = 56 + this.m_lblContent.spriteHeight; + int spriteHeight = this.m_sprRoot.spriteHeight; + float num = (float)spriteHeight / 2f - 23f; + this.m_transTitle.localPosition = new Vector3(-180f, num, 0f); + } + } +} -- cgit v1.1-26-g67d0