add overlay && game do not start until the opponent came
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user