Message box is no longer a bunch of borken blocks
Signed-off-by: James Ketrenos <james_eikona@ketrenos.com>
This commit is contained in:
parent
4fd17cc130
commit
36677dc22c
@ -1315,51 +1315,55 @@ class Board extends React.Component {
|
|||||||
|
|
||||||
let message = [],
|
let message = [],
|
||||||
key = 0;
|
key = 0;
|
||||||
|
const color = 'B';
|
||||||
|
message=<></>;
|
||||||
|
//message=<>{message}<i>itallic</i></>;
|
||||||
|
// this.setState({ message: message})
|
||||||
if (this.state.pickName || !name) {
|
if (this.state.pickName || !name) {
|
||||||
message.push((<div key={'message-'+(++key)}>Enter the name you would like to be known by, then press <b>ENTER</b> or select <b>SET</b>.</div>));
|
message = <>{message}Enter the name you would like to be known by, then press <b>ENTER</b> or select <b>SET</b>.</>;
|
||||||
} else {
|
} else {
|
||||||
switch (this.game && this.game.state) {
|
switch (this.game && this.game.state) {
|
||||||
case 'lobby':
|
case 'lobby':
|
||||||
message.push((<div key={'message-'+(++key)}>You are in the lobby as <b>{name}</b>.</div>));
|
message = <>{message}You are in the lobby as <b>{name}</b>.</>;
|
||||||
if (!this.game.color) {
|
if (!this.game.color) {
|
||||||
message.push((<div key={'message-'+(++key)}>You need to pick your color.</div>));
|
message = <>{message}You need to pick your color.</>;
|
||||||
} else {
|
} else {
|
||||||
message.push((<div key={'message-'+(++key)}>You have selected <PlayerColor color={this.game.color}/>.</div>));
|
message = <>{message}You have selected <PlayerColor color={this.game.color}/>.</>;
|
||||||
}
|
}
|
||||||
message.push((<div key={'message-'+(++key)}>You can chat with other players below.</div>));
|
message = <>{message}You can chat with other players below.</>;
|
||||||
if (this.game.active < 2) {
|
if (this.game.active < 2) {
|
||||||
message.push((<div key={'message-'+(++key)}>Once there are two or more players, you can select <b>START GAME</b>.</div>));
|
message = <>{message}Once there are two or more players, you can select <b>START GAME</b>.</>;
|
||||||
} else {
|
} else {
|
||||||
message.push((<div key={'message-'+(++key)}>There are enough players to start the game. Select <b>START GAME</b> when ready.</div>));
|
message = <>{message}There are enough players to start the game. Select <b>START GAME</b> when ready.</>;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'game-order':
|
case 'game-order':
|
||||||
if (!player) {
|
if (!player) {
|
||||||
message.push((<div key={'message-'+(++key)}>This game as an observer as <b>{name}</b>.</div>));
|
message = <>{message}This game as an observer as <b>{name}</b>.</>;
|
||||||
message.push((<div key={'message-'+(++key)}>You can chat with other players below as <b>{this.game.name}</b>, but cannot play unless players go back to the Lobby.</div>));
|
message = <>{message}You can chat with other players below as <b>{this.game.name}</b>, but cannot play unless players go back to the Lobby.</>;
|
||||||
} else {
|
} else {
|
||||||
if (!player.order) {
|
if (!player.order) {
|
||||||
message.push((<div key={'message-'+(++key)}>You need to roll for game order. Click <b>Roll Dice</b> below.</div>));
|
message = <>{message}You need to roll for game order. Click <b>Roll Dice</b> below.</>;
|
||||||
} else {
|
} else {
|
||||||
message.push((<div key={'message-'+(++key)}>You rolled <b>{player.order}</b> for game order. Waiting for all players.</div>));
|
message = <>{message}You rolled <b>{player.order}</b> for game order. Waiting for all players.</>;
|
||||||
message.push((<div key={'message-'+(++key)}><br/><b>THIS IS THE END OF THE FUNCTIONALITY SO FAR</b></div>));
|
message = <>{message}<br/><b>THIS IS THE END OF THE FUNCTIONALITY SO FAR</b></>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'active':
|
case 'active':
|
||||||
if (!player) {
|
if (!player) {
|
||||||
message.push((<div key={'message-'+(++key)}>This game is no longer in the lobby.<br/><b>TODO: Override game state to allow Lobby mode while in-game</b></div>));
|
message = <>{message}This game is no longer in the lobby.<br/><b>TODO: Override game state to allow Lobby mode while in-game</b></>;
|
||||||
} else {
|
} else {
|
||||||
message.push((<div key={'message-'+(++key)}><br/><b>THIS IS THE END OF THE FUNCTIONALITY SO FAR</b></div>));
|
message = <>{message}<br/><b>THIS IS THE END OF THE FUNCTIONALITY SO FAR</b></>;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case null:
|
case null:
|
||||||
case undefined:
|
case undefined:
|
||||||
case '':
|
case '':
|
||||||
message.push((<div key={'message-'+(++key)}>The game is in a wonky state. Sorry :(</div>));
|
message = <>{message}The game is in a wonky state. Sorry :(</>;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
message.push((<div key={'message-'+(++key)}>Game state is: {this.game.state}</div>));
|
message = <>{message}Game state is: {this.game.state}</>;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user