From d3d376dca38cc9d7a2e424609b581468964daf56 Mon Sep 17 00:00:00 2001 From: Leo Kim <47556641+KimJeongSun@users.noreply.github.com> Date: Mon, 12 Aug 2024 15:19:20 +0900 Subject: [PATCH] [Enhancement] update initial filter setting when not in challenge mode (#3506) * update initial filter setting when not in challenge mode * Modify the code with more consideration for future scalability. * update initial setting in challenge mode also. no conditional setting! --- src/ui/starter-select-ui-handler.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index f7ef4b47353..8cea765fb57 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -973,13 +973,16 @@ export default class StarterSelectUiHandler extends MessageUiHandler { * Set the selections for all filters to their default starting value */ resetFilters() : void { - const genDropDown: DropDown = this.filterBar.getFilter(DropDownColumn.GEN); + const caughtDropDown: DropDown = this.filterBar.getFilter(DropDownColumn.CAUGHT); this.filterBar.setValsToDefault(); - if (!this.scene.gameMode.isChallenge) { - // if not in a challenge, in Gen hybrid filter hovering mode, set the cursor to the Gen1 - genDropDown.setCursor(1); + // initial setting, in caught filter, select the options excluding the uncaught option + for (let i = 0; i < caughtDropDown.options.length; i++) { + // if the option is not "ALL" or "UNCAUGHT", toggle it + if (caughtDropDown.options[i].val !== "ALL" && caughtDropDown.options[i].val !== "UNCAUGHT") { + caughtDropDown.toggleOptionState(i); + } } }