-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path[clientscript,addtooltip].cs2
49 lines (49 loc) · 1.93 KB
/
[clientscript,addtooltip].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
// 38
[clientscript,addtooltip](component $component0, component $component1, string $string0, int $int2, int $width3)
def_int $x4 = 0;
def_int $y5 = 0;
if (%varcint1 < calc(clientclock + $int2)) {
if (%varcint1 < clientclock) {
%varcint1 = clientclock;
}
%varcint1 = calc(%varcint1 + 2);
return;
}
%varcint1 = calc(clientclock + $int2 + 10);
if (%varcint2 = 0) {
if ($width3 > if_getwidth(if_getlayer($component1))) {
$width3 = if_getwidth(if_getlayer($component1));
}
$width3 = calc($width3 - 4);
if_setsize(calc(4 + parawidth($string0, $width3, p12_full)), calc(4 + 13 * paraheight($string0, $width3, p12_full)), ^setsize_abs, ^setsize_abs, $component1);
$x4 = calc(if_getx($component0) + 5);
$y5 = calc(if_gety($component0) + if_getheight($component0) + 5);
if (if_getlayer($component1) ! null) {
if ($x4 > calc(if_getwidth(if_getlayer($component1)) - if_getwidth($component1))) {
$x4 = calc(if_getwidth(if_getlayer($component1)) - if_getwidth($component1));
}
if ($y5 > calc(if_getheight(if_getlayer($component1)) - if_getheight($component1))) {
$y5 = calc(if_gety($component0) - if_getheight($component1) - 5);
}
}
if_setposition($x4, $y5, ^setpos_abs_left, ^setpos_abs_top, $component1);
cc_deleteall($component1);
cc_create($component1, ^iftype_rectangle, 0);
cc_setsize(0, 0, ^setsize_minus, ^setsize_minus);
cc_setposition(0, 0, ^setpos_abs_centre, ^setpos_abs_centre);
cc_setfill(true);
cc_setcolour(0xffffa0);
cc_create($component1, ^iftype_rectangle, 1);
cc_setsize(0, 0, ^setsize_minus, ^setsize_minus);
cc_setposition(0, 0, ^setpos_abs_centre, ^setpos_abs_centre);
cc_setfill(false);
cc_setcolour(^black);
cc_create($component1, ^iftype_text, 2);
cc_setsize(4, 0, ^setsize_minus, ^setsize_minus);
cc_setposition(0, 0, ^setpos_abs_centre, ^setpos_abs_centre);
cc_settext($string0);
cc_settextalign(^settextalign_left, ^settextalign_centre, 0);
cc_settextfont(p12_full);
cc_setcolour(^black);
%varcint2 = 1;
}