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
|
using System;
using KKSG;
using UILib;
using UnityEngine;
using XMainClient.UI.UICommon;
using XUtliPoolLib;
namespace XMainClient.UI
{
internal class XBattleTeamTowerHandler : DlgHandlerBase
{
public IXUILabel _total_coin;
public IXUILabel _total_manao;
public IXUILabel _req_level;
public IXUILabel _req_fight_point;
public IXUILabel _difficulty;
public XNumberTween _coin_tween;
public XNumberTween _manao_tween;
protected override void Init()
{
base.Init();
this._total_coin = (base.PanelObject.transform.Find("TotalCoin").GetComponent("XUILabel") as IXUILabel);
this._req_level = (base.PanelObject.transform.Find("InfoBack/Level").GetComponent("XUILabel") as IXUILabel);
this._req_fight_point = (base.PanelObject.transform.Find("InfoBack/FightPoint").GetComponent("XUILabel") as IXUILabel);
this._difficulty = (base.PanelObject.transform.Find("InfoBack/Difficulty").GetComponent("XUILabel") as IXUILabel);
this._coin_tween = XNumberTween.Create(this._total_coin);
this._total_manao = (base.PanelObject.transform.Find("TotalManao").GetComponent("XUILabel") as IXUILabel);
this._manao_tween = XNumberTween.Create(this._total_manao);
}
public void SetLeftTime(uint leftTime)
{
bool flag = DlgBase<BattleMain, BattleMainBehaviour>.singleton.IsLoaded();
if (flag)
{
DlgBase<BattleMain, BattleMainBehaviour>.singleton.SetLeftTime(leftTime, -1);
}
bool flag2 = DlgBase<SpectateSceneView, SpectateSceneBehaviour>.singleton.IsLoaded();
if (flag2)
{
DlgBase<SpectateSceneView, SpectateSceneBehaviour>.singleton.SetLeftTime(leftTime);
}
}
public void OnRefreshTowerInfo(PtcG2C_TowerSceneInfoNtf infoNtf)
{
bool flag = infoNtf.Data.leftTime > 0;
if (flag)
{
bool flag2 = DlgBase<BattleMain, BattleMainBehaviour>.singleton.IsLoaded();
if (flag2)
{
DlgBase<BattleMain, BattleMainBehaviour>.singleton.SetLeftTime((uint)infoNtf.Data.leftTime, -1);
}
bool flag3 = DlgBase<SpectateSceneView, SpectateSceneBehaviour>.singleton.IsLoaded();
if (flag3)
{
DlgBase<SpectateSceneView, SpectateSceneBehaviour>.singleton.SetLeftTime((uint)infoNtf.Data.leftTime);
}
}
bool flag4 = false;
bool flag5 = false;
for (int i = 0; i < infoNtf.Data.items.Count; i++)
{
ItemBrief itemBrief = infoNtf.Data.items[i];
bool flag6 = itemBrief.itemID == 1u;
if (flag6)
{
this._coin_tween.SetNumberWithTween((ulong)infoNtf.Data.items[0].itemCount, "", false, true);
flag4 = true;
}
else
{
bool flag7 = itemBrief.itemID == 93u;
if (flag7)
{
this._manao_tween.SetNumberWithTween((ulong)infoNtf.Data.items[1].itemCount, "", false, true);
flag5 = true;
}
}
}
bool flag8 = !flag4;
if (flag8)
{
this._coin_tween.SetNumberWithTween(0UL, "", false, true);
}
bool flag9 = !flag5;
if (flag9)
{
this._manao_tween.SetNumberWithTween(0UL, "", false, true);
}
this._req_level.SetText(infoNtf.Data.curTowerFloor.ToString());
double attr = XSingleton<XEntityMgr>.singleton.Player.PlayerAttributes.GetAttr(XAttributeDefine.XAttr_POWER_POINT_Total);
SceneTable.RowData sceneData = XSingleton<XSceneMgr>.singleton.GetSceneData(XSingleton<XScene>.singleton.SceneID);
double num = (double)sceneData.RecommendPower * 1.0;
bool flag10 = sceneData != null;
if (flag10)
{
num = (double)sceneData.RecommendPower * 1.0;
}
double num2 = (attr - num * 1.0) / num * 1.0;
bool flag11 = num2 > 0.01;
if (flag11)
{
this._req_fight_point.SetText(num.ToString());
this._req_fight_point.SetColor(Color.green);
}
else
{
bool flag12 = num2 > -0.01;
if (flag12)
{
this._req_fight_point.SetText(string.Format("[e2ca9e]{0}[-]", num));
}
else
{
this._req_fight_point.SetText(num.ToString());
this._req_fight_point.SetColor(Color.red);
}
}
this._difficulty.SetText("");
}
}
}
|