Skip to content

Commit 9f9f47d

Browse files
committed
function location
1 parent e65c919 commit 9f9f47d

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

frontend/js/index.js

+15-15
Original file line numberDiff line numberDiff line change
@@ -534,25 +534,25 @@ async function rendermenu(datas) {
534534
let homePressed = false;
535535
let gpUpdate;
536536
function gameLoop() {
537+
// Handle if buttons are missing
538+
function buttonsMissing(axes,buttons) {
539+
var missing = true;
540+
axes.forEach(function(i) {
541+
if (typeof gp.axes[i] === 'undefined') {
542+
missing = false;
543+
}
544+
});
545+
buttons.forEach(function(i) {
546+
if (typeof gp.buttons[i] === 'undefined') {
547+
missing = false;
548+
}
549+
});
550+
return missing;
551+
}
537552
let gamePads = navigator.getGamepads();
538553
if (!gamePads?.[0]) return;
539554
let gp = gamePads[0];
540555
if (window.location.hash != "#game") {
541-
// Handle if buttons are missing
542-
function buttonsMissing(axes,buttons) {
543-
var missing = true;
544-
axes.forEach(function(i) {
545-
if (typeof gp.axes[i] === 'undefined') {
546-
missing = false;
547-
}
548-
});
549-
buttons.forEach(function(i) {
550-
if (typeof gp.buttons[i] === 'undefined') {
551-
missing = false;
552-
}
553-
});
554-
return missing;
555-
}
556556
gameStarted = false;
557557
if (!scrollDelay) {
558558
if ((buttonsMissing([1,3],[13])) && (gp.axes[1] > .5 || gp.axes[3] > .5 || gp.buttons[13].pressed)) {

0 commit comments

Comments
 (0)