From dc4bb1389a168e7e5e74b79faf11756e9bf5f635 Mon Sep 17 00:00:00 2001 From: OleSTEEP Date: Thu, 15 Feb 2024 00:38:29 +0300 Subject: [PATCH] PIXI Controls: Edit Mode Text --- www.rus/js/plugins/VND_ONSControls.js | 30 ++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/www.rus/js/plugins/VND_ONSControls.js b/www.rus/js/plugins/VND_ONSControls.js index 06a935e..13efe80 100644 --- a/www.rus/js/plugins/VND_ONSControls.js +++ b/www.rus/js/plugins/VND_ONSControls.js @@ -120,6 +120,30 @@ ONSControls.createAdditionalButtons = function() { this._showButton = showButton; } //============================================================================= +// * Edit Mode Interface +//============================================================================= +ONSControls.createEditModeInterface = function() { + const headerText = new PIXI.Text("Режим редактирования", { + fontFamily: 'Arial', + fontSize: 24, + fill: 0xaaaaaa, + align: 'center' + }); + const tipText = new PIXI.Text("Здась вы можете свободно перемещать элементы управления по экрану.\nЧтобы выйти из этого режима, нажмите кнопку \"Назад\" вашего Android устройства.", { + fontFamily: 'Arial', + fontSize: 16, + fill: 0xaaaaaa, + align: 'center' + }); + headerText.anchor.set(0.5); + headerText.visible = false; + headerText.addChild(tipText); + tipText.anchor.set(0.5); + tipText.y = 48; + this._controlsCanvas.stage.addChild(headerText); + this._editModeText = headerText; +} +//============================================================================= // * Check idle animation (spinning buttons) //============================================================================= ONSControls.idleAnimation = function() { @@ -360,11 +384,15 @@ ONSControls.openEditMode = function() { 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; } //============================================================================= // * Close Edit Mode //============================================================================= ONSControls.closeEditMode = function() { + this._editModeText.visible = false; Graphics._canvas.hidden = false; this.clearInteractive(); this.setupInteractive(); @@ -751,7 +779,6 @@ Window_OmoMenuOptionsONSControls.prototype.drawItem = function (index) { if (data) { // Draw Header this.contents.drawText(data.header, rect.x + 50, rect.y, rect.width, 24); - if (!data.isBar) {console.log(this.contents);} // Update option bar if (data.isBar) { this.updateOptionBar(index, data.option, data.persent); @@ -904,6 +931,7 @@ ONSControls.initialize = function() { this.createDPad(); this.createBumpers(); this.createAdditionalButtons(); + this.createEditModeInterface(); this.updateButtons(); this.setupInteractive(); this.disableTouch();