Private
Public Access
1
0

add overlay && game do not start until the opponent came

This commit is contained in:
2016-11-01 08:31:13 +01:00
parent 23d334ab27
commit a566ba8cf8
3 changed files with 69 additions and 1 deletions

View File

@@ -20,6 +20,9 @@ class GridControl extends React.Component {
bombFieldCache: [],
foundUserMineCache: 0,
playBomb: false,
overlay: false,
overlayTitle: "",
overlaySubTitle: "",
sound: {
click: click,
bomb: bomb,
@@ -366,6 +369,14 @@ class GridControl extends React.Component {
}
}
overlayClass() {
return 'game-overlay' + (
this.state.overlay
? ''
: ' hide'
);
}
render() {
var grid = [];
@@ -386,6 +397,12 @@ class GridControl extends React.Component {
return (
<div className="game-wrapper">
<div className={this.overlayClass()}>
<div className="game-overlay-window">
<h1>{this.state.overlayTitle}</h1>
<h2>{this.state.overlaySubTitle}</h2>
</div>
</div>
<UserControl ref="userControl"
bombClear={this.bombClear.bind(this)}/>
<div className="grid"> {grid} </div>