fix: prefix locales path with assetBase so fetch resolves correctly
This commit is contained in:
@@ -161,7 +161,7 @@ export function useGameEngine(videoEls: () => [HTMLVideoElement | null, HTMLVide
|
||||
engine.achievementSystem.init(data.achievements || [], achieved)
|
||||
|
||||
store.setEndings(data.endings || [])
|
||||
store.setStoryLocales(data.locales)
|
||||
store.setStoryLocales(data.locales, data.assetBase)
|
||||
|
||||
const visitedIds = await saveSystem.getVisitedSceneIds()
|
||||
store.setVisitedSceneIds(visitedIds)
|
||||
|
||||
@@ -181,8 +181,12 @@ export const useGameStore = defineStore('game', () => {
|
||||
visitedSceneIds.value = new Set(visitedSceneIds.value)
|
||||
}
|
||||
|
||||
function setStoryLocales(locales: LocalesConfig | undefined) {
|
||||
if (locales) storyLocales.value = locales
|
||||
function setStoryLocales(locales: LocalesConfig | undefined, assetBase?: string) {
|
||||
if (locales) {
|
||||
const base = (assetBase || '')
|
||||
const p = locales.path.startsWith('/') || locales.path.startsWith('http') ? locales.path : base + locales.path
|
||||
storyLocales.value = { ...locales, path: p }
|
||||
}
|
||||
}
|
||||
|
||||
function setSubFontSize(v: number) { subFontSize.value = v; localStorage.setItem('subFontSize', String(v)) }
|
||||
|
||||
Reference in New Issue
Block a user