Fix: in-game mute button now mutes background music too
HUD mute is a master toggle (sound effects + music) via sound-store.toggleAll; icon reflects fully-muted state. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -53,7 +53,9 @@ export function GameTable({ onExit }: { onExit?: () => void } = {}) {
|
||||
const { t } = useI18n();
|
||||
|
||||
const sfx = useSoundStore((s) => s.sfx);
|
||||
const toggleSfx = useSoundStore((s) => s.toggleSfx);
|
||||
const music = useSoundStore((s) => s.music);
|
||||
const toggleAll = useSoundStore((s) => s.toggleAll);
|
||||
const muted = !sfx && !music;
|
||||
|
||||
const exit = onExit ?? reset;
|
||||
const { phase, players, hakem, trump, turn, currentTrick } = game;
|
||||
@@ -72,14 +74,14 @@ export function GameTable({ onExit }: { onExit?: () => void } = {}) {
|
||||
<div className="flex items-center gap-2">
|
||||
{trump && <TrumpBadge trump={trump} />}
|
||||
<button
|
||||
onClick={toggleSfx}
|
||||
onClick={toggleAll}
|
||||
className="glass rounded-full p-2.5 hover:bg-navy-800 transition"
|
||||
title={t("settings.sound")}
|
||||
title={t("settings.audio")}
|
||||
>
|
||||
{sfx ? (
|
||||
<Volume2 className="size-4 text-gold-400" />
|
||||
) : (
|
||||
{muted ? (
|
||||
<VolumeX className="size-4 text-cream/60" />
|
||||
) : (
|
||||
<Volume2 className="size-4 text-gold-400" />
|
||||
)}
|
||||
</button>
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user