PIXI Controls: Fix edit mode open

This commit is contained in:
OleSTEEP 2024-02-15 17:29:03 +03:00
parent b68bf9c002
commit 9489e0533e

View file

@ -355,7 +355,6 @@ ONSControls.setupDragNDrop = function(element) {
element.alpha = orig_alpha; element.alpha = orig_alpha;
}; };
} }
element.on("pointerdown", onStart); element.on("pointerdown", onStart);
this._controlsCanvas.stage.on("pointerup", onEnd); this._controlsCanvas.stage.on("pointerup", onEnd);
this._controlsCanvas.stage.on("pointerupoutside", onEnd); this._controlsCanvas.stage.on("pointerupoutside", onEnd);
@ -379,16 +378,18 @@ ONSControls.replaceBackEvent = function() {
// * Open Edit Mode // * Open Edit Mode
//============================================================================= //=============================================================================
ONSControls.openEditMode = function() { ONSControls.openEditMode = function() {
Graphics._canvas.hidden = true; if (Graphics._canvas.hidden === false) {
this.clearInteractive(); Graphics._canvas.hidden = true;
clearInterval(this._idleInterval); this.clearInteractive();
this._buttonsContainer.interactive = true; clearInterval(this._idleInterval);
for (elem of this.getControlElements()) { this._buttonsContainer.interactive = true;
this.setupDragNDrop(elem); for (elem of this.getControlElements()) {
this.setupDragNDrop(elem);
}
this._editModeText.visible = true;
this._editModeText.x = this._controlsCanvas.screen.width / 2;
this._editModeText.y = this._controlsCanvas.screen.height / 2;
} }
this._editModeText.visible = true;
this._editModeText.x = this._controlsCanvas.screen.width / 2;
this._editModeText.y = this._controlsCanvas.screen.height / 2;
} }
//============================================================================= //=============================================================================
// * Close Edit Mode // * Close Edit Mode