summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/Chat/ChatHistoryItem.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/Chat/ChatHistoryItem.cs')
-rw-r--r--Client/Assets/Scripts/XMainClient/Chat/ChatHistoryItem.cs54
1 files changed, 54 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/XMainClient/Chat/ChatHistoryItem.cs b/Client/Assets/Scripts/XMainClient/Chat/ChatHistoryItem.cs
new file mode 100644
index 00000000..5239de76
--- /dev/null
+++ b/Client/Assets/Scripts/XMainClient/Chat/ChatHistoryItem.cs
@@ -0,0 +1,54 @@
+using System;
+using UILib;
+using UnityEngine;
+using XMainClient.UI.UICommon;
+
+namespace XMainClient
+{
+ public class ChatHistoryItem : MonoBehaviour
+ {
+ private const int LENGTH = 60;
+
+ private IXUILabelSymbol m_symbol;
+
+ private string mStr;
+
+ private void Awake()
+ {
+ this.m_symbol = (base.transform.Find("Content").GetComponent("XUILabelSymbol") as IXUILabelSymbol);
+ }
+
+ public void Refresh(string chat)
+ {
+ this.mStr = chat;
+ string text = DlgBase<ChatEmotionView, ChatEmotionBehaviour>.singleton.OnParseEmotion(chat);
+ int num = text.IndexOf("im=Chat");
+ bool flag = num > -1 && num < 12;
+ int num2 = 21;
+ int num3 = flag ? 30 : 12;
+ bool flag2 = flag;
+ if (flag2)
+ {
+ bool flag3 = text.Length > num3 && text.Length > num + num2;
+ if (flag3)
+ {
+ text = text.Substring(0, num + num2) + "...";
+ }
+ }
+ else
+ {
+ bool flag4 = text.Length >= num3 - 3;
+ if (flag4)
+ {
+ text = text.Substring(0, num3 - 3) + "...";
+ }
+ }
+ this.m_symbol.InputText = text;
+ }
+
+ public void OnClick()
+ {
+ DlgBase<ChatAssistView, ChatAssistBehaviour>.singleton.Close(this.mStr);
+ }
+ }
+}