diff --git a/engine/types.ts b/engine/types.ts index 14ef09b..3a2f5c4 100644 --- a/engine/types.ts +++ b/engine/types.ts @@ -26,6 +26,7 @@ export interface Choice { text: string textKey?: string prompt?: string + promptKey?: string targetScene: string conditions?: Condition[] effects?: Effect[] diff --git a/public/demo/locales/en.json b/public/demo/locales/en.json index 2b321f8..a85084d 100644 --- a/public/demo/locales/en.json +++ b/public/demo/locales/en.json @@ -11,6 +11,9 @@ "choice": { "handshake": "Shake hands with the stranger", "reject": "Refuse to shake, stay alert" + }, + "prompt": { + "handshake": "The stranger will remember your kindness" } }, "right_door": { @@ -26,6 +29,9 @@ "choice": { "journey": "Embark on a journey of trust (requires trust >= 80)", "leave": "Leave this place" + }, + "prompt": { + "journey": "Your bond will change everything" } }, "investigation_site": { diff --git a/public/demo/locales/ja.json b/public/demo/locales/ja.json index 8be2ca3..9681ed4 100644 --- a/public/demo/locales/ja.json +++ b/public/demo/locales/ja.json @@ -11,6 +11,9 @@ "choice": { "handshake": "見知らぬ人と握手する", "reject": "握手を断り、警戒を続ける" + }, + "prompt": { + "handshake": "見知らぬ人はあなたの優しさを覚えている" } }, "right_door": { @@ -26,6 +29,9 @@ "choice": { "journey": "信頼の旅に出る(trust >= 80 が必要)", "leave": "ここを去る" + }, + "prompt": { + "journey": "あなたの絆が全てを変える" } }, "investigation_site": { diff --git a/public/demo/locales/zh.json b/public/demo/locales/zh.json index d3e230c..70a75d1 100644 --- a/public/demo/locales/zh.json +++ b/public/demo/locales/zh.json @@ -11,6 +11,9 @@ "choice": { "handshake": "与陌生人握手", "reject": "拒绝握手,保持警惕" + }, + "prompt": { + "handshake": "陌生人会记住你的善意" } }, "right_door": { @@ -26,6 +29,9 @@ "choice": { "journey": "开启信任的旅程(需要 trust >= 80)", "leave": "离开这里" + }, + "prompt": { + "journey": "你们的羁绊将改变一切" } }, "investigation_site": { diff --git a/public/scenes/demo.json b/public/scenes/demo.json index d967a7d..a7192f1 100644 --- a/public/scenes/demo.json +++ b/public/scenes/demo.json @@ -211,6 +211,7 @@ "text": "与陌生人握手", "textKey": "left_door.choice.handshake", "prompt": "陌生人会记住你的善意", + "promptKey": "left_door.prompt.handshake", "targetScene": "trust_ending", "effects": [ { "type": "add", "target": "trust", "value": 30 } @@ -322,6 +323,7 @@ "text": "开启信任的旅程(需要 trust >= 80)", "textKey": "trust_ending.choice.journey", "prompt": "你们的羁绊将改变一切", + "promptKey": "trust_ending.prompt.journey", "targetScene": "secret_ending", "conditions": [ { "variable": "trust", "op": ">=", "value": 80 } diff --git a/src/components/ChoicePanel.vue b/src/components/ChoicePanel.vue index de89e07..a2d7cc4 100644 --- a/src/components/ChoicePanel.vue +++ b/src/components/ChoicePanel.vue @@ -77,7 +77,7 @@ function handleChoose(index: number) { if (!choiceEnabled.value) return const choice = props.choices[index] if (choice?.prompt) { - emit('prompt', choice.prompt) + emit('prompt', t(choice.promptKey || choice.prompt)) } emit('choose', index) }