diff --git a/src/phases/egg-lapse-phase.ts b/src/phases/egg-lapse-phase.ts index ebc67df7139..4463de72de4 100644 --- a/src/phases/egg-lapse-phase.ts +++ b/src/phases/egg-lapse-phase.ts @@ -42,13 +42,13 @@ export class EggLapsePhase extends Phase { for (const egg of eggsToHatch) { this.hatchEggSilently(egg); } + this.showSummary(); }, () => { for (const egg of eggsToHatch) { this.scene.unshiftPhase(new EggHatchPhase(this.scene, this, egg, eggsToHatchCount)); eggsToHatchCount--; } this.showSummary(); - } ); }, 100, true); @@ -79,7 +79,6 @@ export class EggLapsePhase extends Phase { */ hatchEggSilently(egg: Egg) { const eggIndex = this.scene.gameData.eggs.findIndex(e => e.id === egg.id); - const eggsRemaining = this.scene.gameData.eggs.length; if (eggIndex === -1) { return this.end(); } @@ -91,15 +90,12 @@ export class EggLapsePhase extends Phase { pokemon.clearFusionSpecies(); } - console.time("loading assets " + pokemon.name + " " + eggsRemaining); // pokemon.loadAssets().then(() => { this.loadsWaiting--; console.log(this.loadsWaiting); - console.timeEnd("loading assets " + pokemon.name + " " + eggsRemaining); if (this.loadsWaiting === 0) { console.timeEnd("hatch eggs"); - this.showSummary(); } if (pokemon.species.subLegendary) { diff --git a/src/ui/egg-summary-ui-handler.ts b/src/ui/egg-summary-ui-handler.ts index f5b032e0d1d..ace461ff7f3 100644 --- a/src/ui/egg-summary-ui-handler.ts +++ b/src/ui/egg-summary-ui-handler.ts @@ -185,13 +185,22 @@ export default class EggSummaryUiHandler extends MessageUiHandler { bg.setTint(0xdfffaf); break; } + const species = displayPokemon.species; + const female = displayPokemon.gender === Gender.FEMALE; + const formIndex = displayPokemon.formIndex; + const variant = displayPokemon.variant; + const isShiny = displayPokemon.shiny; - const icon = this.scene.add.sprite(x-2, y+2, displayPokemon.species.getIconAtlasKey(displayPokemon.formIndex, displayPokemon.shiny, displayPokemon.variant)); - // const icon = this.scene.add.sprite(x - 2, y + 2, "egg_icons"); + const icon = this.scene.add.sprite(x-2, y+2, species.getIconAtlasKey(formIndex, isShiny, variant)); icon.setScale(0.5); icon.setOrigin(0, 0); - icon.setFrame(displayPokemon.species.getIconId(displayPokemon.gender === Gender.FEMALE, displayPokemon.formIndex, displayPokemon.shiny, displayPokemon.variant)); - // icon.setFrame(egg.getKey()); + icon.setFrame(species.getIconId(female, formIndex, isShiny, variant)); + + if (icon.frame.name !== species.getIconId(female, formIndex, isShiny, variant)) { + console.log(`${species.name}'s variant icon does not exist. Replacing with default.`); + icon.setTexture(species.getIconAtlasKey(formIndex, false, variant)); + icon.setFrame(species.getIconId(female, formIndex, false, variant)); + } this.pokemonIconSpritesContainer.add(icon); this.iconAnimHandler.addOrUpdate(icon, PokemonIconAnimMode.NONE);