summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/XQualifyingLastSeasonRankDlg.cs
blob: a6f3f2555260404fb4f0c149b2cce30683ed0027 (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
using System;
using System.Collections.Generic;
using UILib;
using UnityEngine;
using XMainClient.UI.UICommon;

namespace XMainClient
{
	internal class XQualifyingLastSeasonRankDlg : DlgBase<XQualifyingLastSeasonRankDlg, XQualifyingLastSeasonRankBehavior>
	{
		public override string fileName
		{
			get
			{
				return "GameSystem/XQualifyingLastSeasonRankDlg";
			}
		}

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

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

		protected override void Init()
		{
			base.Init();
			base.uiBehaviour.m_Close.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnCloseDlg));
		}

		protected override void OnShow()
		{
			base.OnShow();
		}

		public void SetupRankWindow(List<QualifyingRankInfo> list)
		{
			base.uiBehaviour.m_RolePool.FakeReturnAll();
			for (int i = 0; i < list.Count; i++)
			{
				GameObject gameObject = base.uiBehaviour.m_RolePool.FetchGameObject(false);
				IXUILabel ixuilabel = gameObject.transform.Find("Bg/Rank").GetComponent("XUILabel") as IXUILabel;
				IXUILabel ixuilabel2 = gameObject.transform.Find("Bg/Level").GetComponent("XUILabel") as IXUILabel;
				IXUILabel ixuilabel3 = gameObject.transform.Find("Bg/Name").GetComponent("XUILabel") as IXUILabel;
				IXUILabel ixuilabel4 = gameObject.transform.Find("Bg/Point").GetComponent("XUILabel") as IXUILabel;
				IXUISprite ixuisprite = gameObject.transform.Find("Bg/RankImage").GetComponent("XUISprite") as IXUISprite;
				bool flag = list[i].rank > 3u;
				if (flag)
				{
					ixuilabel.SetText(string.Format("No.{0}", list[i].rank));
				}
				else
				{
					ixuilabel.SetText("");
				}
				ixuilabel2.SetText(string.Format("Lv.{0}", list[i].level));
				ixuilabel3.SetText(list[i].name);
				ixuilabel4.SetText(list[i].point.ToString());
				ixuisprite.SetSprite(string.Format("N{0}", list[i].rank));
				ixuilabel3.ID = list[i].uid;
				bool flag2 = list[i].uid == 0UL;
				if (flag2)
				{
					ixuilabel3.RegisterLabelClickEventHandler(null);
				}
				else
				{
					ixuilabel3.RegisterLabelClickEventHandler(new LabelClickEventHandler(this.OnRankItemClicked));
				}
				gameObject.transform.localPosition = base.uiBehaviour.m_RolePool.TplPos - new Vector3(0f, (float)(i * base.uiBehaviour.m_RolePool.TplHeight));
			}
			base.uiBehaviour.m_RolePool.ActualReturnAll(false);
			base.uiBehaviour.m_ScrollView.ResetPosition();
		}

		private void OnRankItemClicked(IXUILabel label)
		{
			XCharacterCommonMenuDocument.ReqCharacterMenuInfo(label.ID, false);
		}

		private bool OnCloseDlg(IXUIButton button)
		{
			this.SetVisible(false, true);
			return true;
		}
	}
}