-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path[clientscript,music_init].cs2
65 lines (65 loc) · 2.8 KB
/
[clientscript,music_init].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
// 250
[clientscript,music_init](component $component0, component $component1, component $component2, component $component3, component $component4, component $component5, component $component6, component $component7, component $component8, component $component9, component $component10)
cc_deleteall($component1);
if_setscrollpos(0, 0, $component2);
if_setontimer("music_init_counter($component4)", $component4);
~music_vartransmit_setup($component1, $component4);
def_int $int11 = db_find_with_count(dbtable_44:8, false);
def_int $intarray0($int11);
def_int $int12 = 0;
while ($int12 < $int11) {
$intarray0($int12) = $int12;
cc_create($component1, ^iftype_text, $int12);
cc_sethide(true);
$int12 = calc($int12 + 1);
}
def_int $int13 = 15;
if (~on_mobile = true) {
$int13 = scale(4, 3, $int13);
}
def_int $int14 = calc(3 + $int11 * $int13 + 3);
if_setscrollsize(0, $int14, $component2);
if ($int11 > 1) {
~music_sort(intarray0, 0, calc($int11 - 1));
}
$int12 = 0;
def_dbrow $dbrow15 = null;
def_string $text0 = "";
while ($int12 < $int11) {
if (cc_find($component1, $intarray0($int12)) = ^true) {
cc_sethide(false);
cc_setsize(0, $int14, ^setsize_minus, ^setsize_abs);
cc_setposition(0, 0, ^setpos_abs_centre, ^setpos_abs_top);
$dbrow15 = db_findbyindex($intarray0($int12));
if ($dbrow15 ! null) {
cc_setsize(0, $int13, ^setsize_minus, ^setsize_abs);
cc_setposition(0, calc(3 + $int12 * $int13), ^setpos_abs_centre, ^setpos_abs_top);
cc_settextfont(p12_full);
cc_settextshadow(true);
cc_settextalign(^settextalign_left, ^settextalign_centre, 0);
$text0 = ~script7311($dbrow15);
cc_settext($text0);
cc_setop(1, "Play");
cc_setop(2, "Unlock hint");
cc_setopbase("<col=ff9040><$text0></col>");
if (~music_isunlocked($dbrow15) = 1) {
~music_setcolour(0x0dc10d);
} else {
~music_setcolour(^red);
}
cc_setonmouseover("cc_colour_swapper(event_com, event_comsubid, ^white)");
} else {
cc_sethide(true);
}
}
$int12 = calc($int12 + 1);
}
~music_optionbuttons($component6, $component8, $component10);
if_setonvartransmit("music_optionbuttons_resynch($component6, $component8, $component10){var18, var19}", $component0);
if_setonop("music_optionbuttons_setmode(event_op, 0, $component6, $component8, $component10)", $component5);
if_setonop("music_optionbuttons_setmode(event_op, 1, $component6, $component8, $component10)", $component7);
if_setonop("music_optionbuttons_setmode(event_op, 2, $component6, $component8, $component10)", $component9);
cc_deleteall($component3);
%varcint75 = ~max(0, ~min(calc($int14 - if_getheight($component2)), %varcint75));
~scrollbar_vertical($component3, $component2, "scrollbar_dragger_v2,3", "scrollbar_dragger_v2,0", "scrollbar_dragger_v2,1", "scrollbar_dragger_v2,2", "scrollbar_v2,0", "scrollbar_v2,1");
~scrollbar_resize($component3, $component2, %varcint75);