summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/Team/XTeamLeagueLoadingView.cs
blob: ffa0789361bd115d19b63a8cd4f84da403551170 (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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
using System;
using KKSG;
using UILib;
using UnityEngine;
using XMainClient.UI.UICommon;
using XUtliPoolLib;

namespace XMainClient
{
	internal class XTeamLeagueLoadingView : DlgBase<XTeamLeagueLoadingView, XTeamLeagueLoadingBehaviour>
	{
		public override string fileName
		{
			get
			{
				return "Battle/TeamLeagueLoading";
			}
		}

		public override int layer
		{
			get
			{
				return 1;
			}
		}

		public override bool autoload
		{
			get
			{
				return true;
			}
		}

		public bool IsLoadingOver
		{
			get
			{
				return this._isLoadingOver;
			}
		}

		public override bool needOnTop
		{
			get
			{
				return true;
			}
		}

		private XTeamLeagueBattleDocument _doc;

		private bool _isLoadingOver = false;

		protected override void Init()
		{
			base.Init();
			this._isLoadingOver = false;
			this._doc = XDocuments.GetSpecificDocument<XTeamLeagueBattleDocument>(XTeamLeagueBattleDocument.uuID);
		}

		public void ShowPkLoading()
		{
			this.SetVisible(true, true);
		}

		protected override void OnShow()
		{
			base.OnShow();
			this.LoadingOver(null);
			this.SetBattleInfo();
		}

		private void LoadingOver(object o)
		{
			this._isLoadingOver = true;
		}

		private void SetMemberInfo(GameObject member, LeagueBattleRoleBrief info)
		{
			bool flag = info == null;
			if (!flag)
			{
				IXUILabel ixuilabel = member.transform.Find("Level").GetComponent("XUILabel") as IXUILabel;
				IXUISprite ixuisprite = member.transform.Find("Avatar").GetComponent("XUISprite") as IXUISprite;
				IXUISprite ixuisprite2 = member.transform.Find("Profession").GetComponent("XUISprite") as IXUISprite;
				IXUILabel ixuilabel2 = member.transform.Find("Name").GetComponent("XUILabel") as IXUILabel;
				IXUILabel ixuilabel3 = member.transform.Find("PPT").GetComponent("XUILabel") as IXUILabel;
				ixuilabel.SetText(info.level.ToString());
				ixuisprite2.SetSprite(XSingleton<XProfessionSkillMgr>.singleton.GetProfIcon((int)info.profession));
				ixuisprite.SetSprite(XSingleton<XProfessionSkillMgr>.singleton.GetProfHeadIcon((int)info.profession));
				ixuilabel2.SetText(info.name);
				ixuilabel3.SetText(info.pkpoint.ToString());
			}
		}

		private void SetTeamInfo(int index, LeagueBattleTeamData BattleTeam)
		{
			bool flag = BattleTeam == null;
			if (!flag)
			{
				base.uiBehaviour.m_TeamName[index].SetText(BattleTeam.name);
				base.uiBehaviour.m_TeamRegion[index].SetText(BattleTeam.servername);
				base.uiBehaviour.m_MembersPool[index].FakeReturnAll();
				for (int i = 0; i < BattleTeam.members.Count; i++)
				{
					GameObject gameObject = base.uiBehaviour.m_MembersPool[index].FetchGameObject(false);
					this.SetMemberInfo(gameObject, BattleTeam.members[i]);
					bool flag2 = i < base.uiBehaviour.m_RightMemberNode.Count;
					if (flag2)
					{
						gameObject.transform.parent = ((index == 0) ? base.uiBehaviour.m_LeftMemberNode[i] : base.uiBehaviour.m_RightMemberNode[i]);
					}
					gameObject.transform.localPosition = Vector3.zero;
				}
				base.uiBehaviour.m_MembersPool[index].ActualReturnAll(false);
			}
		}

		private void SetBattleInfo()
		{
			this.SetTeamInfo(0, this._doc.LoadingInfoBlue);
			this.SetTeamInfo(1, this._doc.LoadingInfoRed);
		}

		public void HidePkLoading()
		{
			bool flag = !base.IsVisible();
			if (!flag)
			{
				this.SetVisible(false, true);
			}
		}

		private void OnPkLoadingTweenFinish(IXUITweenTool tween)
		{
			this.SetVisible(false, true);
		}
	}
}