-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path[clientscript,worldmap_overlay].cs2
71 lines (71 loc) · 2.8 KB
/
[clientscript,worldmap_overlay].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
// 1750
[clientscript,worldmap_overlay](component $component0, component $component1, int $int2, int $int3, int $int4, int $int5, coord $coord6)
def_wma $wma7 = worldmap_getcurrentmap;
if (worldmap_isloaded = false | $wma7 = null | if_getwidth($component0) <= 0) {
~worldmap_overlay_clear($component0, $component1);
return;
}
def_int $int8 = 0;
def_int $int9 = 0;
$int8, $int9 = worldmap_getsize;
if ($int8 <= 0) {
return;
}
def_int $int10 = 0;
def_int $int11 = 0;
$int10, $int11 = worldmap_getdisplayposition;
def_int $int12 = 0;
def_int $int13 = 0;
def_coord $coord14 = null;
if (%varcint188 ! $coord6 & %varcint188 ! null) {
$coord14 = ~worldmap_findcoordinmap($wma7, %varcint188);
if ($coord14 ! null) {
$int12, $int13 = worldmap_getdisplaycoord($coord6);
if ($int12 >= calc($int10 - 25) & $int12 <= calc($int10 + 25) & $int13 >= calc($int11 - 25) & $int13 <= calc($int11 + 25)) {
worldmap_jumptosourcecoord($coord14);
}
}
}
if ($int10 = $int2 & $int11 = $int3 & $int8 = $int4 & $int9 = $int5 & %varcint188 = $coord6) {
return;
}
if_setontimer("worldmap_overlay($component0, $component1, $int10, $int11, $int8, $int9, %varcint188)", $component0);
def_int $int15 = calc($int11 + $int9 / 2);
def_int $int16 = calc($int11 - $int9 / 2);
def_int $int17 = calc($int10 + $int8 / 2);
def_int $int18 = calc($int10 - $int8 / 2);
~worldmap_elements_update($component0, $int15, $int16, $int17, $int18);
def_int $width19 = if_getwidth($component1);
def_int $height20 = if_getheight($component1);
def_int $int21 = 0;
def_int $int22 = 0;
def_int $int23 = 0;
def_int $int24 = 0;
$int24, $int22, $int23, $int21 = worldmap_getconfigbounds($wma7);
def_int $int25 = 0;
def_int $int26 = 0;
$int25, $int26 = worldmap_getconfigsize($wma7);
$int25, $int26 = ~max($int25, 1), ~max($int26, 1);
def_int $x27 = scale(calc($int18 - $int24), $int25, $width19);
def_int $y28 = scale(calc($int21 - $int15), $int26, $height20);
def_int $width29 = scale(calc($int17 - $int18), $int25, $width19);
def_int $height30 = scale(calc($int15 - $int16), $int26, $height20);
if (cc_find($component1, 0) = ^true & .cc_find($component1, 1) = ^true) {
cc_setposition($x27, $y28, ^setpos_abs_left, ^setpos_abs_top);
.cc_setposition($x27, $y28, ^setpos_abs_left, ^setpos_abs_top);
cc_setsize($width29, $height30, ^setsize_abs, ^setsize_abs);
.cc_setsize($width29, $height30, ^setsize_abs, ^setsize_abs);
} else {
cc_create($component1, ^iftype_rectangle, 0);
.cc_create($component1, ^iftype_rectangle, 1);
cc_setcolour(0xff3f3f);
.cc_setcolour(0xff3f3f);
cc_setfill(false);
.cc_setfill(true);
cc_settrans(100);
.cc_settrans(200);
cc_setposition($x27, $y28, ^setpos_abs_left, ^setpos_abs_top);
.cc_setposition($x27, $y28, ^setpos_abs_left, ^setpos_abs_top);
cc_setsize($width29, $height30, ^setsize_abs, ^setsize_abs);
.cc_setsize($width29, $height30, ^setsize_abs, ^setsize_abs);
}