summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/InGameADView.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-01-25 14:28:30 +0800
committerchai <chaifix@163.com>2021-01-25 14:28:30 +0800
commit6eb915c129fc90c6f4c82ae097dd6ffad5239efc (patch)
tree7dd2be50edf41f36b60fac84696e731c13afe617 /Client/Assets/Scripts/XMainClient/InGameADView.cs
+scripts
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/InGameADView.cs')
-rw-r--r--Client/Assets/Scripts/XMainClient/InGameADView.cs93
1 files changed, 93 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/XMainClient/InGameADView.cs b/Client/Assets/Scripts/XMainClient/InGameADView.cs
new file mode 100644
index 00000000..c3366e94
--- /dev/null
+++ b/Client/Assets/Scripts/XMainClient/InGameADView.cs
@@ -0,0 +1,93 @@
+using System;
+using UILib;
+using XMainClient.UI.UICommon;
+using XUtliPoolLib;
+
+namespace XMainClient
+{
+ internal class InGameADView : DlgBase<InGameADView, InGameADBehaviour>
+ {
+ private uint npcID
+ {
+ get
+ {
+ return uint.Parse(XSingleton<XGlobalConfig>.singleton.GetValue("InGameADNPCID"));
+ }
+ }
+
+ private string tex
+ {
+ get
+ {
+ return XSingleton<XGlobalConfig>.singleton.GetValue("InGameADTex");
+ }
+ }
+
+ public override string fileName
+ {
+ get
+ {
+ return "GameSystem/InGameAD";
+ }
+ }
+
+ public override int layer
+ {
+ get
+ {
+ return 1;
+ }
+ }
+
+ public override int group
+ {
+ get
+ {
+ return 1;
+ }
+ }
+
+ public override bool autoload
+ {
+ get
+ {
+ return true;
+ }
+ }
+
+ public override void RegisterEvent()
+ {
+ base.uiBehaviour.m_Close.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnCloseClicked));
+ base.uiBehaviour.m_BtnGo.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnGoClick));
+ }
+
+ public bool OnCloseClicked(IXUIButton btn)
+ {
+ this.SetVisibleWithAnimation(false, null);
+ return true;
+ }
+
+ public void OnGoClick(IXUISprite btn)
+ {
+ XSingleton<XInput>.singleton.LastNpc = XSingleton<XEntityMgr>.singleton.GetNpc(this.npcID);
+ this.SetVisibleWithAnimation(false, null);
+ }
+
+ protected override void OnShow()
+ {
+ base.OnShow();
+ base.uiBehaviour.m_Tex.SetTexturePath(this.tex);
+ }
+
+ protected override void OnHide()
+ {
+ base.uiBehaviour.m_Tex.SetTexturePath("");
+ base.OnHide();
+ }
+
+ protected override void OnUnload()
+ {
+ base.OnUnload();
+ }
+ }
+}