feat: i18n system, lang switch component, english subtitles, UI improvements, roadmap update
This commit is contained in:
@@ -3,11 +3,13 @@ import { Engine } from '@engine/core/Engine'
|
||||
import { SaveSystem } from '@engine/systems/SaveSystem'
|
||||
import type { GameData } from '@engine/types'
|
||||
import { useGameStore } from '@/stores/gameStore'
|
||||
import { useI18n } from '@/composables/useI18n'
|
||||
|
||||
export function useGameEngine(videoEls: () => [HTMLVideoElement | null, HTMLVideoElement | null]) {
|
||||
const engine = new Engine()
|
||||
const saveSystem = new SaveSystem()
|
||||
const store = useGameStore()
|
||||
const { t } = useI18n()
|
||||
let lastThumbnail: string | undefined
|
||||
|
||||
if (import.meta.env.DEV) {
|
||||
@@ -34,7 +36,11 @@ export function useGameEngine(videoEls: () => [HTMLVideoElement | null, HTMLVide
|
||||
})
|
||||
|
||||
engine.on('choiceRequest', (choiceList) => {
|
||||
store.setChoices(choiceList)
|
||||
const translated = choiceList.map((c: any) => ({
|
||||
...c,
|
||||
text: c.textKey ? t(c.textKey) : c.text,
|
||||
}))
|
||||
store.setChoices(translated)
|
||||
})
|
||||
|
||||
engine.on('choiceTimer', (timerState) => {
|
||||
|
||||
Reference in New Issue
Block a user