[Bug] Fix ssui passives (#6362)

Fix passives not being persisted in starter select
This commit is contained in:
Sirz Benjie 2025-08-23 11:41:30 -05:00 committed by GitHub
parent 908886d78b
commit 053976daec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2095,27 +2095,21 @@ export class StarterSelectUiHandler extends MessageUiHandler {
const passiveAttr = starterData.passiveAttr; const passiveAttr = starterData.passiveAttr;
if (passiveAttr & PassiveAttr.UNLOCKED) { if (passiveAttr & PassiveAttr.UNLOCKED) {
// this is for enabling and disabling the passive // this is for enabling and disabling the passive
if (!(passiveAttr & PassiveAttr.ENABLED)) { const label = i18next.t(
options.push({ passiveAttr & PassiveAttr.ENABLED
label: i18next.t("starterSelectUiHandler:enablePassive"), ? "starterSelectUiHandler:disablePassive"
handler: () => { : "starterSelectUiHandler:enablePassive",
starterData.passiveAttr |= PassiveAttr.ENABLED; );
ui.setMode(UiMode.STARTER_SELECT); options.push({
this.setSpeciesDetails(this.lastSpecies); label,
return true; handler: () => {
}, starterData.passiveAttr ^= PassiveAttr.ENABLED;
}); persistentStarterData.passiveAttr ^= PassiveAttr.ENABLED;
} else { ui.setMode(UiMode.STARTER_SELECT);
options.push({ this.setSpeciesDetails(this.lastSpecies);
label: i18next.t("starterSelectUiHandler:disablePassive"), return true;
handler: () => { },
starterData.passiveAttr ^= PassiveAttr.ENABLED; });
ui.setMode(UiMode.STARTER_SELECT);
this.setSpeciesDetails(this.lastSpecies);
return true;
},
});
}
} }
// if container.favorite is false, show the favorite option // if container.favorite is false, show the favorite option
const isFavorite = starterAttributes?.favorite ?? false; const isFavorite = starterAttributes?.favorite ?? false;