summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/LevelRewardBattleRoyaleHandler.cs
blob: 0e40f71f36b5caaf2a91dc1ad00e39aca5ef18cd (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
using System;
using UILib;
using UnityEngine;
using XMainClient.UI;
using XUtliPoolLib;

namespace XMainClient
{
	internal class LevelRewardBattleRoyaleHandler : DlgHandlerBase
	{
		protected override string FileName
		{
			get
			{
				return "Battle/LevelReward/LevelRewardBattleRoyaleFrame";
			}
		}

		private XLevelRewardDocument doc = null;

		private Transform m_Win;

		private Transform m_Fail;

		private IXUILabel m_Rank;

		private IXUILabel m_Kill;

		private IXUILabel m_KillBy;

		private IXUILabel m_LiveTime;

		private IXUILabel m_Score;

		private IXUILabel m_Tip;

		private IXUIButton m_Button;

		protected override void Init()
		{
			base.Init();
			this.doc = XDocuments.GetSpecificDocument<XLevelRewardDocument>(XLevelRewardDocument.uuID);
			this.InitUI();
		}

		private void InitUI()
		{
			this.m_Win = base.PanelObject.transform.Find("Bg/Result/Win");
			this.m_Fail = base.PanelObject.transform.Find("Bg/Result/Fail");
			this.m_Rank = (base.PanelObject.transform.Find("Bg/Detail/Rank").GetComponent("XUILabel") as IXUILabel);
			this.m_Kill = (base.PanelObject.transform.Find("Bg/Detail/Kill").GetComponent("XUILabel") as IXUILabel);
			this.m_KillBy = (base.PanelObject.transform.Find("Bg/Detail/KillBy").GetComponent("XUILabel") as IXUILabel);
			this.m_LiveTime = (base.PanelObject.transform.Find("Bg/Detail/JS/Time").GetComponent("XUILabel") as IXUILabel);
			this.m_Score = (base.PanelObject.transform.Find("Bg/Detail/JS/Score").GetComponent("XUILabel") as IXUILabel);
			this.m_Tip = (base.PanelObject.transform.Find("Bg/Detail/Tip").GetComponent("XUILabel") as IXUILabel);
			this.m_Button = (base.PanelObject.transform.Find("Bg/Button/Back").GetComponent("XUIButton") as IXUIButton);
			this.m_Button.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnButtonClicked));
		}

		private bool OnButtonClicked(IXUIButton button)
		{
			this.doc.SendLeaveScene();
			return true;
		}

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

		private void ShowUI()
		{
			this.m_Win.gameObject.SetActive(this.doc.BattleRoyaleDataInfo.SelfRank == 1u);
			this.m_Fail.gameObject.SetActive(this.doc.BattleRoyaleDataInfo.SelfRank != 1u);
			this.m_Rank.SetText(XStringDefineProxy.GetString("BattleRoyaleRank", new object[]
			{
				this.doc.BattleRoyaleDataInfo.SelfRank,
				this.doc.BattleRoyaleDataInfo.AllRank
			}));
			this.m_Kill.SetText(XStringDefineProxy.GetString("BattleRoyaleKill", new object[]
			{
				this.doc.BattleRoyaleDataInfo.KillCount
			}));
			this.m_KillBy.SetText((this.doc.BattleRoyaleDataInfo.SelfRank != 1u) ? XStringDefineProxy.GetString("BattleRoyaleKilledBy", new object[]
			{
				this.doc.BattleRoyaleDataInfo.KilledBy
			}) : "");
			this.m_LiveTime.SetText(XSingleton<UiUtility>.singleton.TimeFormatString(this.doc.BattleRoyaleDataInfo.LiveTime, 2, 3, 4, false));
			this.m_Score.SetText(this.doc.BattleRoyaleDataInfo.AddPoint.ToString());
			this.m_Tip.SetText((this.doc.BattleRoyaleDataInfo.SelfRank == 1u) ? XStringDefineProxy.GetString("BattleRoyaleWin") : XStringDefineProxy.GetString("BattleRoyaleFail"));
		}
	}
}