mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-10 17:39:31 +02:00
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:
parent
88ace888eb
commit
e9318ec4c2
@ -1832,14 +1832,14 @@ class PartySlot extends Phaser.GameObjects.Container {
|
|||||||
const isDoubleBattle = globalScene.currentBattle.double;
|
const isDoubleBattle = globalScene.currentBattle.double;
|
||||||
const isItemManageMode = partyUiMode === PartyUiMode.MODIFIER_TRANSFER || partyUiMode === PartyUiMode.DISCARD;
|
const isItemManageMode = partyUiMode === PartyUiMode.MODIFIER_TRANSFER || partyUiMode === PartyUiMode.DISCARD;
|
||||||
|
|
||||||
/**
|
/*
|
||||||
Here we determine the position of the slot.
|
* 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 x coordinate depends on whether the pokemon is on the field or in the bench.
|
||||||
The y coordinate is more complex to determine
|
* The y coordinate depends on various factors, such as
|
||||||
*/
|
*/
|
||||||
const slotPositionX = isBenched ? 143 : 9;
|
const slotPositionX = isBenched ? 143 : 9;
|
||||||
|
|
||||||
let slotPositionY = 0;
|
let slotPositionY: number;
|
||||||
if (isBenched) {
|
if (isBenched) {
|
||||||
slotPositionY = -196 + (isDoubleBattle ? -40 : 0);
|
slotPositionY = -196 + (isDoubleBattle ? -40 : 0);
|
||||||
slotPositionY += (28 + (isDoubleBattle ? 8 : 0)) * slotIndex;
|
slotPositionY += (28 + (isDoubleBattle ? 8 : 0)) * slotIndex;
|
||||||
@ -1854,8 +1854,7 @@ class PartySlot extends Phaser.GameObjects.Container {
|
|||||||
super(globalScene, slotPositionX, slotPositionY);
|
super(globalScene, slotPositionX, slotPositionY);
|
||||||
|
|
||||||
this.slotIndex = slotIndex;
|
this.slotIndex = slotIndex;
|
||||||
const battlerCount = globalScene.currentBattle.getBattlerCount();
|
this.isBenched = isBenched;
|
||||||
this.isBenched = this.slotIndex >= battlerCount;
|
|
||||||
this.pokemon = pokemon;
|
this.pokemon = pokemon;
|
||||||
this.iconAnimHandler = iconAnimHandler;
|
this.iconAnimHandler = iconAnimHandler;
|
||||||
|
|
||||||
@ -1925,7 +1924,6 @@ class PartySlot extends Phaser.GameObjects.Container {
|
|||||||
this.add(this.slotPb);
|
this.add(this.slotPb);
|
||||||
|
|
||||||
this.pokemonIcon = globalScene.addPokemonIcon(this.pokemon, this.slotPb.x, this.slotPb.y, 0.5, 0.5, true);
|
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.add(this.pokemonIcon);
|
||||||
|
|
||||||
this.iconAnimHandler.addOrUpdate(this.pokemonIcon, PokemonIconAnimMode.PASSIVE);
|
this.iconAnimHandler.addOrUpdate(this.pokemonIcon, PokemonIconAnimMode.PASSIVE);
|
||||||
|
Loading…
Reference in New Issue
Block a user