From f6e477c2f9fd689337c0866662a4b96eb591ddec Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Mon, 28 Jul 2025 22:51:45 +0200 Subject: [PATCH] Replaced some sneaky instances of `scaledCanvas / 2` --- src/phases/end-card-phase.ts | 2 +- src/ui/login-form-ui-handler.ts | 2 +- src/ui/modifier-select-ui-handler.ts | 14 +++++++------- src/ui/party-ui-handler.ts | 2 +- src/ui/run-info-ui-handler.ts | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/phases/end-card-phase.ts b/src/phases/end-card-phase.ts index 0716f714b68..5ce0ca47b99 100644 --- a/src/phases/end-card-phase.ts +++ b/src/phases/end-card-phase.ts @@ -25,7 +25,7 @@ export class EndCardPhase extends Phase { globalScene.field.add(this.endCard); this.text = addTextObject( - globalScene.game.canvas.width / 12, + globalScene.scaledCanvas.width / 2, globalScene.scaledCanvas.height - 16, i18next.t("battle:congratulations"), TextStyle.SUMMARY, diff --git a/src/ui/login-form-ui-handler.ts b/src/ui/login-form-ui-handler.ts index 524eaeece86..67b2c81b94c 100644 --- a/src/ui/login-form-ui-handler.ts +++ b/src/ui/login-form-ui-handler.ts @@ -49,7 +49,7 @@ export class LoginFormUiHandler extends FormModalUiHandler { private buildExternalPartyContainer() { this.externalPartyContainer = globalScene.add.container(0, 0); this.externalPartyContainer.setInteractive( - new Phaser.Geom.Rectangle(0, 0, globalScene.game.canvas.width / 12, globalScene.game.canvas.height / 12), + new Phaser.Geom.Rectangle(0, 0, globalScene.scaledCanvas.width / 2, globalScene.scaledCanvas.height / 2), Phaser.Geom.Rectangle.Contains, ); this.externalPartyTitle = addTextObject(0, 4, "", TextStyle.SETTINGS_LABEL); diff --git a/src/ui/modifier-select-ui-handler.ts b/src/ui/modifier-select-ui-handler.ts index 63d6ca1e028..c02ff482776 100644 --- a/src/ui/modifier-select-ui-handler.ts +++ b/src/ui/modifier-select-ui-handler.ts @@ -126,8 +126,8 @@ export class ModifierSelectUiHandler extends AwaitableUiHandler { this.lockRarityButtonContainer.add(this.lockRarityButtonText); this.continueButtonContainer = globalScene.add.container( - globalScene.game.canvas.width / 12, - -(globalScene.game.canvas.height / 12), + globalScene.scaledCanvas.width / 2, + -(globalScene.scaledCanvas.height / 2), ); this.continueButtonContainer.setVisible(false); ui.add(this.continueButtonContainer); @@ -217,7 +217,7 @@ export class ModifierSelectUiHandler extends AwaitableUiHandler { const sliceWidth = globalScene.scaledCanvas.width / (typeOptions.length + 2); const option = new ModifierOption( sliceWidth * (m + 1) + sliceWidth * 0.5, - -globalScene.game.canvas.height / 12 + optionsYOffset, + -globalScene.scaledCanvas.height / 2 + optionsYOffset, typeOptions[m], ); option.setScale(0.5); @@ -241,7 +241,7 @@ export class ModifierSelectUiHandler extends AwaitableUiHandler { const sliceWidth = globalScene.scaledCanvas.width / (rowOptions.length + 2); const option = new ModifierOption( sliceWidth * (col + 1) + sliceWidth * 0.5, - -globalScene.game.canvas.height / 12 - globalScene.game.canvas.height / 32 - (42 - (28 * row - 1)), + -globalScene.scaledCanvas.height / 2 - globalScene.game.canvas.height / 32 - (42 - (28 * row - 1)), shopTypeOptions[m], ); option.setScale(0.375); @@ -554,7 +554,7 @@ export class ModifierSelectUiHandler extends AwaitableUiHandler { this.cursorObj.setScale(1.25); this.cursorObj.setPosition( globalScene.game.canvas.width / 18 + 23, - -globalScene.game.canvas.height / 12 - + -globalScene.scaledCanvas.height / 2 - (this.shopOptionsRows.length > 1 ? SINGLE_SHOP_ROW_YOFFSET - 2 : DOUBLE_SHOP_ROW_YOFFSET - 2), ); ui.showText(i18next.t("modifierSelectUiHandler:continueNextWaveDescription")); @@ -566,14 +566,14 @@ export class ModifierSelectUiHandler extends AwaitableUiHandler { // Cursor on free items this.cursorObj.setPosition( sliceWidth * (cursor + 1) + sliceWidth * 0.5 - 20, - -globalScene.game.canvas.height / 12 - + -globalScene.scaledCanvas.height / 2 - (this.shopOptionsRows.length > 1 ? SINGLE_SHOP_ROW_YOFFSET - 2 : DOUBLE_SHOP_ROW_YOFFSET - 2), ); } else { // Cursor on paying items this.cursorObj.setPosition( sliceWidth * (cursor + 1) + sliceWidth * 0.5 - 16, - -globalScene.game.canvas.height / 12 - + -globalScene.scaledCanvas.height / 2 - globalScene.game.canvas.height / 32 - (-14 + 28 * (this.rowCursor - (this.shopOptionsRows.length - 1))), ); diff --git a/src/ui/party-ui-handler.ts b/src/ui/party-ui-handler.ts index f2dec29c770..6b16c82690d 100644 --- a/src/ui/party-ui-handler.ts +++ b/src/ui/party-ui-handler.ts @@ -312,7 +312,7 @@ export class PartyUiHandler extends MessageUiHandler { top: true, x: 1, y: -MoveInfoOverlay.getHeight() - 1, - width: globalScene.game.canvas.width / 12 - 30, + width: globalScene.scaledCanvas.width / 2 - 30, }); ui.add(this.moveInfoOverlay); diff --git a/src/ui/run-info-ui-handler.ts b/src/ui/run-info-ui-handler.ts index 64492816c8e..667a22a001a 100644 --- a/src/ui/run-info-ui-handler.ts +++ b/src/ui/run-info-ui-handler.ts @@ -971,7 +971,7 @@ export class RunInfoUiHandler extends UiHandler { endCard.setOrigin(0); endCard.setScale(0.5); const text = addTextObject( - globalScene.game.canvas.width / 12, + globalScene.scaledCanvas.width / 2, globalScene.scaledCanvas.height - 16, i18next.t("battle:congratulations"), TextStyle.SUMMARY,