채팅 소리 기본 크기를 게임 소리의 80%로 올리고(60%는 너무 안 들린다는 의견), 관리자 사이트 설정에 "채팅 소리 크기"(게임 소리의 0~200%, 정수, 기본 80%)를 추가. 0%면 채팅 소리 없음. 각자의 소리 크기(0~100)는 그대로 곱해짐. 저장하면 /api/config와 방 정보(RoomView.chatSound)로 열린 방에도 바로 적용. 설정 화면에 저장 없이 그 값으로 울려 보는 "들어 보기" 버튼. feedback.test.ts·admin.test.ts·admin.e2e.ts에 확인 추가, docs/14-admin.md 표에 항목 추가
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,19 @@ export function clampGameSpeed(x: unknown): number {
|
||||
return Math.min(GAME_SPEED_MAX, Math.max(GAME_SPEED_MIN, x));
|
||||
}
|
||||
|
||||
/**
|
||||
* Chat sound level (admin site setting, docs/14-admin.md §5): percent of the usual game sound level, 0 = no chat sound.
|
||||
* It still follows each player's own volume setting.
|
||||
*/
|
||||
export const CHAT_SOUND_MIN = 0;
|
||||
export const CHAT_SOUND_MAX = 200;
|
||||
export const CHAT_SOUND_DEFAULT = 80;
|
||||
/** Clamps a chat sound percent from the network / settings into the range (anything not a number → the default). */
|
||||
export function clampChatSound(x: unknown): number {
|
||||
if (typeof x !== 'number' || !Number.isFinite(x)) return CHAT_SOUND_DEFAULT;
|
||||
return Math.min(CHAT_SOUND_MAX, Math.max(CHAT_SOUND_MIN, x));
|
||||
}
|
||||
|
||||
export const EMOTES = ['thumbs', 'laugh', 'wow', 'sad', 'clap', 'nice', 'hurry', 'gg'] as const;
|
||||
export const EMOTE_LABEL: Record<(typeof EMOTES)[number], string> = {
|
||||
thumbs: '👍',
|
||||
@@ -83,6 +96,8 @@ export interface RoomView {
|
||||
lastShuffles?: number;
|
||||
/** Game speed set by the admin (1/16 ~ 16, 1 = normal): the screen's animations follow it. */
|
||||
gameSpeed?: number;
|
||||
/** Chat sound set by the admin (0~200, % of a game sound): the chat "뽁" follows it. */
|
||||
chatSound?: number;
|
||||
}
|
||||
|
||||
export interface GameResultView {
|
||||
|
||||
Reference in New Issue
Block a user