From 92fb8b715e86baf085ede2c5d7b96249dfaf6d83 Mon Sep 17 00:00:00 2001 From: Akuma-Reiki <66755974+Akuma-Reiki@users.noreply.github.com> Date: Sat, 4 May 2024 17:29:48 -0500 Subject: [PATCH] Added Candy Progress UI (#463) * Added Candy Progress UI * GetRootSpecies rather than colors of current Species --- public/images/ui/candy.png | Bin 0 -> 415 bytes public/images/ui/candy_overlay.png | Bin 0 -> 211 bytes public/images/ui/legacy/candy.png | Bin 0 -> 415 bytes public/images/ui/legacy/candy_overlay.png | Bin 0 -> 211 bytes src/loading-scene.ts | 2 ++ src/ui/summary-ui-handler.ts | 40 +++++++++++++++++++++- 6 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 public/images/ui/candy.png create mode 100644 public/images/ui/candy_overlay.png create mode 100644 public/images/ui/legacy/candy.png create mode 100644 public/images/ui/legacy/candy_overlay.png diff --git a/public/images/ui/candy.png b/public/images/ui/candy.png new file mode 100644 index 0000000000000000000000000000000000000000..6b633a195040a4177cbbcf632e760b0a1d2aea90 GIT binary patch literal 415 zcmV;Q0bu@#P)Px$KS@MER5*==lQFJ>KoEvMjfFi4fs#nGm7yZ>0$#*;2oB&O40oXB0wkP(irBG) zSXe3DzQXLvy5RehO_+iC{#kZ*#e#$oY8p39vzq(PN$SEp&#nCFbeaWOfe=FFdCqpb zHMwyd9nciA{#6V(@#S){wzr-u4#RK};`_b@F&!jHVv6-zQktgbd8OR}4u=B(Qc9$h zR?#?)#-uDu0J1D&qg|zxR8>V3MNS8=*9(BY?+w`VJb*VK2m<4LyWK4J?^76t0nhV@ zbm~C5JIS;DAe=${JFZWQ(f1oq9~L;h0WAK|D64P zZ?*;Scsyv^miztgbY&(=2%)amE4$s!Zf~MAO=;Vf^Z9J1(HUh8nbUW%1JDq7kL*-g zmI41eK@{oCO|{#S9GG z!XV7ZFl&wkP_V+&#WAE}PIAHm(I5Z+@3$~g3tem}q;^k1XOPx$KS@MER5*==lQFJ>KoEvMjfFi4fs#nGm7yZ>0$#*;2oB&O40oXB0wkP(irBG) zSXe3DzQXLvy5RehO_+iC{#kZ*#e#$oY8p39vzq(PN$SEp&#nCFbeaWOfe=FFdCqpb zHMwyd9nciA{#6V(@#S){wzr-u4#RK};`_b@F&!jHVv6-zQktgbd8OR}4u=B(Qc9$h zR?#?)#-uDu0J1D&qg|zxR8>V3MNS8=*9(BY?+w`VJb*VK2m<4LyWK4J?^76t0nhV@ zbm~C5JIS;DAe=${JFZWQ(f1oq9~L;h0WAK|D64P zZ?*;Scsyv^miztgbY&(=2%)amE4$s!Zf~MAO=;Vf^Z9J1(HUh8nbUW%1JDq7kL*-g zmI41eK@{oCO|{#S9GG z!XV7ZFl&wkP_V+&#WAE}PIAHm(I5Z+@3$~g3tem}q;^k1XO (this.scene as BattleScene).ui.hideTooltip()); } + var currentFriendship = this.scene.gameData.starterData[this.pokemon.species.getRootSpeciesId()].friendship; + if (!currentFriendship || currentFriendship === undefined) + currentFriendship = 0; + + const friendshipCap = getStarterValueFriendshipCap(speciesStarters[this.pokemon.species.getRootSpeciesId()]); + const candyCropY = 16 - (16 * (currentFriendship / friendshipCap)); + + if (this.candyShadow.visible) { + this.candyShadow.on('pointerover', () => (this.scene as BattleScene).ui.showTooltip(null, `${currentFriendship}/${friendshipCap}`, true)); + this.candyShadow.on('pointerout', () => (this.scene as BattleScene).ui.hideTooltip()); + } + + this.candyIcon.setCrop(0,candyCropY,16, 16); + this.candyOverlay.setCrop(0,candyCropY,16, 16); + const doubleShiny = isFusion && this.pokemon.shiny && this.pokemon.fusionShiny; const baseVariant = !doubleShiny ? this.pokemon.getVariant() : this.pokemon.variant;