mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 17:14:52 -07:00
Multiple background images on all zones (#4144)
This commit is contained in:
parent
e10446f5b8
commit
1a94261490
6 changed files with 84 additions and 5 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue