Fixed bug which prevented tera from displaying the saved preference; tera resets in fresh start

This commit is contained in:
Wlowscha 2025-08-16 22:50:32 +02:00
parent f749ab8f63
commit 1e786a72b8
No known key found for this signature in database
GPG Key ID: 3C8F1AD330565D04

View File

@ -1142,6 +1142,7 @@ export class StarterSelectUiHandler extends MessageUiHandler {
this.starterPreferences = loadStarterPreferences(); this.starterPreferences = loadStarterPreferences();
this.originalStarterPreferences = loadStarterPreferences(); this.originalStarterPreferences = loadStarterPreferences();
console.log("Loaded", this.originalStarterPreferences);
this.allSpecies.forEach((species, s) => { this.allSpecies.forEach((species, s) => {
const icon = this.starterContainers[s].icon; const icon = this.starterContainers[s].icon;
@ -1163,6 +1164,7 @@ export class StarterSelectUiHandler extends MessageUiHandler {
this.setUpgradeAnimation(icon, species); this.setUpgradeAnimation(icon, species);
}); });
console.log("Initiated", this.originalStarterPreferences);
this.resetFilters(); this.resetFilters();
this.updateStarters(); this.updateStarters();
@ -2495,14 +2497,14 @@ export class StarterSelectUiHandler extends MessageUiHandler {
if (this.canCycleTera) { if (this.canCycleTera) {
const speciesForm = getPokemonSpeciesForm(this.lastSpecies.speciesId, starterAttributes.form ?? 0); const speciesForm = getPokemonSpeciesForm(this.lastSpecies.speciesId, starterAttributes.form ?? 0);
if (speciesForm.type1 === this.teraCursor && !isNullOrUndefined(speciesForm.type2)) { if (speciesForm.type1 === this.teraCursor && !isNullOrUndefined(speciesForm.type2)) {
starterAttributes.tera = speciesForm.type2!; starterAttributes.tera = speciesForm.type2;
originalStarterAttributes.form = starterAttributes.tera; originalStarterAttributes.tera = starterAttributes.tera;
this.setSpeciesDetails(this.lastSpecies, { this.setSpeciesDetails(this.lastSpecies, {
teraType: speciesForm.type2!, teraType: speciesForm.type2,
}); });
} else { } else {
starterAttributes.tera = speciesForm.type1; starterAttributes.tera = speciesForm.type1;
originalStarterAttributes.form = starterAttributes.tera; originalStarterAttributes.tera = starterAttributes.tera;
this.setSpeciesDetails(this.lastSpecies, { this.setSpeciesDetails(this.lastSpecies, {
teraType: speciesForm.type1, teraType: speciesForm.type1,
}); });
@ -3624,6 +3626,7 @@ export class StarterSelectUiHandler extends MessageUiHandler {
variant: props.variant, variant: props.variant,
abilityIndex: defaultAbilityIndex, abilityIndex: defaultAbilityIndex,
natureIndex: defaultNature, natureIndex: defaultNature,
teraType: starterAttributes?.tera,
}); });
} }