summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/UI/CustomBattle/CustomBattleMatchingHandler.cs
blob: 14fb4780eb499354d71919bef9500d9c3e4357fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System;
using UILib;

namespace XMainClient.UI.CustomBattle
{
	internal class CustomBattleMatchingHandler : DlgHandlerBase
	{
		protected override string FileName
		{
			get
			{
				return "GameSystem/CustomBattle/MatchingFrame";
			}
		}

		private XCustomBattleDocument _doc = null;

		private IXUIButton _cancel;

		protected override void Init()
		{
			base.Init();
			this._doc = XDocuments.GetSpecificDocument<XCustomBattleDocument>(XCustomBattleDocument.uuID);
			this._cancel = (base.transform.Find("Cancel").GetComponent("XUIButton") as IXUIButton);
		}

		public override void RegisterEvent()
		{
			base.RegisterEvent();
			this._cancel.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnCancelButtonClicked));
		}

		private bool OnCancelButtonClicked(IXUIButton button)
		{
			this._doc.SendCustomBattleUnMatch();
			base.SetVisible(false);
			return true;
		}
	}
}