PIXI Controls: Fix Interval cleaning
This commit is contained in:
parent
e396132f7f
commit
e74e407aed
1 changed files with 4 additions and 5 deletions
|
@ -268,13 +268,12 @@ ONSControls.updateButtons = function() {
|
|||
ONSControls.setupInteractive = function () {
|
||||
|
||||
// Canvas
|
||||
var idleInterval = setInterval(ONSControls.playIdleAnimation, 60000);
|
||||
this._idleInterval = setInterval(ONSControls.playIdleAnimation, 60000);
|
||||
this._controlsCanvas.stage.on("pointerdown", () => {
|
||||
this.stopIdleAnimation();
|
||||
clearInterval(idleInterval);
|
||||
idleInterval = setInterval(ONSControls.playIdleAnimation, 60000);
|
||||
clearInterval(ONSControls._idleInterval);
|
||||
ONSControls._idleInterval = setInterval(ONSControls.playIdleAnimation, 60000);
|
||||
});
|
||||
this._idleInterval = idleInterval;
|
||||
|
||||
// A/B/X/Y
|
||||
const buttons = this._buttonsContainer.children;
|
||||
|
@ -335,6 +334,7 @@ ONSControls.clearInteractive = function() {
|
|||
elem.removeAllListeners();
|
||||
}
|
||||
this._dPadContainer.upAll();
|
||||
clearInterval(this._idleInterval);
|
||||
// Clear status of VirtualGamepad
|
||||
VirtualGamepad.clearState();
|
||||
}
|
||||
|
@ -392,7 +392,6 @@ ONSControls.openEditMode = function() {
|
|||
if (Graphics._canvas.hidden === false) {
|
||||
Graphics._canvas.hidden = true;
|
||||
this.clearInteractive();
|
||||
clearInterval(this._idleInterval);
|
||||
this._buttonsContainer.interactive = true;
|
||||
for (elem of this.getControlElements()) {
|
||||
this.setupDragNDrop(elem);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue