Removed candy upgrade instructions from evolved pokemon; attempting to buy candies from evolution now gives error sound instead of crashing the game

This commit is contained in:
Wlowscha 2025-01-07 22:30:03 +01:00
parent f86ab7bd46
commit c340b8be28
No known key found for this signature in database
GPG Key ID: 3C8F1AD330565D04

View File

@ -1644,12 +1644,10 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
options: options, options: options,
yOffset: 47 yOffset: 47
}); });
success = true;
} else {
error = true;
} }
ui.setModeWithoutClear(Mode.OPTION_SELECT, {
options: options,
yOffset: 47
});
success = true;
} }
break; break;
case Button.UP: case Button.UP:
@ -1709,41 +1707,18 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
iconPath = this.scene.inputController?.getIconForLatestInputRecorded(iconSetting); iconPath = this.scene.inputController?.getIconForLatestInputRecorded(iconSetting);
} }
iconElement.setTexture(gamepadType, iconPath); iconElement.setTexture(gamepadType, iconPath);
iconElement.setPosition(this.instructionRowX, this.instructionRowY + 8); iconElement.setPosition(this.instructionRowX, this.instructionRowY);
controlLabel.setPosition(this.instructionRowX + this.instructionRowTextOffset, this.instructionRowY + 8); controlLabel.setPosition(this.instructionRowX + this.instructionRowTextOffset, this.instructionRowY);
iconElement.setVisible(true); iconElement.setVisible(true);
controlLabel.setVisible(true); controlLabel.setVisible(true);
this.instructionsContainer.add([ iconElement, controlLabel ]); this.instructionsContainer.add([ iconElement, controlLabel ]);
this.instructionRowY += 8; this.instructionRowY += 8;
if (this.instructionRowY >= 16) { if (this.instructionRowY >= 24) {
this.instructionRowY = 0; this.instructionRowY = 8;
this.instructionRowX += 50; this.instructionRowX += 50;
} }
} }
updateFilterButtonIcon(iconSetting, gamepadType, iconElement, controlLabel): void {
let iconPath;
// touch controls cannot be rebound as is, and are just emulating a keyboard event.
// Additionally, since keyboard controls can be rebound (and will be displayed when they are), we need to have special handling for the touch controls
if (gamepadType === "touch") {
gamepadType = "keyboard";
iconPath = "C.png";
} else {
iconPath = this.scene.inputController?.getIconForLatestInputRecorded(iconSetting);
}
iconElement.setTexture(gamepadType, iconPath);
iconElement.setPosition(this.filterInstructionRowX, this.filterInstructionRowY);
controlLabel.setPosition(this.filterInstructionRowX + this.instructionRowTextOffset, this.filterInstructionRowY);
iconElement.setVisible(true);
controlLabel.setVisible(true);
this.filterInstructionsContainer.add([ iconElement, controlLabel ]);
this.filterInstructionRowY += 8;
if (this.filterInstructionRowY >= 24) {
this.filterInstructionRowY = 0;
this.filterInstructionRowX += 50;
}
}
updateInstructions(): void { updateInstructions(): void {
this.instructionRowX = 0; this.instructionRowX = 0;
this.instructionRowY = 0; this.instructionRowY = 0;
@ -1763,12 +1738,10 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
return; return;
} }
this.candyUpgradeIconElement.setVisible(true);
this.candyUpgradeLabel.setVisible(true);
this.instructionsContainer.add(this.candyUpgradeIconElement);
this.instructionsContainer.add(this.candyUpgradeLabel);
if (this.speciesStarterDexEntry?.caughtAttr) { if (this.speciesStarterDexEntry?.caughtAttr) {
if (!pokemonPrevolutions.hasOwnProperty(this.lastSpecies.speciesId)) {
this.updateButtonIcon(SettingKeyboard.Button_Stats, gamepadType, this.candyUpgradeIconElement, this.candyUpgradeLabel);
}
if (this.canCycleShiny) { if (this.canCycleShiny) {
this.updateButtonIcon(SettingKeyboard.Button_Cycle_Shiny, gamepadType, this.shinyIconElement, this.shinyLabel); this.updateButtonIcon(SettingKeyboard.Button_Cycle_Shiny, gamepadType, this.shinyIconElement, this.shinyLabel);
} }