-
Notifications
You must be signed in to change notification settings - Fork 11
/
[proc,script2990].cs2
54 lines (54 loc) · 2.88 KB
/
[proc,script2990].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
// 2990
[proc,script2990](component $component0, int $int1, int $int2, int $int3, int $int4, int $int5, int $int6, int $int7, int $int8, string $string0)(int)
def_int $int9 = 0;
def_int $x10 = calc($int2 - 9 + $int4);
def_int $y11 = calc($int3 - 9 + $int5);
def_int $width12 = calc($int2 - 18);
def_int $height13 = calc($int3 - 18);
def_int $int14 = 5;
cc_create($component0, ^iftype_rectangle, $int1);
def_int $width15 = 0;
if ($int6 >= $int7) {
$width15 = calc($int2 - 4);
} else {
$width15 = scale($int6, $int7, calc($int2 - 4));
}
cc_setsize($width15, $int3, ^setsize_abs, ^setsize_abs);
cc_setposition(calc(2 + $int4), $int5, ^setpos_abs_left, ^setpos_abs_top);
def_int $int16 = calc($int7 / 2);
def_int $int17 = 0;
def_int $int18 = 0;
if ($int7 > 0) {
if ($int6 <= $int16) {
$int17, $int18 = 150, interpolate(0, $int6, 0, $int16, 150);
} else {
$int17, $int18 = calc(150 - interpolate(0, $int6 - $int16, 0, $int16, 150)), 150;
}
}
cc_setcolour(~rgb_to_hex($int17, $int18, 0));
cc_setfill(true);
$int1 = calc($int1 + 1);
~create_graphic($component0, calc($int1 + 0), "ap_border,0", $int4, $int5, ^setpos_abs_left, ^setpos_abs_top, 9, 9, ^setsize_abs, ^setsize_abs);
~create_graphic($component0, calc($int1 + 1), "ap_border,1", $x10, $int5, ^setpos_abs_left, ^setpos_abs_top, 9, 9, ^setsize_abs, ^setsize_abs);
~create_graphic($component0, calc($int1 + 2), "ap_border,2", $int4, $y11, ^setpos_abs_left, ^setpos_abs_top, 9, 9, ^setsize_abs, ^setsize_abs);
~create_graphic($component0, calc($int1 + 3), "ap_border,3", $x10, $y11, ^setpos_abs_left, ^setpos_abs_top, 9, 9, ^setsize_abs, ^setsize_abs);
~create_graphic($component0, calc($int1 + 4), "ap_border,4", $int4, calc(9 + $int5), ^setpos_abs_left, ^setpos_abs_top, 9, $height13, ^setsize_abs, ^setsize_abs);
~create_graphic($component0, calc($int1 + 5), "ap_border,5", calc($int4 + 9), $int5, ^setpos_abs_left, ^setpos_abs_top, $width12, 9, ^setsize_abs, ^setsize_abs);
~create_graphic($component0, calc($int1 + 6), "ap_border,6", $x10, calc(9 + $int5), ^setpos_abs_left, ^setpos_abs_top, 9, $height13, ^setsize_abs, ^setsize_abs);
~create_graphic($component0, calc($int1 + 7), "ap_border,7", calc($int4 + 9), $y11, ^setpos_abs_left, ^setpos_abs_top, $width12, 9, ^setsize_abs, ^setsize_abs);
cc_create($component0, ^iftype_text, calc($int1 + 8));
cc_setsize($int2, calc($int3 - 3), ^setsize_abs, ^setsize_abs);
cc_setposition($int4, calc($int5 + 3), ^setpos_abs_left, ^setpos_abs_top);
def_string $string1 = ",";
if ($int6 = 0 & $int7 = 0 | ($int6 = -1 | $int7 = -1)) {
cc_settext("N/A");
} else if ($int8 = 0) {
cc_settext("<~tostring_spacer($int6, $string1)>/<~tostring_spacer($int7, $string1)><$string0>");
} else {
cc_settext("<tostring(calc($int6 / 10))>.<tostring(calc($int6 % 10))>/<tostring(100)><$string0>");
}
cc_setcolour(0xff981f);
cc_settextfont(b12_full);
cc_settextshadow(true);
cc_settextalign(^settextalign_centre, ^settextalign_centre, 0);
return(calc($int1 + 9));