Phase 2 client: N-player HUD, lobby room, and DTO fields

Server:
- PlayerStateDto: add SeatIndex, TeamIndex, IsEliminated
- GameStateDto: add SeatOrder, GameMode
- CreateCustomLobbyResponse / JoinCustomLobbyResponse: add MaxPlayers, GameMode, TeamCount
- GameEngine.ToDto(): populate new fields from GameState / PlayerState
- Handlers: return MaxPlayers, GameMode, TeamCount in lobby create/join ACKs

Client:
- GameScreen.tscn: add TurnOrderStrip HBoxContainer in TopBar
- game_screen.gd: show TurnOrderStrip for >2 player games; _rebuild_turn_order_strip()
  builds per-player chips sorted by seatIndex, highlighting active/eliminated players
- LobbyRoomScreen.tscn: add GameModeLabel, AdditionalPlayersContainer,
  unique_name on FirstTurnSection/FirstTurnBtns
- lobby_room_screen.gd: show game mode + player count; _rebuild_additional_players_panel()
  shows occupied seats and empty waiting slots; hide first-turn buttons for 3+ players;
  _on_guest_joined refreshes full display instead of only updating GuestNameLabel

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
dingo
2026-03-26 00:14:25 -04:00
co-authored by Claude Happy
parent f700fd5de6
commit 00bf788ac8
8 changed files with 190 additions and 26 deletions
+16 -5
View File
@@ -240,17 +240,23 @@ public sealed record GameForceConcedeResponse(GameStateDto State);
public sealed record CreateCustomLobbyResponse(
Guid LobbyId,
string LobbyName,
CustomRulesDto ActiveRules);
CustomRulesDto ActiveRules,
int MaxPlayers,
string GameMode,
int TeamCount);
public sealed record JoinCustomLobbyResponse(
Guid LobbyId,
string Status, // "WaitingForReady"
string Status, // "WaitingForReady" | "WaitingForPlayers"
CustomRulesDto ActiveRules,
Guid? GameSessionId, // always null; reserved for future use
Guid HostAccountId,
string HostDisplayName,
Guid GuestAccountId,
string GuestDisplayName);
string GuestDisplayName,
int MaxPlayers,
string GameMode,
int TeamCount);
public sealed record LeaveCustomLobbyResponse(Guid LobbyId);
@@ -515,7 +521,9 @@ public sealed record GameStateDto(
int TurnNumber,
int StateVersion, // monotonic; use for client mismatch detection
IEnumerable<PlayerStateDto> Players,
BoardDto? Board); // full board state including tile affinities
BoardDto? Board, // full board state including tile affinities
IEnumerable<string> SeatOrder, // account IDs in seat/turn order; empty = legacy 1v1
string GameMode); // "FFA" | "Teams" | "MultiTeam"
public sealed record PlayerStateDto(
Guid AccountId,
@@ -526,7 +534,10 @@ public sealed record PlayerStateDto(
IEnumerable<CardInstanceDto> Discard, // always visible
CardInstanceDto? ArchSpirit,
int CurrentSp,
int CurrentSt);
int CurrentSt,
int SeatIndex, // 0-based turn order position
int TeamIndex, // same value = allies; FFA = SeatIndex
bool IsEliminated); // true when ArchSpirit has been destroyed
public sealed record CardInstanceDto(
string InstanceId,