Fix ready button state after game over

- Enable ready button in resetLobbyState() so players can ready up
- Remove redundant ready button state reset from endGame()
- Ensure ready button is enabled when returning to lobby

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-21 04:30:09 +00:00
parent 4d28189205
commit 7d385806df
2 changed files with 2 additions and 5 deletions
-4
View File
@@ -229,10 +229,6 @@ function endGame(states) {
network.isSpectator = false; network.isSpectator = false;
ui.hideSpectatorMode(); ui.hideSpectatorMode();
// Reset ready button state
ui.buttons.ready.textContent = 'READY';
ui.buttons.ready.disabled = true;
ui.showGameOver(winner, scores); ui.showGameOver(winner, scores);
} }
+2 -1
View File
@@ -81,13 +81,14 @@ class UIManager {
handleBackToLobby() { handleBackToLobby() {
this.hideGameOver(); this.hideGameOver();
this.resetLobbyState(); this.resetLobbyState();
this.buttons.ready.disabled = false;
this.showScreen('room'); this.showScreen('room');
} }
resetLobbyState() { resetLobbyState() {
// Reset ready button to default state // Reset ready button to default state
this.buttons.ready.textContent = 'READY'; this.buttons.ready.textContent = 'READY';
this.buttons.ready.disabled = true; this.buttons.ready.disabled = false;
// Clear player and spectator lists // Clear player and spectator lists
this.displays.playerList.innerHTML = ''; this.displays.playerList.innerHTML = '';