Removed redundant form index argument in show() of pokedex page

This commit is contained in:
Wlowscha 2025-03-16 13:59:00 +01:00
parent b298138157
commit 5d2e477744
No known key found for this signature in database
GPG Key ID: 3C8F1AD330565D04
4 changed files with 12 additions and 14 deletions

View File

@ -574,9 +574,7 @@ export default class PartyUiHandler extends MessageUiHandler {
form: pokemon.formIndex, form: pokemon.formIndex,
female: pokemon.gender === Gender.FEMALE, female: pokemon.gender === Gender.FEMALE,
}; };
ui.setOverlayMode(Mode.POKEDEX_PAGE, pokemon.species, pokemon.formIndex, attributes).then(() => ui.setOverlayMode(Mode.POKEDEX_PAGE, pokemon.species, attributes).then(() => this.clearOptions());
this.clearOptions(),
);
return true; return true;
} else if (option === PartyOption.UNPAUSE_EVOLUTION) { } else if (option === PartyOption.UNPAUSE_EVOLUTION) {
this.clearOptions(); this.clearOptions();

View File

@ -242,6 +242,9 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
private starterAttributes: StarterAttributes; private starterAttributes: StarterAttributes;
private savedStarterAttributes: StarterAttributes; private savedStarterAttributes: StarterAttributes;
private previousSpecies: PokemonSpecies[];
private previousStarterAttributes: StarterAttributes[];
protected blockInput = false; protected blockInput = false;
protected blockInputOverlay = false; protected blockInputOverlay = false;
@ -668,14 +671,14 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
return false; return false;
} }
this.species = args[0]; this.species = args[0];
this.formIndex = args[1] ?? 0; this.savedStarterAttributes = args[1] ?? {
this.savedStarterAttributes = args[2] ?? {
shiny: false, shiny: false,
female: true, female: true,
variant: 0, variant: 0,
form: 0, form: 0,
}; };
this.filteredIndices = args[3] ?? null; this.formIndex = this.savedStarterAttributes.form ?? 0;
this.filteredIndices = args[2] ?? null;
this.starterSetup(); this.starterSetup();
this.moveInfoOverlay.clear(); // clear this when removing a menu; the cancel button doesn't seem to trigger this automatically on controllers this.moveInfoOverlay.clear(); // clear this when removing a menu; the cancel button doesn't seem to trigger this automatically on controllers
@ -1522,7 +1525,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
this.savedStarterAttributes.form = newFormIndex; this.savedStarterAttributes.form = newFormIndex;
this.moveInfoOverlay.clear(); this.moveInfoOverlay.clear();
this.clearText(); this.clearText();
ui.setMode(Mode.POKEDEX_PAGE, newSpecies, newFormIndex, this.savedStarterAttributes); ui.setMode(Mode.POKEDEX_PAGE, newSpecies, this.savedStarterAttributes);
return true; return true;
}, },
onHover: () => this.showText(conditionText), onHover: () => this.showText(conditionText),
@ -1562,7 +1565,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
this.savedStarterAttributes.form = newFormIndex; this.savedStarterAttributes.form = newFormIndex;
this.moveInfoOverlay.clear(); this.moveInfoOverlay.clear();
this.clearText(); this.clearText();
ui.setMode(Mode.POKEDEX_PAGE, evoSpecies, newFormIndex, this.savedStarterAttributes); ui.setMode(Mode.POKEDEX_PAGE, evoSpecies, this.savedStarterAttributes);
return true; return true;
}, },
onHover: () => this.showText(conditionText), onHover: () => this.showText(conditionText),
@ -1607,7 +1610,6 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
ui.setMode( ui.setMode(
Mode.POKEDEX_PAGE, Mode.POKEDEX_PAGE,
newSpecies, newSpecies,
newFormIndex,
this.savedStarterAttributes, this.savedStarterAttributes,
this.filteredIndices, this.filteredIndices,
); );
@ -1979,7 +1981,6 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
ui.setModeForceTransition( ui.setModeForceTransition(
Mode.POKEDEX_PAGE, Mode.POKEDEX_PAGE,
newSpecies, newSpecies,
newFormIndex,
this.savedStarterAttributes, this.savedStarterAttributes,
this.filteredIndices, this.filteredIndices,
); );
@ -2009,7 +2010,6 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
ui.setModeForceTransition( ui.setModeForceTransition(
Mode.POKEDEX_PAGE, Mode.POKEDEX_PAGE,
newSpecies, newSpecies,
newFormIndex,
this.savedStarterAttributes, this.savedStarterAttributes,
this.filteredIndices, this.filteredIndices,
); );

View File

@ -1125,7 +1125,7 @@ export default class PokedexUiHandler extends MessageUiHandler {
} else if (this.showingTray) { } else if (this.showingTray) {
if (button === Button.ACTION) { if (button === Button.ACTION) {
const formIndex = this.trayForms[this.trayCursor].formIndex; const formIndex = this.trayForms[this.trayCursor].formIndex;
ui.setOverlayMode(Mode.POKEDEX_PAGE, this.lastSpecies, formIndex, { form: formIndex }, this.filteredIndices); ui.setOverlayMode(Mode.POKEDEX_PAGE, this.lastSpecies, { form: formIndex }, this.filteredIndices);
success = true; success = true;
} else { } else {
const numberOfForms = this.trayContainers.length; const numberOfForms = this.trayContainers.length;
@ -1174,7 +1174,7 @@ export default class PokedexUiHandler extends MessageUiHandler {
} }
} else { } else {
if (button === Button.ACTION) { if (button === Button.ACTION) {
ui.setOverlayMode(Mode.POKEDEX_PAGE, this.lastSpecies, 0, null, this.filteredIndices); ui.setOverlayMode(Mode.POKEDEX_PAGE, this.lastSpecies, null, this.filteredIndices);
success = true; success = true;
} else { } else {
switch (button) { switch (button) {

View File

@ -2336,7 +2336,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
form: starterAttributes.form, form: starterAttributes.form,
female: starterAttributes.female, female: starterAttributes.female,
}; };
ui.setOverlayMode(Mode.POKEDEX_PAGE, this.lastSpecies, starterAttributes.form, attributes); ui.setOverlayMode(Mode.POKEDEX_PAGE, this.lastSpecies, attributes);
}); });
return true; return true;
}, },