[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:
parent
cc7e1af827
commit
6857cd459c
|
@ -2260,7 +2260,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
||||||
this.pokemonCaughtHatchedContainer.setY(25);
|
this.pokemonCaughtHatchedContainer.setY(25);
|
||||||
this.pokemonCandyIcon.setTint(argbFromRgba(rgbHexToRgba(colorScheme[0])));
|
this.pokemonCandyIcon.setTint(argbFromRgba(rgbHexToRgba(colorScheme[0])));
|
||||||
this.pokemonCandyOverlayIcon.setTint(argbFromRgba(rgbHexToRgba(colorScheme[1])));
|
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);
|
this.pokemonCandyContainer.setVisible(true);
|
||||||
|
|
||||||
if (pokemonPrevolutions.hasOwnProperty(species.speciesId)) {
|
if (pokemonPrevolutions.hasOwnProperty(species.speciesId)) {
|
||||||
|
|
|
@ -1534,8 +1534,8 @@ export default class PokedexUiHandler extends MessageUiHandler {
|
||||||
case SortCriteria.COST:
|
case SortCriteria.COST:
|
||||||
return (a.cost - b.cost) * -sort.dir;
|
return (a.cost - b.cost) * -sort.dir;
|
||||||
case SortCriteria.CANDY:
|
case SortCriteria.CANDY:
|
||||||
const candyCountA = globalScene.gameData.starterData[a.species.speciesId].candyCount;
|
const candyCountA = globalScene.gameData.starterData[this.getStarterSpeciesId(a.species.speciesId)].candyCount;
|
||||||
const candyCountB = globalScene.gameData.starterData[b.species.speciesId].candyCount;
|
const candyCountB = globalScene.gameData.starterData[this.getStarterSpeciesId(b.species.speciesId)].candyCount;
|
||||||
return (candyCountA - candyCountB) * -sort.dir;
|
return (candyCountA - candyCountB) * -sort.dir;
|
||||||
case SortCriteria.IV:
|
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;
|
const avgIVsA = globalScene.gameData.dexData[a.species.speciesId].ivs.reduce((a, b) => a + b, 0) / globalScene.gameData.dexData[a.species.speciesId].ivs.length;
|
||||||
|
|
Loading…
Reference in New Issue