Fix Mega evolutions causing ability slot to be lost

This commit is contained in:
Flashfyre committed 2024-04-11 11:09:07 -04:00
1 parent c14c581248
commit f2a141cf15
2 files changed
+48 -46

No files matched your search

+5 -3
View File
@@ -7,8 +7,10 @@ export enum PokemonIconAnimMode {
ACTIVE
}
type PokemonIcon = Phaser.GameObjects.Container | Phaser.GameObjects.Sprite;
export default class PokemonIconAnimHandler {
private icons: Map<Phaser.GameObjects.Container, PokemonIconAnimMode>;
private icons: Map<PokemonIcon, PokemonIconAnimMode>;
private toggled: boolean;
setup(scene: BattleScene): void {
@@ -43,7 +45,7 @@ export default class PokemonIconAnimHandler {
}
}
addOrUpdate(icons: Phaser.GameObjects.Container | Phaser.GameObjects.Container[], mode: PokemonIconAnimMode): void {
addOrUpdate(icons: PokemonIcon | PokemonIcon[], mode: PokemonIconAnimMode): void {
if (!Array.isArray(icons))
icons = [ icons ];
for (let i of icons) {
@@ -60,7 +62,7 @@ export default class PokemonIconAnimHandler {
}
}
remove(icons: Phaser.GameObjects.Container | Phaser.GameObjects.Container[]): void {
remove(icons: PokemonIcon | PokemonIcon[]): void {
if (!Array.isArray(icons))
icons = [ icons ];
for (let i of icons) {