From 977af14570d645bb61670aa007ddc3311c1f2c78 Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Wed, 19 Feb 2025 20:49:52 +0100 Subject: [PATCH] Pressing B on filter now closes it or resets instead of going to top of starters --- src/ui/pokedex-ui-handler.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/ui/pokedex-ui-handler.ts b/src/ui/pokedex-ui-handler.ts index 5180d7bd956..d7d91470b8f 100644 --- a/src/ui/pokedex-ui-handler.ts +++ b/src/ui/pokedex-ui-handler.ts @@ -889,16 +889,11 @@ export default class PokedexUiHandler extends MessageUiHandler { if (this.filterMode && this.filterBar.openDropDown) { // CANCEL with a filter menu open > close it this.filterBar.toggleDropDown(this.filterBarCursor); - - // if there are possible pokemon go the first one of the list - if (numberOfStarters > 0) { - this.setFilterMode(false); - this.scrollCursor = 0; - this.updateScroll(); - this.setCursor(0); - } success = true; - + } else if (this.filterMode && !this.filterBar.getFilter(this.filterBarCursor).hasDefaultValues()) { + this.filterBar.resetSelection(this.filterBarCursor); + this.updateStarters; + success = true; } else if (this.filterTextMode && !(this.filterText.getValue(this.filterTextCursor) === this.filterText.defaultText)) { this.filterText.resetSelection(this.filterTextCursor); success = true;