Files
Kokorone/apps/web/lib/voice-autoplay-settings.ts
jiantw83andClaude Sonnet 5 1bea06e3cd feat(遊戲化): 新增大廳、附身、時間流、後日談進度等遊戲化系統功能
新增角色大廳(lobby)邀約與通話、附身(possession)、時鐘(clock)抽象、
時間流與睡眠負債、後日談進度、行為選擇與旁觀反應等模組,並補齊對應冒煙
測試(R~V)與單元測試;同步調整 web/mobile 對應頁面與元件。

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-20 09:10:26 +08:00

14 lines
568 B
TypeScript

const STORAGE_KEY = "kokorone:voice-autoplay-enabled";
// T26:自走語音在場自動播放的開關,純前端偏好(不需要跨裝置同步),預設開啟。
export function isVoiceAutoplayEnabled(): boolean {
if (typeof window === "undefined") return true;
const stored = window.localStorage.getItem(STORAGE_KEY);
return stored !== "false";
}
export function setVoiceAutoplayEnabled(enabled: boolean): void {
window.localStorage.setItem(STORAGE_KEY, String(enabled));
window.dispatchEvent(new StorageEvent("storage", { key: STORAGE_KEY }));
}