mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-03-03 16:38:23 +00:00
[Bug][Hotfix] Restrict Use Candies option in the Pokédex during Shop (#5446)
This commit is contained in:
parent
13429446d3
commit
942bcacb56
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "pokemon-rogue-battle",
|
||||
"version": "1.7.4",
|
||||
"version": "1.7.5",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "pokemon-rogue-battle",
|
||||
"version": "1.7.4",
|
||||
"version": "1.7.5",
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"@material/material-color-utilities": "^0.2.7",
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "pokemon-rogue-battle",
|
||||
"private": true,
|
||||
"version": "1.7.4",
|
||||
"version": "1.7.5",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"start": "vite",
|
||||
|
@ -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,9 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
||||
|
||||
show(args: any[]): boolean {
|
||||
|
||||
// Allow the use of candies if we are in one of the whitelisted phases
|
||||
this.canUseCandies = [ "TitlePhase", "SelectStarterPhase", "CommandPhase" ].includes(globalScene.getCurrentPhase()?.constructor.name ?? "");
|
||||
|
||||
if (args.length >= 1 && args[0] === "refresh") {
|
||||
return false;
|
||||
} else {
|
||||
@ -1626,7 +1631,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 +1893,9 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
||||
|
||||
if (this.isCaught()) {
|
||||
if (isFormCaught) {
|
||||
this.updateButtonIcon(SettingKeyboard.Button_Stats, gamepadType, this.candyUpgradeIconElement, this.candyUpgradeLabel);
|
||||
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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user