[Bugfix #3930] Moves That a Pokemon Knows and are not in their List of Learnable TMs Display as "Not Able" Rather than Learned (#3935)
* fix for [Bug] Moves That a Pokemon Knows and are not in their List of Learnable TMs Display as "Not Able" Rather than Learned #3930 * convert switch case block to if/elif/else
This commit is contained in:
parent
4c4a2c1900
commit
03567ed56c
|
@ -1321,16 +1321,13 @@ class PartySlot extends Phaser.GameObjects.Container {
|
||||||
this.slotHpOverlay.setVisible(false);
|
this.slotHpOverlay.setVisible(false);
|
||||||
this.slotHpText.setVisible(false);
|
this.slotHpText.setVisible(false);
|
||||||
let slotTmText: string;
|
let slotTmText: string;
|
||||||
switch (true) {
|
|
||||||
case (this.pokemon.compatibleTms.indexOf(tmMoveId) === -1):
|
if (this.pokemon.getMoveset().filter(m => m?.moveId === tmMoveId).length > 0) {
|
||||||
slotTmText = i18next.t("partyUiHandler:notAble");
|
|
||||||
break;
|
|
||||||
case (this.pokemon.getMoveset().filter(m => m?.moveId === tmMoveId).length > 0):
|
|
||||||
slotTmText = i18next.t("partyUiHandler:learned");
|
slotTmText = i18next.t("partyUiHandler:learned");
|
||||||
break;
|
} else if (this.pokemon.compatibleTms.indexOf(tmMoveId) === -1) {
|
||||||
default:
|
slotTmText = i18next.t("partyUiHandler:notAble");
|
||||||
|
} else {
|
||||||
slotTmText = i18next.t("partyUiHandler:able");
|
slotTmText = i18next.t("partyUiHandler:able");
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.slotDescriptionLabel.setText(slotTmText);
|
this.slotDescriptionLabel.setText(slotTmText);
|
||||||
|
|
Loading…
Reference in New Issue