Fix scenario where catch stats moves container position can become desynced

This commit is contained in:
Flashfyre 2024-03-31 12:09:27 -04:00
parent 203ba1646d
commit ec9365a8bf
1 changed files with 5 additions and 2 deletions

View File

@ -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({