diff options
author | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
commit | 6eb915c129fc90c6f4c82ae097dd6ffad5239efc (patch) | |
tree | 7dd2be50edf41f36b60fac84696e731c13afe617 /Client/Assets/Scripts/XMainClient/UI/XGuildLogView.cs |
+scripts
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/UI/XGuildLogView.cs')
-rw-r--r-- | Client/Assets/Scripts/XMainClient/UI/XGuildLogView.cs | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/XMainClient/UI/XGuildLogView.cs b/Client/Assets/Scripts/XMainClient/UI/XGuildLogView.cs new file mode 100644 index 00000000..dcb17969 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/UI/XGuildLogView.cs @@ -0,0 +1,88 @@ +using System;
+using System.Collections.Generic;
+using UILib;
+using UnityEngine;
+using XUtliPoolLib;
+
+namespace XMainClient.UI
+{
+ internal class XGuildLogView : DlgHandlerBase
+ {
+ public ILogSource LogSource
+ {
+ set
+ {
+ this.m_LogSource = value;
+ }
+ }
+
+ private ILogSource m_LogSource;
+
+ private IXUIWrapContent m_WrapContent;
+
+ private IXUIScrollView m_ScrollView;
+
+ protected override void Init()
+ {
+ this.m_ScrollView = (base.PanelObject.transform.Find("LogMenu/Panel").GetComponent("XUIScrollView") as IXUIScrollView);
+ this.m_WrapContent = (base.PanelObject.transform.Find("LogMenu/Panel/WrapContent").GetComponent("XUIWrapContent") as IXUIWrapContent);
+ this.m_WrapContent.RegisterItemUpdateEventHandler(new WrapItemUpdateEventHandler(this._WrapContentItemUpdated));
+ }
+
+ public override void RegisterEvent()
+ {
+ base.RegisterEvent();
+ Transform transform = base.PanelObject.transform.Find("Close");
+ bool flag = transform != null;
+ if (flag)
+ {
+ IXUIButton ixuibutton = transform.GetComponent("XUIButton") as IXUIButton;
+ ixuibutton.RegisterClickEventHandler(new ButtonClickEventHandler(this._OnCloseBtnClick));
+ }
+ }
+
+ public void Refresh()
+ {
+ List<ILogData> logList = this.m_LogSource.GetLogList();
+ int count = logList.Count;
+ this.m_WrapContent.SetContentCount(count, false);
+ this.m_ScrollView.ResetPosition();
+ }
+
+ private void _WrapContentItemUpdated(Transform t, int index)
+ {
+ List<ILogData> logList = this.m_LogSource.GetLogList();
+ bool flag = index < 0 || index >= logList.Count;
+ if (!flag)
+ {
+ ILogData logData = logList[index];
+ IXUILabelSymbol ixuilabelSymbol = t.Find("Content").GetComponent("XUILabelSymbol") as IXUILabelSymbol;
+ IXUILabel ixuilabel = t.Find("Time").GetComponent("XUILabel") as IXUILabel;
+ ixuilabelSymbol.RegisterNameEventHandler(new HyperLinkClickEventHandler(this._NameClick));
+ ixuilabelSymbol.InputText = logData.GetContent();
+ ixuilabel.SetText(logData.GetTime());
+ }
+ }
+
+ private bool _OnCloseBtnClick(IXUIButton go)
+ {
+ base.SetVisible(false);
+ return true;
+ }
+
+ private void _NameClick(string param)
+ {
+ string text = "";
+ ulong num = 0UL;
+ bool flag = XLabelSymbolHelper.ParseNameParam(param, ref text, ref num);
+ if (flag)
+ {
+ bool flag2 = num == XSingleton<XEntityMgr>.singleton.Player.Attributes.EntityID;
+ if (!flag2)
+ {
+ XCharacterCommonMenuDocument.ReqCharacterMenuInfo(num, false);
+ }
+ }
+ }
+ }
+}
|