mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-05 16:02:20 +02:00
fix missing variant icon fallback
This commit is contained in:
parent
547bc145c1
commit
a9cf25b2ab
@ -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) {
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user