-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path[proc,rebuildchatbox].cs2
310 lines (310 loc) · 16.5 KB
/
[proc,rebuildchatbox].cs2
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
// 84
[proc,rebuildchatbox](int $mesuid0)
def_int $width1 = if_getwidth(interface_162:56);
def_string $string0 = removetags(chat_playername);
def_int $int2 = 0;
if (%varcint41 = 3) {
$int2 = 1;
}
def_int $int3 = 0;
def_boolean $boolean4 = false;
def_int $int5 = 0;
def_string $string1 = "<col=004f00>";
def_string $string2 = "<col=0000ff>";
def_string $string3 = "<col=0000ff>";
def_string $string4 = "";
def_string $string5 = "";
def_string $string6 = "";
def_string $string7 = "";
def_string $string8 = "";
def_string $string9 = "";
def_string $string10 = "";
def_string $string11 = "";
if (~toplevel_chatbox_maketransparent = 1) {
$int3, $boolean4, $int5 = 16777215, true, 1;
$string1, $string2, $string3 = "<col=30ff30>", "<col=9070ff>", "<col=9070ff>";
$string4 = ~script3739(struct_param(public_chat_2897, param_1230), "col");
$string5 = ~script3739(struct_param(private_chat_2899, param_1230), "col");
$string6 = ~script3739(struct_param(auto_chat_2902, param_1230), "col");
$string8 = ~script3739(struct_param(clan_chat_2909, param_1230), "col");
$string7 = ~script3739(struct_param(friend_chat_2907, param_1230), "col");
$string9 = ~script3739(struct_param(incoming_trade_request_2911, param_1230), "col");
$string10 = ~script3739(struct_param(incoming_challenge_request_2913, param_1230), "col");
$string11 = ~script3739(struct_param(guest_clan_chat_2976, param_1230), "col");
} else {
$string4 = ~script3739(struct_param(public_chat_2896, param_1230), "col");
$string5 = ~script3739(struct_param(private_chat_2898, param_1230), "col");
$string6 = ~script3739(struct_param(auto_chat_2901, param_1230), "col");
$string7 = ~script3739(struct_param(friend_chat_2906, param_1230), "col");
$string8 = ~script3739(struct_param(clan_chat_2908, param_1230), "col");
$string9 = ~script3739(struct_param(incoming_trade_request_2910, param_1230), "col");
$string10 = ~script3739(struct_param(incoming_challenge_request_2912, param_1230), "col");
$string11 = ~script3739(struct_param(guest_clan_chat_2975, param_1230), "col");
}
def_string $string12 = ~script3739($int3, "col");
$string4, $string5, $string6, $string12, $string7, $string8, $string9, $string10, $string11 = ~script4484($string4, $string5, $string6, $string12, $string7, $string8, $string9, $string10, $string11, $int5);
def_int $int6 = 0;
def_int $int7 = 0;
def_int $int8 = 0;
def_component $component9 = enum(int, component, enum_579, $int8);
if ((%varcint41 = 0 | %varcint41 = 2) & string_length(chat_getmessagefilter) > 0) {
$int7 = ~script199("<$string4>Public chat filtering:</col> <lt><lowercase(escape(chat_getmessagefilter))><gt>", $int8, $component9, interface_162:56, $width1, 3, 14, $int6, ^setpos_abs_top, 103, $int3, $boolean4);
if_clearops($component9);
if_setonop(null, $component9);
if_setonmouserepeat(null, $component9);
if_setonmouseleave(null, $component9);
$int6 = calc($int6 - $int7);
$int8 = calc($int8 + 1);
$component9 = enum(int, component, enum_579, $int8);
}
def_int $mesuid10 = $mesuid0;
def_int $chattype11 = ^chattype_gamemessage;
def_int $int12 = -1;
def_string $string13 = "";
def_string $string14 = "";
def_string $string15 = "";
def_string $string16 = "";
def_int $int13 = -1;
def_int $int14 = 0;
def_int $int15 = 0;
def_string $string17 = "";
def_graphic $graphic16 = null;
def_int $clanslot17 = -1;
def_int $int18 = -1;
def_int $int19 = 126;
def_int $int20 = 126;
if (activeclansettings_find_affined(0) = true & activeclanchannel_find_affined(0) = true) {
$clanslot17 = activeclanchannel_getuserslot($string0);
if ($clanslot17 ! -1) {
$int18 = activeclanchannel_getuserrank($clanslot17);
}
$int19, $int20 = activeclanchannel_getrankkick, ~clan_permission_get(ban_from_chat_2956);
}
def_string $string18 = "";
def_int $int21 = 0;
while ($mesuid10 ! -1 & $component9 ! null) {
$chattype11, $int12, $string13, $string14, $string15, $int15, $string18, $int21 = chat_gethistoryex_byuid($mesuid10);
if (~panetest($chattype11, $string13, $int15) = 1 & ~filtertest($chattype11, $string13, ~script4742($string18, $string15), $int12, $int2, $string0, $int15) = 1) {
switch_int ($chattype11) {
case ^chattype_publicchat, ^chattype_modchat :
$int7 = ~script203(~script4742($string18, "<$string13>:"), "<$string4><$string15></col>", $int8, $component9, interface_162:56, $width1, 3, 14, $int6, ^setpos_abs_top, 103, $int3, $boolean4);
case ^chattype_autotyper, ^chattype_modautotyper :
$int7 = ~script203(~script4742($string18, "<$string13>:"), "<$string6><$string15></col>", $int8, $component9, interface_162:56, $width1, 3, 14, $int6, ^setpos_abs_top, 103, $int3, $boolean4);
case ^chattype_privatechat, ^chattype_modprivatechat :
$int7 = ~script203(~script4742($string18, "From <$string13>:"), "<$string5><$string15></col>", $int8, $component9, interface_162:56, $width1, 3, 14, $int6, ^setpos_abs_top, 103, $int3, $boolean4);
case ^chattype_tradereq :
$int7 = ~script199(~script4742($string18, "<$string9><$string15></col>"), $int8, $component9, interface_162:56, $width1, 3, 14, $int6, ^setpos_abs_top, 103, $int3, $boolean4);
case ^chattype_loginlogoutnotification :
$int7 = ~script199(~script4742($string18, "<$string5><$string15></col>"), $int8, $component9, interface_162:56, $width1, 3, 14, $int6, ^setpos_abs_top, 103, $int3, $boolean4);
if (%varbit1627 = 0) {
%varcint65 = calc($int12 + 500 + 1);
if_setontimer("script664(false)", interface_162:0);
}
case ^chattype_privatechatout :
$int7 = ~script203(~script4742($string18, "To <$string13>:"), "<$string5><$string15></col>", $int8, $component9, interface_162:56, $width1, 3, 14, $int6, ^setpos_abs_top, 103, $int3, $boolean4);
case ^chattype_chalreq_trade, ^chattype_chalreq_friendschat, 110 :
$int7 = ~script199(~script4742($string18, "<$string10><$string15></col>"), $int8, $component9, interface_162:56, $width1, 3, 14, $int6, ^setpos_abs_top, 103, $int3, $boolean4);
case 109 :
$int7 = ~script199(~script4742($string18, "<col=1a31f2><$string15></col>"), $int8, $component9, interface_162:56, $width1, 3, 14, $int6, ^setpos_abs_top, 103, $int3, $boolean4);
case ^chattype_friendschat :
$int7 = ~script203(~script4742($string18, "[<$string3><$string14></col>] <$string13>:"), "<$string7><$string15></col>", $int8, $component9, interface_162:56, $width1, 3, 14, $int6, ^setpos_abs_top, 103, $int3, $boolean4);
case 41 :
if (activeclansettings_find_affined(0) = true & activeclanchannel_find_affined(0) = true) {
$clanslot17 = activeclanchannel_getuserslot(removetags($string13));
if ($clanslot17 ! -1) {
$string17, $graphic16 = ~script4302(activeclanchannel_getuserrank($clanslot17));
if ($graphic16 ! null) {
$int7 = ~script4483(~script4742($string18, "[<$string2><$string14></col>]"), $graphic16, 13, 13, "<$string13>:", "<$string8><$string15></col>", $int8, $component9, interface_162:56, $width1, 3, 14, $int6, ^setpos_abs_top, 103, $int3, $boolean4);
} else {
$int7 = ~script4483(~script4742($string18, "[<$string2><$string14></col>]"), null, 0, 0, "<$string2><$string17></col> <$string13>:", "<$string8><$string15></col>", $int8, $component9, interface_162:56, $width1, 3, 14, $int6, ^setpos_abs_top, 103, $int3, $boolean4);
}
} else {
$string17, $graphic16 = ~script4302(-1);
$int7 = ~script4483(~script4742($string18, "[<$string2><$string14></col>]"), $graphic16, 13, 13, "<$string13>:", "<$string8><$string15></col>", $int8, $component9, interface_162:56, $width1, 3, 14, $int6, ^setpos_abs_top, 103, $int3, $boolean4);
}
} else {
$int7 = ~script4483(~script4742($string18, "[<$string2><$string14></col>]"), null, 0, 0, "<$string13>:", "<$string8><$string15></col>", $int8, $component9, interface_162:56, $width1, 3, 14, $int6, ^setpos_abs_top, 103, $int3, $boolean4);
}
case 44 :
if (activeclansettings_find_listened = true & activeclanchannel_find_listened = true) {
$clanslot17 = activeclanchannel_getuserslot(removetags($string13));
if ($clanslot17 ! -1) {
$string17, $graphic16 = ~script4302(activeclanchannel_getuserrank($clanslot17));
if ($graphic16 ! null) {
$int7 = ~script4483(~script4742($string18, "[<$string2><$string14></col>]"), $graphic16, 13, 13, "<$string13>:", "<$string11><$string15></col>", $int8, $component9, interface_162:56, $width1, 3, 14, $int6, ^setpos_abs_top, 103, $int3, $boolean4);
} else {
$int7 = ~script4483(~script4742($string18, "[<$string2><$string14></col>]"), null, 0, 0, "<$string2><$string17></col> <$string13>:", "<$string11><$string15></col>", $int8, $component9, interface_162:56, $width1, 3, 14, $int6, ^setpos_abs_top, 103, $int3, $boolean4);
}
} else {
$string17, $graphic16 = ~script4302(-1);
$int7 = ~script4483(~script4742($string18, "[<$string2><$string14></col>]"), $graphic16, 13, 13, "<$string13>:", "<$string11><$string15></col>", $int8, $component9, interface_162:56, $width1, 3, 14, $int6, ^setpos_abs_top, 103, $int3, $boolean4);
}
} else {
$int7 = ~script4483(~script4742($string18, "[<$string2><$string14></col>]"), null, 0, 0, "<$string13>:", "<$string11><$string15></col>", $int8, $component9, interface_162:56, $width1, 3, 14, $int6, ^setpos_abs_top, 103, $int3, $boolean4);
}
case 43 :
if (activeclanchannel_find_affined(0) = true) {
$int7 = ~script4483(~script4742($string18, "[<$string2><activeclanchannel_getclanname></col>]"), null, 0, 0, "", $string15, $int8, $component9, interface_162:56, $width1, 3, 14, $int6, ^setpos_abs_top, 103, $int3, $boolean4);
} else {
$int7 = ~script4483(~script4742($string18, ""), null, 0, 0, "", $string15, $int8, $component9, interface_162:56, $width1, 3, 14, $int6, ^setpos_abs_top, 103, $int3, $boolean4);
}
case 46 :
if (activeclanchannel_find_listened = true) {
$int7 = ~script4483(~script4742($string18, "[<$string2><activeclanchannel_getclanname></col>]"), null, 0, 0, "", $string15, $int8, $component9, interface_162:56, $width1, 3, 14, $int6, ^setpos_abs_top, 103, $int3, $boolean4);
} else {
$int7 = ~script4483(~script4742($string18, ""), null, 0, 0, "", $string15, $int8, $component9, interface_162:56, $width1, 3, 14, $int6, ^setpos_abs_top, 103, $int3, $boolean4);
}
case ^chattype_broadcast :
$string15, $string16, $int13 = ~chat_broadcast_parseurl($string15);
$int7 = ~script203(~script4742($string18, "<$string1>Broadcast:</col>"), "<$string12><$string15></col>", $int8, $component9, interface_162:56, $width1, 3, 14, $int6, ^setpos_abs_top, 103, $int3, $boolean4);
case ^chattype_10sectimeout :
if (calc(clientclock - $int12) > 500) {
$int7 = ~script199("jk :P", $int8, $component9, interface_162:56, $width1, 3, 14, $int6, ^setpos_abs_top, 103, $int3, $boolean4);
} else {
$int7 = ~script199(~script4742($string18, $string15), $int8, $component9, interface_162:56, $width1, 3, 14, $int6, ^setpos_abs_top, 103, $int3, $boolean4);
}
case default :
$int7 = ~script199(~script4742($string18, $string15), $int8, $component9, interface_162:56, $width1, 3, 14, $int6, ^setpos_abs_top, 103, $int3, $boolean4);
}
if_clearops($component9);
switch_int ($chattype11) {
case ^chattype_modchat, ^chattype_publicchat, ^chattype_privatechat, ^chattype_privatechatout, ^chattype_modprivatechat, ^chattype_friendschat, ^chattype_autotyper, ^chattype_modautotyper, ^chattype_playerrelated, 41, 44 :
if_setopbase("<col=ffffff><$string13></col>", $component9);
if_setonop("chat_op(event_opindex, event_opbase, $chattype11)", $component9);
if_setonmouserepeat(null, $component9);
if_setonmouseleave(null, $component9);
if (compare($string0, removetags($string13)) ! 0) {
if ($int15 = 1) {
if_setop(6, "Message", $component9);
} else {
if_setop(6, "Add friend", $component9);
if_setop(7, "Add ignore", $component9);
}
if_setop(8, "Report", $component9);
if ($chattype11 = ^chattype_friendschat) {
if (clan_getchatcount > 0 & clan_getchatrank >= clan_getchatminkick) {
if_setop(9, "Kick", $component9);
}
} else if ($chattype11 = 41 & $int18 >= $int19 & activeclanchannel_find_affined(0) = true) {
$clanslot17 = activeclanchannel_getuserslot(removetags($string13));
if ($clanslot17 = -1 | activeclanchannel_getuserrank($clanslot17) <= -1) {
if_setop(9, "Kick", $component9);
if ($int18 >= $int20) {
if_setop(10, "Ban", $component9);
}
}
}
}
case ^chattype_tradereq :
if_setopbase("<col=ffffff><$string13></col>", $component9);
if_setonop("chat_op(event_opindex, event_opbase, $chattype11)", $component9);
if_setonmouserepeat(null, $component9);
if_setonmouseleave(null, $component9);
if_setop(1, "Accept trade", $component9);
if ($int15 = 1) {
if_setop(6, "Message", $component9);
} else {
if_setop(6, "Add friend", $component9);
if_setop(7, "Add ignore", $component9);
}
case ^chattype_chalreq_trade, ^chattype_chalreq_friendschat, 110 :
if_setopbase("<col=ffffff><$string13></col>", $component9);
if_setonop("chat_op(event_opindex, event_opbase, $chattype11)", $component9);
if_setonmouserepeat(null, $component9);
if_setonmouseleave(null, $component9);
if_setop(2, "Accept challenge", $component9);
if ($int15 = 1) {
if_setop(6, "Message", $component9);
} else {
if_setop(6, "Add friend", $component9);
if_setop(7, "Add ignore", $component9);
}
case ^chattype_broadcast :
if (string_length($string16) > 0 & $int13 ! -1) {
if_setop(6, "Open", $component9);
if_setop(7, "Check", $component9);
if_setonmouserepeat("chat_recol(if_getlayer($component9), $int8, 0x3030ff)", $component9);
if_setonmouseleave("chat_recol(if_getlayer($component9), $int8, $int3)", $component9);
} else {
if_setonmouserepeat(null, $component9);
if_setonmouseleave(null, $component9);
}
if_setop(9, "Clear history", $component9);
if_setopbase("<col=ff9040>Notification</col>", $component9);
if_setonop("chat_broadcast_op(event_opindex, $string16, $int13)", $component9);
case 109 :
if_setopbase("<col=0xffffff><$string13></col>", $component9);
if_setop(2, "Form clan", $component9);
if_setonop("chat_op(event_opindex, event_opbase, $chattype11)", $component9);
if_setonmouserepeat(null, $component9);
if_setonmouseleave(null, $component9);
if ($int15 = 1) {
if_setop(6, "Message", $component9);
} else {
if_setop(6, "Add friend", $component9);
if_setop(7, "Add ignore", $component9);
}
case default :
if_setonop(null, $component9);
if_setonmouserepeat(null, $component9);
if_setonmouseleave(null, $component9);
}
$int6 = calc($int6 - $int7);
$int8 = calc($int8 + 1);
$component9 = enum(int, component, enum_579, $int8);
}
$mesuid10 = chat_getprevuid($mesuid10);
}
def_int $int22 = $int8;
while ($component9 ! null) {
if_clearops($component9);
if_setonop(null, $component9);
if_setonmouserepeat(null, $component9);
if_setonmouseleave(null, $component9);
if_setsize(0, 0, ^setsize_abs, ^setsize_abs, $component9);
if (cc_find(interface_162:56, calc($int8 * 4)) = ^true) {
cc_settext("");
cc_sethide(true);
}
if (cc_find(interface_162:56, calc($int8 * 4 + 1)) = ^true) {
cc_settext("");
cc_sethide(true);
}
if (cc_find(interface_162:56, calc($int8 * 4 + 2)) = ^true) {
cc_settext("");
cc_sethide(true);
}
if (cc_find(interface_162:56, calc($int8 * 4 + 3)) = ^true) {
cc_sethide(true);
}
$int8 = calc($int8 + 1);
$component9 = enum(int, component, enum_579, $int8);
}
$int6 = calc($int6 - 2);
$int6 = calc(0 - $int6);
def_int $int23 = if_getheight(interface_162:56);
if ($int6 > $int23) {
$int23 = $int6;
}
$int8 = $int22;
while ($int8 > 0) {
$int8 = calc($int8 - 1);
$component9 = enum(int, component, enum_579, $int8);
$int6 = calc(if_gety($component9) + $int23 - 2);
if_setposition(if_getx($component9), $int6, ^setpos_abs_left, ^setpos_abs_top, $component9);
if (cc_find(interface_162:56, calc($int8 * 4)) = ^true) {
cc_setposition(cc_getx, $int6, ^setpos_abs_left, ^setpos_abs_top);
}
if (cc_find(interface_162:56, calc($int8 * 4 + 1)) = ^true) {
cc_setposition(cc_getx, $int6, ^setpos_abs_left, ^setpos_abs_top);
}
if (cc_find(interface_162:56, calc($int8 * 4 + 2)) = ^true) {
cc_setposition(cc_getx, $int6, ^setpos_abs_left, ^setpos_abs_top);
}
if (cc_find(interface_162:56, calc($int8 * 4 + 3)) = ^true) {
cc_setposition(cc_getx, $int6, ^setpos_abs_left, ^setpos_abs_top);
}
}
if_setscrollsize(0, $int23, interface_162:56);
~scrollbar_resize(interface_162:557, interface_162:56, calc(%varcint7 + ($int23 - %varcint8)));
%varcint7, %varcint8 = if_getscrolly(interface_162:56), $int23;