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",
|
"name": "pokemon-rogue-battle",
|
||||||
"version": "1.7.4",
|
"version": "1.7.5",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "pokemon-rogue-battle",
|
"name": "pokemon-rogue-battle",
|
||||||
"version": "1.7.4",
|
"version": "1.7.5",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@material/material-color-utilities": "^0.2.7",
|
"@material/material-color-utilities": "^0.2.7",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "pokemon-rogue-battle",
|
"name": "pokemon-rogue-battle",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.7.4",
|
"version": "1.7.5",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "vite",
|
"start": "vite",
|
||||||
|
@ -250,6 +250,8 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
private availableVariants: number;
|
private availableVariants: number;
|
||||||
private unlockedVariants: boolean[];
|
private unlockedVariants: boolean[];
|
||||||
|
|
||||||
|
private canUseCandies: boolean;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super(Mode.POKEDEX_PAGE);
|
super(Mode.POKEDEX_PAGE);
|
||||||
}
|
}
|
||||||
@ -556,6 +558,9 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
show(args: any[]): boolean {
|
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") {
|
if (args.length >= 1 && args[0] === "refresh") {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
@ -1626,7 +1631,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Button.STATS:
|
case Button.STATS:
|
||||||
if (!isCaught || !isFormCaught) {
|
if (!isCaught || !isFormCaught || !this.canUseCandies) {
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
const ui = this.getUi();
|
const ui = this.getUi();
|
||||||
@ -1888,7 +1893,9 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
if (this.isCaught()) {
|
if (this.isCaught()) {
|
||||||
if (isFormCaught) {
|
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) {
|
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);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user