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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the grid of egg icons to display
|
||||
*/
|
||||
private initEggIcons() {
|
||||
this.eggIcons = [];
|
||||
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() {
|
||||
const indexOffset = this.scrollGridHandler.getItemOffset();
|
||||
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 {
|
||||
const egg = this.scene.gameData.eggs[index];
|
||||
this.eggSprite.setFrame(`egg_${egg.getKey()}`);
|
||||
|
@ -29,6 +29,7 @@ export default class EggSummaryUiHandler extends MessageUiHandler {
|
||||
private summaryContainer: Phaser.GameObjects.Container;
|
||||
/** container for the each pokemon sprites and icons */
|
||||
private pokemonIconsContainer: Phaser.GameObjects.Container;
|
||||
/** list of the containers added to pokemonIconsContainer for easier access */
|
||||
private pokemonContainers: HatchedPokemonContainer[];
|
||||
|
||||
/** 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.scrollGridHandler.reset();
|
||||
this.summaryContainer.setVisible(false);
|
||||
this.pokemonIconsContainer.removeAll(true);
|
||||
this.pokemonContainers = [];
|
||||
this.eggHatchBg.setVisible(false);
|
||||
this.getUi().hideTooltip();
|
||||
|
||||
@ -167,7 +170,10 @@ export default class EggSummaryUiHandler extends MessageUiHandler {
|
||||
return true;
|
||||
}
|
||||
|
||||
updatePokemonIcons(): void {
|
||||
/**
|
||||
* Show the grid of Pokemon icons
|
||||
*/
|
||||
private updatePokemonIcons(): void {
|
||||
const itemOffset = this.scrollGridHandler.getItemOffset();
|
||||
const eggsToShow = Math.min(numRows * numCols, this.eggHatchData.length - itemOffset);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user