code cleanup

This commit is contained in:
James Diefenbach 2024-09-02 09:25:26 +10:00
parent f5a46d9f26
commit 24687c352c
4 changed files with 14 additions and 23 deletions

View File

@ -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({

View File

@ -91,7 +91,6 @@ export class EggLapsePhase extends Phase {
}
this.loadsWaiting--;
if (this.loadsWaiting === 0) {
console.timeEnd("hatch eggs");
}

View File

@ -1627,14 +1627,13 @@ export class GameData {
};
if (newCatch && speciesStarters.hasOwnProperty(species.speciesId)) {
if (showMessage) {
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);
console.log("show text passed");
} else {
resolve();
}
} else {
checkPrevolution();
}
@ -1698,16 +1697,15 @@ export class GameData {
}
this.starterData[speciesId].eggMoves |= value;
if (showMessage) {
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);
} else {
resolve(true);
}
});
}

View File

@ -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);