mirror of
https://github.com/jiojciojsioe3/a3cjroijsiojiorj.git
synced 2024-11-15 07:21:50 +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
|
// Disable back navigation when pressing backspace
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
if(!controller.autoPlay()){
|
if(_this.buttonEnabled(e.which)){
|
||||||
_this.setKey(e.which, true);
|
_this.setKey(e.which, true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).keyup(function(e){
|
$(document).keyup(function(e){
|
||||||
if(!controller.autoPlay()){
|
if(_this.buttonEnabled(e.which)){
|
||||||
_this.setKey(e.which, false);
|
_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(){
|
this.checkGameKeys = function(){
|
||||||
|
|
||||||
if(_keys[86] && !_this.isWaitingForKeyup(86, "sound")){
|
if(_keys[86] && !_this.isWaitingForKeyup(86, "sound")){
|
||||||
@ -58,7 +71,7 @@ function Keyboard(controller){
|
|||||||
controller.songSelection();
|
controller.songSelection();
|
||||||
}
|
}
|
||||||
if(_keys[81] && !_this.isWaitingForKeyup(81, "menu")){
|
if(_keys[81] && !_this.isWaitingForKeyup(81, "menu")){
|
||||||
// P, pause the game
|
// Q, pause the game
|
||||||
_this.waitForKeyup(81, "menu");
|
_this.waitForKeyup(81, "menu");
|
||||||
controller.togglePauseMenu();
|
controller.togglePauseMenu();
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,10 @@ function soundSystem(controller){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.pauseSound = function(){
|
||||||
|
_sounds["main-music"].pause();
|
||||||
|
}
|
||||||
|
|
||||||
this.fadeOutMusic = function(){
|
this.fadeOutMusic = function(){
|
||||||
|
|
||||||
if(_sounds["main-music"].volume.toFixed(1)!=0.0){
|
if(_sounds["main-music"].volume.toFixed(1)!=0.0){
|
||||||
|
Loading…
Reference in New Issue
Block a user