From 4d3c9e799aa22542c9bd13ebaab66da51be9092e Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 11 Sep 2025 08:45:13 +0800 Subject: [PATCH] Apply suggestions from code review - Adding suggestions and fixing the globalscene.lastPokeballType Co-authored-by: Fabi <192151969+fabske0@users.noreply.github.com> --- src/phases/attempt-capture-phase.ts | 2 +- src/ui/handlers/command-ui-handler.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/phases/attempt-capture-phase.ts b/src/phases/attempt-capture-phase.ts index cdb7c6c8c9c..39a0019a8c5 100644 --- a/src/phases/attempt-capture-phase.ts +++ b/src/phases/attempt-capture-phase.ts @@ -56,7 +56,7 @@ export class AttemptCapturePhase extends PokemonPhase { } globalScene.pokeballCounts[this.pokeballType]--; - globalScene.lastUsedPokeball = this.pokeballType; + globalScene.lastPokeballType = this.pokeballType; this.originalY = pokemon.y; diff --git a/src/ui/handlers/command-ui-handler.ts b/src/ui/handlers/command-ui-handler.ts index dfd1137be36..857d3160469 100644 --- a/src/ui/handlers/command-ui-handler.ts +++ b/src/ui/handlers/command-ui-handler.ts @@ -13,7 +13,7 @@ import { PartyUiHandler, PartyUiMode } from "#ui/handlers/party-ui-handler"; import { UiHandler } from "#ui/handlers/ui-handler"; import { addTextObject } from "#ui/text"; import i18next from "i18next"; -import { BattleType } from "../../enums/battle-type"; +import { BattleType } from "#enums/battle-type"; export class CommandUiHandler extends UiHandler { private commandsContainer: Phaser.GameObjects.Container; @@ -188,7 +188,7 @@ export class CommandUiHandler extends UiHandler { this.toggleTeraButton(); } break; - case Button.CYCLE_SHINY: + case Button.CYCLE_SHINY: // Used to throw the last pokeball const commandPhase = globalScene.phaseManager.getCurrentPhase() as CommandPhase; if (globalScene.pokeballCounts[globalScene.lastPokeballType]) { if (commandPhase.handleCommand(Command.BALL, globalScene.lastPokeballType)) { @@ -200,7 +200,7 @@ export class CommandUiHandler extends UiHandler { ui.playError(); } break; - case Button.CYCLE_ABILITY: + case Button.CYCLE_ABILITY: // Used to restart the battle if (globalScene.enableRetries){ globalScene.ui.setMode(UiMode.MESSAGE) globalScene.ui.showText(i18next.t("battle:retryBattle"), null, () => {