mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-27 01:39:34 +02:00
load trainer assets on demand for run history UI
This commit is contained in:
parent
e556db81cb
commit
c5d8c6e746
@ -288,6 +288,9 @@ export default class RunInfoUiHandler extends UiHandler {
|
||||
private parseTrainerDefeat(enemyContainer: Phaser.GameObjects.Container) {
|
||||
// Creating the trainer sprite and adding it to enemyContainer
|
||||
const tObj = this.runInfo.trainer.toTrainer(this.scene);
|
||||
|
||||
// Loads trainer assets on demand, as they are not loaded by default in the scene
|
||||
tObj.config.loadAssets(this.scene, this.runInfo.trainer.variant).then(() => {
|
||||
const tObjSpriteKey = tObj.config.getSpriteKey(this.runInfo.trainer.variant === TrainerVariant.FEMALE, false);
|
||||
const tObjSprite = this.scene.add.sprite(0, 5, tObjSpriteKey);
|
||||
if (this.runInfo.trainer.variant === TrainerVariant.DOUBLE) {
|
||||
@ -307,6 +310,7 @@ export default class RunInfoUiHandler extends UiHandler {
|
||||
tObjSprite.setPosition(12, 28);
|
||||
enemyContainer.add(tObjSprite);
|
||||
}
|
||||
});
|
||||
|
||||
// Determining which Terastallize Modifier belongs to which Pokemon
|
||||
// Creates a dictionary {PokemonId: TeraShardType}
|
||||
|
Loading…
Reference in New Issue
Block a user