PIXI Controls: Edit Mode Text

This commit is contained in:
OleSTEEP 2024-02-15 00:38:29 +03:00
parent 2457c283dd
commit dc4bb1389a

View file

@ -120,6 +120,30 @@ ONSControls.createAdditionalButtons = function() {
this._showButton = showButton; 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) // * Check idle animation (spinning buttons)
//============================================================================= //=============================================================================
ONSControls.idleAnimation = function() { ONSControls.idleAnimation = function() {
@ -360,11 +384,15 @@ ONSControls.openEditMode = function() {
for (elem of this.getControlElements()) { for (elem of this.getControlElements()) {
this.setupDragNDrop(elem); 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 // * Close Edit Mode
//============================================================================= //=============================================================================
ONSControls.closeEditMode = function() { ONSControls.closeEditMode = function() {
this._editModeText.visible = false;
Graphics._canvas.hidden = false; Graphics._canvas.hidden = false;
this.clearInteractive(); this.clearInteractive();
this.setupInteractive(); this.setupInteractive();
@ -751,7 +779,6 @@ Window_OmoMenuOptionsONSControls.prototype.drawItem = function (index) {
if (data) { if (data) {
// Draw Header // Draw Header
this.contents.drawText(data.header, rect.x + 50, rect.y, rect.width, 24); this.contents.drawText(data.header, rect.x + 50, rect.y, rect.width, 24);
if (!data.isBar) {console.log(this.contents);}
// Update option bar // Update option bar
if (data.isBar) { if (data.isBar) {
this.updateOptionBar(index, data.option, data.persent); this.updateOptionBar(index, data.option, data.persent);
@ -904,6 +931,7 @@ ONSControls.initialize = function() {
this.createDPad(); this.createDPad();
this.createBumpers(); this.createBumpers();
this.createAdditionalButtons(); this.createAdditionalButtons();
this.createEditModeInterface();
this.updateButtons(); this.updateButtons();
this.setupInteractive(); this.setupInteractive();
this.disableTouch(); this.disableTouch();