blob: 2148f8a26686913fae047756547e041cc73ade02 (
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
|
using System;
using UILib;
using UnityEngine;
using XUtliPoolLib;
namespace XMainClient
{
internal class RecruitTitleBar : DlgHandlerBase
{
public uint filter
{
get
{
return this.m_selectIndex;
}
}
public int direction
{
get
{
return this.m_dir;
}
}
public TitleSelector selector
{
get
{
return this.m_selector;
}
set
{
bool flag = this.m_selector != value;
if (flag)
{
this.m_dir = -1;
}
else
{
this.m_dir = -this.m_dir;
}
this.m_selector = value;
}
}
private IXUILabel[] m_titles;
private Transform m_SortArrow;
private Transform m_UpArrow;
private Transform m_DownArrow;
private uint m_selectIndex = 0u;
private int m_dir = -1;
private TitleSelector m_selector = TitleSelector.Name;
private Transform m_DropList;
private IXUISprite m_DropClose;
private RecruitTitleChange m_titleChange;
private RecruitTitleReSelect m_reselect;
public override void OnUnload()
{
bool flag = this.m_titles != null;
if (flag)
{
this.m_titles = null;
}
this.m_titleChange = null;
base.OnUnload();
}
protected override void Init()
{
base.Init();
this.m_SortArrow = base.transform.Find("Sorting");
this.m_UpArrow = base.transform.Find("Sorting/Up");
this.m_DownArrow = base.transform.Find("Sorting/Down");
int num = XFastEnumIntEqualityComparer<TitleSelector>.ToInt(TitleSelector.End);
this.m_titles = new IXUILabel[num];
for (int i = 0; i < num; i++)
{
this.m_titles[i] = (base.transform.Find(string.Format("Title{0}", i)).GetComponent("XUILabel") as IXUILabel);
this.m_titles[i].ID = (ulong)((long)i);
IXUIButton ixuibutton = this.m_titles[i].gameObject.transform.Find("Button").GetComponent("XUIButton") as IXUIButton;
ixuibutton.ID = (ulong)((long)i);
ixuibutton.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnTitleClick));
}
this.m_DropList = base.transform.Find(string.Format("Title{0}/DropList", XFastEnumIntEqualityComparer<TitleSelector>.ToInt(TitleSelector.Type)));
this.m_DropClose = (this.m_DropList.Find("Close").GetComponent("XUISprite") as IXUISprite);
Transform transform = this.m_DropList.Find("Jobs");
this.m_DropClose.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnCloseDrop));
int j = 0;
int childCount = transform.childCount;
while (j < childCount)
{
IXUISprite ixuisprite = transform.Find(XSingleton<XCommon>.singleton.StringCombine("GroupMember_Type", j.ToString())).GetComponent("XUISprite") as IXUISprite;
ixuisprite.ID = (ulong)((long)j);
IXUILabel ixuilabel = ixuisprite.transform.Find("ItemText").GetComponent("XUILabel") as IXUILabel;
ixuilabel.SetText(XStringDefineProxy.GetString(ixuisprite.gameObject.name));
ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnDropClick));
j++;
}
this.OnCloseDrop(null);
this.SetupMemberType(this.m_titles[XFastEnumIntEqualityComparer<TitleSelector>.ToInt(TitleSelector.Type)]);
this.SetState(this.m_titles[XFastEnumIntEqualityComparer<TitleSelector>.ToInt(this.selector)]);
}
private void OnDropClick(IXUISprite sprite)
{
uint num = (uint)sprite.ID;
bool flag = this.m_selectIndex != num;
if (flag)
{
this.m_selectIndex = num;
this.SetupMemberType(this.m_titles[XFastEnumIntEqualityComparer<TitleSelector>.ToInt(TitleSelector.Type)]);
bool flag2 = this.m_reselect != null;
if (flag2)
{
this.m_reselect();
}
}
this.OnCloseDrop(null);
}
private void Excute()
{
}
private void OnCloseDrop(IXUISprite sprite = null)
{
this.m_DropList.gameObject.SetActive(false);
}
private bool OnTitleClick(IXUIButton btn)
{
TitleSelector titleSelector = (TitleSelector)btn.ID;
bool flag = titleSelector == TitleSelector.Type;
if (flag)
{
this.m_DropList.gameObject.SetActive(true);
}
else
{
this.SetState(titleSelector);
bool flag2 = this.m_titleChange != null;
if (flag2)
{
this.m_titleChange();
}
}
return true;
}
public void RegisterTitleChange(RecruitTitleChange eventHandler)
{
this.m_titleChange = eventHandler;
}
public void RegisterTitleReSelect(RecruitTitleReSelect selectHandle)
{
this.m_reselect = selectHandle;
}
public void SetState(TitleSelector select)
{
this.selector = select;
this.SetState(this.m_titles[XFastEnumIntEqualityComparer<TitleSelector>.ToInt(select)]);
}
private void SetState(IXUILabel selector)
{
TitleSelector titleSelector = (TitleSelector)selector.ID;
bool flag = titleSelector == TitleSelector.Type;
if (flag)
{
this.SetupMemberType(selector);
}
else
{
this.m_SortArrow.parent = selector.gameObject.transform;
this.m_SortArrow.localPosition = Vector2.zero;
this.m_UpArrow.gameObject.SetActive(this.m_dir == 1);
this.m_DownArrow.gameObject.SetActive(this.m_dir == -1);
}
}
private void SetupMemberType(IXUILabel select)
{
Transform transform = select.gameObject.transform.Find("Job");
bool flag = transform == null;
if (!flag)
{
IXUILabel ixuilabel = transform.GetComponent("XUILabel") as IXUILabel;
bool flag2 = ixuilabel == null;
if (!flag2)
{
ixuilabel.SetText(XStringDefineProxy.GetString(string.Format("GroupMember_Type{0}", this.m_selectIndex)));
}
}
}
}
}
|