From 78b7eae307880f3a000a859005601aab3983f50f Mon Sep 17 00:00:00 2001 From: Greenlamp Date: Mon, 6 May 2024 21:19:26 +0200 Subject: [PATCH] Revert "added "Free switch" text when variable "hasFreeSwitch" is true and display it only when we can see the command box" This reverts commit a65c696e6924a76d8fc40ace536e7170487fef4d. --- src/battle-scene.ts | 2 -- src/battle.ts | 1 - src/ui/command-ui-handler.ts | 17 ----------------- 3 files changed, 20 deletions(-) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 9cdb29e0d0a..1a1d9626c84 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -163,8 +163,6 @@ export default class BattleScene extends SceneBase { public waveCycleOffset: integer; public offsetGym: boolean; - public hasFreeSwitch: boolean; - public damageNumberHandler: DamageNumberHandler private spriteSparkleHandler: PokemonSpriteSparkleHandler; diff --git a/src/battle.ts b/src/battle.ts index 9e3a87dc94a..580bad9a508 100644 --- a/src/battle.ts +++ b/src/battle.ts @@ -133,7 +133,6 @@ export default class Battle { incrementTurn(scene: BattleScene): void { this.turn++; - scene.hasFreeSwitch = this.turn === 1; this.turnCommands = Object.fromEntries(Utils.getEnumValues(BattlerIndex).map(bt => [ bt, null ])); this.battleSeedState = null; } diff --git a/src/ui/command-ui-handler.ts b/src/ui/command-ui-handler.ts index f4b5e09e490..a2705301563 100644 --- a/src/ui/command-ui-handler.ts +++ b/src/ui/command-ui-handler.ts @@ -17,7 +17,6 @@ export enum Command { export default class CommandUiHandler extends UiHandler { private commandsContainer: Phaser.GameObjects.Container; private cursorObj: Phaser.GameObjects.Image; - private freeSwitchText: Phaser.GameObjects.Text; protected fieldIndex: integer = 0; protected cursor2: integer = 0; @@ -43,21 +42,6 @@ export default class CommandUiHandler extends UiHandler { const commandText = addTextObject(this.scene, c % 2 === 0 ? 0 : 55.8, c < 2 ? 0 : 16, commands[c], TextStyle.WINDOW); this.commandsContainer.add(commandText); } - - this.freeSwitchText = addTextObject(this.scene, -45, 25, '', TextStyle.WINDOW, {fontSize: '48px', color: '#A8E4A0'}); - this.freeSwitchText.setVisible(false); - this.commandsContainer.add(this.freeSwitchText); - } - - updateFreeSwitchText(): void { - if (!this.scene.currentBattle?.turn) return; - if (this.scene.hasFreeSwitch) { - this.freeSwitchText.setText('Free Switch'); - this.freeSwitchText.setVisible(true); - } else { - this.freeSwitchText.setText(''); - this.freeSwitchText.setVisible(false); - } } show(args: any[]): boolean { @@ -80,7 +64,6 @@ export default class CommandUiHandler extends UiHandler { messageHandler.message.setWordWrapWidth(1110); messageHandler.showText(i18next.t('commandUiHandler:actionMessage', {pokemonName: commandPhase.getPokemon().name}), 0); this.setCursor(this.getCursor()); - this.updateFreeSwitchText(); return true; }