feat: P2 - QTE system, subtitles, save thumbnails

- QTESystem: trigger detection via timeupdate, multi-key matching, timeout handling
- QTEOverlay: SVG countdown ring + key prompts + success/fail animation
- Engine: integrate QTE (timeupdate check, conditional branching, effect application)
- Subtitles: WebVTT parsing + synchronized subtitle rendering
- GamePlayer: overlay QTE and subtitle components
- SaveSystem: DB v2 with thumbnail field, canvas snapshot at 320x180 JPEG
- SaveLoadMenu: thumbnail preview for save slots
- VideoManager: getActiveVideoElement() for canvas capture
- App.vue: QTE/subtitle integration, thumbnail capture on save
- stores: QTE state management, save list with thumbnails
- demo.json: QTE scene (right_door), subtitles, new event types
- ROADMAP: mark P2 as completed
This commit is contained in:
2026-06-07 19:35:14 +08:00
parent c168e30e52
commit 319a379921
18 changed files with 625 additions and 53 deletions

View File

@@ -8,11 +8,11 @@
"intro": {
"id": "intro",
"videoUrl": "/videos/intro.mp4",
"subtitleUrl": "/subtitles/intro.vtt",
"choices": [
{
"text": "走向左边那扇发光的门",
"targetScene": "left_door",
"timeLimit": 5,
"effects": [
{ "type": "add", "target": "courage", "value": 10 }
]
@@ -33,6 +33,7 @@
"left_door": {
"id": "left_door",
"videoUrl": "/videos/left_door.mp4",
"subtitleUrl": "/subtitles/left_door.vtt",
"choices": [
{
"text": "与陌生人握手",
@@ -50,6 +51,36 @@
"right_door": {
"id": "right_door",
"videoUrl": "/videos/right_door.mp4",
"qte": {
"triggerTime": 1.0,
"prompt": "躲避飞来的石块!",
"keys": ["ArrowLeft", "ArrowRight", "a", "d"],
"timeLimit": 3.0,
"successScene": "qte_success",
"failScene": "qte_fail",
"effects": {
"success": [{ "type": "add", "target": "courage", "value": 15 }],
"fail": [{ "type": "add", "target": "trust", "value": -20 }]
}
}
},
"qte_success": {
"id": "qte_success",
"videoUrl": "/videos/qte_success.mp4",
"choices": [
{
"text": "继续前进",
"targetScene": "continue_ending"
},
{
"text": "回头",
"targetScene": "intro"
}
]
},
"qte_fail": {
"id": "qte_fail",
"videoUrl": "/videos/qte_fail.mp4",
"choices": [
{
"text": "继续前进",
@@ -64,6 +95,7 @@
"stay": {
"id": "stay",
"videoUrl": "/videos/stay.mp4",
"subtitleUrl": "/subtitles/stay.vtt",
"nextScene": "alone_ending"
},
"trust_ending": {

View File

@@ -0,0 +1,7 @@
WEBVTT
00:00.000 --> 00:02.000
你醒来发现自己在一个陌生的房间
00:02.500 --> 00:03.000
前方有两扇门,你必须做出选择

View File

@@ -0,0 +1,7 @@
WEBVTT
00:00.000 --> 00:02.500
你走进了发光的门,来到一个明亮的大厅
00:02.500 --> 00:03.000
一位陌生人向你伸出了手

View File

@@ -0,0 +1,4 @@
WEBVTT
00:00.000 --> 00:03.000
你选择留在原地,时间缓缓流逝...

BIN
public/videos/qte_fail.mp4 Normal file

Binary file not shown.

Binary file not shown.