summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/XSelectCharacterDocument.cs
blob: 418c960b9a4f856705d2672ec819531e65e1fba1 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
using System;
using System.Collections.Generic;
using KKSG;
using XMainClient.UI;
using XUtliPoolLib;

namespace XMainClient
{
	internal class XSelectCharacterDocument : XDocComponent
	{
		public override uint ID
		{
			get
			{
				return XSelectCharacterDocument.uuID;
			}
		}

		public XSelectCharView View
		{
			get
			{
				return this._view;
			}
			set
			{
				this._view = value;
			}
		}

		public int CurrentProf
		{
			get
			{
				return this._currentCreateProf;
			}
			set
			{
				this._currentCreateProf = value;
			}
		}

		public List<RoleBriefInfo> RoleList
		{
			get
			{
				return this._roleList;
			}
			set
			{
				this._roleList = value;
			}
		}

		public new static readonly uint uuID = XSingleton<XCommon>.singleton.XHash("SelectCharacterDocument");

		private int _currentCreateProf = -1;

		private int tttt = 2;

		private List<RoleBriefInfo> _roleList = new List<RoleBriefInfo>();

		private XSelectCharView _view = null;

		private List<int> testlist = new List<int>();

		public override void OnAttachToHost(XObject host)
		{
			base.OnAttachToHost(host);
			this.testlist.Add(1);
			this.testlist.Add(2);
			this.testlist.Add(4);
		}

		public void OnSelectCharBack()
		{
			XSingleton<XClientNetwork>.singleton.Close(NetErrCode.Net_NoError);
			XAutoFade.FadeOut2In(1.5f, 0.5f);
			XSingleton<XDebug>.singleton.AddLog(string.Concat(this.tttt), null, null, null, null, null, XDebugColor.XDebug_None);
			XSingleton<XTimerMgr>.singleton.SetTimer(0.5f, new XTimerMgr.ElapsedEventHandler(this.BackToLoginOnClick), null);
		}

		public void OnEnterWorld()
		{
			XSelectcharStage xselectcharStage = XSingleton<XGame>.singleton.CurrentStage as XSelectcharStage;
			bool flag = xselectcharStage != null;
			if (flag)
			{
				xselectcharStage.EnterGameWorld(this._view.SelectCharIndex);
			}
			XMainInterfaceDocument specificDocument = XDocuments.GetSpecificDocument<XMainInterfaceDocument>(XMainInterfaceDocument.uuID);
			specificDocument.GameAnnouncement = false;
		}

		protected override void OnReconnected(XReconnectedEventArgs arg)
		{
		}

		private void BackToLoginOnClick(object o)
		{
			XAutoFade.MakeBlack(false);
			XSingleton<XLoginDocument>.singleton.FromLogining();
		}
	}
}