-
Notifications
You must be signed in to change notification settings - Fork 0
/
[proc,poll_addlink].cs2
40 lines (40 loc) · 1.71 KB
/
[proc,poll_addlink].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
// 611
[proc,poll_addlink](string $string0, string $string1, component $component0, int $int1, int $int2, fontmetrics $fontmetrics3, fontmetrics $fontmetrics4, int $int5, int $int6)
$string0 = removetags($string0);
if (string_length($string0) <= 0 | string_length($string1) <= 0) {
return;
}
if (~on_ios = 1) {
$string0 = "There is more info on the OSRS website.";
}
def_int $int7 = calc($int1 - (15 + $int6));
def_int $width8 = parawidth($string0, $int7, $fontmetrics4);
def_int $int9 = calc(paraheight($string0, $int7, $fontmetrics4) * $int5 + $int6);
$int9 = ~max($int9, 15);
if (~on_mobile = true) {
$int9 = ~max($int9, 25);
}
$int7 = calc($width8 + 15 + $int6);
cc_create($component0, ^iftype_rectangle, %varcint43);
%varcint43 = calc(%varcint43 + 1);
cc_setsize($int7, $int9, ^setsize_abs, ^setsize_abs);
$int7 = calc(($int1 - $int7) / 2);
cc_setposition($int7, %varcint49, ^setpos_abs_left, ^setpos_abs_top);
cc_setfill(true);
cc_settrans(255);
.cc_create($component0, ^iftype_text, %varcint43);
%varcint43 = calc(%varcint43 + 1);
.cc_setsize($width8, $int9, ^setsize_abs, ^setsize_abs);
.cc_setposition(calc($int7 + 15 + $int6), %varcint49, ^setpos_abs_left, ^setpos_abs_top);
.cc_settextfont($fontmetrics3);
.cc_settextalign(^settextalign_centre, ^settextalign_centre, 0);
.cc_settextshadow(true);
~poll_setuplink($component0, cc_getid, .cc_getid, $string0, $string1);
.cc_create($component0, ^iftype_graphic, %varcint43);
%varcint43 = calc(%varcint43 + 1);
.cc_setsize(15, 15, ^setsize_abs, ^setsize_abs);
.cc_setposition($int7, calc(%varcint49 + ($int9 - 15) / 2), ^setpos_abs_left, ^setpos_abs_top);
.cc_setgraphicshadow(0x333333);
.cc_settiling(true);
.cc_setgraphic("mapfunction_infoicon");
%varcint49 = calc(%varcint49 + $int9 + 3);