From 9489e0533eee52528718b1b0182193ffa782aa66 Mon Sep 17 00:00:00 2001 From: OleSTEEP Date: Thu, 15 Feb 2024 17:29:03 +0300 Subject: [PATCH] PIXI Controls: Fix edit mode open --- www.rus/js/plugins/VND_ONSControls.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/www.rus/js/plugins/VND_ONSControls.js b/www.rus/js/plugins/VND_ONSControls.js index b8796c5..3fdb569 100644 --- a/www.rus/js/plugins/VND_ONSControls.js +++ b/www.rus/js/plugins/VND_ONSControls.js @@ -355,7 +355,6 @@ ONSControls.setupDragNDrop = function(element) { element.alpha = orig_alpha; }; } - element.on("pointerdown", onStart); this._controlsCanvas.stage.on("pointerup", onEnd); this._controlsCanvas.stage.on("pointerupoutside", onEnd); @@ -379,16 +378,18 @@ ONSControls.replaceBackEvent = function() { // * Open Edit Mode //============================================================================= ONSControls.openEditMode = function() { - Graphics._canvas.hidden = true; - this.clearInteractive(); - clearInterval(this._idleInterval); - this._buttonsContainer.interactive = true; - for (elem of this.getControlElements()) { - this.setupDragNDrop(elem); + 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); + } + 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