feat: i18n StoryGallery UI labels and data layer chapter/ending names
This commit is contained in:
@@ -77,6 +77,7 @@ export interface QTEDefinition {
|
|||||||
export interface ChapterInfo {
|
export interface ChapterInfo {
|
||||||
id: string
|
id: string
|
||||||
label: string
|
label: string
|
||||||
|
labelKey?: string
|
||||||
startScene: string
|
startScene: string
|
||||||
thumbnail?: string
|
thumbnail?: string
|
||||||
defaultVariables?: Record<string, number>
|
defaultVariables?: Record<string, number>
|
||||||
@@ -94,6 +95,7 @@ export interface AchievementDef {
|
|||||||
export interface EndingDef {
|
export interface EndingDef {
|
||||||
id: string
|
id: string
|
||||||
label: string
|
label: string
|
||||||
|
labelKey?: string
|
||||||
sceneId: string
|
sceneId: string
|
||||||
chapterId?: string
|
chapterId?: string
|
||||||
thumbnail?: string
|
thumbnail?: string
|
||||||
|
|||||||
@@ -60,5 +60,15 @@
|
|||||||
"continue": "Keep moving forward",
|
"continue": "Keep moving forward",
|
||||||
"back": "Turn back"
|
"back": "Turn back"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"chapter": {
|
||||||
|
"ch1": "Chapter 1: Awakening",
|
||||||
|
"ch2": "Chapter 2: Investigation",
|
||||||
|
"ch3": "Chapter 3: Finale"
|
||||||
|
},
|
||||||
|
"ending": {
|
||||||
|
"trust_end": "Trusted Ally",
|
||||||
|
"alone_end": "Lone Path",
|
||||||
|
"continue_end": "Keep Moving Forward"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -55,5 +55,15 @@
|
|||||||
"continue": "先へ進む",
|
"continue": "先へ進む",
|
||||||
"back": "引き返す"
|
"back": "引き返す"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"chapter": {
|
||||||
|
"ch1": "第一章:目覚め",
|
||||||
|
"ch2": "第二章:捜査",
|
||||||
|
"ch3": "第三章:終局"
|
||||||
|
},
|
||||||
|
"ending": {
|
||||||
|
"trust_end": "信頼の仲間",
|
||||||
|
"alone_end": "孤独の道",
|
||||||
|
"continue_end": "前進を続ける"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -60,5 +60,15 @@
|
|||||||
"continue": "继续前进",
|
"continue": "继续前进",
|
||||||
"back": "回头"
|
"back": "回头"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"chapter": {
|
||||||
|
"ch1": "第一章:醒来",
|
||||||
|
"ch2": "第二章:调查",
|
||||||
|
"ch3": "第三章:终局"
|
||||||
|
},
|
||||||
|
"ending": {
|
||||||
|
"trust_end": "信任的伙伴",
|
||||||
|
"alone_end": "独行之路",
|
||||||
|
"continue_end": "继续前行"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -39,14 +39,15 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"endings": [
|
"endings": [
|
||||||
{ "id": "trust_end", "label": "信任的伙伴", "sceneId": "trust_ending", "chapterId": "ch1", "thumbnail": "ui/images/end_trust.jpg" },
|
{ "id": "trust_end", "label": "信任的伙伴", "labelKey": "ending.trust_end", "sceneId": "trust_ending", "chapterId": "ch1", "thumbnail": "ui/images/end_trust.jpg" },
|
||||||
{ "id": "alone_end", "label": "独行之路", "sceneId": "alone_ending", "chapterId": "ch1", "thumbnail": "ui/images/end_alone.jpg" },
|
{ "id": "alone_end", "label": "独行之路", "labelKey": "ending.alone_end", "sceneId": "alone_ending", "chapterId": "ch1", "thumbnail": "ui/images/end_alone.jpg" },
|
||||||
{ "id": "continue_end", "label": "继续前行", "sceneId": "continue_ending", "chapterId": "ch3", "thumbnail": "ui/images/end_continue.jpg" }
|
{ "id": "continue_end", "label": "继续前行", "labelKey": "ending.continue_end", "sceneId": "continue_ending", "chapterId": "ch3", "thumbnail": "ui/images/end_continue.jpg" }
|
||||||
],
|
],
|
||||||
"chapters": [
|
"chapters": [
|
||||||
{
|
{
|
||||||
"id": "ch1",
|
"id": "ch1",
|
||||||
"label": "第一章:醒来",
|
"label": "第一章:醒来",
|
||||||
|
"labelKey": "chapter.ch1",
|
||||||
"startScene": "intro",
|
"startScene": "intro",
|
||||||
"thumbnail": "ui/images/ch1.jpg",
|
"thumbnail": "ui/images/ch1.jpg",
|
||||||
"defaultVariables": { "trust": 50, "courage": 0, "investigation": 0 }
|
"defaultVariables": { "trust": 50, "courage": 0, "investigation": 0 }
|
||||||
@@ -54,6 +55,7 @@
|
|||||||
{
|
{
|
||||||
"id": "ch2",
|
"id": "ch2",
|
||||||
"label": "第二章:调查",
|
"label": "第二章:调查",
|
||||||
|
"labelKey": "chapter.ch2",
|
||||||
"startScene": "desk_detail",
|
"startScene": "desk_detail",
|
||||||
"thumbnail": "ui/images/ch2.jpg",
|
"thumbnail": "ui/images/ch2.jpg",
|
||||||
"defaultVariables": { "trust": 60, "courage": 10, "investigation": 1 }
|
"defaultVariables": { "trust": 60, "courage": 10, "investigation": 1 }
|
||||||
@@ -61,6 +63,7 @@
|
|||||||
{
|
{
|
||||||
"id": "ch3",
|
"id": "ch3",
|
||||||
"label": "第三章:终局",
|
"label": "第三章:终局",
|
||||||
|
"labelKey": "chapter.ch3",
|
||||||
"startScene": "qte_success",
|
"startScene": "qte_success",
|
||||||
"thumbnail": "ui/images/ch3.jpg",
|
"thumbnail": "ui/images/ch3.jpg",
|
||||||
"defaultVariables": { "trust": 70, "courage": 20, "investigation": 2 }
|
"defaultVariables": { "trust": 70, "courage": 20, "investigation": 2 }
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref } from 'vue'
|
import { computed, ref } from 'vue'
|
||||||
import type { ChapterInfo, SceneNode, EndingDef } from '@engine/types'
|
import type { ChapterInfo, SceneNode, EndingDef } from '@engine/types'
|
||||||
|
import { useI18n } from '@/composables/useI18n'
|
||||||
|
|
||||||
|
const { t } = useI18n()
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
chapters: ChapterInfo[]
|
chapters: ChapterInfo[]
|
||||||
@@ -117,7 +120,7 @@ function toggleExpand(chapterId: string) {
|
|||||||
<template>
|
<template>
|
||||||
<div class="story-overlay" @click.self="emit('close')" @keydown.escape="emit('close')">
|
<div class="story-overlay" @click.self="emit('close')" @keydown.escape="emit('close')">
|
||||||
<div class="story-panel">
|
<div class="story-panel">
|
||||||
<h2 class="story-title">故事进度</h2>
|
<h2 class="story-title">{{ t('ui.story') }}</h2>
|
||||||
|
|
||||||
<div class="story-grid">
|
<div class="story-grid">
|
||||||
<div
|
<div
|
||||||
@@ -131,7 +134,7 @@ function toggleExpand(chapterId: string) {
|
|||||||
<img v-if="ch.thumbnail" :src="ch.thumbnail" class="thumb-img" />
|
<img v-if="ch.thumbnail" :src="ch.thumbnail" class="thumb-img" />
|
||||||
<div v-else class="thumb-placeholder">?</div>
|
<div v-else class="thumb-placeholder">?</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-label">{{ ch.label }}</div>
|
<div class="card-label">{{ t(ch.labelKey || ch.label) }}</div>
|
||||||
|
|
||||||
<div class="card-progress" v-if="unlockedChapterIds.has(ch.id)">
|
<div class="card-progress" v-if="unlockedChapterIds.has(ch.id)">
|
||||||
<div class="mini-progress-bar">
|
<div class="mini-progress-bar">
|
||||||
@@ -146,14 +149,14 @@ function toggleExpand(chapterId: string) {
|
|||||||
:key="end.id"
|
:key="end.id"
|
||||||
class="ending-tag"
|
class="ending-tag"
|
||||||
:class="{ unlocked: endingStatus(end.id) }"
|
:class="{ unlocked: endingStatus(end.id) }"
|
||||||
>{{ endingStatus(end.id) ? '✅' : '🔒' }} {{ end.label }}</span>
|
>{{ endingStatus(end.id) ? '✅' : '🔒' }} {{ t(end.labelKey || end.label) }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
v-if="unlockedChapterIds.has(ch.id)"
|
v-if="unlockedChapterIds.has(ch.id)"
|
||||||
class="card-start-btn"
|
class="card-start-btn"
|
||||||
@click.stop="emit('startChapter', ch.id)"
|
@click.stop="emit('startChapter', ch.id)"
|
||||||
>▶ 开始</button>
|
>▶ {{ t('ui.startChapter') }}</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card-recap" v-if="expandedChapterId === ch.id">
|
<div class="card-recap" v-if="expandedChapterId === ch.id">
|
||||||
@@ -173,7 +176,7 @@ function toggleExpand(chapterId: string) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button class="story-close" @click="emit('close')">关闭</button>
|
<button class="story-close" @click="emit('close')">{{ t('ui.close') }}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
"achievements": "Achievements",
|
"achievements": "Achievements",
|
||||||
"gallery": "Gallery",
|
"gallery": "Gallery",
|
||||||
"story": "Story Progress",
|
"story": "Story Progress",
|
||||||
|
"startChapter": "Start",
|
||||||
"noAutoSave": "No auto save yet",
|
"noAutoSave": "No auto save yet",
|
||||||
"autoSaveHint": "Game auto-saves to slot 0 at each scene change",
|
"autoSaveHint": "Game auto-saves to slot 0 at each scene change",
|
||||||
"language": "Language",
|
"language": "Language",
|
||||||
|
|||||||
@@ -25,6 +25,8 @@
|
|||||||
"pauseHint": "Esc = 再開",
|
"pauseHint": "Esc = 再開",
|
||||||
"achievements": "実績",
|
"achievements": "実績",
|
||||||
"gallery": "ギャラリー",
|
"gallery": "ギャラリー",
|
||||||
|
"story": "ストーリー進行",
|
||||||
|
"startChapter": "開始",
|
||||||
"noAutoSave": "オートセーブがありません",
|
"noAutoSave": "オートセーブがありません",
|
||||||
"autoSaveHint": "シーン切替時にスロット0に自動保存されます",
|
"autoSaveHint": "シーン切替時にスロット0に自動保存されます",
|
||||||
"language": "言語",
|
"language": "言語",
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
"achievements": "成就",
|
"achievements": "成就",
|
||||||
"gallery": "画廊",
|
"gallery": "画廊",
|
||||||
"story": "故事进度",
|
"story": "故事进度",
|
||||||
|
"startChapter": "开始",
|
||||||
"noAutoSave": "暂无自动存档",
|
"noAutoSave": "暂无自动存档",
|
||||||
"autoSaveHint": "游戏会在每次场景切换时自动保存到槽位 0",
|
"autoSaveHint": "游戏会在每次场景切换时自动保存到槽位 0",
|
||||||
"language": "语言",
|
"language": "语言",
|
||||||
|
|||||||
Reference in New Issue
Block a user