-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path[proc,worldswitcher_entry_draw].cs2
151 lines (151 loc) · 5.19 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, int $width10, int $width11, int $width12, int $width13, int $x14, int $int15, int $int16, component $component17)(int)
if ($comsubid4 ! -1 & .cc_find($component3, $comsubid4) = ^true) {
.cc_sethide(false);
.cc_setposition(0, $int2, ^setpos_abs_centre, ^setpos_abs_top);
if (string_length($string0) > 0) {
.cc_setonmouserepeat("tooltip_mouserepeat(event_com, event_comsubid, $component17, removetags($string0), 25, 190)");
} else {
.cc_setonmouserepeat(null);
}
} else if (string_length($string0) > 0) {
if_setonmouserepeat("tooltip_mouserepeat(event_com, -1, $component17, removetags($string0), 25, 190)", $component3);
} else {
if_setonmouserepeat(null, $component3);
}
def_int $int18 = 0;
def_int $int19 = 0;
if (map_world = $world5) {
$int18 = 1;
} else if (testbit($flags6, 7) = ^true) {
$int19 = enum(int, int, enum_1496, $world5);
if (testbit($flags6, 0) = ^true) {
if ($int15 < $int19) {
$int18 = 1;
}
} else if ($int16 < $int19) {
$int18 = 1;
}
}
if (~script2872($flags6) = 1 & %varbit8374 = 0) {
$int18 = 1;
}
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 ($int18 = 0) {
cc_setcolour(^white);
cc_settrans(255);
if ($comsubid4 ! -1 & .cc_find($component3, $comsubid4) = ^true) {
.cc_setonmouseover("cc_settrans($component0, cc_getid, 200, null)");
.cc_setonmouseleave("cc_settrans($component0, cc_getid, 255, $component17)");
.cc_setonop("logout_op(event_opindex, 6, $world5)");
} else {
if_setonmouseover("cc_settrans(event_com, cc_getid, 200, null)", $component3);
if_setonmouseleave("cc_settrans(event_com, cc_getid, 255, $component17)", $component3);
if_setonop("logout_op(event_opindex, 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_setonmouseleave("deltooltip($component17)");
.cc_setonop(null);
} else {
if_setonmouseleave("deltooltip($component17)", $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(0, calc($int2 + ($int9 - cc_getheight) / 2), ^setpos_abs_left, ^setpos_abs_top);
.cc_create($component0, ^iftype_text, $int1);
$int1 = calc($int1 + 1);
.cc_setsize($width11, $int9, ^setsize_abs, ^setsize_abs);
.cc_setposition($width10, $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, 2) = ^true) {
cc_setgraphic("worldswitcher_stars,2");
} else if (testbit($flags6, 29) = ^true) {
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 ($int18 = 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($width12, 15, ^setsize_abs, ^setsize_abs);
cc_setposition(calc($width10 + $width11), 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($width13, $int9, ^setsize_abs, ^setsize_abs);
cc_setposition($x14, $int2, ^setpos_abs_right, ^setpos_abs_top);
if ($int18 = 0) {
cc_setcolour(^white);
} else {
cc_setcolour(0x7f7f7f);
}
cc_settextfont(p11_full);
cc_settextalign(^settextalign_centre, ^settextalign_centre, 0);
cc_settextshadow(true);
cc_settext(tostring($int8));
def_int $int20 = 0;
def_string $string1 = "";
def_int $int21 = string_length($string0);
if ($int21 <= 0) {
$string0, $int21 = "-", 1;
}
if ($int21 > 0 & parawidth($string0, 512, p11_full) > $x14) {
while ($int21 > 1 & $int20 = 0) {
$int21 = calc($int21 - 1);
$string1 = append(substring($string0, 0, $int21), "...");
if (parawidth($string1, 512, p11_full) <= $x14) {
$string0, $int20 = $string1, 1;
}
}
}
cc_create($component0, ^iftype_text, $int1);
$int1 = calc($int1 + 1);
cc_setsize($x14, $int9, ^setsize_abs, ^setsize_abs);
cc_setposition(0, $int2, ^setpos_abs_right, ^setpos_abs_top);
if ($int18 = 1) {
cc_setcolour(0x7f7f7f);
} else if (testbit($flags6, 2) = ^true | testbit($flags6, 29) = ^true | testbit($flags6, 25) = ^true) {
cc_setcolour(^red);
} else {
cc_setcolour(0xff981f);
}
cc_settextfont(p11_full);
cc_settextalign(^settextalign_left, ^settextalign_centre, 0);
cc_settextshadow(true);
cc_settext($string0);
return($int1);