Apply suggestions from code review

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
This commit is contained in:
Wlowscha 2025-08-03 15:52:01 +02:00 committed by GitHub
parent 88ace888eb
commit e9318ec4c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1832,14 +1832,14 @@ class PartySlot extends Phaser.GameObjects.Container {
const isDoubleBattle = globalScene.currentBattle.double;
const isItemManageMode = partyUiMode === PartyUiMode.MODIFIER_TRANSFER || partyUiMode === PartyUiMode.DISCARD;
/**
Here we determine the position of the slot.
The x coordinate depends on whether the pokemon is on the field or in the bench.
The y coordinate is more complex to determine
/*
* Here we determine the position of the slot.
* The x coordinate depends on whether the pokemon is on the field or in the bench.
* The y coordinate depends on various factors, such as
*/
const slotPositionX = isBenched ? 143 : 9;
let slotPositionY = 0;
let slotPositionY: number;
if (isBenched) {
slotPositionY = -196 + (isDoubleBattle ? -40 : 0);
slotPositionY += (28 + (isDoubleBattle ? 8 : 0)) * slotIndex;
@ -1854,8 +1854,7 @@ class PartySlot extends Phaser.GameObjects.Container {
super(globalScene, slotPositionX, slotPositionY);
this.slotIndex = slotIndex;
const battlerCount = globalScene.currentBattle.getBattlerCount();
this.isBenched = this.slotIndex >= battlerCount;
this.isBenched = isBenched;
this.pokemon = pokemon;
this.iconAnimHandler = iconAnimHandler;
@ -1925,7 +1924,6 @@ class PartySlot extends Phaser.GameObjects.Container {
this.add(this.slotPb);
this.pokemonIcon = globalScene.addPokemonIcon(this.pokemon, this.slotPb.x, this.slotPb.y, 0.5, 0.5, true);
// this.pokemonIcon.setPosition();
this.add(this.pokemonIcon);
this.iconAnimHandler.addOrUpdate(this.pokemonIcon, PokemonIconAnimMode.PASSIVE);