-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path[clientscript,br_loadout_init].cs2
148 lines (148 loc) · 6.11 KB
/
[clientscript,br_loadout_init].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
// 1292
[clientscript,br_loadout_init](component $component0, component $component1, component $component2, component $component3, component $component4, component $component5, component $component6)
cc_deleteall($component5);
def_int $count7 = 0;
cc_create($component5, ^iftype_graphic, $count7);
$count7 = calc($count7 + 1);
cc_setposition(0, 0, ^setpos_abs_left, ^setpos_abs_centre);
cc_setsize(36, 36, ^setsize_abs, ^setsize_abs);
cc_setgraphic("miscgraphics,0");
cc_create($component5, ^iftype_graphic, $count7);
$count7 = calc($count7 + 1);
cc_setposition(2, 0, ^setpos_abs_left, ^setpos_abs_centre);
cc_setsize(29, 22, ^setsize_abs, ^setsize_abs);
cc_setgraphic("bankbuttons,6");
cc_create($component5, ^iftype_text, $count7);
cc_setcolour(0xff981f);
if_setonmouserepeat("cc_colour_swapper(event_com, $count7, ^white)", $component5);
if_setonmouseleave("cc_colour_swapper(event_com, $count7, 0xff981f)", $component5);
$count7 = calc($count7 + 1);
cc_setposition(0, 0, ^setpos_abs_right, ^setpos_abs_centre);
cc_setsize(38, 0, ^setsize_minus, ^setsize_minus);
cc_settextfont(p12_full);
cc_settextshadow(true);
cc_settextalign(^settextalign_centre, ^settextalign_centre, 0);
cc_settext("Drag items here to discard them.");
def_int $count8 = enum_getoutputcount(enum_2630);
def_int $countarray0($count8);
def_int $int9 = 0;
cc_deleteall($component3);
$count7 = 0;
while ($count7 < $count8) {
if (enum(int, namedobj, enum_2630, $count7) ! null) {
$countarray0($int9) = $count7;
$int9 = calc($int9 + 1);
}
cc_create($component3, ^iftype_graphic, $count7);
cc_sethide(true);
$count7 = calc($count7 + 1);
}
def_int $int10 = $int9;
if ($int10 > 1) {
~br_loadout_sort(countarray0, 0, calc($int10 - 1));
}
cc_deleteall($component1);
cc_create($component1, ^iftype_graphic, 0);
cc_setsize(36, 32, ^setsize_abs, ^setsize_abs);
cc_setoutline(1);
cc_setgraphicshadow(0x333333);
cc_sethide(true);
cc_settrans(125);
def_int $comsubid11 = cc_getid;
cc_create($component1, ^iftype_text, 1);
cc_setcolour(0xff981f);
cc_settextfont(p12_full);
cc_settextalign(^settextalign_left, ^settextalign_centre, 0);
cc_settextshadow(true);
cc_sethide(true);
def_int $comsubid12 = cc_getid;
def_int $height13 = 0;
def_int $int14 = calc((36 - 32) / 2);
def_namedobj $namedobj15 = null;
def_int $int16 = 0;
def_string $string0 = "";
def_string $string1 = "";
def_int $int17 = 0;
$int9 = 0;
while ($int9 < $int10) {
if (cc_find($component3, $countarray0($int9)) = ^true) {
cc_sethide(false);
cc_settiling(true);
cc_setgraphic("tradebacking_light");
cc_settrans(255);
cc_setsize(0, 36, ^setsize_minus, ^setsize_abs);
cc_setposition(0, $height13, ^setpos_abs_centre, ^setpos_abs_top);
cc_setop(1, "Add");
cc_setop(10, "Examine");
cc_setdraggable($component1, -1);
cc_setdragdeadzone(5);
cc_setdragdeadtime(5);
$namedobj15 = enum(int, namedobj, enum_2630, $countarray0($int9));
$string1 = oc_name($namedobj15);
cc_setopbase("<col=ff9040><$string1></col>");
.cc_create($component3, ^iftype_rectangle, $count7);
$count7 = calc($count7 + 1);
.cc_setsize(0, 36, ^setsize_minus, ^setsize_abs);
.cc_setposition(0, $height13, ^setpos_abs_centre, ^setpos_abs_top);
.cc_setfill(true);
cc_setonmouserepeat("script1015(event_com, .cc_getid, ^white, 225)");
if (calc($int9 % 2) = 0) {
.cc_setcolour(^white);
.cc_settrans(255);
cc_setonmouseleave("script1015(event_com, .cc_getid, ^white, 255)");
cc_setonop("br_loadout_menuop(event_opindex, event_com, event_comsubid, .cc_getid, ^white, 225, ^white, 255, $component1, $component2, $component5, $component6)");
} else {
.cc_setcolour(^black);
.cc_settrans(225);
cc_setonmouseleave("script1015(event_com, .cc_getid, ^black, 225)");
cc_setonop("br_loadout_menuop(event_opindex, event_com, event_comsubid, .cc_getid, ^white, 225, ^black, 225, $component1, $component2, $component5, $component6)");
}
.cc_create($component3, ^iftype_graphic, $count7);
$count7 = calc($count7 + 1);
.cc_setsize(36, 32, ^setsize_abs, ^setsize_abs);
.cc_setposition(3, calc($height13 + $int14), ^setpos_abs_left, ^setpos_abs_top);
.cc_setoutline(1);
.cc_setgraphicshadow(0x333333);
if (oc_stackable($namedobj15) = true) {
.cc_setobject($namedobj15, 5000);
} else {
.cc_setobject_nonum($namedobj15, 1);
}
.cc_create($component3, ^iftype_text, $count7);
$count7 = calc($count7 + 1);
.cc_setsize(calc(8 + 36), 36, ^setsize_minus, ^setsize_abs);
.cc_setposition(3, $height13, ^setpos_abs_right, ^setpos_abs_top);
.cc_setcolour(0xff981f);
.cc_settextfont(p12_full);
.cc_settextalign(^settextalign_left, ^settextalign_centre, 0);
.cc_settextshadow(true);
$int17, $int16 = string_length($string1), 0;
if ($int17 <= 0) {
$string1, $int17 = "-", 1;
}
if ($int17 > 0 & parawidth($string1, 512, p12_full) > .cc_getwidth) {
while ($int17 > 1 & $int16 = 0) {
$int17 = calc($int17 - 1);
$string0 = append(substring($string1, 0, $int17), "...");
if (parawidth($string0, 512, p12_full) <= .cc_getwidth) {
$string1, $int16 = $string0, 1;
}
}
}
.cc_settext($string1);
cc_setondrag("br_loadout_menudragging(event_com, event_comsubid, $namedobj15, $string1, $component1, $comsubid11, $comsubid12, $int14, event_mousex, event_mousey)");
cc_setondragcomplete("br_loadout_insert(event_com, event_comsubid, event_drop, event_dropsubid, $countarray0($int9), $component1, $comsubid11, $comsubid12, $component2, $component5, $component6)");
$height13 = calc($height13 + 36);
}
$int9 = calc($int9 + 1);
}
if ($height13 > if_getheight($component3)) {
if_setscrollsize(0, $height13, $component3);
} else {
if_setscrollsize(0, 0, $component3);
}
if_setscrollpos(0, 0, $component3);
~scrollbar_vertical($component4, $component3, "scrollbar_dragger_v2,3", "scrollbar_dragger_v2,0", "scrollbar_dragger_v2,1", "scrollbar_dragger_v2,2", "scrollbar_v2,0", "scrollbar_v2,1");
~br_loadout_drawloadout($component1, $component2, $component5, $component6);
if_setonvartransmit("br_loadout_drawloadout_request($component0, $component1, $component2, $component5, $component6){var2382, var2383, var2384, var2385, var2386, var2387, var2388, var2389, var1373, var1573, var1704, var1666, var309}", $component0);
if_setontimer(null, $component0);