create first working communication
This commit is contained in:
@@ -9,6 +9,7 @@ class User extends React.Component {
|
||||
active: props.active,
|
||||
color: props.color === 'blue' ? 1 : 0,
|
||||
mines: 0,
|
||||
srcRoot: '/bundles/mineseeker/images/',
|
||||
haveBomb: true,
|
||||
enabledBomb: true
|
||||
};
|
||||
@@ -19,27 +20,27 @@ class User extends React.Component {
|
||||
}
|
||||
|
||||
getSrc(color) {
|
||||
return 'bundles/mineseeker/images/bg-flag-' + color + '-outbg.png';
|
||||
return this.state.srcRoot + 'bg-flag-' + color + '-outbg.png';
|
||||
}
|
||||
|
||||
getBomb() {
|
||||
if (this.state.haveBomb) {
|
||||
if (this.state.enabledBomb && this.state.active) {
|
||||
return 'bundles/mineseeker/images/bg-bomb-outbg.png';
|
||||
return this.state.srcRoot + 'bg-bomb-outbg.png';
|
||||
} else {
|
||||
return 'bundles/mineseeker/images/bg-bomb-disabled-outbg.png';
|
||||
return this.state.srcRoot + 'bg-bomb-disabled-outbg.png';
|
||||
}
|
||||
} else {
|
||||
return 'bundles/mineseeker/images/bg-bomb-exploded-outbg.png';
|
||||
return this.state.srcRoot + 'bg-bomb-exploded-outbg.png';
|
||||
}
|
||||
}
|
||||
|
||||
getFigure(color) {
|
||||
return 'bundles/mineseeker/images/bg-figure-' + color + '-outbg.png';
|
||||
return this.state.srcRoot + 'bg-figure-' + color + '-outbg.png';
|
||||
}
|
||||
|
||||
getCursor(state, color) {
|
||||
var cursorImg = 'bundles/mineseeker/images/bg-cursor-' + color + '-outbg.png';
|
||||
var cursorImg = this.state.srcRoot + 'bg-cursor-' + color + '-outbg.png';
|
||||
|
||||
return state
|
||||
? <img src={cursorImg} alt="cursor" className="user-cursor"/>
|
||||
|
||||
Reference in New Issue
Block a user