-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommand.cs
More file actions
298 lines (260 loc) · 6.9 KB
/
Command.cs
File metadata and controls
298 lines (260 loc) · 6.9 KB
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
using System;
// Token: 0x0200004C RID: 76
public class Command
{
// Token: 0x060002B6 RID: 694 RVA: 0x00015944 File Offset: 0x00013B44
public Command(string caption, IActionListener actionListener, int action, object p, int x, int y)
{
this.caption = caption;
this.idAction = action;
this.actionListener = actionListener;
this.p = p;
this.x = x;
this.y = y;
}
// Token: 0x060002B7 RID: 695 RVA: 0x00004A6E File Offset: 0x00002C6E
public Command()
{
}
// Token: 0x060002B8 RID: 696 RVA: 0x000159AC File Offset: 0x00013BAC
public Command(string caption, IActionListener actionListener, int action, object p)
{
this.caption = caption;
this.idAction = action;
this.actionListener = actionListener;
this.p = p;
}
// Token: 0x060002B9 RID: 697 RVA: 0x00015A04 File Offset: 0x00013C04
public Command(string caption, int action, object p)
{
this.caption = caption;
this.idAction = action;
this.p = p;
}
// Token: 0x060002BA RID: 698 RVA: 0x00004A9E File Offset: 0x00002C9E
public Command(string caption, int action)
{
this.caption = caption;
this.idAction = action;
}
// Token: 0x060002BB RID: 699 RVA: 0x00015A54 File Offset: 0x00013C54
public Command(string caption, int action, int x, int y)
{
this.caption = caption;
this.idAction = action;
this.x = x;
this.y = y;
}
// Token: 0x060002BC RID: 700 RVA: 0x00004ADC File Offset: 0x00002CDC
public void perform(string str)
{
if (this.actionChat != null)
{
this.actionChat(str);
}
}
// Token: 0x060002BD RID: 701 RVA: 0x00015AAC File Offset: 0x00013CAC
public void performAction()
{
GameCanvas.clearAllPointerEvent();
if (this.isPlaySoundButton && ((this.caption != null && !this.caption.Equals(string.Empty) && !this.caption.Equals(mResources.saying)) || this.img != null))
{
SoundMn.gI().buttonClick();
}
if (this.idAction > 0)
{
if (this.actionListener != null)
{
this.actionListener.perform(this.idAction, this.p);
}
else
{
GameScr.gI().actionPerform(this.idAction, this.p);
}
}
}
// Token: 0x060002BE RID: 702 RVA: 0x00004AF5 File Offset: 0x00002CF5
public void setType()
{
this.type = 1;
this.w = 160;
this.hw = 80;
}
// Token: 0x060002BF RID: 703 RVA: 0x00015B5C File Offset: 0x00013D5C
public void paint(mGraphics g)
{
if (this.img != null)
{
g.drawImage(this.img, this.x, this.y + mGraphics.addYWhenOpenKeyBoard, 0);
if (this.isFocus)
{
if (this.imgFocus == null)
{
if (this.cmdClosePanel)
{
g.drawImage(ItemMap.imageFlare, this.x + 8, this.y + mGraphics.addYWhenOpenKeyBoard + 8, 3);
}
else
{
g.drawImage(ItemMap.imageFlare, this.x - ((!this.img.Equals(GameScr.imgMenu)) ? 0 : 10), this.y + mGraphics.addYWhenOpenKeyBoard, 0);
}
}
else
{
g.drawImage(this.imgFocus, this.x, this.y + mGraphics.addYWhenOpenKeyBoard, 0);
}
}
if (this.caption != "menu" && this.caption != null)
{
if (!this.isFocus)
{
mFont.tahoma_7b_dark.drawString(g, this.caption, this.x + mGraphics.getImageWidth(this.img) / 2, this.y + mGraphics.getImageHeight(this.img) / 2 - 5, 2);
}
else
{
mFont.tahoma_7b_green2.drawString(g, this.caption, this.x + mGraphics.getImageWidth(this.img) / 2, this.y + mGraphics.getImageHeight(this.img) / 2 - 5, 2);
}
}
return;
}
if (this.caption != string.Empty)
{
if (this.type == 1)
{
if (!this.isFocus)
{
Command.paintOngMau(Command.btn0left, Command.btn0mid, Command.btn0right, this.x, this.y, 160, g);
}
else
{
Command.paintOngMau(Command.btn1left, Command.btn1mid, Command.btn1right, this.x, this.y, 160, g);
}
}
else if (!this.isFocus)
{
Command.paintOngMau(Command.btn0left, Command.btn0mid, Command.btn0right, this.x, this.y, 76, g);
}
else
{
Command.paintOngMau(Command.btn1left, Command.btn1mid, Command.btn1right, this.x, this.y, 76, g);
}
}
int num;
if (this.type == 1)
{
num = this.x + this.hw;
}
else
{
num = this.x + 38;
}
if (!this.isFocus)
{
mFont.tahoma_7b_dark.drawString(g, this.caption, num, this.y + 7, 2);
}
else
{
mFont.tahoma_7b_green2.drawString(g, this.caption, num, this.y + 7, 2);
}
}
// Token: 0x060002C0 RID: 704 RVA: 0x00015E2C File Offset: 0x0001402C
public static void paintOngMau(Image img0, Image img1, Image img2, int x, int y, int size, mGraphics g)
{
for (int i = 10; i <= size - 20; i += 10)
{
g.drawImage(img1, x + i, y, 0);
}
int num = size % 10;
if (num > 0)
{
g.drawRegion(img1, 0, 0, num, 24, 0, x + size - 10 - num, y, 0);
}
g.drawImage(img0, x, y, 0);
g.drawImage(img2, x + size - 10, y, 0);
}
// Token: 0x060002C1 RID: 705 RVA: 0x00015EA4 File Offset: 0x000140A4
public bool isPointerPressInside()
{
this.isFocus = false;
if (GameCanvas.isPointerHoldIn(this.x, this.y, this.w, this.h))
{
if (GameCanvas.isPointerDown)
{
this.isFocus = true;
}
if (GameCanvas.isPointerJustRelease && GameCanvas.isPointerClick)
{
return true;
}
}
return false;
}
// Token: 0x060002C2 RID: 706 RVA: 0x00015F04 File Offset: 0x00014104
public bool isPointerPressInsideCamera(int cmx, int cmy)
{
this.isFocus = false;
if (GameCanvas.isPointerHoldIn(this.x - cmx, this.y - cmy, this.w, this.h))
{
Res.outz("w= " + this.w);
if (GameCanvas.isPointerDown)
{
this.isFocus = true;
}
if (GameCanvas.isPointerJustRelease && GameCanvas.isPointerClick)
{
return true;
}
}
return false;
}
// Token: 0x04000477 RID: 1143
public ActionChat actionChat;
// Token: 0x04000478 RID: 1144
public string caption;
// Token: 0x04000479 RID: 1145
public string[] subCaption;
// Token: 0x0400047A RID: 1146
public IActionListener actionListener;
// Token: 0x0400047B RID: 1147
public int idAction;
// Token: 0x0400047C RID: 1148
public bool isPlaySoundButton = true;
// Token: 0x0400047D RID: 1149
public Image img;
// Token: 0x0400047E RID: 1150
public Image imgFocus;
// Token: 0x0400047F RID: 1151
public int x;
// Token: 0x04000480 RID: 1152
public int y;
// Token: 0x04000481 RID: 1153
public int w = mScreen.cmdW;
// Token: 0x04000482 RID: 1154
public int h = mScreen.cmdH;
// Token: 0x04000483 RID: 1155
public int hw;
// Token: 0x04000484 RID: 1156
private int lenCaption;
// Token: 0x04000485 RID: 1157
public bool isFocus;
// Token: 0x04000486 RID: 1158
public object p;
// Token: 0x04000487 RID: 1159
public int type;
// Token: 0x04000488 RID: 1160
public string caption2 = string.Empty;
// Token: 0x04000489 RID: 1161
public static Image btn0left;
// Token: 0x0400048A RID: 1162
public static Image btn0mid;
// Token: 0x0400048B RID: 1163
public static Image btn0right;
// Token: 0x0400048C RID: 1164
public static Image btn1left;
// Token: 0x0400048D RID: 1165
public static Image btn1mid;
// Token: 0x0400048E RID: 1166
public static Image btn1right;
// Token: 0x0400048F RID: 1167
public bool cmdClosePanel;
}