diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 895be521e21..e77cd44b369 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -3584,6 +3584,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { * info container. */ leaveField(clearEffects: boolean = true, hideInfo: boolean = true) { + this.resetSprite(); this.resetTurnData(); if (clearEffects) { this.resetSummonData(); @@ -3592,7 +3593,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { if (hideInfo) { this.hideInfo(); } - this.resetSprite(); this.scene.field.remove(this); this.scene.triggerPokemonFormChange(this, SpeciesFormChangeActiveTrigger, true); } diff --git a/src/phases/return-phase.ts b/src/phases/return-phase.ts index 50f43e7a1ea..19c73816b36 100644 --- a/src/phases/return-phase.ts +++ b/src/phases/return-phase.ts @@ -16,9 +16,9 @@ export class ReturnPhase extends SwitchSummonPhase { onEnd(): void { const pokemon = this.getPokemon(); + pokemon.resetSprite(); pokemon.resetTurnData(); pokemon.resetSummonData(); - pokemon.resetSprite(); this.scene.updateFieldScale(); diff --git a/src/ui/modal-ui-handler.ts b/src/ui/modal-ui-handler.ts index 2aeafa68b23..80a39d7bf7f 100644 --- a/src/ui/modal-ui-handler.ts +++ b/src/ui/modal-ui-handler.ts @@ -92,13 +92,13 @@ export abstract class ModalUiHandler extends UiHandler { if (args[0].hasOwnProperty("fadeOut") && typeof args[0].fadeOut === "function") { const [ marginTop, marginRight, marginBottom, marginLeft ] = this.getMargin(); - const overlay = this.scene.add.rectangle(( this.getWidth() + marginLeft + marginRight) / 2, (this.getHeight() + marginTop + marginBottom) / 2,this.scene.game.canvas.width / 6,this.scene.game.canvas.height /6, 0); - overlay.setOrigin(0.5,0.5); + const overlay = this.scene.add.rectangle(( this.getWidth() + marginLeft + marginRight) / 2, (this.getHeight() + marginTop + marginBottom) / 2, this.scene.game.canvas.width / 6, this.scene.game.canvas.height /6, 0); + overlay.setOrigin(0.5, 0.5); overlay.setName("rect-ui-overlay-modal"); overlay.setAlpha(0); this.modalContainer.add(overlay); - this.modalContainer.moveTo(overlay,0); + this.modalContainer.moveTo(overlay, 0); this.scene.tweens.add({ targets: overlay,