Disable menu temporarily on receiving a voucher

This commit is contained in:
Flashfyre 2024-04-17 15:56:29 -04:00
parent 7155174d3c
commit d210e3878e
3 changed files with 10 additions and 2 deletions

View File

@ -132,6 +132,8 @@ export default class BattleScene extends SceneBase {
public enableTouchControls: boolean = false;
public enableVibration: boolean = false;
public disableMenu: boolean = false;
public gameData: GameData;
public sessionSlotId: integer;
@ -733,6 +735,8 @@ export default class BattleScene extends SceneBase {
this.setSeed(SEED_OVERRIDE || Utils.randomString(24));
console.log('Seed:', this.seed);
this.disableMenu = false;
this.score = 0;
this.money = 0;
@ -1234,6 +1238,8 @@ export default class BattleScene extends SceneBase {
inputSuccess = this.ui.processInput(Button.CANCEL);
this.setLastProcessedMovementTime(Button.CANCEL);
} else if (this.buttonJustPressed(Button.MENU)) {
if (this.disableMenu)
return;
switch (this.ui?.getMode()) {
case Mode.MESSAGE:
if (!(this.ui.getHandler() as MessageUiHandler).pendingPrompt)

View File

@ -670,8 +670,8 @@ export default class PokemonSpecies extends PokemonSpeciesForm {
const legendary = this.legendary;
const mythical = this.mythical;
return species => {
return pokemonEvolutions.hasOwnProperty(species.speciesId) === hasEvolution
&& pokemonPrevolutions.hasOwnProperty(species.speciesId) === hasPrevolution
return (pseudoLegendary || legendary || mythical || (!pokemonEvolutions.hasOwnProperty(species.speciesId) === hasEvolution
&& pokemonPrevolutions.hasOwnProperty(species.speciesId) === hasPrevolution))
&& species.pseudoLegendary === pseudoLegendary
&& species.legendary === legendary
&& species.mythical === mythical

View File

@ -742,6 +742,7 @@ export class EncounterPhase extends BattlePhase {
this.scene.ui.setMode(Mode.MESSAGE).then(() => {
if (!this.loaded) {
this.scene.gameData.saveSystem().then(success => {
this.scene.disableMenu = false;
if (!success)
return this.scene.reset(true);
this.scene.gameData.saveSession(this.scene, true).then(() => this.doEncounter());
@ -3304,6 +3305,7 @@ export class ModifierRewardPhase extends BattlePhase {
doReward(): Promise<void> {
return new Promise<void>(resolve => {
this.scene.disableMenu = true;
const newModifier = this.modifierType.newModifier();
this.scene.addModifier(newModifier).then(() => {
this.scene.playSound('item_fanfare');