From edc060c00aafaa83c5bda10d85d56e9b45045692 Mon Sep 17 00:00:00 2001 From: Songyi Huang Date: Sun, 25 Apr 2021 16:08:50 -0700 Subject: [PATCH] adding select role interface for pve demo; fix bugs --- src/assets/doudizhu.scss | 19 ++- src/components/GameBoard/DoudizhuGameBoard.js | 148 +++++++++++++----- src/view/PvEView/PvEDoudizhuDemoView.js | 123 ++++++++++----- 3 files changed, 205 insertions(+), 85 deletions(-) diff --git a/src/assets/doudizhu.scss b/src/assets/doudizhu.scss index 4adb9c4..ca8c9e3 100644 --- a/src/assets/doudizhu.scss +++ b/src/assets/doudizhu.scss @@ -3,12 +3,21 @@ .doudizhu-wrapper { width: 100%; height: 100%; - //background-color: #C3CDFF; - background-image: url("./images/gameboard.png"); - background-repeat: no-repeat; - background-size: 100% 125%; - background-position: bottom; position: relative; + + #gameboard-background { + width: 100%; + height: 100%; + background-image: url("./images/gameboard.png"); + background-repeat: no-repeat; + background-size: 100% 125%; + background-position: bottom; + + &.blur-background { + filter: blur(3px); + pointer-events: none; + } + } .played-card-area { font-size: 12px; diff --git a/src/components/GameBoard/DoudizhuGameBoard.js b/src/components/GameBoard/DoudizhuGameBoard.js index d0e275d..5634b8f 100644 --- a/src/components/GameBoard/DoudizhuGameBoard.js +++ b/src/components/GameBoard/DoudizhuGameBoard.js @@ -1,6 +1,7 @@ import Avatar from '@material-ui/core/Avatar'; import Button from '@material-ui/core/Button'; import Chip from '@material-ui/core/Chip'; +import { Layout } from 'element-react'; import React from 'react'; import '../../assets/doudizhu.scss'; import Landlord_wName from '../../assets/images/Portrait/Landlord_wName.png'; @@ -14,19 +15,19 @@ class DoudizhuGameBoard extends React.Component { return this.props.playerInfo[playerIdx].role === 'landlord' ? (
{'Landlord'} - ID} label={playerId} clickable color="primary" /> + ID} label={playerId} color="primary" />
) : (
{'Peasant'} - ID} label={playerId} clickable color="primary" /> + ID} label={playerId} color="primary" />
); } else return (
{'Player'} - ID} label={playerId} clickable color="primary" /> + ID} label={playerId} color="primary" />
); } @@ -90,7 +91,11 @@ class DoudizhuGameBoard extends React.Component { const [rankClass, suitClass, rankText, suitText] = translateCardData(card); return (
  • -
  • -