more beautiful arrows; fixed server bug regarding facedown cards

This commit is contained in:
Max-Wilhelm Bruker 2010-02-24 14:43:18 +01:00
parent 2d57715a6e
commit 89fe7d2d69
4 changed files with 42 additions and 11 deletions

View file

@ -11,7 +11,7 @@
#include "protocol_datastructures.h"
CardItem::CardItem(Player *_owner, const QString &_name, int _cardid, QGraphicsItem *parent)
: AbstractCardItem(_name, parent), owner(_owner), id(_cardid), attacking(false), facedown(false), counters(0), doesntUntap(false), dragItem(NULL)
: AbstractCardItem(_name, parent), owner(_owner), id(_cardid), attacking(false), facedown(false), counters(0), doesntUntap(false), beingPointedAt(false), dragItem(NULL)
{
owner->addCard(this);
}
@ -27,6 +27,8 @@ void CardItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
AbstractCardItem::paint(painter, option, widget);
if (counters)
paintNumberEllipse(counters, painter);
if (beingPointedAt)
painter->fillRect(boundingRect(), QBrush(QColor(255, 0, 0, 100)));
painter->restore();
}
@ -61,6 +63,12 @@ void CardItem::setDoesntUntap(bool _doesntUntap)
doesntUntap = _doesntUntap;
}
void CardItem::setBeingPointedAt(bool _beingPointedAt)
{
beingPointedAt = _beingPointedAt;
update();
}
void CardItem::resetState()
{
attacking = false;