mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-21 00:52:47 +02:00
[UI/UX] [Bug] Icons for egg moves and passives show up even when not unlocked (#5540)
Reworked icons to more compact code
This commit is contained in:
parent
3b99d3aea2
commit
b1d494eadb
@ -1742,36 +1742,26 @@ export default class PokedexUiHandler extends MessageUiHandler {
|
||||
container.icon.setTint(0);
|
||||
}
|
||||
|
||||
if (data.eggMove1) {
|
||||
container.eggMove1Icon.setVisible(true);
|
||||
} else {
|
||||
container.eggMove1Icon.setVisible(false);
|
||||
}
|
||||
if (data.eggMove2) {
|
||||
container.eggMove2Icon.setVisible(true);
|
||||
} else {
|
||||
container.eggMove2Icon.setVisible(false);
|
||||
}
|
||||
if (data.tmMove1) {
|
||||
container.tmMove1Icon.setVisible(true);
|
||||
} else {
|
||||
container.tmMove1Icon.setVisible(false);
|
||||
}
|
||||
if (data.tmMove2) {
|
||||
container.tmMove2Icon.setVisible(true);
|
||||
} else {
|
||||
container.tmMove2Icon.setVisible(false);
|
||||
}
|
||||
if (data.passive1) {
|
||||
container.passive1Icon.setVisible(true);
|
||||
} else {
|
||||
container.passive1Icon.setVisible(false);
|
||||
}
|
||||
if (data.passive2) {
|
||||
container.passive2Icon.setVisible(true);
|
||||
} else {
|
||||
container.passive2Icon.setVisible(false);
|
||||
}
|
||||
const pairs: [boolean | undefined, Phaser.GameObjects.Image][] = [
|
||||
[data.eggMove1, container.eggMove1Icon],
|
||||
[data.eggMove2, container.eggMove2Icon],
|
||||
[data.tmMove1, container.tmMove1Icon],
|
||||
[data.tmMove2, container.tmMove2Icon],
|
||||
[data.passive1, container.passive1Icon],
|
||||
[data.passive2, container.passive2Icon],
|
||||
];
|
||||
|
||||
pairs.forEach(([unlocked, icon]) => {
|
||||
if (unlocked) {
|
||||
icon.setVisible(true);
|
||||
icon.clearTint();
|
||||
} else if (unlocked === false) {
|
||||
icon.setVisible(true);
|
||||
icon.setTint(0x808080);
|
||||
} else {
|
||||
icon.setVisible(false);
|
||||
}
|
||||
});
|
||||
|
||||
if (this.showDecorations) {
|
||||
if (this.pokerusSpecies.includes(data.species)) {
|
||||
|
Loading…
Reference in New Issue
Block a user