blob: 3d3c5d9c0297b20da0ed37eba33688d11987ea04 (
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
|
using System;
using UILib;
using XUtliPoolLib;
namespace XMainClient.UI
{
internal class BattleDpsHandler : DlgHandlerBase
{
private IXUILabel m_uiInfo;
private IXUISprite m_uiBg;
private ulong m_Dps;
private int m_Rank;
private XCombatStatisticsDocument doc;
private string m_strTemplate;
protected override void Init()
{
base.Init();
this.m_uiInfo = (base.PanelObject.GetComponent("XUILabel") as IXUILabel);
this.m_uiBg = (base.PanelObject.transform.Find("Bg").GetComponent("XUISprite") as IXUISprite);
this.doc = XDocuments.GetSpecificDocument<XCombatStatisticsDocument>(XCombatStatisticsDocument.uuID);
this.doc.DpsHandler = this;
this.m_Dps = 0UL;
this.m_Rank = 0;
this.m_strTemplate = XSingleton<UiUtility>.singleton.ReplaceReturn(XStringDefineProxy.GetString("DPS_INFO"));
}
public override void OnUnload()
{
base.OnUnload();
this.doc.DpsHandler = null;
}
protected override void OnShow()
{
base.OnShow();
this._Refresh();
this.RefreshData();
}
public override void OnUpdate()
{
base.OnUpdate();
bool flag = !XSingleton<XGame>.singleton.SyncMode;
if (flag)
{
this.RefreshData();
}
}
public override void RefreshData()
{
base.RefreshData();
this.doc.ReqDps();
}
public void SetDps(double dps, double rank)
{
ulong num = (ulong)dps;
int num2 = (int)rank;
bool flag = num != this.m_Dps || num2 != this.m_Rank;
if (flag)
{
this.m_Dps = num;
this.m_Rank = num2;
this._Refresh();
}
}
public void SetInfo(string s)
{
this.m_uiInfo.SetText(s);
this.m_uiBg.UpdateAnchors();
}
private void _Refresh()
{
string text = string.Format(this.m_strTemplate, XSingleton<UiUtility>.singleton.NumberFormat(this.m_Dps), this.m_Rank.ToString());
this.m_uiInfo.SetText(text);
this.m_uiBg.UpdateAnchors();
}
}
}
|