blob: 61a8fc2d521f0bfc7538b31593bdb77cb3ba363c (
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
|
using System;
using System.Collections.Generic;
using KKSG;
using UILib;
using UnityEngine;
using XUtliPoolLib;
namespace XMainClient
{
internal class XQualifyingRecordsHandler : DlgHandlerBase
{
public uint MatchTotalCount
{
get
{
return this.WinCount + this.DrawCount + this.LoseCount;
}
}
public uint MatchTotalPercent
{
get
{
bool flag = this.MatchTotalCount == 0u;
uint result;
if (flag)
{
result = 0u;
}
else
{
bool flag2 = this.WinCount == 0u;
if (flag2)
{
result = 0u;
}
else
{
result = Math.Max(1u, 100u * this.WinCount / this.MatchTotalCount);
}
}
return result;
}
}
protected override string FileName
{
get
{
return "GameSystem/QualifyRecords";
}
}
public uint WinCount;
public uint DrawCount;
public uint LoseCount;
public uint ContinueWin;
public uint ContinueLose;
public List<uint> ProfessionWin = new List<uint>();
public List<PkOneRecord> GameRecords = new List<PkOneRecord>();
public XUIPool m_RecordPool = new XUIPool(XSingleton<XGameUI>.singleton.m_uiTool);
public IXUIButton m_Close;
public IXUIScrollView m_ScrollView;
public IXUILabel MatchTotalWin;
public IXUILabel MatchTotalLose;
public IXUILabel RateOfTotalWin;
public IXUILabel MaxConsecutiveWin;
public IXUILabel MaxConsecutiveLose;
public List<IXUILabel> RateOfWinProf = new List<IXUILabel>();
protected override void Init()
{
this.m_Close = (base.transform.Find("Bg/Close").GetComponent("XUIButton") as IXUIButton);
this.m_RecordPool.SetupPool(base.transform.Find("Bg/Bg/ScrollView").gameObject, base.transform.Find("Bg/Bg/ScrollView/RecordTpl").gameObject, 20u, false);
this.m_ScrollView = (base.transform.Find("Bg/Bg/ScrollView").GetComponent("XUIScrollView") as IXUIScrollView);
this.MatchTotalWin = (base.transform.Find("Bg/Bg/Message/Win/Label").GetComponent("XUILabel") as IXUILabel);
this.MatchTotalLose = (base.transform.Find("Bg/Bg/Message/Lose/Label").GetComponent("XUILabel") as IXUILabel);
this.RateOfTotalWin = (base.transform.Find("Bg/Bg/Message/Rate/Label").GetComponent("XUILabel") as IXUILabel);
this.MaxConsecutiveWin = (base.transform.Find("Bg/Bg/Message/ConsWin/Label").GetComponent("XUILabel") as IXUILabel);
this.MaxConsecutiveLose = (base.transform.Find("Bg/Bg/Message/ConsLose/Label").GetComponent("XUILabel") as IXUILabel);
Transform transform = base.transform.Find("Bg/Bg/Message/WinRate");
for (int i = 0; i < transform.childCount; i++)
{
IXUILabel item = transform.Find(string.Format("Rate{0}", i)).GetComponent("XUILabel") as IXUILabel;
this.RateOfWinProf.Add(item);
}
}
public override void RegisterEvent()
{
this.m_Close.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnCloseClicked));
}
protected override void OnShow()
{
base.OnShow();
}
protected override void OnHide()
{
base.OnHide();
}
public override void OnUnload()
{
base.OnUnload();
}
public void Refresh()
{
bool flag = !base.PanelObject.activeSelf;
if (flag)
{
base.SetVisible(true);
}
this.MatchTotalWin.SetText(this.WinCount.ToString());
this.MatchTotalLose.SetText(this.LoseCount.ToString());
this.RateOfTotalWin.SetText(this.MatchTotalPercent.ToString() + "%");
this.MaxConsecutiveWin.SetText(this.ContinueWin.ToString());
this.MaxConsecutiveLose.SetText(this.ContinueLose.ToString());
for (int i = 0; i < this.RateOfWinProf.Count; i++)
{
bool flag2 = i >= XGame.RoleCount || i >= this.ProfessionWin.Count;
if (flag2)
{
this.RateOfWinProf[i].gameObject.SetActive(false);
}
else
{
this.RateOfWinProf[i].gameObject.SetActive(true);
this.RateOfWinProf[i].SetText(this.ProfessionWin[i].ToString() + "%");
}
}
this.m_RecordPool.FakeReturnAll();
for (int j = 0; j < this.GameRecords.Count; j++)
{
GameObject gameObject = this.m_RecordPool.FetchGameObject(false);
IXUILabel ixuilabel = gameObject.transform.Find("OpponentName").GetComponent("XUILabel") as IXUILabel;
IXUISprite ixuisprite = gameObject.transform.Find("Avatar").GetComponent("XUISprite") as IXUISprite;
IXUISprite ixuisprite2 = gameObject.transform.Find("Status").GetComponent("XUISprite") as IXUISprite;
IXUILabelSymbol ixuilabelSymbol = gameObject.transform.Find("Reward").GetComponent("XUILabelSymbol") as IXUILabelSymbol;
ixuilabel.SetText(this.GameRecords[j].name);
ixuisprite.SetSprite(XSingleton<XProfessionSkillMgr>.singleton.GetProfIcon((int)this.GameRecords[j].profession));
switch (this.GameRecords[j].result)
{
case PkResultType.PkResult_Win:
ixuisprite2.SetSprite("jjc-pws-win");
break;
case PkResultType.PkResult_Lose:
ixuisprite2.SetSprite("jjc-pws-lose");
break;
case PkResultType.PkResult_Draw:
ixuisprite2.SetSprite("jjc-pws-draw");
break;
}
ixuilabelSymbol.InputText = XStringDefineProxy.GetString("MATCH_RECORDS_REWARD", new object[]
{
(this.GameRecords[j].point < 0) ? "" : "+",
this.GameRecords[j].point,
XLabelSymbolHelper.FormatSmallIcon(21),
this.GameRecords[j].honorpoint
});
gameObject.transform.localPosition = this.m_RecordPool.TplPos - new Vector3(0f, (float)(j * this.m_RecordPool.TplHeight));
}
this.m_RecordPool.ActualReturnAll(false);
this.m_ScrollView.ResetPosition();
}
private bool OnCloseClicked(IXUIButton button)
{
base.SetVisible(false);
return true;
}
}
}
|