mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-06 16:32:16 +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) {
|
for (const egg of eggsToHatch) {
|
||||||
this.hatchEggSilently(egg);
|
this.hatchEggSilently(egg);
|
||||||
}
|
}
|
||||||
|
this.showSummary();
|
||||||
}, () => {
|
}, () => {
|
||||||
for (const egg of eggsToHatch) {
|
for (const egg of eggsToHatch) {
|
||||||
this.scene.unshiftPhase(new EggHatchPhase(this.scene, this, egg, eggsToHatchCount));
|
this.scene.unshiftPhase(new EggHatchPhase(this.scene, this, egg, eggsToHatchCount));
|
||||||
eggsToHatchCount--;
|
eggsToHatchCount--;
|
||||||
}
|
}
|
||||||
this.showSummary();
|
this.showSummary();
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}, 100, true);
|
}, 100, true);
|
||||||
@ -79,7 +79,6 @@ export class EggLapsePhase extends Phase {
|
|||||||
*/
|
*/
|
||||||
hatchEggSilently(egg: Egg) {
|
hatchEggSilently(egg: Egg) {
|
||||||
const eggIndex = this.scene.gameData.eggs.findIndex(e => e.id === egg.id);
|
const eggIndex = this.scene.gameData.eggs.findIndex(e => e.id === egg.id);
|
||||||
const eggsRemaining = this.scene.gameData.eggs.length;
|
|
||||||
if (eggIndex === -1) {
|
if (eggIndex === -1) {
|
||||||
return this.end();
|
return this.end();
|
||||||
}
|
}
|
||||||
@ -91,15 +90,12 @@ export class EggLapsePhase extends Phase {
|
|||||||
pokemon.clearFusionSpecies();
|
pokemon.clearFusionSpecies();
|
||||||
}
|
}
|
||||||
|
|
||||||
console.time("loading assets " + pokemon.name + " " + eggsRemaining);
|
|
||||||
// pokemon.loadAssets().then(() => {
|
// pokemon.loadAssets().then(() => {
|
||||||
this.loadsWaiting--;
|
this.loadsWaiting--;
|
||||||
console.log(this.loadsWaiting);
|
console.log(this.loadsWaiting);
|
||||||
console.timeEnd("loading assets " + pokemon.name + " " + eggsRemaining);
|
|
||||||
|
|
||||||
if (this.loadsWaiting === 0) {
|
if (this.loadsWaiting === 0) {
|
||||||
console.timeEnd("hatch eggs");
|
console.timeEnd("hatch eggs");
|
||||||
this.showSummary();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pokemon.species.subLegendary) {
|
if (pokemon.species.subLegendary) {
|
||||||
|
@ -185,13 +185,22 @@ export default class EggSummaryUiHandler extends MessageUiHandler {
|
|||||||
bg.setTint(0xdfffaf);
|
bg.setTint(0xdfffaf);
|
||||||
break;
|
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, species.getIconAtlasKey(formIndex, isShiny, variant));
|
||||||
// const icon = this.scene.add.sprite(x - 2, y + 2, "egg_icons");
|
|
||||||
icon.setScale(0.5);
|
icon.setScale(0.5);
|
||||||
icon.setOrigin(0, 0);
|
icon.setOrigin(0, 0);
|
||||||
icon.setFrame(displayPokemon.species.getIconId(displayPokemon.gender === Gender.FEMALE, displayPokemon.formIndex, displayPokemon.shiny, displayPokemon.variant));
|
icon.setFrame(species.getIconId(female, formIndex, isShiny, variant));
|
||||||
// icon.setFrame(egg.getKey());
|
|
||||||
|
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.pokemonIconSpritesContainer.add(icon);
|
||||||
this.iconAnimHandler.addOrUpdate(icon, PokemonIconAnimMode.NONE);
|
this.iconAnimHandler.addOrUpdate(icon, PokemonIconAnimMode.NONE);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user