forked from brendan-rius/gta-v-decompiled-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appsidetask.c4
394 lines (374 loc) · 11.5 KB
/
appsidetask.c4
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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
// listener's C4 decompiler
void main() {
l_2 = 1;
l_3 = 134;
l_4 = 134;
l_5 = 1;
l_6 = 1;
l_7 = 1;
l_8 = 134;
l_9 = 1;
l_A = 12;
l_B = 12;
l_E = 0.001;
l_11 = -1;
l_1B = 0.72;
l_1C = 0.42;
l_1D = 0.0;
l_1E = 0.0;
GAMEPLAY::NETWORK_SET_SCRIPT_IS_SAFE_FOR_NETWORK_GAME();
g_418A = 0;
g_38EA = 0;
sub_905();
g_384D._f1 = 7;
sub_8a2(g_383A, "DISPLAY_VIEW", 14.0, 0xbf800000, 0xbf800000, 0xbf800000, 0xbf800000);
sub_847(g_383A, "SET_HEADER", "CELL_4", 0, 0, 0, 0);
while (1) {
SYSTEM::WAIT(0);
if (g_384D._f1 != 9) {
switch (g_384D._f1) {
case 7:
if (g_418A == 0) {
sub_6e0();
sub_643();
sub_500();
}
break;
case 8:
if (g_418A == 1) {
sub_24d();
}
break;
case 3:
SCRIPT::TERMINATE_THIS_THREAD();
break;
default:
break;
}
if (g_418A == 0) {
if (sub_224()) {
sub_218();
}
} else if (sub_1a6(2, g_382D, 0)) {
g_3837 = 1;
g_418A = 0;
g_384D._f1 = 7;
sub_905();
sub_8a2(g_383A, "DISPLAY_VIEW", 14.0, 0xbf800000, 0xbf800000, 0xbf800000, 0xbf800000);
sub_847(g_383A, "SET_HEADER", "CELL_4", 0, 0, 0, 0);
}
}
if (sub_163()) {
sub_218();
}
}
}
auto sub_163() {
if ((((g_384D._f1 == 1) || (g_384D._f1 == 3)) || (g_384D._f1 == 0)) || (g_3815 == 1)) {
g_3840 = 1;
return 1;
} else {
return 0;
}
}
auto sub_1a6(auto a_0, auto a_1, auto a_2) {
if (CONTROLS::IS_CONTROL_JUST_PRESSED(a_0, a_1) || ((a_2 == 1) && CONTROLS::IS_DISABLED_CONTROL_JUST_PRESSED(a_0, a_1))) {
if (GAMEPLAY::IS_PC_VERSION()) {
if ((GAMEPLAY::UPDATE_ONSCREEN_KEYBOARD() == 0) || (NETWORK::_NETWORK_IS_TEXT_CHAT_ACTIVE() && CONTROLS::_GET_LAST_INPUT_METHOD(2))) {
return 0;
}
}
if (UI::IS_PAUSE_MENU_ACTIVE() || UI::_E18B138FABC53103()) {
return 0;
} else {
return 1;
}
} else {
return 0;
}
}
void sub_218() {
SCRIPT::TERMINATE_THIS_THREAD();
}
auto sub_224() {
if ((g_B49 == 1) || (g_384D._f1 < 7)) {
g_3840 = 1;
return 1;
} else {
return 0;
}
}
void sub_24d() {
GRAPHICS::DRAW_RECT(0.824, 0.5, 0.253, 0.313, 0, 0, 0, 155, 0);
sub_277();
}
void sub_277() {
l_1D = l_1B;
l_1E = l_1C;
sub_4c1(255, 255, 255, 205);
sub_497();
sub_47f(l_1D, l_1E, &g_18A70._f7F07[g_4268[l_19/*9*/]/*29*/]._f3, 0);
l_1D += 0.07;
sub_4c1(255, 255, 255, 205);
if (g_4268[l_19/*9*/]._f2._f1 < 10) {
sub_45c(l_1D, l_1E, "CELL_506", g_4268[l_19/*9*/]._f2._f2, g_4268[l_19/*9*/]._f2._f1);
} else {
sub_45c(l_1D, l_1E, "CELL_503", g_4268[l_19/*9*/]._f2._f2, g_4268[l_19/*9*/]._f2._f1);
}
l_1D += 0.07;
sub_4c1(255, 255, 255, 205);
sub_45c(l_1D, l_1E, "CELL_505", g_4268[l_19/*9*/]._f2._f3, g_4268[l_19/*9*/]._f2._f4);
l_1D = l_1B;
sub_4c1(255, 255, 255, 205);
l_1E += 0.02;
if (g_41BF[g_4268[l_19/*9*/]._f1/*42*/]._f8 == 0) {
sub_497();
}
UI::SET_TEXT_WRAP(0.0, 0.93);
sub_47f(l_1D, l_1E, &g_41BF[g_4268[l_19/*9*/]._f1/*42*/]._f4, 0);
l_1E += 0.07;
for (v_2 = 1; v_2 <= g_41BF[g_4268[l_19/*9*/]._f1/*42*/]._f9; v_2 += 1) {
sub_4c1(255, 255, 255, 255);
l_1E += 0.04;
if (g_41BF[g_4268[l_19/*9*/]._f1/*42*/]._f20[v_2/*1*/] == -1) {
sub_47f(l_1D, l_1E, &g_41BF[g_4268[l_19/*9*/]._f1/*42*/]._fA[v_2/*4*/], 0);
} else {
sub_45c(l_1D, l_1E, &g_41BF[g_4268[l_19/*9*/]._f1/*42*/]._fA[v_2/*4*/], g_41BF[g_4268[l_19/*9*/]._f1/*42*/]._f1B[v_2/*1*/], g_41BF[g_4268[l_19/*9*/]._f1/*42*/]._f20[v_2/*1*/]);
}
}
}
void sub_45c(auto a_0, auto a_1, auto a_2, auto a_3, auto a_4) {
UI::_SET_TEXT_ENTRY(a_2);
UI::ADD_TEXT_COMPONENT_INTEGER(a_3);
UI::ADD_TEXT_COMPONENT_INTEGER(a_4);
UI::_DRAW_TEXT(a_0, a_1, 0);
}
void sub_47f(auto a_0, auto a_1, auto a_2, auto a_3) {
UI::_SET_TEXT_ENTRY(a_2);
UI::_DRAW_TEXT(a_0, a_1, a_3);
}
void sub_497() {
UI::SET_TEXT_SCALE(0.4, 0.4);
UI::SET_TEXT_COLOUR(255, 128, 0, 255);
UI::SET_TEXT_DROPSHADOW(1, 0, 78, 255, 255);
}
void sub_4c1(auto a_0, auto a_1, auto a_2, auto a_3) {
UI::SET_TEXT_SCALE(0.3, 0.3);
UI::SET_TEXT_DROPSHADOW(0, 0, 0, 0, 0);
UI::SET_TEXT_EDGE(1, 0, 0, 0, 205);
UI::SET_TEXT_PROPORTIONAL(1);
UI::SET_TEXT_FONT(0);
UI::SET_TEXT_COLOUR(a_0, a_1, a_2, a_3);
}
void sub_500() {
if (sub_1a6(2, g_382E, 0)) {
l_19 = l_12[l_18/*1*/];
g_418A = 1;
sub_57e(g_383A, "SET_DATA_SLOT", 15.0, 0.0, -1.0, -1.0, -1.0, "CELL_287", "CELL_280", "CELL_285", "CELL_284", 0);
sub_8a2(g_383A, "DISPLAY_VIEW", 15.0, 0xbf800000, 0xbf800000, 0xbf800000, 0xbf800000);
sub_847(g_383A, "SET_HEADER", "CELL_4", 0, 0, 0, 0);
g_384D._f1 = 8;
g_418A = 1;
}
}
void sub_57e(auto a_0, auto a_1, auto a_2, auto a_3, auto a_4, auto a_5, auto a_6, auto a_7, auto a_8, auto a_9, auto a_10, auto a_11) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION(a_0, a_1);
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(SYSTEM::ROUND(a_2));
if (a_3 != -1.0) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(SYSTEM::ROUND(a_3));
}
if (a_4 != -1.0) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(SYSTEM::ROUND(a_4));
}
if (a_5 != -1.0) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(SYSTEM::ROUND(a_5));
}
if (a_6 != -1.0) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(SYSTEM::ROUND(a_6));
}
if (!GAMEPLAY::IS_STRING_NULL_OR_EMPTY(a_7)) {
sub_631(a_7);
}
if (!GAMEPLAY::IS_STRING_NULL_OR_EMPTY(a_8)) {
sub_631(a_8);
}
if (!GAMEPLAY::IS_STRING_NULL_OR_EMPTY(a_9)) {
sub_631(a_9);
}
if (!GAMEPLAY::IS_STRING_NULL_OR_EMPTY(a_A)) {
sub_631(a_A);
}
if (!GAMEPLAY::IS_STRING_NULL_OR_EMPTY(a_B)) {
sub_631(a_B);
}
GRAPHICS::_POP_SCALEFORM_MOVIE_FUNCTION_VOID();
}
void sub_631(auto a_0) {
GRAPHICS::_BEGIN_TEXT_COMPONENT(a_0);
GRAPHICS::_END_TEXT_COMPONENT();
}
void sub_643() {
if (l_1F) {
if (SYSTEM::TIMERA() > 50) {
l_1F = 0;
}
}
if (CONTROLS::_GET_LAST_INPUT_METHOD(2)) {
if (sub_1a6(2, 181, 0)) {
if (l_18 > 0) {
l_18 -= 1;
}
}
if (sub_1a6(2, 180, 0)) {
l_18 += 1;
if (l_18 == l_17) {
l_18 = 0;
}
}
}
if (l_1F == 0) {
if (sub_1a6(2, g_3835, 0)) {
if (l_18 > 0) {
l_18 -= 1;
}
l_1F = 1;
SYSTEM::SETTIMERA(0);
}
if (sub_1a6(2, g_3836, 0)) {
l_18 += 1;
if (l_18 == l_17) {
l_18 = 0;
}
l_1F = 1;
SYSTEM::SETTIMERA(0);
}
}
}
void sub_6e0() {
v_2 = 0;
l_1D = l_1B;
l_1E = l_1C;
l_1A = l_17;
for (; v_2 < l_1A; v_2 += 1) {
sub_4c1(255, 255, 255, 205);
if (v_2 == l_18) {
sub_497();
}
sub_47f(l_1D, l_1E, &g_18A70._f7F07[g_4268[l_12[v_2/*1*/]/*9*/]/*29*/]._f3, 0);
l_1D += 0.07;
sub_4c1(255, 255, 255, 205);
if (g_4268[l_12[v_2/*1*/]/*9*/]._f2._f1 < 10) {
sub_45c(l_1D, l_1E, "CELL_506", g_4268[l_12[v_2/*1*/]/*9*/]._f2._f2, g_4268[l_12[v_2/*1*/]/*9*/]._f2._f1);
} else {
sub_45c(l_1D, l_1E, "CELL_503", g_4268[l_12[v_2/*1*/]/*9*/]._f2._f2, g_4268[l_12[v_2/*1*/]/*9*/]._f2._f1);
}
l_1D += 0.07;
sub_4c1(255, 255, 255, 205);
sub_45c(l_1D, l_1E, "CELL_505", g_4268[l_12[v_2/*1*/]/*9*/]._f2._f3, g_4268[l_12[v_2/*1*/]/*9*/]._f2._f4);
l_1D = l_1B;
sub_4c1(255, 255, 255, 205);
if (v_2 == l_18) {
sub_497();
}
l_1E += 0.02;
UI::SET_TEXT_WRAP(0.0, 0.93);
sub_47f(l_1D, l_1E, &g_41BF[g_4268[l_12[v_2/*1*/]/*9*/]._f1/*42*/], 0);
l_1E += 0.05;
}
}
void sub_847(auto a_0, auto a_1, auto a_2, auto a_3, auto a_4, auto a_5, auto a_6) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION(a_0, a_1);
sub_631(a_2);
if (!GAMEPLAY::IS_STRING_NULL_OR_EMPTY(a_3)) {
sub_631(a_3);
}
if (!GAMEPLAY::IS_STRING_NULL_OR_EMPTY(a_4)) {
sub_631(a_4);
}
if (!GAMEPLAY::IS_STRING_NULL_OR_EMPTY(a_5)) {
sub_631(a_5);
}
if (!GAMEPLAY::IS_STRING_NULL_OR_EMPTY(a_6)) {
sub_631(a_6);
}
GRAPHICS::_POP_SCALEFORM_MOVIE_FUNCTION_VOID();
}
void sub_8a2(auto a_0, auto a_1, auto a_2, auto a_3, auto a_4, auto a_5, auto a_6) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION(a_0, a_1);
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(SYSTEM::ROUND(a_2));
if (a_3 != -1.0) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(SYSTEM::ROUND(a_3));
}
if (a_4 != -1.0) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(SYSTEM::ROUND(a_4));
}
if (a_5 != -1.0) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(SYSTEM::ROUND(a_5));
}
if (a_6 != -1.0) {
GRAPHICS::_PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(SYSTEM::ROUND(a_6));
}
GRAPHICS::_POP_SCALEFORM_MOVIE_FUNCTION_VOID();
}
void sub_905() {
l_17 = 0;
asm .vardef<F> 2, "[{\"offset\":0,\"value\":4}]"
for (v_7 = 0; v_7 < 4; v_7 += 1) {
v_8 = 0;
v_9 = 3;
g_4268[v_9/*9*/]._f2 = -1;
g_4268[v_9/*9*/]._f2._f1 = 0;
g_4268[v_9/*9*/]._f2._f2 = 0;
g_4268[v_9/*9*/]._f2._f3 = 0;
g_4268[v_9/*9*/]._f2._f5 = 0;
for (; v_8 < 4; v_8 += 1) {
if (v_2[v_8/*1*/] == 0) {
if (g_4268[v_8/*9*/]._f8 != 0) {
if (sub_9f0(g_4268[v_8/*9*/]._f2, g_4268[v_9/*9*/]._f2)) {
v_9 = v_8;
}
}
}
}
l_12[v_7/*1*/] = v_9;
v_2[v_9/*1*/] = 1;
if (g_4268[v_7/*9*/]._f8 != 0) {
l_17 += 1;
}
}
sub_57e(g_383A, "SET_DATA_SLOT", 14.0, 0.0, 25.0, -1.0, -1.0, "CELL_287", "CELL_280", 0, 0, 0);
}
auto sub_9f0(auto a_0, auto a_1, auto a_2, auto a_3, auto a_4, auto a_5, auto a_6, auto a_7, auto a_8, auto a_9, auto a_10, auto a_11) {
if (a_0._f5 < a_6._f5) {
return 0;
}
if (a_0._f5 > a_6._f5) {
return 1;
}
if (a_0._f5 == a_6._f5) {
if (a_0._f4 < a_6._f4) {
return 0;
}
if (a_0._f4 > a_6._f4) {
return 1;
}
if (a_0._f4 == a_6._f4) {
v_E = a_0;
v_E._f1 = a_0._f1 * 60;
v_E._f2 = a_0._f2 * 3600;
v_E._f3 = a_0._f3 * 86400;
v_1A = ((v_E + v_E._f1) + v_E._f2) + v_E._f3;
v_14 = a_6;
v_14._f1 = a_6._f1 * 60;
v_14._f2 = a_6._f2 * 3600;
v_14._f3 = a_6._f3 * 86400;
v_1B = ((v_14 + v_14._f1) + v_14._f2) + v_14._f3;
if ((v_1A > v_1B) || (v_1A == v_1B)) {
return 1;
} else {
return 0;
}
}
}
return 0;
}