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:
@@ -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
@@ -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 = '';
|
||||||
|
|||||||
Reference in New Issue
Block a user