diff --git a/apps/web/src/arcade-games/rithmomachia/components/RithmomachiaGame.tsx b/apps/web/src/arcade-games/rithmomachia/components/RithmomachiaGame.tsx index 1ab66d23..01c40e22 100644 --- a/apps/web/src/arcade-games/rithmomachia/components/RithmomachiaGame.tsx +++ b/apps/web/src/arcade-games/rithmomachia/components/RithmomachiaGame.tsx @@ -8,7 +8,6 @@ import { PageWithNav } from '@/components/PageWithNav' import { StandardGameLayout } from '@/components/StandardGameLayout' import { Z_INDEX } from '@/constants/zIndex' import { useGameMode } from '@/contexts/GameModeContext' -import type { Player } from '@/contexts/GameModeContext' import { useFullscreen } from '@/contexts/FullscreenContext' import { css } from '../../../../styled-system/css' import { useRithmomachia } from '../Provider' @@ -199,7 +198,6 @@ export function RithmomachiaGame() { function RosterStatusNotice({ phase }: { phase: 'setup' | 'playing' }) { const { rosterStatus, whitePlayerId, blackPlayerId } = useRithmomachia() const { players: playerMap, activePlayers: activePlayerIds, addPlayer, setActive } = useGameMode() - const [showManager, setShowManager] = useState(false) const playersArray = useMemo(() => { const list = Array.from(playerMap.values()) @@ -220,16 +218,6 @@ function RosterStatusNotice({ phase }: { phase: 'setup' | 'playing' }) { }) }, [playerMap]) - const activePlayerNames = useMemo( - () => - playersArray - .filter((player) => activePlayerIds.has(player.id)) - .map((player) => - `${player.emoji} ${player.name}${player.isLocal === false ? ' (remote)' : ''}` - ), - [playersArray, activePlayerIds] - ) - const inactiveLocalPlayer = useMemo( () => playersArray.find( @@ -303,14 +291,14 @@ function RosterStatusNotice({ phase }: { phase: 'setup' | 'playing' }) { switch (rosterStatus.status) { case 'tooFew': return phase === 'setup' - ? 'Rithmomachia needs exactly two active players before the match can begin. Activate or add another player to continue.' - : 'Gameplay is paused until two players are active. Activate or add another player to resume the match.' + ? 'Rithmomachia needs exactly two active players before the match can begin. Use the roster controls in the game nav to activate or add another player.' + : 'Gameplay is paused until two players are active. Use the roster controls in the game nav to activate or add another player and resume the match.' case 'tooMany': - return 'Rithmomachia supports only two active players. Deactivate extra players so each color has exactly one seat.' + return 'Rithmomachia supports only two active players. Use the game nav roster to deactivate extras so each color has exactly one seat.' case 'noLocalControl': return phase === 'setup' - ? 'All active seats belong to other devices. Activate a local player to control a side before starting.' - : 'All active seats belong to other devices. Activate a local player if you want to make moves from this computer.' + ? 'All active seats belong to other devices. Activate a local player from the game nav if you want to start from this computer.' + : 'All active seats belong to other devices. Activate a local player in the game nav if you want to make moves from this computer.' default: return '' } @@ -320,212 +308,48 @@ function RosterStatusNotice({ phase }: { phase: 'setup' | 'playing' }) { return null } - const details: string[] = [] - if (activePlayerNames.length > 0) { - details.push(`Active seats: ${activePlayerNames.join(', ')}`) - } else { - details.push('No players are currently marked active.') - } - - return ( - <> -
-
-

{heading}

-

{description}

- {details.map((detail) => ( -

- {detail} -

- ))} -
-
- {quickFix && ( - - )} - -
-
- {showManager && ( - addPlayer({ isActive: true })} - /> - )} - - ) -} - -function InlinePlayerManager({ - players, - activePlayerIds, - onToggleActive, - onAddPlayer, -}: { - players: Player[] - activePlayerIds: Set - onToggleActive: (playerId: string, active: boolean) => void - onAddPlayer: () => void -}) { return (
-
-

- Player seats -

+
+

{heading}

+

{description}

+
+ {quickFix && ( -
-
    - {players.map((player) => { - const isActive = activePlayerIds.has(player.id) - const isLocal = player.isLocal !== false - - return ( -
  • -
    - - {player.emoji} {player.name} - - - {isLocal ? 'Local player' : 'Remote player'} - -
    - -
  • - ) - })} -
+ )}
) }