diff --git a/src/phases/egg-hatch-phase.ts b/src/phases/egg-hatch-phase.ts index 591f5332557..b11d56fcbb7 100644 --- a/src/phases/egg-hatch-phase.ts +++ b/src/phases/egg-hatch-phase.ts @@ -359,7 +359,6 @@ export class EggHatchPhase extends Phase { }); }); }, null, true, 3000); - //this.scene.time.delayedCall(Utils.fixedInt(4250), () => this.scene.playBgm()); }); }); this.scene.tweens.add({ diff --git a/src/phases/egg-lapse-phase.ts b/src/phases/egg-lapse-phase.ts index f2240a9362c..b1fb3ccb82b 100644 --- a/src/phases/egg-lapse-phase.ts +++ b/src/phases/egg-lapse-phase.ts @@ -91,7 +91,6 @@ export class EggLapsePhase extends Phase { } this.loadsWaiting--; - if (this.loadsWaiting === 0) { console.timeEnd("hatch eggs"); } diff --git a/src/system/game-data.ts b/src/system/game-data.ts index d1a9492f7ce..1859b2757e0 100644 --- a/src/system/game-data.ts +++ b/src/system/game-data.ts @@ -1627,14 +1627,13 @@ export class GameData { }; if (newCatch && speciesStarters.hasOwnProperty(species.speciesId)) { - if (showMessage) { - this.scene.playSound("level_up_fanfare"); - console.log(`${species.name} has been\nadded as a starter!`); - this.scene.ui.showText(i18next.t("battle:addedAsAStarter", { pokemonName: species.name }), null, () => checkPrevolution(), null, true); - console.log("show text passed"); - } else { + if (!showMessage) { resolve(); + return; } + this.scene.playSound("level_up_fanfare"); + console.log(`${species.name} has been\nadded as a starter!`); + this.scene.ui.showText(i18next.t("battle:addedAsAStarter", { pokemonName: species.name }), null, () => checkPrevolution(), null, true); } else { checkPrevolution(); } @@ -1698,16 +1697,15 @@ export class GameData { } this.starterData[speciesId].eggMoves |= value; - - if (showMessage) { - this.scene.playSound("level_up_fanfare"); - const moveName = allMoves[speciesEggMoves[speciesId][eggMoveIndex]].name; - this.scene.ui.showText(eggMoveIndex === 3 ? i18next.t("egg:rareEggMoveUnlock", { moveName: moveName }) : i18next.t("egg:eggMoveUnlock", { moveName: moveName }), null, (() => { - resolve(true); - }), null, true); - } else { + if (!showMessage) { resolve(true); + return; } + this.scene.playSound("level_up_fanfare"); + const moveName = allMoves[speciesEggMoves[speciesId][eggMoveIndex]].name; + this.scene.ui.showText(eggMoveIndex === 3 ? i18next.t("egg:rareEggMoveUnlock", { moveName: moveName }) : i18next.t("egg:eggMoveUnlock", { moveName: moveName }), null, (() => { + resolve(true); + }), null, true); }); } diff --git a/src/ui/egg-summary-ui-handler.ts b/src/ui/egg-summary-ui-handler.ts index 8c9a180f0a1..c27164a3e81 100644 --- a/src/ui/egg-summary-ui-handler.ts +++ b/src/ui/egg-summary-ui-handler.ts @@ -21,14 +21,11 @@ export default class EggSummaryUiHandler extends MessageUiHandler { private pokemonListContainer: Phaser.GameObjects.Container; private pokemonIconSpritesContainer: Phaser.GameObjects.Container; private pokemonIconsContainer: Phaser.GameObjects.Container; - private eggListMessageBoxContainer: Phaser.GameObjects.Container; private eggHatchContainer: Phaser.GameObjects.Container; private eggHatchBg: Phaser.GameObjects.Image; - private infoContainer: PokemonHatchInfoContainer; - private cursorObj: Phaser.GameObjects.Image; private iconAnimHandler: PokemonIconAnimHandler; @@ -91,9 +88,9 @@ export default class EggSummaryUiHandler extends MessageUiHandler { this.pokemonIconSpritesContainer.removeAll(true); this.pokemonIconsContainer.removeAll(true); this.eggHatchBg.setVisible(false); - // this.currentPokemonSprite.setVisible(false); - // this.pokemonEggMovesContainer.setVisible(false); this.getUi().hideTooltip(); + + const activeKeys = this.scene.getActiveKeys(); // Removing unnecessary sprites from animation manager const animKeys = Object.keys(this.scene.anims["anims"]["entries"]); @@ -125,7 +122,6 @@ export default class EggSummaryUiHandler extends MessageUiHandler { if (args.length >= 1) { - // this.pokemonHatched = args[0]; this.eggHatchData = args[0].sort(function sortHatchData(a: EggHatchData, b: EggHatchData) { const speciesA = a.pokemon.species; const speciesB = b.pokemon.species; @@ -146,7 +142,6 @@ export default class EggSummaryUiHandler extends MessageUiHandler { ); } - // this.pokemonHatched = []; this.getUi().bringToTop(this.pokemonListContainer);