From b68bf9c0022adc2cc5d2b7d8693ac007659616dc Mon Sep 17 00:00:00 2001 From: OleSTEEP Date: Thu, 15 Feb 2024 00:50:30 +0300 Subject: [PATCH] PIXI Controls: Move buttons container instead of buttons --- www.rus/js/plugins/VND_ONSControls.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/www.rus/js/plugins/VND_ONSControls.js b/www.rus/js/plugins/VND_ONSControls.js index 13efe80..b8796c5 100644 --- a/www.rus/js/plugins/VND_ONSControls.js +++ b/www.rus/js/plugins/VND_ONSControls.js @@ -129,7 +129,7 @@ ONSControls.createEditModeInterface = function() { fill: 0xaaaaaa, align: 'center' }); - const tipText = new PIXI.Text("Здась вы можете свободно перемещать элементы управления по экрану.\nЧтобы выйти из этого режима, нажмите кнопку \"Назад\" вашего Android устройства.", { + const tipText = new PIXI.Text("Здесь вы можете свободно перемещать элементы управления по экрану.\nЧтобы выйти из этого режима, нажмите кнопку \"Назад\" вашего Android устройства.", { fontFamily: 'Arial', fontSize: 16, fill: 0xaaaaaa, @@ -320,9 +320,7 @@ ONSControls.setupInteractive = function () { ONSControls.getControlElements = function() { return [ this._dPadContainer, this._LBsprite, - this._RBsprite, this._showButton, this._buttonsContainer.children[0], - this._buttonsContainer.children[1], this._buttonsContainer.children[2], - this._buttonsContainer.children[3] + this._RBsprite, this._showButton, this._buttonsContainer ]; } //============================================================================= @@ -330,6 +328,9 @@ ONSControls.getControlElements = function() { //============================================================================= ONSControls.clearInteractive = function() { this._controlsCanvas.stage.removeAllListeners(); + for (child of this._buttonsContainer.children) { + child.removeAllListeners(); + } for (elem of this.getControlElements()) { elem.removeAllListeners(); } @@ -381,6 +382,7 @@ ONSControls.openEditMode = function() { Graphics._canvas.hidden = true; this.clearInteractive(); clearInterval(this._idleInterval); + this._buttonsContainer.interactive = true; for (elem of this.getControlElements()) { this.setupDragNDrop(elem); }