From ec9365a8bffd8fa0dc050e71ef3eb177e63bc1e9 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Sun, 31 Mar 2024 12:09:27 -0400 Subject: [PATCH] Fix scenario where catch stats moves container position can become desynced --- src/ui/pokemon-info-container.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ui/pokemon-info-container.ts b/src/ui/pokemon-info-container.ts index 337236756..9eb53fcc3 100644 --- a/src/ui/pokemon-info-container.ts +++ b/src/ui/pokemon-info-container.ts @@ -22,6 +22,7 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container { private pokemonMoveLabels: Phaser.GameObjects.Text[]; private initialX: number; + private movesContainerInitialX: number; public statsContainer: StatsContainer; @@ -38,6 +39,8 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container { this.pokemonMovesContainer = this.scene.add.container(6, 14); + this.movesContainerInitialX = this.pokemonMovesContainer.x; + this.pokemonMovesContainers = []; this.pokemonMoveBgs = []; this.pokemonMoveLabels = []; @@ -142,7 +145,7 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container { targets: this.pokemonMovesContainer, duration: Utils.fixedInt(325), ease: 'Cubic.easeInOut', - x: '-=57', + x: this.movesContainerInitialX - 57, onComplete: () => resolve() }); } @@ -168,7 +171,7 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container { targets: this.pokemonMovesContainer, duration: Utils.fixedInt(750), ease: 'Cubic.easeInOut', - x: '+=57' + x: this.movesContainerInitialX }); this.scene.tweens.add({