Revert "added "Free switch" text when variable "hasFreeSwitch" is true and display it only when we can see the command box"

This reverts commit a65c696e69.
This commit is contained in:
Greenlamp 2024-05-06 21:19:26 +02:00
parent 90f0d7e72e
commit 78b7eae307
3 changed files with 0 additions and 20 deletions

View File

@ -163,8 +163,6 @@ export default class BattleScene extends SceneBase {
public waveCycleOffset: integer; public waveCycleOffset: integer;
public offsetGym: boolean; public offsetGym: boolean;
public hasFreeSwitch: boolean;
public damageNumberHandler: DamageNumberHandler public damageNumberHandler: DamageNumberHandler
private spriteSparkleHandler: PokemonSpriteSparkleHandler; private spriteSparkleHandler: PokemonSpriteSparkleHandler;

View File

@ -133,7 +133,6 @@ export default class Battle {
incrementTurn(scene: BattleScene): void { incrementTurn(scene: BattleScene): void {
this.turn++; this.turn++;
scene.hasFreeSwitch = this.turn === 1;
this.turnCommands = Object.fromEntries(Utils.getEnumValues(BattlerIndex).map(bt => [ bt, null ])); this.turnCommands = Object.fromEntries(Utils.getEnumValues(BattlerIndex).map(bt => [ bt, null ]));
this.battleSeedState = null; this.battleSeedState = null;
} }

View File

@ -17,7 +17,6 @@ export enum Command {
export default class CommandUiHandler extends UiHandler { export default class CommandUiHandler extends UiHandler {
private commandsContainer: Phaser.GameObjects.Container; private commandsContainer: Phaser.GameObjects.Container;
private cursorObj: Phaser.GameObjects.Image; private cursorObj: Phaser.GameObjects.Image;
private freeSwitchText: Phaser.GameObjects.Text;
protected fieldIndex: integer = 0; protected fieldIndex: integer = 0;
protected cursor2: 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); const commandText = addTextObject(this.scene, c % 2 === 0 ? 0 : 55.8, c < 2 ? 0 : 16, commands[c], TextStyle.WINDOW);
this.commandsContainer.add(commandText); 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 { show(args: any[]): boolean {
@ -80,7 +64,6 @@ export default class CommandUiHandler extends UiHandler {
messageHandler.message.setWordWrapWidth(1110); messageHandler.message.setWordWrapWidth(1110);
messageHandler.showText(i18next.t('commandUiHandler:actionMessage', {pokemonName: commandPhase.getPokemon().name}), 0); messageHandler.showText(i18next.t('commandUiHandler:actionMessage', {pokemonName: commandPhase.getPokemon().name}), 0);
this.setCursor(this.getCursor()); this.setCursor(this.getCursor());
this.updateFreeSwitchText();
return true; return true;
} }