Adding canUseCandies option to dex, setting temporarily to false.

This commit is contained in:
Wlowscha 2025-02-28 18:08:52 +01:00
parent 9701f27c63
commit c59e06956d
No known key found for this signature in database
GPG Key ID: 3C8F1AD330565D04

View File

@ -250,6 +250,8 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
private availableVariants: number;
private unlockedVariants: boolean[];
private canUseCandies: boolean;
constructor() {
super(Mode.POKEDEX_PAGE);
}
@ -556,6 +558,8 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
show(args: any[]): boolean {
this.canUseCandies = false;
if (args.length >= 1 && args[0] === "refresh") {
return false;
} else {
@ -1626,7 +1630,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
}
break;
case Button.STATS:
if (!isCaught || !isFormCaught) {
if (!isCaught || !isFormCaught || !this.canUseCandies) {
error = true;
} else {
const ui = this.getUi();
@ -1888,7 +1892,9 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
if (this.isCaught()) {
if (isFormCaught) {
if (this.canUseCandies) {
this.updateButtonIcon(SettingKeyboard.Button_Stats, gamepadType, this.candyUpgradeIconElement, this.candyUpgradeLabel);
}
if (this.canCycleShiny) {
this.updateButtonIcon(SettingKeyboard.Button_Cycle_Shiny, gamepadType, this.shinyIconElement, this.shinyLabel);
}