新增 PWA 更新提示並整理 README
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user