Add shiny indicator on summary screen

pull/62/head
Flashfyre 2024-04-08 10:12:06 -04:00
parent fdcefbd5c1
commit dff22c4cae
1 changed files with 10 additions and 0 deletions

View File

@ -41,6 +41,7 @@ export default class SummaryUiHandler extends UiHandler {
private pokeball: Phaser.GameObjects.Sprite;
private levelText: Phaser.GameObjects.Text;
private genderText: Phaser.GameObjects.Text;
private shinyStar: Phaser.GameObjects.Image;
private statusContainer: Phaser.GameObjects.Container;
private status: Phaser.GameObjects.Image;
private summaryPageContainer: Phaser.GameObjects.Container;
@ -95,6 +96,7 @@ export default class SummaryUiHandler extends UiHandler {
this.shinyOverlay = this.scene.add.image(6, -54, 'summary_overlay_shiny');
this.shinyOverlay.setOrigin(0, 1);
this.shinyOverlay.setVisible(false);
this.summaryContainer.add(this.shinyOverlay);
this.numberText = addTextObject(this.scene, 17, -149, '0000', TextStyle.SUMMARY);
@ -127,6 +129,11 @@ export default class SummaryUiHandler extends UiHandler {
this.genderText.setOrigin(0, 1);
this.summaryContainer.add(this.genderText);
this.shinyStar = this.scene.add.image(96, -19, 'shiny_star');
this.shinyStar.setOrigin(0, 1);
this.shinyStar.setVisible(false);
this.summaryContainer.add(this.shinyStar);
this.statusContainer = this.scene.add.container(-106, -16);
const statusBg = this.scene.add.image(0, 0, 'summary_status');
@ -235,6 +242,9 @@ export default class SummaryUiHandler extends UiHandler {
this.genderText.setColor(getGenderColor(this.pokemon.getGender(true)));
this.genderText.setShadowColor(getGenderColor(this.pokemon.getGender(true), true));
this.shinyStar.setX(96 - (this.genderText.text ? 10 : 0));
this.shinyStar.setVisible(this.pokemon.isShiny());
switch (this.summaryUiMode) {
case SummaryUiMode.DEFAULT:
const page = args.length < 2 ? Page.PROFILE : args[2] as Page;