fix myster-encounter-ui-handler duplicate

This commit is contained in:
Felix Staud 2024-07-11 15:27:33 -07:00
parent 4d4d0e55cc
commit 96554427b5
1 changed files with 4 additions and 5 deletions

View File

@ -337,7 +337,7 @@ export default class MysteryEncounterUiHandler extends UiHandler {
optionText.setText(text); optionText.setText(text);
} }
if (!this.optionsMeetsReqs[i]) { if (!this.optionsMeetsReqs[i] && option.isDisabledOnRequirementsNotMet) {
optionText.setAlpha(0.5); optionText.setAlpha(0.5);
} }
if (this.blockInput) { if (this.blockInput) {
@ -422,11 +422,10 @@ export default class MysteryEncounterUiHandler extends UiHandler {
return; return;
} }
const mysteryEncounter = this.scene.currentBattle.mysteryEncounter;
let text: string; let text: string;
const option = this.filteredEncounterOptions[cursor]; const cursorOption = this.filteredEncounterOptions[cursor];
const optionDialogue = option.dialogue ?? mysteryEncounter.dialogue.encounterOptionsDialogue.options[cursor]; const optionDialogue = cursorOption.dialogue;
if (!this.optionsMeetsReqs[cursor] && this.filteredEncounterOptions[cursor].isDisabledOnRequirementsNotMet && optionDialogue.disabledTooltip) { if (!this.optionsMeetsReqs[cursor] && cursorOption.isDisabledOnRequirementsNotMet && optionDialogue.disabledTooltip) {
text = getEncounterText(this.scene, optionDialogue.disabledTooltip, TextStyle.TOOLTIP_CONTENT); text = getEncounterText(this.scene, optionDialogue.disabledTooltip, TextStyle.TOOLTIP_CONTENT);
} else { } else {
text = getEncounterText(this.scene, optionDialogue.buttonTooltip, TextStyle.TOOLTIP_CONTENT); text = getEncounterText(this.scene, optionDialogue.buttonTooltip, TextStyle.TOOLTIP_CONTENT);