From 36677dc22c615520b69e242578aa0d7fe6381bd7 Mon Sep 17 00:00:00 2001 From: James Ketrenos Date: Sun, 30 Jan 2022 13:53:43 -0800 Subject: [PATCH] Message box is no longer a bunch of borken blocks Signed-off-by: James Ketrenos --- client/src/Board.js | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/client/src/Board.js b/client/src/Board.js index 7f05732..c56bd33 100755 --- a/client/src/Board.js +++ b/client/src/Board.js @@ -1315,51 +1315,55 @@ class Board extends React.Component { let message = [], key = 0; + const color = 'B'; + message=<>; + //message=<>{message}itallic; + // this.setState({ message: message}) if (this.state.pickName || !name) { - message.push((
Enter the name you would like to be known by, then press ENTER or select  SET.
)); + message = <>{message}Enter the name you would like to be known by, then press ENTER or select  SET.; } else { switch (this.game && this.game.state) { case 'lobby': - message.push((
You are in the lobby as {name}.
)); + message = <>{message}You are in the lobby as {name}.; if (!this.game.color) { - message.push((
You need to pick your color.
)); + message = <>{message}You need to pick your color.; } else { - message.push((
You have selected .
)); + message = <>{message}You have selected .; } - message.push((
You can chat with other players below.
)); + message = <>{message}You can chat with other players below.; if (this.game.active < 2) { - message.push((
Once there are two or more players, you can select START GAME.
)); + message = <>{message}Once there are two or more players, you can select START GAME.; } else { - message.push((
There are enough players to start the game. Select START GAME when ready.
)); + message = <>{message}There are enough players to start the game. Select START GAME when ready.; } break; case 'game-order': if (!player) { - message.push((
This game as an observer as  {name}.
)); - message.push((
You can chat with other players below as {this.game.name}, but cannot play unless players go back to the Lobby.
)); + message = <>{message}This game as an observer as  {name}.; + message = <>{message}You can chat with other players below as {this.game.name}, but cannot play unless players go back to the Lobby.; } else { if (!player.order) { - message.push((
You need to roll for game order. Click Roll Dice below.
)); + message = <>{message}You need to roll for game order. Click Roll Dice below.; } else { - message.push((
You rolled {player.order} for game order. Waiting for all players.
)); - message.push((

THIS IS THE END OF THE FUNCTIONALITY SO FAR
)); + message = <>{message}You rolled {player.order} for game order. Waiting for all players.; + message = <>{message}
THIS IS THE END OF THE FUNCTIONALITY SO FAR; } } break; case 'active': if (!player) { - message.push((
This game is no longer in the lobby.
TODO: Override game state to allow Lobby mode while in-game
)); + message = <>{message}This game is no longer in the lobby.
TODO: Override game state to allow Lobby mode while in-game; } else { - message.push((

THIS IS THE END OF THE FUNCTIONALITY SO FAR
)); + message = <>{message}
THIS IS THE END OF THE FUNCTIONALITY SO FAR; } break; case null: case undefined: case '': - message.push((
The game is in a wonky state. Sorry :(
)); + message = <>{message}The game is in a wonky state. Sorry :(; break; default: - message.push((
Game state is: {this.game.state}
)); + message = <>{message}Game state is: {this.game.state}; break; } }