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,worldswitcher_entry_draw].cs2
151 lines (151 loc) · 5.72 KB
/
[proc,worldswitcher_entry_draw].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
// 960
[proc,worldswitcher_entry_draw](component $component0, int $int1, int $int2, component $component3, int $comsubid4, int $world5, int $flags6, string $string0, int $int7, int $int8, int $int9, graphic $graphic10, fontmetrics $fontmetrics11, int $int12, int $width13, int $width14, int $width15, int $width16, int $x17, int $int18, int $int19, component $component20)(int)
def_int $int21 = 0;
def_int $int22 = 0;
if (map_world = $world5) {
$int21 = 1;
} else if (testbit($flags6, 7) = ^true) {
$int22 = enum(int, int, enum_1496, $world5);
if (testbit($flags6, 0) = ^true) {
if ($int18 < $int22) {
$int21 = 1;
}
} else if ($int19 < $int22) {
$int21 = 1;
}
}
def_int $trans23 = 255;
if ($int12 = 1) {
$trans23 = 245;
}
cc_create($component0, ^iftype_rectangle, $int1);
$int1 = calc($int1 + 1);
cc_setsize(0, $int9, ^setsize_minus, ^setsize_abs);
cc_setposition(0, $int2, ^setpos_abs_centre, ^setpos_abs_top);
cc_setfill(true);
if ($int21 = 0) {
cc_setcolour(^white);
cc_settrans($trans23);
if ($comsubid4 ! -1 & .cc_find($component3, $comsubid4) = ^true) {
.cc_sethide(false);
.cc_setposition(0, $int2, ^setpos_abs_centre, ^setpos_abs_top);
.cc_setonmouserepeat("script7274(true, event_com, event_comsubid, $component0, cc_getid, $component20, $string0, $trans23)");
.cc_setonmouseleave("script7274(false, event_com, event_comsubid, $component0, cc_getid, $component20, $string0, $trans23)");
.cc_setonop("logout_op(event_op, 6, $world5)");
} else {
if_setonmouserepeat("script7274(true, event_com, -1, $component0, cc_getid, $component20, $string0, $trans23)", $component3);
if_setonmouseleave("script7274(false, event_com, -1, $component0, cc_getid, $component20, $string0, $trans23)", $component3);
if_setonop("logout_op(event_op, 6, $world5)", $component3);
}
} else {
if (map_world = $world5) {
cc_setcolour(0x0dc10d);
} else {
cc_setcolour(^black);
}
cc_settrans(175);
if ($comsubid4 ! -1 & .cc_find($component3, $comsubid4) = ^true) {
.cc_sethide(false);
.cc_setposition(0, $int2, ^setpos_abs_centre, ^setpos_abs_top);
.cc_setonmouserepeat("script7274(true, event_com, event_comsubid, $component0, cc_getid, $component20, $string0, -1)");
.cc_setonmouseleave("script7274(false, event_com, event_comsubid, $component0, cc_getid, $component20, $string0, -1)");
.cc_setonop(null);
} else {
if_setonmouserepeat("script7274(true, event_com, -1, $component0, cc_getid, $component20, $string0, -1)", $component3);
if_setonmouseleave("script7274(false, event_com, -1, $component0, cc_getid, $component20, $string0, -1)", $component3);
if_setonop(null, $component3);
}
}
cc_create($component0, ^iftype_graphic, $int1);
$int1 = calc($int1 + 1);
cc_setsize(16, 16, ^setsize_abs, ^setsize_abs);
cc_setposition(calc(($width13 - cc_getwidth) / 2), calc($int2 + ($int9 - cc_getheight) / 2), ^setpos_abs_left, ^setpos_abs_top);
.cc_create($component0, ^iftype_text, $int1);
$int1 = calc($int1 + 1);
.cc_setsize($width14, $int9, ^setsize_abs, ^setsize_abs);
.cc_setposition($width13, $int2, ^setpos_abs_left, ^setpos_abs_top);
.cc_settextfont(p12_full);
.cc_settextalign(^settextalign_centre, ^settextalign_centre, 0);
.cc_settextshadow(true);
if ($world5 <= 0) {
.cc_settext("-");
} else {
.cc_settext(tostring($world5));
}
if (testbit($flags6, 16) = ^true) {
cc_setgraphic("worldswitcher_stars,8");
} else if (~script7323($flags6) = 1) {
cc_setgraphic("worldswitcher_stars,2");
} else if (~script6810($flags6) = 1) {
cc_setgraphic("worldswitcher_stars,6");
} else if (~script6812($flags6) = 1) {
cc_setgraphic("worldswitcher_stars,7");
} else if (~script6942($flags6) ! 0) {
cc_setgraphic("worldswitcher_stars,3");
} else if (testbit($flags6, 30) = ^true) {
cc_setgraphic("worldswitcher_stars,5");
} else if (testbit($flags6, 25) = ^true) {
cc_setgraphic("worldswitcher_stars,4");
} else if (testbit($flags6, 0) = ^true) {
cc_setgraphic("worldswitcher_stars,1");
} else {
cc_setgraphic("worldswitcher_stars,0");
}
if ($int21 = 0) {
if (testbit($flags6, 0) = ^true) {
.cc_setcolour(0xf0f000);
} else {
.cc_setcolour(0xe0e0e0);
}
} else {
.cc_setcolour(0x7f7f7f);
}
cc_create($component0, ^iftype_graphic, $int1);
$int1 = calc($int1 + 1);
cc_setsize(30, 15, ^setsize_abs, ^setsize_abs);
cc_setposition(calc($width13 + $width14 + ($width15 - cc_getwidth) / 2), calc($int2 + ($int9 - cc_getheight) / 2), ^setpos_abs_left, ^setpos_abs_top);
cc_setgraphic(enum(int, graphic, enum_1125, $int7));
cc_create($component0, ^iftype_text, $int1);
$int1 = calc($int1 + 1);
cc_setsize($width16, $int9, ^setsize_abs, ^setsize_abs);
cc_setposition($x17, $int2, ^setpos_abs_right, ^setpos_abs_top);
if ($int21 = 0) {
cc_setcolour(^white);
} else {
cc_setcolour(0x7f7f7f);
}
cc_settextfont($graphic10);
cc_settextalign(^settextalign_centre, ^settextalign_centre, 0);
cc_settextshadow(true);
cc_settext(tostring(~max($int8, 0)));
def_int $int24 = 0;
def_string $string1 = "";
def_int $int25 = string_length($string0);
if ($int25 <= 0) {
$string0, $int25 = "-", 1;
}
if ($int25 > 0 & parawidth($string0, 512, $fontmetrics11) > $x17) {
while ($int25 > 1 & $int24 = 0) {
$int25 = calc($int25 - 1);
$string1 = append(substring($string0, 0, $int25), "...");
if (parawidth($string1, 512, $fontmetrics11) <= $x17) {
$string0, $int24 = $string1, 1;
}
}
}
cc_create($component0, ^iftype_text, $int1);
$int1 = calc($int1 + 1);
cc_setsize($x17, $int9, ^setsize_abs, ^setsize_abs);
cc_setposition(0, $int2, ^setpos_abs_right, ^setpos_abs_top);
if ($int21 = 1) {
cc_setcolour(0x7f7f7f);
} else if (~script7323($flags6) = 1 | ~script6942($flags6) ! 0 | testbit($flags6, 25) = ^true) {
cc_setcolour(^red);
} else {
cc_setcolour(0xff981f);
}
cc_settextfont($graphic10);
cc_settextalign(^settextalign_left, ^settextalign_centre, 0);
cc_settextshadow(true);
cc_settext($string0);
return($int1);