mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-09-23 15:03:24 +02:00
[UI/UX][Bug] Setting shiny preferences before saving (#6348)
Setting shiny preferences before saving
This commit is contained in:
parent
342eb33138
commit
7af128f68a
@ -2391,6 +2391,10 @@ export class StarterSelectUiHandler extends MessageUiHandler {
|
|||||||
const newVariant = starterAttributes.variant
|
const newVariant = starterAttributes.variant
|
||||||
? (starterAttributes.variant as Variant)
|
? (starterAttributes.variant as Variant)
|
||||||
: newProps.variant;
|
: newProps.variant;
|
||||||
|
starterAttributes.shiny = true;
|
||||||
|
originalStarterAttributes.shiny = true;
|
||||||
|
starterAttributes.variant = newVariant;
|
||||||
|
originalStarterAttributes.variant = newVariant;
|
||||||
this.setSpeciesDetails(this.lastSpecies, {
|
this.setSpeciesDetails(this.lastSpecies, {
|
||||||
shiny: true,
|
shiny: true,
|
||||||
variant: newVariant,
|
variant: newVariant,
|
||||||
@ -2400,9 +2404,6 @@ export class StarterSelectUiHandler extends MessageUiHandler {
|
|||||||
// Cycle tint based on current sprite tint
|
// Cycle tint based on current sprite tint
|
||||||
const tint = getVariantTint(newVariant);
|
const tint = getVariantTint(newVariant);
|
||||||
this.pokemonShinyIcon.setFrame(getVariantIcon(newVariant)).setTint(tint).setVisible(true);
|
this.pokemonShinyIcon.setFrame(getVariantIcon(newVariant)).setTint(tint).setVisible(true);
|
||||||
|
|
||||||
starterAttributes.shiny = true;
|
|
||||||
originalStarterAttributes.shiny = true;
|
|
||||||
} else {
|
} else {
|
||||||
// If shiny, we update the variant
|
// If shiny, we update the variant
|
||||||
let newVariant = props.variant;
|
let newVariant = props.variant;
|
||||||
@ -2429,14 +2430,14 @@ export class StarterSelectUiHandler extends MessageUiHandler {
|
|||||||
originalStarterAttributes.variant = newVariant;
|
originalStarterAttributes.variant = newVariant;
|
||||||
if (this.speciesStarterDexEntry!.caughtAttr & DexAttr.NON_SHINY && newVariant <= props.variant) {
|
if (this.speciesStarterDexEntry!.caughtAttr & DexAttr.NON_SHINY && newVariant <= props.variant) {
|
||||||
// If we have run out of variants, go back to non shiny
|
// If we have run out of variants, go back to non shiny
|
||||||
|
starterAttributes.shiny = false;
|
||||||
|
originalStarterAttributes.shiny = false;
|
||||||
this.setSpeciesDetails(this.lastSpecies, {
|
this.setSpeciesDetails(this.lastSpecies, {
|
||||||
shiny: false,
|
shiny: false,
|
||||||
variant: 0,
|
variant: 0,
|
||||||
});
|
});
|
||||||
this.pokemonShinyIcon.setVisible(false);
|
this.pokemonShinyIcon.setVisible(false);
|
||||||
success = true;
|
success = true;
|
||||||
starterAttributes.shiny = false;
|
|
||||||
originalStarterAttributes.shiny = false;
|
|
||||||
} else {
|
} else {
|
||||||
// If going to a higher variant, or only shiny forms are caught, go to next variant
|
// If going to a higher variant, or only shiny forms are caught, go to next variant
|
||||||
this.setSpeciesDetails(this.lastSpecies, {
|
this.setSpeciesDetails(this.lastSpecies, {
|
||||||
|
Loading…
Reference in New Issue
Block a user