Recolour some UI elements to match the player's ink

This commit is contained in:
Andrio Celos
2022-10-28 15:05:50 +11:00
parent 391b11a386
commit fc41531398
5 changed files with 48 additions and 15 deletions

View File

@@ -5,6 +5,7 @@ interface Player {
colour: Colour;
specialColour: Colour;
specialAccentColour: Colour;
uiBaseColourIsSpecialColour?: boolean;
totalSpecialPoints: number;
passes: number;
}

View File

@@ -69,7 +69,7 @@ function clearUrlFromGame() {
location.hash = '';
}
function onGameStateChange(game: any, playerData: any) {
function onGameStateChange(game: any, playerData: PlayerData | null) {
if (currentGame == null)
throw new Error('currentGame is null');
clearPlayContainers();
@@ -78,6 +78,9 @@ function onGameStateChange(game: any, playerData: any) {
board.refresh();
}
loadPlayers(game.players);
gamePage.dataset.myPlayerIndex = playerData ? playerData.playerIndex.toString() : '';
gamePage.dataset.uiBaseColourIsSpecialColour = playerData && game.players[playerData.playerIndex].uiBaseColourIsSpecialColour ? 'true' : 'false';
redrawModal.hidden = true;
gamePage.classList.remove('gameEnded');
switch (game.state) {