新增 PWA 更新提示並整理 README

This commit is contained in:
2026-04-16 19:57:08 +08:00
parent 0cfcdc3b0a
commit 975732017f
11 changed files with 349 additions and 67 deletions

View File

@@ -29,6 +29,9 @@ const defaultVoiceSettings: VoiceSettings = {
announceServer: true,
rate: 1,
}
const SPEECH_NAME_MAP: Record<string, string> = {
ruru: '嚕嚕',
}
type ScoreboardPageProps = {
currentSelectionOrder: string[]
@@ -252,7 +255,7 @@ export function ScoreboardPage({
}
if (voiceSettings.announceServer) {
parts.push(`${currentServer.name}發球`)
parts.push(`${getSpeechName(currentServer.name)}發球`)
}
if (parts.length > 0) {
@@ -1061,7 +1064,11 @@ function loadVoiceSettings(): VoiceSettings {
}
function getAnnouncementName(team: GroupTeam | null) {
return team?.playerA ?? '本隊'
return getSpeechName(team?.playerA ?? '本隊')
}
function getSpeechName(name: string) {
return SPEECH_NAME_MAP[name.trim().toLowerCase()] ?? name
}
function speakAnnouncement(message: string, rate: number) {