[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:
njahja 2024-09-02 14:59:26 -07:00 committed by GitHub
parent 4c4a2c1900
commit 03567ed56c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 8 deletions

View File

@ -1321,16 +1321,13 @@ class PartySlot extends Phaser.GameObjects.Container {
this.slotHpOverlay.setVisible(false);
this.slotHpText.setVisible(false);
let slotTmText: string;
switch (true) {
case (this.pokemon.compatibleTms.indexOf(tmMoveId) === -1):
slotTmText = i18next.t("partyUiHandler:notAble");
break;
case (this.pokemon.getMoveset().filter(m => m?.moveId === tmMoveId).length > 0):
if (this.pokemon.getMoveset().filter(m => m?.moveId === tmMoveId).length > 0) {
slotTmText = i18next.t("partyUiHandler:learned");
break;
default:
} else if (this.pokemon.compatibleTms.indexOf(tmMoveId) === -1) {
slotTmText = i18next.t("partyUiHandler:notAble");
} else {
slotTmText = i18next.t("partyUiHandler:able");
break;
}
this.slotDescriptionLabel.setText(slotTmText);