change play replay button; disable possibility area for doudizhu

This commit is contained in:
Songyi Huang 2020-07-20 22:15:22 -07:00
parent 42012ba578
commit 2a045c3fb2
2 changed files with 3 additions and 1 deletions

View File

@ -280,6 +280,7 @@ class DoudizhuGameView extends React.Component {
} }
computeProbabilityItem(idx){ computeProbabilityItem(idx){
return <span className={"waiting"}>Currently Unavailable...</span>
if(this.state.gameInfo.gameStatus !== "ready" && this.state.gameInfo.turn < this.moveHistory.length){ if(this.state.gameInfo.gameStatus !== "ready" && this.state.gameInfo.turn < this.moveHistory.length){
let style = {}; let style = {};
style["backgroundColor"] = this.moveHistory[this.state.gameInfo.turn].probabilities.length > idx ? `rgba(63, 81, 181, ${this.moveHistory[this.state.gameInfo.turn].probabilities[idx].probability})` : "#bdbdbd"; style["backgroundColor"] = this.moveHistory[this.state.gameInfo.turn].probabilities.length > idx ? `rgba(63, 81, 181, ${this.moveHistory[this.state.gameInfo.turn].probabilities[idx].probability})` : "#bdbdbd";

View File

@ -18,6 +18,7 @@ import axios from 'axios';
import TablePagination from "@material-ui/core/TablePagination"; import TablePagination from "@material-ui/core/TablePagination";
import Breadcrumbs from "@material-ui/core/Breadcrumbs"; import Breadcrumbs from "@material-ui/core/Breadcrumbs";
import withStyles from "@material-ui/core/styles/withStyles"; import withStyles from "@material-ui/core/styles/withStyles";
import PlayCircleOutlineIcon from '@material-ui/icons/PlayCircleOutline';
const gameList = [ const gameList = [
{game: 'leduc-holdem', dispName: 'Leduc Hold\'em'}, {game: 'leduc-holdem', dispName: 'Leduc Hold\'em'},
@ -263,7 +264,7 @@ const EnhancedTable = (props) => {
<TableCell>{row.agent1}</TableCell> <TableCell>{row.agent1}</TableCell>
<TableCell>{row.win}</TableCell> <TableCell>{row.win}</TableCell>
<TableCell>{row.payoff}</TableCell> <TableCell>{row.payoff}</TableCell>
<TableCell><a style={{display: "table-cell"}} href={row.replayUrl} target="_blank">Replay</a></TableCell> <TableCell><a style={{display: "table-cell"}} href={row.replayUrl} target="_blank"><PlayCircleOutlineIcon style={{verticalAlign: "middle"}}/></a></TableCell>
</TableRow> </TableRow>
); );
})} })}