This repository was archived by the owner on Feb 4, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy path[proc,death_office_redraw].cs2
81 lines (81 loc) · 3.46 KB
/
[proc,death_office_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
// 3492
[proc,death_office_redraw](component $component0, component $component1, component $component2, component $component3, component $component4, component $component5, component $component6, component $component7)
def_int $width8 = if_getwidth($component0);
def_int $int9 = ~max(1, calc($width8 / (36 + 10)));
def_int $int10 = 0;
if ($int9 > 1) {
$int10 = calc(($width8 - $int9 * 36) / ($int9 - 1));
}
def_int $int11 = calc($width8 - ($int9 * 36 + ($int9 - 1) * $int10));
def_int $int12 = calc(($int11 + 1) / 2);
def_int $int13 = 0;
def_obj $obj14 = null;
def_int $int15 = 0;
def_obj $obj16 = null;
def_int $int17 = 0;
def_int $int18 = 0;
while ($int18 < 120) {
if (cc_find($component0, $int18) = ^true) {
$obj14 = inv_getobj(inv_636, $int18);
if ($obj14 ! null) {
cc_sethide(false);
cc_setobject($obj14, inv_getnum(inv_636, $int18));
cc_setopbase("<col=ff9040><oc_name($obj14)></col>");
$int13 = calc($int15 / $int9 * (32 + 10));
cc_setposition(calc($int12 + $int15 % $int9 * (36 + $int10)), $int13, ^setpos_abs_left, ^setpos_abs_top);
if (%var262 = $int18) {
cc_setoutline(2);
$obj16, $int17 = $obj14, inv_total(inv_636, $obj14);
} else {
cc_setoutline(1);
}
$int15 = calc($int15 + 1);
} else {
cc_sethide(true);
}
}
$int18 = calc($int18 + 1);
}
if ($int13 >= 0) {
$int13 = calc($int13 + 32);
if_setscrollpos(0, ~min(if_getscrolly($component0), calc($int13 - if_getheight($component0))), $component0);
if_setscrollsize(0, $int13, $component0);
} else {
if_setscrollpos(0, 0, $component0);
if_setscrollsize(0, 0, $component0);
}
~scrollbar_vertical_rebuild($component1, $component0);
def_string $string0 = "";
def_string $string1 = ",";
if ($obj16 ! null) {
if_sethide(false, $component2);
if_sethide(false, $component3);
if_sethide(false, $component4);
if_sethide(false, $component5);
if_setsize(if_getx($component2), 0, ^setsize_abs, ^setsize_minus, $component7);
if_settextfont(p11_full, $component7);
if ($int17 > 1) {
if (%var263 ! 1) {
if (calc(^max_32bit_int / $int17) < %var263) {
$string0 = "Fee: <col=ffffff><~tostring_spacer(%var263, $string1)> coins</col> each";
} else {
$string0 = "Fee: <col=ffffff><~tostring_spacer(%var263, $string1)> coins</col> each (<col=ffffff><~tostring_spacer(calc($int17 * %var263), $string1)></col>)";
}
if_settext("<~tostring_spacer($int17, $string1)> x <oc_name($obj16)>:<br><$string0><br>Death's Coffer: <col=ffffff><~tostring_spacer(%var261, $string1)> coins</col>", $component7);
} else {
if_settext("<~tostring_spacer($int17, $string1)> x <oc_name($obj16)>:<br>Fee: <col=ffffff>1 coin</col> each<br>Death's Coffer: <col=ffffff><~tostring_spacer(%var261, $string1)> coins</col>", $component7);
}
} else if (%var263 ! 1) {
if_settext("<oc_name($obj16)>:<br>Fee: <col=ffffff><~tostring_spacer(%var263, $string1)> coins</col><br>Death's Coffer: <col=ffffff><~tostring_spacer(%var261, $string1)> coins</col>", $component7);
} else {
if_settext("<oc_name($obj16)>:<br>Fee: <col=ffffff>1 coin</col><br>Death's Coffer: <col=ffffff><~tostring_spacer(%var261, $string1)> coins</col>", $component7);
}
} else {
if_sethide(true, $component2);
if_sethide(true, $component3);
if_sethide(true, $component4);
if_sethide(true, $component5);
if_setsize(if_getx($component6), 0, ^setsize_abs, ^setsize_minus, $component7);
if_settextfont(p12_full, $component7);
if_settext("Select an item to retrieve.<br>Death's Coffer: <col=ffffff><~tostring_spacer(%var261, $string1)></col>", $component7);
}