mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
zone background textures
This commit is contained in:
parent
af605ab1f8
commit
7c06d6d84f
8 changed files with 124 additions and 3 deletions
|
|
@ -48,6 +48,12 @@ TableZone::TableZone(Player *_p, QGraphicsItem *parent)
|
|||
<< QPoint(19, 0)
|
||||
<< QPoint(1, 0)
|
||||
<< QPoint(22, 0));
|
||||
QSettings settings;
|
||||
QString bgPath = settings.value("zonebg/table").toString();
|
||||
if (!bgPath.isEmpty())
|
||||
bgPixmap.load(bgPath);
|
||||
|
||||
setCacheMode(DeviceCoordinateCache);
|
||||
}
|
||||
|
||||
QRectF TableZone::boundingRect() const
|
||||
|
|
@ -57,7 +63,10 @@ QRectF TableZone::boundingRect() const
|
|||
|
||||
void TableZone::paint(QPainter *painter, const QStyleOptionGraphicsItem */*option*/, QWidget */*widget*/)
|
||||
{
|
||||
painter->fillRect(boundingRect(), QColor(0, 0, 100));
|
||||
if (bgPixmap.isNull())
|
||||
painter->fillRect(boundingRect(), QColor(0, 0, 100));
|
||||
else
|
||||
painter->fillRect(boundingRect(), QBrush(bgPixmap));
|
||||
}
|
||||
|
||||
void TableZone::addCardImpl(CardItem *card, int _x, int _y)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue