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
191
192
193
194
195
196
197
198
199
200
|
using System;
using UILib;
using XMainClient.UI;
using XMainClient.UI.UICommon;
using XUtliPoolLib;
namespace XMainClient
{
internal class XSpriteShowView : DlgBase<XSpriteShowView, XSpriteShowBehaviour>
{
public override string fileName
{
get
{
return "GameSystem/SpriteSystem/SpriteShowDlg";
}
}
public override int sysid
{
get
{
return XFastEnumIntEqualityComparer<XSysDefine>.ToInt(XSysDefine.XSys_SpriteSystem_Detail);
}
}
public override bool autoload
{
get
{
return true;
}
}
public override bool hideMainMenu
{
get
{
return true;
}
}
public override bool pushstack
{
get
{
return true;
}
}
private XSpriteSystemDocument _doc = null;
private XSpriteAvatarHandler m_AvatarHandler;
private XFx m_Fx;
private bool _from_lottery = false;
private uint token = 0u;
private int _spriteID = 0;
private bool _isShowedShare = false;
protected override void Init()
{
base.Init();
this._doc = XDocuments.GetSpecificDocument<XSpriteSystemDocument>(XSpriteSystemDocument.uuID);
DlgHandlerBase.EnsureCreate<XSpriteAvatarHandler>(ref this.m_AvatarHandler, base.uiBehaviour.m_AvatarRoot, true, this);
}
public override void StackRefresh()
{
base.StackRefresh();
bool isShowedShare = this._isShowedShare;
if (isShowedShare)
{
this._spriteID = 0;
this._isShowedShare = false;
this.OnCloseClicked(null);
}
}
public override void RegisterEvent()
{
base.RegisterEvent();
base.uiBehaviour.m_Close.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnCloseClicked));
}
protected override void OnHide()
{
XSingleton<XTimerMgr>.singleton.KillTimer(this.token);
this._doc.DestroyFx(this.m_Fx);
this.m_Fx = null;
this._spriteID = 0;
this._isShowedShare = false;
base.OnHide();
this.m_AvatarHandler.SetVisible(false);
}
protected override void OnUnload()
{
XSingleton<XTimerMgr>.singleton.KillTimer(this.token);
this._doc.DestroyFx(this.m_Fx);
this.m_Fx = null;
DlgHandlerBase.EnsureUnload<XSpriteAvatarHandler>(ref this.m_AvatarHandler);
base.OnUnload();
}
public void ShowDetail(uint spriteID, uint ppt, bool fromLottery = false)
{
bool flag = !base.IsVisible();
if (flag)
{
this.SetVisible(true, true);
}
this.m_AvatarHandler.SetVisible(true);
this.m_AvatarHandler.SetSpriteInfo(spriteID, false, ppt);
this.SetLotteryAnim();
ItemList.RowData itemConf = XBagDocument.GetItemConf((int)spriteID);
this.SetupFx((int)((itemConf != null) ? itemConf.ItemQuality : 0));
this.SetupQuality((int)((itemConf != null) ? itemConf.ItemQuality : 0));
this._from_lottery = fromLottery;
this._spriteID = (int)spriteID;
}
private void SetLotteryAnim()
{
XEntityPresentation.RowData spritePresent = this.m_AvatarHandler.GetSpritePresent();
XSingleton<XTimerMgr>.singleton.KillTimer(this.token);
float interval = this.m_AvatarHandler.SetSpriteAnim(spritePresent.AttackIdle);
this.token = XSingleton<XTimerMgr>.singleton.SetTimer(interval, new XTimerMgr.ElapsedEventHandler(this.ResetAvatarAnim), null);
}
private void SetupFx(int quality)
{
this._doc.DestroyFx(this.m_Fx);
this.m_Fx = null;
switch (quality)
{
case 3:
this.m_Fx = this._doc.CreateAndPlayFx("Effects/FX_Particle/UIfx/UI_jl_05_orange", base.uiBehaviour.m_FxPoint);
break;
case 4:
this.m_Fx = this._doc.CreateAndPlayFx("Effects/FX_Particle/UIfx/UI_jl_05_purple", base.uiBehaviour.m_FxPoint);
break;
case 5:
this.m_Fx = this._doc.CreateAndPlayFx("Effects/FX_Particle/UIfx/UI_jl_05_red", base.uiBehaviour.m_FxPoint);
break;
}
}
private void SetupQuality(int quality)
{
switch (quality)
{
case 3:
base.uiBehaviour.m_Quality.SetSprite("Fairy_Show_0");
break;
case 4:
base.uiBehaviour.m_Quality.SetSprite("Fairy_Show_1");
break;
case 5:
base.uiBehaviour.m_Quality.SetSprite("Fairy_Show_2");
break;
}
base.uiBehaviour.m_QualityTween.PlayTween(true, -1f);
}
private void ResetAvatarAnim(object o)
{
this.m_AvatarHandler.ResetSpriteAnim();
}
public void OnCloseClicked(IXUISprite sp)
{
ItemList.RowData itemConf = XBagDocument.GetItemConf(this._spriteID);
XScreenShotShareDocument specificDocument = XDocuments.GetSpecificDocument<XScreenShotShareDocument>(XScreenShotShareDocument.uuID);
bool flag = itemConf != null && itemConf.ItemQuality == 4 && specificDocument.CurShareBgType == ShareBgType.LuckySpriteType && (ulong)specificDocument.SpriteID == (ulong)((long)this._spriteID);
if (flag)
{
this._isShowedShare = true;
XSingleton<PDatabase>.singleton.shareCallbackType = ShareCallBackType.GloryPic;
DlgBase<DungeonShareView, DungeonShareBehavior>.singleton.SetVisibleWithAnimation(true, null);
}
else
{
bool flag2 = this._from_lottery && this._doc.AutoShowEpicSprite;
if (flag2)
{
DlgBase<SpriteSystemDlg, TabDlgBehaviour>.singleton._SpriteLotteryHandler.OnOkButtonClicked(null);
}
else
{
this.SetVisible(false, true);
}
}
}
}
}
|