mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-28 18:29:36 +02:00
cleanup and doc
This commit is contained in:
parent
4d6095b1f7
commit
53f2625168
@ -120,6 +120,9 @@ export default class EggListUiHandler extends MessageUiHandler {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create the grid of egg icons to display
|
||||||
|
*/
|
||||||
private initEggIcons() {
|
private initEggIcons() {
|
||||||
this.eggIcons = [];
|
this.eggIcons = [];
|
||||||
for (let i = 0; i < Math.min(this.ROWS * this.COLUMNS, this.scene.gameData.eggs.length); i++) {
|
for (let i = 0; i < Math.min(this.ROWS * this.COLUMNS, this.scene.gameData.eggs.length); i++) {
|
||||||
@ -133,6 +136,9 @@ export default class EggListUiHandler extends MessageUiHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the grid of egg icons
|
||||||
|
*/
|
||||||
private updateEggIcons() {
|
private updateEggIcons() {
|
||||||
const indexOffset = this.scrollGridHandler.getItemOffset();
|
const indexOffset = this.scrollGridHandler.getItemOffset();
|
||||||
const eggsToShow = Math.min(this.eggIcons.length, this.scene.gameData.eggs.length - indexOffset);
|
const eggsToShow = Math.min(this.eggIcons.length, this.scene.gameData.eggs.length - indexOffset);
|
||||||
@ -151,6 +157,10 @@ export default class EggListUiHandler extends MessageUiHandler {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the information panel with the information of the given egg
|
||||||
|
* @param index which egg in the list to display the info for
|
||||||
|
*/
|
||||||
private setEggDetails(index: number): void {
|
private setEggDetails(index: number): void {
|
||||||
const egg = this.scene.gameData.eggs[index];
|
const egg = this.scene.gameData.eggs[index];
|
||||||
this.eggSprite.setFrame(`egg_${egg.getKey()}`);
|
this.eggSprite.setFrame(`egg_${egg.getKey()}`);
|
||||||
|
@ -3,7 +3,7 @@ import { Mode } from "./ui";
|
|||||||
import PokemonIconAnimHandler, { PokemonIconAnimMode } from "./pokemon-icon-anim-handler";
|
import PokemonIconAnimHandler, { PokemonIconAnimMode } from "./pokemon-icon-anim-handler";
|
||||||
import MessageUiHandler from "./message-ui-handler";
|
import MessageUiHandler from "./message-ui-handler";
|
||||||
import { getEggTierForSpecies } from "../data/egg";
|
import { getEggTierForSpecies } from "../data/egg";
|
||||||
import {Button} from "#enums/buttons";
|
import { Button } from "#enums/buttons";
|
||||||
import PokemonHatchInfoContainer from "./pokemon-hatch-info-container";
|
import PokemonHatchInfoContainer from "./pokemon-hatch-info-container";
|
||||||
import { EggSummaryPhase } from "#app/phases/egg-summary-phase";
|
import { EggSummaryPhase } from "#app/phases/egg-summary-phase";
|
||||||
import { EggHatchData } from "#app/data/egg-hatch-data";
|
import { EggHatchData } from "#app/data/egg-hatch-data";
|
||||||
@ -29,6 +29,7 @@ export default class EggSummaryUiHandler extends MessageUiHandler {
|
|||||||
private summaryContainer: Phaser.GameObjects.Container;
|
private summaryContainer: Phaser.GameObjects.Container;
|
||||||
/** container for the each pokemon sprites and icons */
|
/** container for the each pokemon sprites and icons */
|
||||||
private pokemonIconsContainer: Phaser.GameObjects.Container;
|
private pokemonIconsContainer: Phaser.GameObjects.Container;
|
||||||
|
/** list of the containers added to pokemonIconsContainer for easier access */
|
||||||
private pokemonContainers: HatchedPokemonContainer[];
|
private pokemonContainers: HatchedPokemonContainer[];
|
||||||
|
|
||||||
/** hatch info container that displays the current pokemon / hatch (main element on left hand side) */
|
/** hatch info container that displays the current pokemon / hatch (main element on left hand side) */
|
||||||
@ -101,6 +102,8 @@ export default class EggSummaryUiHandler extends MessageUiHandler {
|
|||||||
this.cursor = -1;
|
this.cursor = -1;
|
||||||
this.scrollGridHandler.reset();
|
this.scrollGridHandler.reset();
|
||||||
this.summaryContainer.setVisible(false);
|
this.summaryContainer.setVisible(false);
|
||||||
|
this.pokemonIconsContainer.removeAll(true);
|
||||||
|
this.pokemonContainers = [];
|
||||||
this.eggHatchBg.setVisible(false);
|
this.eggHatchBg.setVisible(false);
|
||||||
this.getUi().hideTooltip();
|
this.getUi().hideTooltip();
|
||||||
|
|
||||||
@ -167,7 +170,10 @@ export default class EggSummaryUiHandler extends MessageUiHandler {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
updatePokemonIcons(): void {
|
/**
|
||||||
|
* Show the grid of Pokemon icons
|
||||||
|
*/
|
||||||
|
private updatePokemonIcons(): void {
|
||||||
const itemOffset = this.scrollGridHandler.getItemOffset();
|
const itemOffset = this.scrollGridHandler.getItemOffset();
|
||||||
const eggsToShow = Math.min(numRows * numCols, this.eggHatchData.length - itemOffset);
|
const eggsToShow = Math.min(numRows * numCols, this.eggHatchData.length - itemOffset);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user