mirror of
https://github.com/AndrioCelos/TableturfBattleApp.git
synced 2026-10-26 03:21:55 -05:00
UI adjustments
This commit is contained in:
@@ -33,6 +33,7 @@ function onGameStateChange(game: any, playerData: any) {
|
||||
switch (game.state) {
|
||||
case GameState.WaitingForPlayers:
|
||||
showSection('lobby');
|
||||
document.getElementById('lobbyStageSection')!.hidden = !playerData || game.players[playerData.playerIndex]?.isReady;
|
||||
break;
|
||||
case GameState.Preparing:
|
||||
showSection('deck');
|
||||
@@ -154,6 +155,10 @@ function setupWebSocket(gameID: string, myPlayerIndex: number | null) {
|
||||
currentGame.players[payload.data.playerIndex].isReady = true;
|
||||
updatePlayerListItem(payload.data.playerIndex);
|
||||
|
||||
if (payload.data.playerIndex == currentGame.me?.playerIndex) {
|
||||
document.getElementById('lobbyStageSection')!.hidden = true;
|
||||
}
|
||||
|
||||
if (playContainers[payload.data.playerIndex].getElementsByTagName('div').length == 0) {
|
||||
showReady(payload.data.playerIndex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user