From 03567ed56cb3e1923b40802cdaf52aeec713f13d Mon Sep 17 00:00:00 2001 From: njahja Date: Mon, 2 Sep 2024 14:59:26 -0700 Subject: [PATCH] [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 --- src/ui/party-ui-handler.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/ui/party-ui-handler.ts b/src/ui/party-ui-handler.ts index a61037548e6..176a7098347 100644 --- a/src/ui/party-ui-handler.ts +++ b/src/ui/party-ui-handler.ts @@ -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);