From d057beb82d8edd22376d0a37d8d12d7a7e8dc3f3 Mon Sep 17 00:00:00 2001 From: cocos02 Date: Wed, 10 Jun 2026 16:21:23 +0800 Subject: [PATCH] feat: QTE prompt i18n via promptKey, fallback to prompt text --- engine/types.ts | 1 + public/demo/locales/en.json | 3 +++ public/demo/locales/ja.json | 3 +++ public/demo/locales/zh.json | 3 +++ public/scenes/demo.json | 1 + src/App.vue | 2 +- 6 files changed, 12 insertions(+), 1 deletion(-) diff --git a/engine/types.ts b/engine/types.ts index 3d8844e..407a685 100644 --- a/engine/types.ts +++ b/engine/types.ts @@ -63,6 +63,7 @@ export interface Effect { export interface QTEDefinition { triggerTime: number prompt: string + promptKey?: string keys: string[] timeLimit: number successScene: string diff --git a/public/demo/locales/en.json b/public/demo/locales/en.json index a1514de..1a1e3e7 100644 --- a/public/demo/locales/en.json +++ b/public/demo/locales/en.json @@ -17,6 +17,9 @@ "choice": { "continue": "Keep moving forward", "back": "Turn back" + }, + "qte": { + "dodge": "Dodge the flying rocks!" } }, "trust_ending": { diff --git a/public/demo/locales/ja.json b/public/demo/locales/ja.json index 87253fe..0f32236 100644 --- a/public/demo/locales/ja.json +++ b/public/demo/locales/ja.json @@ -17,6 +17,9 @@ "choice": { "continue": "先へ進む", "back": "引き返す" + }, + "qte": { + "dodge": "飛んでくる石を避けろ!" } }, "trust_ending": { diff --git a/public/demo/locales/zh.json b/public/demo/locales/zh.json index 2d73e43..3943510 100644 --- a/public/demo/locales/zh.json +++ b/public/demo/locales/zh.json @@ -17,6 +17,9 @@ "choice": { "continue": "继续前进", "back": "回头" + }, + "qte": { + "dodge": "躲避飞来的石块!" } }, "trust_ending": { diff --git a/public/scenes/demo.json b/public/scenes/demo.json index 304748e..0fdf14e 100644 --- a/public/scenes/demo.json +++ b/public/scenes/demo.json @@ -224,6 +224,7 @@ "qte": { "triggerTime": 1.0, "prompt": "躲避飞来的石块!", + "promptKey": "right_door.qte.dodge", "keys": ["ArrowLeft", "ArrowRight", "a", "d"], "timeLimit": 3.0, "successScene": "qte_success", diff --git a/src/App.vue b/src/App.vue index 9888f3d..7febc3b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -301,7 +301,7 @@ init() />