Fixed isSeen in page handler

This commit is contained in:
Wlowscha 2025-03-29 00:03:59 +01:00
parent c3b97b244d
commit 2e2f61ff5d
No known key found for this signature in database
GPG Key ID: 3C8F1AD330565D04

View File

@ -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()) {