[UI/UX] Pokédex - Fix candy filter (#5377)

* Hardcoding Pikachu to show 0 candies

* Looking at starterId to determine order in sort by candy
This commit is contained in:
Wlowscha 2025-02-25 05:43:53 +01:00 committed by GitHub
parent cc7e1af827
commit 6857cd459c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -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)) {

View File

@ -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;