diff --git a/www.eng/js/plugins/VND_ONSControls.js b/www.eng/js/plugins/VND_ONSControls.js index 664bd91..34d05c0 100644 --- a/www.eng/js/plugins/VND_ONSControls.js +++ b/www.eng/js/plugins/VND_ONSControls.js @@ -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(); } \ No newline at end of file diff --git a/www.rus/js/plugins/VND_ONSControls.js b/www.rus/js/plugins/VND_ONSControls.js index 416f0ff..94dd6d2 100644 --- a/www.rus/js/plugins/VND_ONSControls.js +++ b/www.rus/js/plugins/VND_ONSControls.js @@ -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(); } \ No newline at end of file