From 2e2f61ff5d51039ff3f05cff9a02728b69b4a6ae Mon Sep 17 00:00:00 2001 From: Wlowscha <54003515+Wlowscha@users.noreply.github.com> Date: Sat, 29 Mar 2025 00:03:59 +0100 Subject: [PATCH] Fixed isSeen in page handler --- src/ui/pokedex-page-ui-handler.ts | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/ui/pokedex-page-ui-handler.ts b/src/ui/pokedex-page-ui-handler.ts index b359c188e0c..ee4e8b62ffc 100644 --- a/src/ui/pokedex-page-ui-handler.ts +++ b/src/ui/pokedex-page-ui-handler.ts @@ -257,6 +257,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { private menuDescriptions: string[]; private isFormGender: boolean; private filteredIndices: Species[] | null = null; + private filteredFormIndices: number[] | null = null; private availableVariants: number; private unlockedVariants: boolean[]; @@ -680,6 +681,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { }; this.formIndex = this.savedStarterAttributes.form ?? 0; this.filteredIndices = args[2] ?? null; + this.filteredFormIndices = args[3] ?? null; this.starterSetup(); if (args[4] instanceof Function) { @@ -696,6 +698,10 @@ export default class PokedexPageUiHandler extends MessageUiHandler { this.starterAttributes = this.initStarterPrefs(); + console.log(this.filteredIndices); + console.log(this.savedStarterAttributes); + console.log(this.starterAttributes); + this.menuOptions = Utils.getEnumKeys(MenuOptions).map(m => Number.parseInt(MenuOptions[m]) as MenuOptions); this.menuContainer.setVisible(true); @@ -1150,15 +1156,14 @@ export default class PokedexPageUiHandler extends MessageUiHandler { }); this.blockInput = false; } else { - ui.revertMode() - .then(() => { - console.log("exitCallback", this.exitCallback); - if (this.exitCallback instanceof Function) { - const exitCallback = this.exitCallback; - this.exitCallback = null; - exitCallback(); - } - }); + ui.revertMode().then(() => { + console.log("exitCallback", this.exitCallback); + if (this.exitCallback instanceof Function) { + const exitCallback = this.exitCallback; + this.exitCallback = null; + exitCallback(); + } + }); success = true; } } else { @@ -2222,8 +2227,9 @@ export default class PokedexPageUiHandler extends MessageUiHandler { const ui = this.getUi(); const isFormCaught = this.isFormCaught(); + const isSeen = this.isSeen(); - if ((this.isCaught() && isFormCaught) || (this.speciesStarterDexEntry?.seenAttr && cursor === 5)) { + if ((this.isCaught() && isFormCaught) || isSeen) { ui.showText(this.menuDescriptions[cursor]); } else { ui.showText(""); @@ -2302,7 +2308,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler { } } - if (species && (this.speciesStarterDexEntry?.seenAttr || this.isCaught())) { + if (species && (this.isSeen() || this.isCaught())) { this.pokemonNumberText.setText(padInt(species.speciesId, 4)); if (this.isCaught()) {