changed loading to be on demand from cursor nav

This commit is contained in:
James Diefenbach 2024-08-31 17:41:32 +10:00
parent 46f39b57bc
commit 547bc145c1
2 changed files with 31 additions and 28 deletions

View File

@ -92,7 +92,7 @@ export class EggLapsePhase extends Phase {
}
console.time("loading assets " + pokemon.name + " " + eggsRemaining);
pokemon.loadAssets().then(() => {
// pokemon.loadAssets().then(() => {
this.loadsWaiting--;
console.log(this.loadsWaiting);
console.timeEnd("loading assets " + pokemon.name + " " + eggsRemaining);
@ -114,7 +114,7 @@ export class EggLapsePhase extends Phase {
if (pokemon.isShiny()) {
this.scene.validateAchv(achvs.HATCH_SHINY);
}
});
// });
}

View File

@ -128,6 +128,8 @@ export default class PokemonHatchInfoContainer extends PokemonInfoContainer {
const formIndex = pokemon.formIndex;
const shiny = pokemon.shiny;
const variant = pokemon.variant;
this.currentPokemonSprite.setVisible(false);
species.loadAssets(this.scene, female, formIndex, shiny, variant, true).then(() => {
getPokemonSpeciesForm(species.speciesId, pokemon.formIndex).cry(this.scene);
this.currentPokemonSprite.play(species.getSpriteKey(female, formIndex, shiny, variant));
@ -136,6 +138,7 @@ export default class PokemonHatchInfoContainer extends PokemonInfoContainer {
this.currentPokemonSprite.setPipelineData("spriteKey", species.getSpriteKey(female, formIndex, shiny, variant));
this.currentPokemonSprite.setVisible(true);
console.timeEnd("display pokemon" + pokemon.name);
});
}
/**