1 |
function scr_getbuttonspritescr_getbuttonspritefunction scr_getbuttonsprite(arg0, arg1)
{
var control = arg0;
var isString = arg1;
var button = noone;
var is_dualshock = os_type == os_ps4 || obj_gamecontroller.gamepad_type == 1;
var button_sprite = button_questionmark;
var invert = is_dualshock && (global.typer == 50 || global.typer == 70 || global.typer == 71);
if (isString)
{
if (control == "A")
{
button_sprite = button_xbox_left;
if (os_type == os_switch)
button_sprite = button_switch_left_0;
else if (is_dualshock)
button_sprite = invert ? button_ps4_dpad_left_dark : button_ps4_dpad_left;
return button_sprite;
}
if (control == "D")
{
button_sprite = button_xbox_right;
if (os_type == os_switch)
button_sprite = button_switch_right_0;
else if (is_dualshock)
button_sprite = invert ? button_ps4_dpad_right_dark : button_ps4_dpad_right;
return button_sprite;
}
if (control == "W")
{
button_sprite = button_xbox_up;
if (os_type == os_switch)
button_sprite = button_switch_up_0;
else if (is_dualshock)
button_sprite = invert ? button_ps4_dpad_up_dark : button_ps4_dpad_up;
return button_sprite;
}
if (control == "S")
{
button_sprite = button_xbox_down;
if (os_type == os_switch)
button_sprite = button_switch_down_0;
else if (is_dualshock)
button_sprite = invert ? button_ps4_dpad_down_dark : button_ps4_dpad_down;
return button_sprite;
}
if (control == "Z")
button = global.button0;
if (control == "X")
button = global.button1;
if (control == "C")
button = global.button2;
}
else
{
button = control;
if (control == gp_padl)
{
button_sprite = button_xbox_left;
if (os_type == os_switch)
button_sprite = button_switch_left_0;
else if (is_dualshock)
button_sprite = invert ? button_ps4_dpad_left_dark : button_ps4_dpad_left;
return button_sprite;
}
if (control == gp_padr)
{
button_sprite = button_xbox_right;
if (os_type == os_switch)
button_sprite = button_switch_right_0;
else if (is_dualshock)
button_sprite = invert ? button_ps4_dpad_right_dark : button_ps4_dpad_right;
return button_sprite;
}
if (control == gp_padu)
{
button_sprite = button_xbox_up;
if (os_type == os_switch)
button_sprite = button_switch_up_0;
else if (is_dualshock)
button_sprite = invert ? button_ps4_dpad_up_dark : button_ps4_dpad_up;
return button_sprite;
}
if (control == gp_padd)
{
button_sprite = button_xbox_down;
if (os_type == os_switch)
button_sprite = button_switch_down_0;
else if (is_dualshock)
button_sprite = invert ? button_ps4_dpad_down_dark : button_ps4_dpad_down;
return button_sprite;
}
}
if (button == gp_face1)
{
button_sprite = button_xbox_a;
if (is_dualshock)
button_sprite = button_ps4_cross_0;
if (os_type == os_switch)
button_sprite = button_switch_b_0;
return button_sprite;
... (arg0, arg1) |
2 |
{ |
3 |
var control = arg0; |
4 |
var isString = arg1; |
5 |
var button = noone; |
6 |
var is_dualshock = os_type == os_ps4 || obj_gamecontroller.gamepad_type == 1; |
7 |
var button_sprite = button_questionmark; |
8 |
var invert = is_dualshock && (global.typer == 50 || global.typer == 70 || global.typer == 71); |
9 |
if (isString) |
10 |
{ |
11 |
if (control == "A") |
12 |
{ |
13 |
button_sprite = button_xbox_left; |
14 |
if (os_type == os_switch) |
15 |
button_sprite = button_switch_left_0; |
16 |
else if (is_dualshock) |
17 |
button_sprite = invert ? button_ps4_dpad_left_dark : button_ps4_dpad_left; |
18 |
return button_sprite; |
19 |
} |
20 |
if (control == "D") |
21 |
{ |
22 |
button_sprite = button_xbox_right; |
23 |
if (os_type == os_switch) |
24 |
button_sprite = button_switch_right_0; |
25 |
else if (is_dualshock) |
26 |
button_sprite = invert ? button_ps4_dpad_right_dark : button_ps4_dpad_right; |
27 |
return button_sprite; |
28 |
} |
29 |
if (control == "W") |
30 |
{ |
31 |
button_sprite = button_xbox_up; |
32 |
if (os_type == os_switch) |
33 |
button_sprite = button_switch_up_0; |
34 |
else if (is_dualshock) |
35 |
button_sprite = invert ? button_ps4_dpad_up_dark : button_ps4_dpad_up; |
36 |
return button_sprite; |
37 |
} |
38 |
if (control == "S") |
39 |
{ |
40 |
button_sprite = button_xbox_down; |
41 |
if (os_type == os_switch) |
42 |
button_sprite = button_switch_down_0; |
43 |
else if (is_dualshock) |
44 |
button_sprite = invert ? button_ps4_dpad_down_dark : button_ps4_dpad_down; |
45 |
return button_sprite; |
46 |
} |
47 |
if (control == "Z") |
48 |
button = global.button0; |
49 |
if (control == "X") |
50 |
button = global.button1; |
51 |
if (control == "C") |
52 |
button = global.button2; |
53 |
} |
54 |
else |
55 |
{ |
56 |
button = control; |
57 |
if (control == gp_padl) |
58 |
{ |
59 |
button_sprite = button_xbox_left; |
60 |
if (os_type == os_switch) |
61 |
button_sprite = button_switch_left_0; |
62 |
else if (is_dualshock) |
63 |
button_sprite = invert ? button_ps4_dpad_left_dark : button_ps4_dpad_left; |
64 |
return button_sprite; |
65 |
} |
66 |
if (control == gp_padr) |
67 |
{ |
68 |
button_sprite = button_xbox_right; |
69 |
if (os_type == os_switch) |
70 |
button_sprite = button_switch_right_0; |
71 |
else if (is_dualshock) |
72 |
button_sprite = invert ? button_ps4_dpad_right_dark : button_ps4_dpad_right; |
73 |
return button_sprite; |
74 |
} |
75 |
if (control == gp_padu) |
76 |
{ |
77 |
button_sprite = button_xbox_up; |
78 |
if (os_type == os_switch) |
79 |
button_sprite = button_switch_up_0; |
80 |
else if (is_dualshock) |
81 |
button_sprite = invert ? button_ps4_dpad_up_dark : button_ps4_dpad_up; |
82 |
return button_sprite; |
83 |
} |
84 |
if (control == gp_padd) |
85 |
{ |
86 |
button_sprite = button_xbox_down; |
87 |
if (os_type == os_switch) |
88 |
button_sprite = button_switch_down_0; |
89 |
else if (is_dualshock) |
90 |
button_sprite = invert ? button_ps4_dpad_down_dark : button_ps4_dpad_down; |
91 |
return button_sprite; |
92 |
} |
93 |
} |
94 |
if (button == gp_face1) |
95 |
{ |
96 |
button_sprite = button_xbox_a; |
97 |
if (is_dualshock) |
98 |
button_sprite = button_ps4_cross_0; |
99 |
if (os_type == os_switch) |
100 |
button_sprite = button_switch_b_0; |
101 |
return button_sprite; |
102 |
} |
103 |
if (button == gp_face2) |
104 |
{ |
105 |
button_sprite = button_xbox_b; |
106 |
if (is_dualshock) |
107 |
button_sprite = button_ps4_circle_0; |
108 |
if (os_type == os_switch) |
109 |
button_sprite = button_switch_a_0; |
110 |
return button_sprite; |
111 |
} |
112 |
if (button == gp_face3) |
113 |
{ |
114 |
button_sprite = button_xbox_x; |
115 |
if (is_dualshock) |
116 |
button_sprite = button_ps4_square_0; |
117 |
if (os_type == os_switch) |
118 |
button_sprite = button_switch_y_0; |
119 |
return button_sprite; |
120 |
} |
121 |
if (button == gp_face4) |
122 |
{ |
123 |
button_sprite = button_xbox_y; |
124 |
if (is_dualshock) |
125 |
button_sprite = button_ps4_triangle_0; |
126 |
if (os_type == os_switch) |
127 |
button_sprite = button_switch_x_0; |
128 |
return button_sprite; |
129 |
} |
130 |
if (button == gp_shoulderl) |
131 |
{ |
132 |
button_sprite = button_xbox_left_bumper; |
133 |
if (is_dualshock) |
134 |
button_sprite = button_ps4_l1; |
135 |
if (os_type == os_switch) |
136 |
button_sprite = button_switch_l_0; |
137 |
return button_sprite; |
138 |
} |
139 |
if (button == gp_shoulderlb) |
140 |
{ |
141 |
button_sprite = button_xbox_left_trigger; |
142 |
if (is_dualshock) |
143 |
button_sprite = button_ps4_l2; |
144 |
if (os_type == os_switch) |
145 |
button_sprite = button_switch_zl_0; |
146 |
return button_sprite; |
147 |
} |
148 |
if (button == gp_shoulderr) |
149 |
{ |
150 |
button_sprite = button_xbox_right_bumper; |
151 |
if (is_dualshock) |
152 |
button_sprite = button_ps4_r1; |
153 |
if (os_type == os_switch) |
154 |
button_sprite = button_switch_r_0; |
155 |
return button_sprite; |
156 |
} |
157 |
if (button == gp_shoulderrb) |
158 |
{ |
159 |
button_sprite = button_xbox_right_trigger; |
160 |
if (is_dualshock) |
161 |
button_sprite = button_ps4_r2; |
162 |
if (os_type == os_switch) |
163 |
button_sprite = button_switch_zr_0; |
164 |
return button_sprite; |
165 |
} |
166 |
if (button == gp_stickl) |
167 |
{ |
168 |
button_sprite = button_xbox_left_stick; |
169 |
if (is_dualshock) |
170 |
button_sprite = button_ps4_l3_0; |
171 |
if (os_type == os_switch) |
172 |
button_sprite = button_switch_lStickClick_0; |
173 |
return button_sprite; |
174 |
} |
175 |
if (button == gp_stickr) |
176 |
{ |
177 |
button_sprite = button_xbox_right_stick; |
178 |
if (is_dualshock) |
179 |
button_sprite = button_ps4_r3_0; |
180 |
if (os_type == os_switch) |
181 |
button_sprite = button_switch_rStickClick_0; |
182 |
return button_sprite; |
183 |
} |
184 |
if (button == gp_select) |
185 |
{ |
186 |
button_sprite = button_xbox_menu; |
187 |
if (is_dualshock) |
188 |
button_sprite = button_ps4_touchpad; |
189 |
if (os_type == os_switch) |
190 |
button_sprite = button_switch_minus_0; |
191 |
return button_sprite; |
192 |
} |
193 |
if (button == gp_start) |
194 |
{ |
195 |
button_sprite = button_xbox_share; |
196 |
if (is_dualshock) |
197 |
return button_ps4_options; |
198 |
if (os_type == os_switch) |
199 |
button_sprite = button_switch_plus_0; |
200 |
return button_sprite; |
201 |
} |
202 |
if (button == gp_padl) |
203 |
{ |
204 |
button_sprite = button_xbox_left; |
205 |
if (os_type == os_switch) |
206 |
button_sprite = button_switch_left_0; |
207 |
else if (is_dualshock) |
208 |
button_sprite = invert ? button_ps4_dpad_left_dark : button_ps4_dpad_left; |
209 |
return button_sprite; |
210 |
} |
211 |
if (button == gp_padr) |
212 |
{ |
213 |
button_sprite = button_xbox_right; |
214 |
if (os_type == os_switch) |
215 |
button_sprite = button_switch_right_0; |
216 |
else if (is_dualshock) |
217 |
button_sprite = invert ? button_ps4_dpad_right_dark : button_ps4_dpad_right; |
218 |
return button_sprite; |
219 |
} |
220 |
if (button == gp_padu) |
221 |
{ |
222 |
button_sprite = button_xbox_up; |
223 |
if (os_type == os_switch) |
224 |
button_sprite = button_switch_up_0; |
225 |
else if (is_dualshock) |
226 |
button_sprite = invert ? button_ps4_dpad_up_dark : button_ps4_dpad_up; |
227 |
return button_sprite; |
228 |
} |
229 |
if (button == gp_padd) |
230 |
{ |
231 |
button_sprite = button_xbox_down; |
232 |
if (os_type == os_switch) |
233 |
button_sprite = button_switch_down_0; |
234 |
else if (is_dualshock) |
235 |
button_sprite = invert ? button_ps4_dpad_down_dark : button_ps4_dpad_down; |
236 |
return button_sprite; |
237 |
} |
238 |
return button_sprite; |
239 |
} |