From f5cd99f091929ccc2082f5049c34e485a318c8c2 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Sun, 21 Apr 2024 18:22:33 -0400 Subject: [PATCH] Fix evolution and hatch screen not applying shader pipeline --- src/egg-hatch-phase.ts | 8 ++++++-- src/evolution-phase.ts | 11 +++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/egg-hatch-phase.ts b/src/egg-hatch-phase.ts index 9259e7b10..a28d8e298 100644 --- a/src/egg-hatch-phase.ts +++ b/src/egg-hatch-phase.ts @@ -82,7 +82,11 @@ export class EggHatchPhase extends Phase { this.eggContainer.add(this.eggLightraysOverlay); this.eggHatchContainer.add(this.eggContainer); - const getPokemonSprite = () => this.scene.add.sprite(this.eggHatchBg.displayWidth / 2, this.eggHatchBg.displayHeight / 2, `pkmn__sub`); + const getPokemonSprite = () => { + const ret = this.scene.add.sprite(this.eggHatchBg.displayWidth / 2, this.eggHatchBg.displayHeight / 2, `pkmn__sub`); + ret.setPipeline(this.scene.spritePipeline, { tone: [ 0.0, 0.0, 0.0, 0.0 ], ignoreTimeTint: true }); + return ret; + }; this.eggHatchContainer.add((this.pokemonSprite = getPokemonSprite())); @@ -245,7 +249,7 @@ export class EggHatchPhase extends Phase { this.scene.validateAchv(achvs.HATCH_SHINY); this.eggContainer.setVisible(false); this.pokemonSprite.play(this.pokemon.getSpriteKey(true)); - this.pokemonSprite.pipelineData['ignoreTimeTint'] = true; + this.pokemonSprite.setPipelineData('ignoreTimeTint', true); this.pokemonSprite.setPipelineData('spriteKey', this.pokemon.getSpriteKey()); this.pokemonSprite.setPipelineData('shiny', this.pokemon.shiny); this.pokemonSprite.setPipelineData('variant', this.pokemon.variant); diff --git a/src/evolution-phase.ts b/src/evolution-phase.ts index fc58d1413..fb3803a1e 100644 --- a/src/evolution-phase.ts +++ b/src/evolution-phase.ts @@ -71,7 +71,11 @@ export class EvolutionPhase extends Phase { this.evolutionBgOverlay.setAlpha(0); this.evolutionContainer.add(this.evolutionBgOverlay); - const getPokemonSprite = () => this.scene.addPokemonSprite(this.pokemon, this.evolutionBaseBg.displayWidth / 2, this.evolutionBaseBg.displayHeight / 2, `pkmn__sub`); + const getPokemonSprite = () => { + const ret = this.scene.addPokemonSprite(this.pokemon, this.evolutionBaseBg.displayWidth / 2, this.evolutionBaseBg.displayHeight / 2, `pkmn__sub`); + ret.setPipeline(this.scene.spritePipeline, { tone: [ 0.0, 0.0, 0.0, 0.0 ], ignoreTimeTint: true }); + return ret; + }; this.evolutionContainer.add((this.pokemonSprite = getPokemonSprite())); this.evolutionContainer.add((this.pokemonTintSprite = getPokemonSprite())); @@ -92,7 +96,10 @@ export class EvolutionPhase extends Phase { [ this.pokemonSprite, this.pokemonTintSprite, this.pokemonEvoSprite, this.pokemonEvoTintSprite ].map(sprite => { sprite.play(this.pokemon.getSpriteKey(true)); sprite.setPipeline(this.scene.spritePipeline, { tone: [ 0.0, 0.0, 0.0, 0.0 ], hasShadow: false, teraColor: getTypeRgb(this.pokemon.getTeraType()) }); - sprite.pipelineData['ignoreTimeTint'] = true; + sprite.setPipelineData('ignoreTimeTint', true); + sprite.setPipelineData('spriteKey', this.pokemon.getSpriteKey()); + sprite.setPipelineData('shiny', this.pokemon.shiny); + sprite.setPipelineData('variant', this.pokemon.variant); [ 'spriteColors', 'fusionSpriteColors' ].map(k => { if (this.pokemon.summonData?.speciesForm) k += 'Base';