From f068b53d44b540aa9be630a7db51fec05cce5769 Mon Sep 17 00:00:00 2001 From: shayebeadling Date: Sat, 13 Apr 2024 23:20:54 -0400 Subject: [PATCH] Show icon in dex for HA mons, like shiny (#117) * Show icon in dex for HA mons, like shiny * Swaps the star with the HA capsule * Removes the unwanted icon --- public/images/ui/ha_capsule.png | Bin 0 -> 297 bytes src/loading-scene.ts | 1 + src/ui/starter-select-ui-handler.ts | 13 +++++++++++++ 3 files changed, 14 insertions(+) create mode 100644 public/images/ui/ha_capsule.png diff --git a/public/images/ui/ha_capsule.png b/public/images/ui/ha_capsule.png new file mode 100644 index 0000000000000000000000000000000000000000..cccc9cf51d3054351193c5fbd53fa8a8e2be5fff GIT binary patch literal 297 zcmeAS@N?(olHy`uVBq!ia0vp^>_E)H!3HEvS)PI@&H|6fVg?3oVGw3ym^DWND0tA* z#W93qW^#f9^P4p}U3wQER_;+!dZcqg=;q7Hzk28FzP(SW;GJ(*^G8-M@!f;_HLq^n z|3BS-?~nQ)2ma=N`gE%C3=as%%vtq!x&HcjMZcsEf85+IG3DQ%guNwCznHNZO8S1c zyqmsXe$LnT_0>-g|Myn^^MAd@db9S%#>TlPuh|&gns>Xy`Om@dHXBFFHfi?fHT(a6 z2;*XAKJ3pHmS^|1r^8eI|Jncl>%G6e{SUNilY|{d(fQX8L`3*q#8?=X8@g{xJvR9b i&@+6g5uRzjz6@GGHU|)cz@^~HAj;F#&t;ucLK6V`mUt8Z literal 0 HcmV?d00001 diff --git a/src/loading-scene.ts b/src/loading-scene.ts index 5c8f879eb..9a3b7fdd5 100644 --- a/src/loading-scene.ts +++ b/src/loading-scene.ts @@ -58,6 +58,7 @@ export class LoadingScene extends SceneBase { this.loadImage('achv_bar_3', 'ui'); this.loadImage('achv_bar_4', 'ui'); this.loadImage('shiny_star', 'ui', 'shiny.png'); + this.loadImage('ha_capsule', 'ui', 'ha_capsule.png'); this.loadImage('icon_spliced', 'ui'); this.loadImage('icon_tera', 'ui'); this.loadImage('type_tera', 'ui'); diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index 479ae21e5..e87914821 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -163,6 +163,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { private startCursorObj: Phaser.GameObjects.NineSlice; private starterValueLabels: Phaser.GameObjects.Text[]; private shinyIcons: Phaser.GameObjects.Image[]; + private hiddenAbilityIcons: Phaser.GameObjects.Image[]; private iconAnimHandler: PokemonIconAnimHandler; @@ -382,6 +383,17 @@ export default class StarterSelectUiHandler extends MessageUiHandler { return ret; }); + this.hiddenAbilityIcons = new Array(81).fill(null).map((_, i) => { + const x = (i % 9) * 18; + const y = Math.floor(i / 9) * 18; + const ret = this.scene.add.image(x + 163, y + 16, 'ha_capsule'); + ret.setOrigin(0, 0); + ret.setScale(0.5); + ret.setVisible(false); + this.starterSelectContainer.add(ret); + return ret; + }); + this.pokemonSprite = this.scene.add.sprite(53, 63, `pkmn__sub`); this.starterSelectContainer.add(this.pokemonSprite); @@ -1106,6 +1118,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.updateStarterValueLabel(s); this.starterValueLabels[s].setVisible(slotVisible); this.shinyIcons[s].setVisible(slotVisible && !!this.scene.gameData.dexData[speciesId].caughtAttr && !!(this.scene.gameData.dexData[speciesId].caughtAttr & DexAttr.SHINY)); + this.hiddenAbilityIcons[s].setVisible(slotVisible && !!this.scene.gameData.dexData[speciesId].caughtAttr && !!(this.scene.gameData.dexData[speciesId].caughtAttr & DexAttr.ABILITY_HIDDEN)); } } else { changed = super.setCursor(cursor);