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
|
using System;
using UILib;
using UnityEngine;
using XUtliPoolLib;
namespace XMainClient
{
internal class XCharacterInfoView : DlgHandlerBase
{
public string EffectPath
{
get
{
bool flag = string.IsNullOrEmpty(this.m_effectPath);
if (flag)
{
this.m_effectPath = XSingleton<XGlobalConfig>.singleton.GetValue("CharacterEffectPath");
}
return this.m_effectPath;
}
}
protected override string FileName
{
get
{
return "ItemNew/CharacterInfoFrame";
}
}
public IXUISprite m_CharacterBG;
public IXUILabel m_PPT;
public IXUILabel m_UID;
public IXUILabel m_Name;
public IXUISprite m_ProfIcon;
private IUIDummy m_SnapShot = null;
private XCharacterDocument _doc = null;
private bool m_ShowPPT = true;
private XFx m_fx;
private string m_effectPath = string.Empty;
protected override void Init()
{
base.Init();
base.Init();
this._doc = XDocuments.GetSpecificDocument<XCharacterDocument>(XCharacterDocument.uuID);
this.m_CharacterBG = (base.PanelObject.transform.Find("CharacterFrame/Bg").GetComponent("XUISprite") as IXUISprite);
Transform transform = base.PanelObject.transform.Find("CharacterFrame/PowerPoint");
bool flag = transform != null;
if (flag)
{
this.m_PPT = (transform.GetComponent("XUILabel") as IXUILabel);
}
transform = base.PanelObject.transform.Find("TitleFrame/ProfIcon");
bool flag2 = transform != null;
if (flag2)
{
this.m_ProfIcon = (transform.GetComponent("XUISprite") as IXUISprite);
}
transform = base.PanelObject.transform.Find("UID");
bool flag3 = transform != null;
if (flag3)
{
this.m_UID = (transform.GetComponent("XUILabel") as IXUILabel);
}
transform = base.PanelObject.transform.Find("name");
bool flag4 = transform != null;
if (flag4)
{
this.m_Name = (transform.GetComponent("XUILabel") as IXUILabel);
}
this.m_SnapShot = (base.PanelObject.transform.Find("CharacterFrame/Snapshot").GetComponent("UIDummy") as IUIDummy);
bool flag5 = this.m_fx == null;
if (flag5)
{
this.m_fx = XSingleton<XFxMgr>.singleton.CreateFx(this.EffectPath, null, true);
}
else
{
this.m_fx.SetActive(true);
}
this.m_fx.Play(base.PanelObject.transform.Find("CharacterFrame/T1/FX"), Vector3.zero, Vector3.one, 1f, true, false);
}
public override void RegisterEvent()
{
base.RegisterEvent();
this.m_CharacterBG.RegisterSpriteDragEventHandler(new SpriteDragEventHandler(this.OnCharacterWindowDrag));
}
protected override void OnShow()
{
base.OnShow();
this._doc.InfoView = this;
this.SetPowerpoint(this.m_ShowPPT, XCharacterDocument.GetCharacterPPT());
bool flag = this.m_UID != null;
if (flag)
{
this.m_UID.SetText(string.Format("UID:{0}", XSingleton<XAttributeMgr>.singleton.XPlayerData.ShortId));
}
bool flag2 = this.m_Name != null;
if (flag2)
{
this.m_Name.SetText(XSingleton<XAttributeMgr>.singleton.XPlayerData.Name);
}
bool flag3 = this.m_ProfIcon != null;
if (flag3)
{
uint typeID = XSingleton<XEntityMgr>.singleton.Player.TypeID;
this.m_ProfIcon.SetSprite(XSingleton<XProfessionSkillMgr>.singleton.GetProfIcon((int)typeID));
}
XSingleton<X3DAvatarMgr>.singleton.EnableMainDummy(true, this.m_SnapShot);
}
public override void StackRefresh()
{
base.StackRefresh();
this.SetPowerpoint(this.m_ShowPPT, XCharacterDocument.GetCharacterPPT());
XSingleton<X3DAvatarMgr>.singleton.EnableMainDummy(true, this.m_SnapShot);
}
protected override void OnHide()
{
base.OnHide();
this._doc.InfoView = null;
XSingleton<X3DAvatarMgr>.singleton.EnableMainDummy(false, null);
bool flag = this.m_SnapShot != null;
if (flag)
{
this.m_SnapShot.RefreshRenderQueue = null;
}
}
public override void OnUnload()
{
XSingleton<X3DAvatarMgr>.singleton.OnUIUnloadMainDummy(this.m_SnapShot);
bool flag = this.m_SnapShot != null;
if (flag)
{
this.m_SnapShot.RefreshRenderQueue = null;
}
this._doc.InfoView = null;
bool flag2 = this.m_fx != null;
if (flag2)
{
XSingleton<XFxMgr>.singleton.DestroyFx(this.m_fx, true);
this.m_fx = null;
}
base.OnUnload();
}
protected bool OnCharacterWindowDrag(Vector2 delta)
{
XSingleton<X3DAvatarMgr>.singleton.RotateMain(-delta.x / 2f);
return true;
}
public void SetPowerpoint(bool visible, uint value)
{
this.m_ShowPPT = visible;
bool flag = this.m_PPT != null;
if (flag)
{
this.m_PPT.gameObject.SetActive(visible);
bool flag2 = value > 0u;
if (flag2)
{
this.m_PPT.SetText(value.ToString());
}
}
}
}
}
|