-
Notifications
You must be signed in to change notification settings - Fork 11
/
[proc,script3483].cs2
84 lines (84 loc) · 3.44 KB
/
[proc,script3483].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
// 3483
[proc,script3483](component $component0, component $component1, component $component2, component $component3, component $component4, component $component5)
def_string $string0 = ",";
def_obj $obj6 = null;
def_int $int7 = 0;
def_int $int8 = 0;
if (%var262 >= 0 & %var262 < inv_size(inv)) {
$obj6 = inv_getobj(inv, %var262);
}
if ($obj6 ! null) {
cc_settext(oc_name($obj6));
if (%var263 > 0) {
$int7 = ~min(%var263, inv_total(inv, $obj6));
if (%var264 >= 10000) {
if ($int7 > 1) {
.cc_settext("<~tostring_spacer($int7, $string0)> x <~tostring_spacer(%var264, $string0)> coins");
} else {
.cc_settext("<~tostring_spacer(%var264, $string0)> coins");
}
if (calc(^max_32bit_int / %var264) < $int7) {
~death_coffer_activebutton($component5, "Many coins", $component5);
} else {
~death_coffer_activebutton($component5, "<~tostring_spacer(calc($int7 * %var264), $string0)> coins", $component5);
}
} else if (%var264 = 1) {
if ($int7 > 1) {
.cc_settext("<~tostring_spacer($int7, $string0)> x <col=ff0000>1 coin</col>");
} else {
.cc_settext("<col=ff0000>1 coin</col>");
}
~death_coffer_activebutton($component5, "Unacceptable item", $component5);
} else {
if ($int7 > 1) {
.cc_settext("<~tostring_spacer($int7, $string0)> x <col=ff0000><~tostring_spacer(%var264, $string0)> coins</col>");
} else {
.cc_settext("<col=ff0000><~tostring_spacer(%var264, $string0)> coins</col>");
}
~death_coffer_activebutton($component5, "Unacceptable item", $component5);
}
} else {
.cc_settext("Select a quantity...");
~death_coffer_inactivebutton($component5, "", 0, $component5);
if_setontimer(null, $component5);
}
switch_int (%var263) {
case 1 :
~death_coffer_inactivebutton($component1, "1", 1, $component5);
if_setontimer(null, $component1);
~death_coffer_activebutton($component2, "5", $component5);
~death_coffer_activebutton($component3, "X", $component5);
~death_coffer_activebutton($component4, "All", $component5);
case 5 :
~death_coffer_activebutton($component1, "1", $component5);
~death_coffer_inactivebutton($component2, "5", 1, $component5);
if_setontimer(null, $component2);
~death_coffer_activebutton($component3, "X", $component5);
~death_coffer_activebutton($component4, "All", $component5);
case ^max_32bit_int :
~death_coffer_activebutton($component1, "1", $component5);
~death_coffer_activebutton($component2, "5", $component5);
~death_coffer_activebutton($component3, "X", $component5);
~death_coffer_inactivebutton($component4, "All", 1, $component5);
if_setontimer(null, $component4);
case default :
~death_coffer_activebutton($component1, "1", $component5);
~death_coffer_activebutton($component2, "5", $component5);
~death_coffer_inactivebutton($component3, "X", 1, $component5);
if_setontimer(null, $component3);
~death_coffer_activebutton($component4, "All", $component5);
}
} else {
cc_settext("Select an item...");
.cc_settext("---");
~death_coffer_inactivebutton($component1, "1", 0, $component5);
if_setontimer(null, $component1);
~death_coffer_inactivebutton($component2, "5", 0, $component5);
if_setontimer(null, $component2);
~death_coffer_inactivebutton($component3, "X", 0, $component5);
if_setontimer(null, $component3);
~death_coffer_inactivebutton($component4, "All", 0, $component5);
if_setontimer(null, $component4);
~death_coffer_inactivebutton($component5, "", 0, $component5);
if_setontimer(null, $component5);
}