mirror of
https://github.com/jiojciojsioe3/a3cjroijsiojiorj.git
synced 2024-12-23 17:56:14 +08:00
Fix pausing during autoplay
This commit is contained in:
parent
2f717614fb
commit
fcc3235bec
@ -12,17 +12,30 @@ function Keyboard(controller){
|
||||
// Disable back navigation when pressing backspace
|
||||
e.preventDefault();
|
||||
|
||||
if(!controller.autoPlay()){
|
||||
if(_this.buttonEnabled(e.which)){
|
||||
_this.setKey(e.which, true);
|
||||
}
|
||||
});
|
||||
|
||||
$(document).keyup(function(e){
|
||||
if(!controller.autoPlay()){
|
||||
if(_this.buttonEnabled(e.which)){
|
||||
_this.setKey(e.which, false);
|
||||
}
|
||||
});
|
||||
|
||||
this.buttonEnabled = function(keyCode){
|
||||
if(controller.autoPlay()){
|
||||
switch(keyCode){
|
||||
case 86:
|
||||
case 66:
|
||||
case 67:
|
||||
case 78:
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
this.checkGameKeys = function(){
|
||||
|
||||
if(_keys[86] && !_this.isWaitingForKeyup(86, "sound")){
|
||||
@ -58,7 +71,7 @@ function Keyboard(controller){
|
||||
controller.songSelection();
|
||||
}
|
||||
if(_keys[81] && !_this.isWaitingForKeyup(81, "menu")){
|
||||
// P, pause the game
|
||||
// Q, pause the game
|
||||
_this.waitForKeyup(81, "menu");
|
||||
controller.togglePauseMenu();
|
||||
}
|
||||
|
@ -29,6 +29,10 @@ function soundSystem(controller){
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.pauseSound = function(){
|
||||
_sounds["main-music"].pause();
|
||||
}
|
||||
|
||||
this.fadeOutMusic = function(){
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user