Candy Icon Display Bugfix (#1507)

Fixes a small visual issue where scrolling through a list of Pokémon would not hide a candy if the Pokémon was not the root species.
This commit is contained in:
Benjamin Odom 2024-05-28 14:22:59 -05:00 committed by GitHub
parent 8824082ceb
commit 91013cf8c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 3 deletions

View File

@ -855,7 +855,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
if (!species // No Pokemon exists at that UI index if (!species // No Pokemon exists at that UI index
|| this.scene.candyUpgradeNotification === 0 // Notification setting is 'Off' || this.scene.candyUpgradeNotification === 0 // Notification setting is 'Off'
|| species?.getRootSpeciesId(false) !== species?.speciesId) { // Pokemon is not the base evolution and can't use candy || species.speciesId !== species.getRootSpeciesId(false)) { // Pokemon is not the base evolution and can't use candy
// Set all icons as hidden and exit early // Set all icons as hidden and exit early
this.candyUpgradeIcon[index].setVisible(false); this.candyUpgradeIcon[index].setVisible(false);
this.candyUpgradeOverlayIcon[index].setVisible(false); this.candyUpgradeOverlayIcon[index].setVisible(false);
@ -1516,9 +1516,8 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
this.hiddenAbilityIcons[s].setVisible(slotVisible && !!this.scene.gameData.dexData[speciesId].caughtAttr && !!(this.scene.gameData.starterData[speciesId].abilityAttr & 4)); this.hiddenAbilityIcons[s].setVisible(slotVisible && !!this.scene.gameData.dexData[speciesId].caughtAttr && !!(this.scene.gameData.starterData[speciesId].abilityAttr & 4));
this.classicWinIcons[s].setVisible(slotVisible && this.scene.gameData.starterData[speciesId].classicWinCount > 0); this.classicWinIcons[s].setVisible(slotVisible && this.scene.gameData.starterData[speciesId].classicWinCount > 0);
const species = this.genSpecies[genCursorWithScroll][s];
// 'Candy Icon' mode // 'Candy Icon' mode
if (this.scene.candyUpgradeDisplay === 0 && species?.getRootSpeciesId(false) === species?.speciesId) { if (this.scene.candyUpgradeDisplay === 0) {
if (!starterColors[speciesId]) { if (!starterColors[speciesId]) {
// Default to white if no colors are found // Default to white if no colors are found