Fix use candy menu showing up for evolved starters
This commit is contained in:
parent
c369e9ed85
commit
000d31f663
|
@ -25,6 +25,7 @@ import { speciesEggMoves } from "../data/egg-moves";
|
||||||
import { TitlePhase } from "../phases";
|
import { TitlePhase } from "../phases";
|
||||||
import { argbFromRgba } from "@material/material-color-utilities";
|
import { argbFromRgba } from "@material/material-color-utilities";
|
||||||
import { OptionSelectItem } from "./abstact-option-select-ui-handler";
|
import { OptionSelectItem } from "./abstact-option-select-ui-handler";
|
||||||
|
import { pokemonPrevolutions } from "#app/data/pokemon-evolutions";
|
||||||
|
|
||||||
export type StarterSelectCallback = (starters: Starter[]) => void;
|
export type StarterSelectCallback = (starters: Starter[]) => void;
|
||||||
|
|
||||||
|
@ -874,13 +875,15 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
||||||
yOffset: 47
|
yOffset: 47
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
options.push({
|
if (!pokemonPrevolutions.hasOwnProperty(this.lastSpecies.speciesId)) {
|
||||||
label: 'Use Candies',
|
options.push({
|
||||||
handler: () => {
|
label: 'Use Candies',
|
||||||
ui.setMode(Mode.STARTER_SELECT).then(() => showUseCandies());
|
handler: () => {
|
||||||
return true;
|
ui.setMode(Mode.STARTER_SELECT).then(() => showUseCandies());
|
||||||
}
|
return true;
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
options.push({
|
options.push({
|
||||||
label: 'Cancel',
|
label: 'Cancel',
|
||||||
handler: () => {
|
handler: () => {
|
||||||
|
|
Loading…
Reference in New Issue