From 96554427b586ed3acdac3c3e825d16958c037fd2 Mon Sep 17 00:00:00 2001 From: Felix Staud Date: Thu, 11 Jul 2024 15:27:33 -0700 Subject: [PATCH] fix myster-encounter-ui-handler duplicate --- src/ui/mystery-encounter-ui-handler.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ui/mystery-encounter-ui-handler.ts b/src/ui/mystery-encounter-ui-handler.ts index 7eb93f9b4ab..9eccfd5d0e8 100644 --- a/src/ui/mystery-encounter-ui-handler.ts +++ b/src/ui/mystery-encounter-ui-handler.ts @@ -337,7 +337,7 @@ export default class MysteryEncounterUiHandler extends UiHandler { optionText.setText(text); } - if (!this.optionsMeetsReqs[i]) { + if (!this.optionsMeetsReqs[i] && option.isDisabledOnRequirementsNotMet) { optionText.setAlpha(0.5); } if (this.blockInput) { @@ -422,11 +422,10 @@ export default class MysteryEncounterUiHandler extends UiHandler { return; } - const mysteryEncounter = this.scene.currentBattle.mysteryEncounter; let text: string; - const option = this.filteredEncounterOptions[cursor]; - const optionDialogue = option.dialogue ?? mysteryEncounter.dialogue.encounterOptionsDialogue.options[cursor]; - if (!this.optionsMeetsReqs[cursor] && this.filteredEncounterOptions[cursor].isDisabledOnRequirementsNotMet && optionDialogue.disabledTooltip) { + const cursorOption = this.filteredEncounterOptions[cursor]; + const optionDialogue = cursorOption.dialogue; + if (!this.optionsMeetsReqs[cursor] && cursorOption.isDisabledOnRequirementsNotMet && optionDialogue.disabledTooltip) { text = getEncounterText(this.scene, optionDialogue.disabledTooltip, TextStyle.TOOLTIP_CONTENT); } else { text = getEncounterText(this.scene, optionDialogue.buttonTooltip, TextStyle.TOOLTIP_CONTENT);