Multiple background images on all zones (#4144)

This commit is contained in:
fdipilla 2020-10-23 16:36:02 -03:00 committed by GitHub
parent e10446f5b8
commit 1a94261490
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 84 additions and 5 deletions

View file

@ -83,7 +83,13 @@ void PlayerArea::updateBg()
void PlayerArea::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*option*/, QWidget * /*widget*/)
{
painter->fillRect(bRect, themeManager->getPlayerBgBrush());
QBrush brush = themeManager->getPlayerBgBrush();
if (playerZoneId > 0) {
// If the extra image is not found, load the default one
brush = themeManager->getExtraPlayerBgBrush(QString::number(playerZoneId), brush);
}
painter->fillRect(boundingRect(), brush);
}
void PlayerArea::setSize(qreal width, qreal height)
@ -92,6 +98,11 @@ void PlayerArea::setSize(qreal width, qreal height)
bRect = QRectF(0, 0, width, height);
}
void PlayerArea::setPlayerZoneId(int _playerZoneId)
{
playerZoneId = _playerZoneId;
}
Player::Player(const ServerInfo_User &info, int _id, bool _local, bool _judge, TabGame *_parent)
: QObject(_parent), game(_parent), shortcutsActive(false), defaultNumberTopCards(1),
defaultNumberTopCardsToPlaceBelow(1), lastTokenDestroy(true), lastTokenTableRow(0), id(_id), active(false),
@ -3266,6 +3277,7 @@ void Player::setConceded(bool _conceded)
void Player::setZoneId(int _zoneId)
{
zoneId = _zoneId;
playerArea->setPlayerZoneId(_zoneId);
}
void Player::setMirrored(bool _mirrored)