File tree 1 file changed +15
-15
lines changed
1 file changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -534,25 +534,25 @@ async function rendermenu(datas) {
534
534
let homePressed = false ;
535
535
let gpUpdate ;
536
536
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
+ }
537
552
let gamePads = navigator . getGamepads ( ) ;
538
553
if ( ! gamePads ?. [ 0 ] ) return ;
539
554
let gp = gamePads [ 0 ] ;
540
555
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
- }
556
556
gameStarted = false ;
557
557
if ( ! scrollDelay ) {
558
558
if ( ( buttonsMissing ( [ 1 , 3 ] , [ 13 ] ) ) && ( gp . axes [ 1 ] > .5 || gp . axes [ 3 ] > .5 || gp . buttons [ 13 ] . pressed ) ) {
You can’t perform that action at this time.
0 commit comments