diff --git a/src/components/GameTable.tsx b/src/components/GameTable.tsx index d1805a6..b80b451 100644 --- a/src/components/GameTable.tsx +++ b/src/components/GameTable.tsx @@ -88,8 +88,8 @@ export function GameTable({ if (el && (el.tagName === "INPUT" || el.tagName === "TEXTAREA" || el.isContentEditable)) return; const k = e.key.toLowerCase(); - // Hakem choosing trump: 1–4 pick a suit. - if (phase === "choosing-trump" && players[hakem!]?.isHuman) { + // Hakem choosing trump: 1–4 pick a suit. Only the hakem (you = local seat 0). + if (phase === "choosing-trump" && hakem === 0) { const idx = "1234".indexOf(e.key); if (idx >= 0) { e.preventDefault(); chooseTrump(SUITS[idx]); return; } } @@ -220,9 +220,13 @@ export function GameTable({ {/* Overlays */} {phase === "selecting-hakem" && } - {phase === "choosing-trump" && players[hakem!]?.isHuman && ( + {/* Only the hakem (you) picks the trump; everyone else waits. */} + {phase === "choosing-trump" && hakem === 0 && ( )} + {phase === "choosing-trump" && hakem !== 0 && hakem != null && ( + + )} {phase === "round-over" && } {phase === "match-over" && mode === "ai" && ( @@ -972,6 +976,40 @@ function TrumpChooser() { ); } +/** Shown to everyone EXCEPT the hakem while they pick the trump. */ +function TrumpWaiting({ name }: { name: string }) { + const { t } = useI18n(); + return ( + + + + 👑 + +

{t("trump.title")}

+

{t("trump.waiting", { name })}

+
+ {[0, 1, 2].map((i) => ( + + ))} +
+
+
+ ); +} + const CONFETTI_SPECS = Array.from({ length: 22 }, (_, i) => ({ id: i, left: 4 + ((i * 4.3) % 92),