From 93ea4f4a221dfa962fc6df36239becc6b8a98a66 Mon Sep 17 00:00:00 2001 From: Black Ram <67595890+BlackRam-oss@users.noreply.github.com> Date: Thu, 8 Aug 2024 23:29:46 +0200 Subject: [PATCH] fix --- src/classes/LabelJson.ts | 6 +++++- src/types/StepLabelJsonType.ts | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) 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,