diff --git a/package-lock.json b/package-lock.json index c6dfdd7be04..d31469f4a45 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pokemon-rogue-battle", - "version": "1.7.4", + "version": "1.7.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "pokemon-rogue-battle", - "version": "1.7.4", + "version": "1.7.5", "hasInstallScript": true, "dependencies": { "@material/material-color-utilities": "^0.2.7", diff --git a/package.json b/package.json index 19f64b56157..1953b886c80 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pokemon-rogue-battle", "private": true, - "version": "1.7.4", + "version": "1.7.5", "type": "module", "scripts": { "start": "vite", diff --git a/src/ui/pokedex-page-ui-handler.ts b/src/ui/pokedex-page-ui-handler.ts index 99b25c3c383..49bb52dddbb 100644 --- a/src/ui/pokedex-page-ui-handler.ts +++ b/src/ui/pokedex-page-ui-handler.ts @@ -250,6 +250,8 @@ export default class PokedexPageUiHandler extends MessageUiHandler { private availableVariants: number; private unlockedVariants: boolean[]; + private canUseCandies: boolean; + constructor() { super(Mode.POKEDEX_PAGE); } @@ -556,6 +558,9 @@ export default class PokedexPageUiHandler extends MessageUiHandler { show(args: any[]): boolean { + // Allow the use of candies if we are in one of the whitelisted phases + this.canUseCandies = [ "TitlePhase", "SelectStarterPhase", "CommandPhase" ].includes(globalScene.getCurrentPhase()?.constructor.name ?? ""); + if (args.length >= 1 && args[0] === "refresh") { return false; } else { @@ -1626,7 +1631,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { } break; case Button.STATS: - if (!isCaught || !isFormCaught) { + if (!isCaught || !isFormCaught || !this.canUseCandies) { error = true; } else { const ui = this.getUi(); @@ -1888,7 +1893,9 @@ export default class PokedexPageUiHandler extends MessageUiHandler { if (this.isCaught()) { if (isFormCaught) { - this.updateButtonIcon(SettingKeyboard.Button_Stats, gamepadType, this.candyUpgradeIconElement, this.candyUpgradeLabel); + if (this.canUseCandies) { + this.updateButtonIcon(SettingKeyboard.Button_Stats, gamepadType, this.candyUpgradeIconElement, this.candyUpgradeLabel); + } if (this.canCycleShiny) { this.updateButtonIcon(SettingKeyboard.Button_Cycle_Shiny, gamepadType, this.shinyIconElement, this.shinyLabel); }