-
Notifications
You must be signed in to change notification settings - Fork 11
/
[proc,trade_confirm_redraw].cs2
191 lines (191 loc) · 5.98 KB
/
[proc,trade_confirm_redraw].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
// 768
[proc,trade_confirm_redraw](int $size0, int $width1, int $x2, component $component3, component $component4, component $component5, component $component6)
if (%varbit4375 = 1) {
if_settext("Trade modified", $component6);
} else {
if_settext("", $component6);
}
cc_deleteall($component3);
cc_deleteall($component4);
cc_deleteall($component5);
def_int $int7 = calc(($size0 + 1) / 2);
def_int $int8 = calc(clientclock - 750);
def_int $int9 = 0;
def_int $int10 = 0;
def_int $size11 = 0;
while ($size11 < $size0) {
if (inv_getobj(inv_90, $size11) ! null) {
$int9 = calc($int9 + 1);
}
if (invother_getobj(inv_90, $size11) ! null) {
$int10 = calc($int10 + 1);
} else if (~script148($size11) > $int8) {
$int10 = calc($int10 + 1);
}
$size11 = calc($size11 + 1);
}
def_obj $obj12 = null;
def_string $string0 = "";
def_int $width13 = $width1;
def_int $width14 = $width1;
if ($int9 > $int7) {
$width13 = $x2;
}
if ($int10 > $int7) {
$width14 = $x2;
}
def_int $x15 = 0;
def_int $y16 = 0;
def_int $int17 = 0;
def_int $int18 = 0;
def_int $int19 = 0;
def_int $int20 = 0;
def_int $int21 = 0;
def_int $int22 = 0;
$size11 = 0;
while ($size11 < $size0) {
$obj12 = inv_getobj(inv_90, $size11);
if ($obj12 ! null) {
cc_create($component3, ^iftype_text, $int17);
cc_setsize($width13, 17, ^setsize_abs, ^setsize_abs);
cc_setcolour(0xff9040);
cc_settextalign(^settextalign_centre, ^settextalign_centre, 0);
cc_settextshadow(true);
$string0 = ~trade_confirm_itemtext($obj12, inv_getnum(inv_90, $size11));
if ($int9 > $int7) {
if (parawidth($string0, 512, p12_full) > $x2) {
cc_settextfont(p11_full);
} else {
cc_settextfont(p12_full);
}
if (calc($int17 % 2) = 0) {
cc_setposition($x2, calc($int17 / 2 * 12), ^setpos_abs_left, ^setpos_abs_top);
} else {
cc_setposition($width1, calc($int17 / 2 * 12), ^setpos_abs_left, ^setpos_abs_top);
}
} else {
if (parawidth($string0, 512, p12_full) > $width1) {
cc_settextfont(p11_full);
} else if (parawidth($string0, 512, b12_full) > $width1) {
cc_settextfont(p12_full);
} else {
cc_settextfont(b12_full);
}
cc_setposition($x2, calc($int17 * 12), ^setpos_abs_left, ^setpos_abs_top);
}
cc_settext($string0);
$int17 = calc($int17 + 1);
}
$obj12 = invother_getobj(inv_90, $size11);
$int20 = ~script148($size11);
if ($obj12 ! null) {
cc_create($component4, ^iftype_text, $int18);
cc_setsize($width14, 17, ^setsize_abs, ^setsize_abs);
cc_setcolour(0xff9040);
cc_settextalign(^settextalign_centre, ^settextalign_centre, 0);
cc_settextshadow(true);
$string0 = ~trade_confirm_itemtext($obj12, invother_getnum(inv_90, $size11));
if ($int10 > $int7) {
if (parawidth($string0, 512, p12_full) > $x2) {
cc_settextfont(p11_full);
} else {
cc_settextfont(p12_full);
}
$y16 = calc($int18 / 2 * 12);
if (calc($int18 % 2) = 0) {
cc_setposition($x2, $y16, ^setpos_abs_left, ^setpos_abs_top);
$x15 = 0;
} else {
cc_setposition($width1, $y16, ^setpos_abs_left, ^setpos_abs_top);
$x15 = $x2;
}
} else {
if (parawidth($string0, 512, p12_full) > $width1) {
cc_settextfont(p11_full);
} else if (parawidth($string0, 512, b12_full) > $width1) {
cc_settextfont(p12_full);
} else {
cc_settextfont(b12_full);
}
$y16 = calc($int18 * 12);
cc_setposition($x2, $y16, ^setpos_abs_left, ^setpos_abs_top);
$x15 = 0;
}
cc_settext($string0);
if ($int20 > $int8) {
.cc_create($component5, ^iftype_rectangle, $int19);
.cc_setsize($width14, 12, ^setsize_abs, ^setsize_abs);
.cc_setposition($x15, $y16, ^setpos_abs_left, ^setpos_abs_top);
.cc_setcolour(^red);
.cc_setfill(true);
.cc_settrans(255);
.cc_setontimer("trade_slot_flasher(event_com, event_comsubid, $int20)");
$int19 = calc($int19 + 1);
.cc_create($component5, ^iftype_rectangle, $int19);
.cc_setsize($width14, 12, ^setsize_abs, ^setsize_abs);
.cc_setposition($x15, $y16, ^setpos_abs_left, ^setpos_abs_top);
.cc_setcolour(0x990000);
.cc_setfill(false);
.cc_settrans(255);
.cc_setontimer("trade_slot_flasher(event_com, event_comsubid, $int20)");
$int19 = calc($int19 + 1);
}
$int18 = calc($int18 + 1);
} else if ($int20 > $int8) {
$int21 = calc($int21 + 1);
if ($int20 > $int22) {
$int22 = $int20;
}
}
$size11 = calc($size11 + 1);
}
if ($int17 <= 0) {
cc_create($component3, ^iftype_text, 0);
cc_setsize($width1, 17, ^setsize_abs, ^setsize_abs);
cc_setposition($x2, 0, ^setpos_abs_left, ^setpos_abs_top);
cc_setcolour(^white);
cc_settextalign(^settextalign_centre, ^settextalign_centre, 0);
cc_settextshadow(true);
cc_settext("Absolutely nothing!");
cc_settextfont(b12_full);
$int17 = calc($int17 + 1);
}
if ($int18 <= 0) {
cc_create($component4, ^iftype_text, 0);
cc_setsize($width1, 17, ^setsize_abs, ^setsize_abs);
cc_setposition($x2, 0, ^setpos_abs_left, ^setpos_abs_top);
cc_setcolour(^white);
cc_settextalign(^settextalign_centre, ^settextalign_centre, 0);
cc_settextshadow(true);
cc_settext("Absolutely nothing!");
cc_settextfont(b12_full);
$int18 = calc($int18 + 1);
}
while ($int21 > 0) {
$int21 = calc($int21 - 1);
cc_create($component5, ^iftype_rectangle, $int19);
$int19 = calc($int19 + 1);
.cc_create($component5, ^iftype_rectangle, $int19);
$int19 = calc($int19 + 1);
cc_setsize($width14, 12, ^setsize_abs, ^setsize_abs);
.cc_setsize($width14, 12, ^setsize_abs, ^setsize_abs);
if ($int10 > $int7) {
if (calc($int18 % 2) = 0) {
cc_setposition($x2, calc($int18 / 2 * 12), ^setpos_abs_left, ^setpos_abs_top);
} else {
cc_setposition($width1, calc($int18 / 2 * 12), ^setpos_abs_left, ^setpos_abs_top);
}
} else {
cc_setposition(0, calc($int18 * 12), ^setpos_abs_left, ^setpos_abs_top);
}
.cc_setposition(cc_getx, cc_gety, ^setpos_abs_left, ^setpos_abs_top);
cc_setcolour(^red);
.cc_setcolour(0x990000);
cc_setfill(true);
.cc_setfill(false);
cc_settrans(255);
.cc_settrans(255);
cc_setontimer("trade_slot_flasher(event_com, event_comsubid, $int22)");
.cc_setontimer("trade_slot_flasher(event_com, event_comsubid, $int22)");
$int18 = calc($int18 + 1);
}