diff --git a/src/classes/LabelJson.ts b/src/classes/LabelJson.ts index 45476a6b..58a5c1d6 100644 --- a/src/classes/LabelJson.ts +++ b/src/classes/LabelJson.ts @@ -4,6 +4,7 @@ import { GameStepManager } from "../managers" import { StepLabelJsonType } from "../types" import { LabelIdType } from "../types/LabelIdType" import { StepLabelType } from "../types/StepLabelType" +import ChoiceMenuOption from "./ChoiceMenuOption" import LabelAbstract from "./LabelAbstract" export default class LabelJson extends LabelAbstract, T> { @@ -31,7 +32,10 @@ export default class LabelJson extends LabelAbstract { return (props) => { if (step.currentChoiceMenuOptions) { - setChoiceMenuOptions(step.currentChoiceMenuOptions) + let options = step.currentChoiceMenuOptions.map((option) => { + return new ChoiceMenuOption(option.text, option.label, option.props, option.type) + }) + setChoiceMenuOptions(options) } else { clearChoiceMenuOptions() diff --git a/src/types/StepLabelJsonType.ts b/src/types/StepLabelJsonType.ts index 3b5b1af7..887f509d 100644 --- a/src/types/StepLabelJsonType.ts +++ b/src/types/StepLabelJsonType.ts @@ -10,7 +10,7 @@ type StepLabelJsonType = { label: LabelIdType type: LabelRunModeType props: StorageObjectType - } + }[] dialog?: { character: string, text: string,