[UI/UX] [Bug] Hiding tera button when toggling on stats mode (#5466)
This commit is contained in:
parent
73afb35c4d
commit
6f686a05e3
|
@ -3353,7 +3353,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
||||||
this.canCycleForm = species.forms.filter(f => f.isStarterSelectable || !pokemonFormChanges[species.speciesId]?.find(fc => fc.formKey))
|
this.canCycleForm = species.forms.filter(f => f.isStarterSelectable || !pokemonFormChanges[species.speciesId]?.find(fc => fc.formKey))
|
||||||
.map((_, f) => dexEntry.caughtAttr & globalScene.gameData.getFormAttr(f)).filter(f => f).length > 1;
|
.map((_, f) => dexEntry.caughtAttr & globalScene.gameData.getFormAttr(f)).filter(f => f).length > 1;
|
||||||
this.canCycleNature = globalScene.gameData.getNaturesForAttr(dexEntry.natureAttr).length > 1;
|
this.canCycleNature = globalScene.gameData.getNaturesForAttr(dexEntry.natureAttr).length > 1;
|
||||||
this.canCycleTera = globalScene.gameData.achvUnlocks.hasOwnProperty(achvs.TERASTALLIZE.id) && !Utils.isNullOrUndefined(getPokemonSpeciesForm(species.speciesId, formIndex ?? 0).type2);
|
this.canCycleTera = !this.statsMode && globalScene.gameData.achvUnlocks.hasOwnProperty(achvs.TERASTALLIZE.id) && !Utils.isNullOrUndefined(getPokemonSpeciesForm(species.speciesId, formIndex ?? 0).type2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dexEntry.caughtAttr && species.malePercent !== null) {
|
if (dexEntry.caughtAttr && species.malePercent !== null) {
|
||||||
|
@ -3858,12 +3858,20 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
||||||
this.showStats();
|
this.showStats();
|
||||||
this.statsMode = true;
|
this.statsMode = true;
|
||||||
this.pokemonSprite.setVisible(false);
|
this.pokemonSprite.setVisible(false);
|
||||||
|
this.teraIcon.setVisible(false);
|
||||||
|
this.canCycleTera = false;
|
||||||
|
this.updateInstructions();
|
||||||
} else {
|
} else {
|
||||||
this.statsMode = false;
|
this.statsMode = false;
|
||||||
this.statsContainer.setVisible(false);
|
this.statsContainer.setVisible(false);
|
||||||
this.pokemonSprite.setVisible(!!this.speciesStarterDexEntry?.caughtAttr);
|
this.pokemonSprite.setVisible(!!this.speciesStarterDexEntry?.caughtAttr);
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
this.statsContainer.updateIvs(null); // TODO: resolve ts-ignore. !?!?
|
this.statsContainer.updateIvs(null); // TODO: resolve ts-ignore. !?!?
|
||||||
|
this.teraIcon.setVisible(globalScene.gameData.achvUnlocks.hasOwnProperty(achvs.TERASTALLIZE.id));
|
||||||
|
const props = globalScene.gameData.getSpeciesDexAttrProps(this.lastSpecies, this.getCurrentDexProps(this.lastSpecies.speciesId));
|
||||||
|
const formIndex = props.formIndex;
|
||||||
|
this.canCycleTera = !this.statsMode && globalScene.gameData.achvUnlocks.hasOwnProperty(achvs.TERASTALLIZE.id) && !Utils.isNullOrUndefined(getPokemonSpeciesForm(this.lastSpecies.speciesId, formIndex ?? 0).type2);
|
||||||
|
this.updateInstructions();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue