PIXI Controls: Disable idle animation on locked device
This commit is contained in:
parent
facea0d1cc
commit
61084be940
2 changed files with 32 additions and 0 deletions
|
@ -460,6 +460,21 @@ ONSControls.gamepadHandler = function() {
|
|||
window.addEventListener("gamepadconnected", () => {this.toggle(false);});
|
||||
window.addEventListener("gamepaddisconnected", () => {this.toggle(true);});
|
||||
}
|
||||
//=============================================================================
|
||||
// * Disable idle animation on locked device
|
||||
//=============================================================================
|
||||
ONSControls.cordovaHandler = function() {
|
||||
document.addEventListener("pause", () => {
|
||||
console.log("Idle stopped");
|
||||
ONSControls.idleDisabled = true;
|
||||
ONSControls.resetIdleAnimation();
|
||||
});
|
||||
document.addEventListener("resume", () => {
|
||||
console.log("Idle started");
|
||||
ONSControls.idleDisabled = false;
|
||||
ONSControls.resetIdleAnimation();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -1084,4 +1099,5 @@ ONSControls.initialize = function() {
|
|||
VirtualGamepad.initialize();
|
||||
Window_OmoMenuOptionsONSControls.prototype.add();
|
||||
this.gamepadHandler();
|
||||
this.cordovaHandler();
|
||||
}
|
|
@ -460,6 +460,21 @@ ONSControls.gamepadHandler = function() {
|
|||
window.addEventListener("gamepadconnected", () => {this.toggle(false);});
|
||||
window.addEventListener("gamepaddisconnected", () => {this.toggle(true);});
|
||||
}
|
||||
//=============================================================================
|
||||
// * Disable idle animation on locked device
|
||||
//=============================================================================
|
||||
ONSControls.cordovaHandler = function() {
|
||||
document.addEventListener("pause", () => {
|
||||
console.log("Idle stopped");
|
||||
ONSControls.idleDisabled = true;
|
||||
ONSControls.resetIdleAnimation();
|
||||
});
|
||||
document.addEventListener("resume", () => {
|
||||
console.log("Idle started");
|
||||
ONSControls.idleDisabled = false;
|
||||
ONSControls.resetIdleAnimation();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -1084,4 +1099,5 @@ ONSControls.initialize = function() {
|
|||
VirtualGamepad.initialize();
|
||||
Window_OmoMenuOptionsONSControls.prototype.add();
|
||||
this.gamepadHandler();
|
||||
this.cordovaHandler();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue