From cfe9b3303a5b97f386c759c7deef3fd12d5136eb Mon Sep 17 00:00:00 2001 From: Frede Date: Wed, 5 Jun 2024 03:05:25 +0200 Subject: [PATCH] [QoL] Pokemon Info Container always on top of Battle UI (#1782) * Added "Skip Dialogues" option (if at least 1 classic win) * Removed error sound and hide option instead when classic wins = 0 * Add skip dialogues option to Unlockables and show unlocked message on first classic win * Only skips seen dialogues, removed dialogue option from unlockables, seen dialogues get saved to local storage * oops * dont show charSprite when skipping a dialogue, small fixes * pokemonInfoContainer always on top of battle UI when shown --------- Co-authored-by: Frederik Hobein --- src/ui/pokemon-info-container.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ui/pokemon-info-container.ts b/src/ui/pokemon-info-container.ts index b731b0d22b4..0952158a78d 100644 --- a/src/ui/pokemon-info-container.ts +++ b/src/ui/pokemon-info-container.ts @@ -62,6 +62,7 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container { private initialX: number; private movesContainerInitialX: number; + private initialParentDepth: number; public statsContainer: StatsContainer; @@ -246,6 +247,8 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container { this.setVisible(true); this.shown = true; + this.initialParentDepth = this.parentContainer.depth; + this.parentContainer.setDepth(3); }); } @@ -266,6 +269,7 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container { hide(speedMultiplier: number = 1): Promise { return new Promise(resolve => { if (!this.shown) { + this.parentContainer.setDepth(this.initialParentDepth); return resolve(); } @@ -286,6 +290,7 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container { this.pokemonShinyIcon.off("pointerover"); this.pokemonShinyIcon.off("pointerout"); (this.scene as BattleScene).ui.hideTooltip(); + this.parentContainer.setDepth(this.initialParentDepth); resolve(); } });