From 6857cd459cb2f5457cecadd35bfcef85f49741ae Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Tue, 25 Feb 2025 05:43:53 +0100 Subject: [PATCH] =?UTF-8?q?[UI/UX]=20Pok=C3=A9dex=20-=20Fix=20candy=20filt?= =?UTF-8?q?er=20(#5377)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Hardcoding Pikachu to show 0 candies * Looking at starterId to determine order in sort by candy --- src/ui/pokedex-page-ui-handler.ts | 2 +- src/ui/pokedex-ui-handler.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ui/pokedex-page-ui-handler.ts b/src/ui/pokedex-page-ui-handler.ts index a086762bb57..ad05b265a50 100644 --- a/src/ui/pokedex-page-ui-handler.ts +++ b/src/ui/pokedex-page-ui-handler.ts @@ -2260,7 +2260,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { this.pokemonCaughtHatchedContainer.setY(25); this.pokemonCandyIcon.setTint(argbFromRgba(rgbHexToRgba(colorScheme[0]))); this.pokemonCandyOverlayIcon.setTint(argbFromRgba(rgbHexToRgba(colorScheme[1]))); - this.pokemonCandyCountText.setText(`x${globalScene.gameData.starterData[this.starterId].candyCount}`); + this.pokemonCandyCountText.setText(`x${species.speciesId === Species.PIKACHU ? 0 : globalScene.gameData.starterData[this.starterId].candyCount}`); this.pokemonCandyContainer.setVisible(true); if (pokemonPrevolutions.hasOwnProperty(species.speciesId)) { diff --git a/src/ui/pokedex-ui-handler.ts b/src/ui/pokedex-ui-handler.ts index 6b8fdc41539..ed0c3e7ee33 100644 --- a/src/ui/pokedex-ui-handler.ts +++ b/src/ui/pokedex-ui-handler.ts @@ -1534,8 +1534,8 @@ export default class PokedexUiHandler extends MessageUiHandler { case SortCriteria.COST: return (a.cost - b.cost) * -sort.dir; case SortCriteria.CANDY: - const candyCountA = globalScene.gameData.starterData[a.species.speciesId].candyCount; - const candyCountB = globalScene.gameData.starterData[b.species.speciesId].candyCount; + const candyCountA = globalScene.gameData.starterData[this.getStarterSpeciesId(a.species.speciesId)].candyCount; + const candyCountB = globalScene.gameData.starterData[this.getStarterSpeciesId(b.species.speciesId)].candyCount; return (candyCountA - candyCountB) * -sort.dir; case SortCriteria.IV: const avgIVsA = globalScene.gameData.dexData[a.species.speciesId].ivs.reduce((a, b) => a + b, 0) / globalScene.gameData.dexData[a.species.speciesId].ivs.length;