From c818f0e1dfb1a87c682da2bcc21b2f34c4e5a813 Mon Sep 17 00:00:00 2001 From: Dakurei Date: Sat, 22 Jun 2024 15:58:07 +0200 Subject: [PATCH] [Enhancement] Avoids 'flashbanging' for players in Shop UI (#2504) * Fix - Avoids 'flashbanging' for players playing at x5 speed by making the transition time constant regardless of the speed chosen * Forgot to delete a debugging value --- src/ui/modifier-select-ui-handler.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ui/modifier-select-ui-handler.ts b/src/ui/modifier-select-ui-handler.ts index bad7d59bd30..5792e170ac7 100644 --- a/src/ui/modifier-select-ui-handler.ts +++ b/src/ui/modifier-select-ui-handler.ts @@ -183,7 +183,8 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler { /* Force updateModifiers without pokemonSpecificModifiers */ this.scene.getModifierBar().updateModifiers(this.scene.modifiers, true); - this.scene.showShopOverlay(750); + /* Multiplies the appearance duration by the speed parameter so that it is always constant, and avoids "flashbangs" at game speed x5 */ + this.scene.showShopOverlay(750 * this.scene.gameSpeed); this.scene.updateAndShowText(750); this.scene.updateBiomeWaveText(); this.scene.updateMoneyText(); @@ -476,7 +477,8 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler { this.getUi().clearText(); this.eraseCursor(); - this.scene.hideShopOverlay(750); + /* Multiplies the fade time duration by the speed parameter so that it is always constant, and avoids "flashbangs" at game speed x5 */ + this.scene.hideShopOverlay(750 * this.scene.gameSpeed); this.scene.hideLuckText(250); /* Normally already called just after the shop, but not sure if it happens in 100% of cases */