From f334b61604a715905f2202571bcc1d180314224d Mon Sep 17 00:00:00 2001 From: Frutescens Date: Fri, 14 Jun 2024 09:39:49 -0700 Subject: [PATCH] Adjusted makeRoomForConfirmUi to improve window spacing --- src/phases.ts | 2 +- src/ui/pokemon-info-container.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/phases.ts b/src/phases.ts index 19cce5e77e4..531215b9716 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -4990,7 +4990,7 @@ export class AttemptCapturePhase extends PokemonPhase { if (this.scene.getParty().length === 6) { const promptRelease = () => { this.scene.ui.showText(i18next.t("battle:partyFull", { pokemonName: pokemon.name }), null, () => { - this.scene.pokemonInfoContainer.makeRoomForConfirmUi(); + this.scene.pokemonInfoContainer.makeRoomForConfirmUi(1, true); this.scene.ui.setMode(Mode.CONFIRM, () => { const newPokemon = this.scene.addPlayerPokemon(pokemon.species, pokemon.level, pokemon.abilityIndex, pokemon.formIndex, pokemon.gender, pokemon.shiny, pokemon.variant, pokemon.ivs, pokemon.nature, pokemon); this.scene.ui.setMode(Mode.SUMMARY, newPokemon).then(() => { diff --git a/src/ui/pokemon-info-container.ts b/src/ui/pokemon-info-container.ts index 9ab3028b564..0a398e56871 100644 --- a/src/ui/pokemon-info-container.ts +++ b/src/ui/pokemon-info-container.ts @@ -364,13 +364,14 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container { }); } - makeRoomForConfirmUi(speedMultiplier: number = 1): Promise { + makeRoomForConfirmUi(speedMultiplier: number = 1, fromCatch: boolean = false): Promise { + const xPosition = fromCatch ? this.initialX - this.infoWindowWidth - 65 : this.initialX - this.infoWindowWidth - ConfirmUiHandler.windowWidth; return new Promise(resolve => { this.scene.tweens.add({ targets: this, duration: Utils.fixedInt(Math.floor(150 / speedMultiplier)), ease: "Cubic.easeInOut", - x: this.initialX - this.infoWindowWidth - ConfirmUiHandler.windowWidth, + x: xPosition, onComplete: () => { resolve(); }