minor reveal fix
This commit is contained in:
parent
509d540167
commit
72223b3229
5 changed files with 13 additions and 10 deletions
|
@ -82,7 +82,7 @@ void GameScene::toggleZoneView(Player *player, const QString &zoneName, int numb
|
|||
}
|
||||
}
|
||||
|
||||
ZoneViewWidget *item = new ZoneViewWidget(player, player->getZones().value(zoneName), numberCards);
|
||||
ZoneViewWidget *item = new ZoneViewWidget(player, player->getZones().value(zoneName), numberCards, false);
|
||||
views.append(item);
|
||||
connect(item, SIGNAL(closePressed(ZoneViewWidget *)), this, SLOT(removeZoneView(ZoneViewWidget *)));
|
||||
addItem(item);
|
||||
|
@ -91,7 +91,7 @@ void GameScene::toggleZoneView(Player *player, const QString &zoneName, int numb
|
|||
|
||||
void GameScene::addRevealedZoneView(Player *player, CardZone *zone, const QList<ServerInfo_Card *> &cardList)
|
||||
{
|
||||
ZoneViewWidget *item = new ZoneViewWidget(player, zone, -2, cardList);
|
||||
ZoneViewWidget *item = new ZoneViewWidget(player, zone, -2, true, cardList);
|
||||
views.append(item);
|
||||
connect(item, SIGNAL(closePressed(ZoneViewWidget *)), this, SLOT(removeZoneView(ZoneViewWidget *)));
|
||||
addItem(item);
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include "protocol_items.h"
|
||||
#include "settingscache.h"
|
||||
|
||||
ZoneViewWidget::ZoneViewWidget(Player *_player, CardZone *_origZone, int numberCards, const QList<ServerInfo_Card *> &cardList)
|
||||
ZoneViewWidget::ZoneViewWidget(Player *_player, CardZone *_origZone, int numberCards, bool _revealZone, const QList<ServerInfo_Card *> &cardList)
|
||||
: QGraphicsWidget(0, Qt::Tool | Qt::CustomizeWindowHint | Qt::WindowSystemMenuHint | Qt::WindowTitleHint/* | Qt::WindowCloseButtonHint*/), player(_player)
|
||||
{
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
@ -48,7 +48,7 @@ ZoneViewWidget::ZoneViewWidget(Player *_player, CardZone *_origZone, int numberC
|
|||
extraHeight = vbox->sizeHint(Qt::PreferredSize).height();
|
||||
resize(150, 150);
|
||||
|
||||
zone = new ZoneViewZone(player, _origZone, numberCards, this);
|
||||
zone = new ZoneViewZone(player, _origZone, numberCards, _revealZone, this);
|
||||
connect(zone, SIGNAL(optimumRectChanged()), this, SLOT(resizeToZoneContents()));
|
||||
connect(zone, SIGNAL(beingDeleted()), this, SLOT(zoneDeleted()));
|
||||
vbox->addItem(zone);
|
||||
|
|
|
@ -30,7 +30,7 @@ private slots:
|
|||
void resizeToZoneContents();
|
||||
void zoneDeleted();
|
||||
public:
|
||||
ZoneViewWidget(Player *_player, CardZone *_origZone, int numberCards = 0, const QList<ServerInfo_Card *> &cardList = QList<ServerInfo_Card *>());
|
||||
ZoneViewWidget(Player *_player, CardZone *_origZone, int numberCards = 0, bool _revealZone = false, const QList<ServerInfo_Card *> &cardList = QList<ServerInfo_Card *>());
|
||||
ZoneViewZone *getZone() const { return zone; }
|
||||
void retranslateUi();
|
||||
protected:
|
||||
|
|
|
@ -5,9 +5,10 @@
|
|||
#include "protocol_items.h"
|
||||
#include "carddragitem.h"
|
||||
|
||||
ZoneViewZone::ZoneViewZone(Player *_p, CardZone *_origZone, int _numberCards, QGraphicsItem *parent)
|
||||
: SelectZone(_p, _origZone->getName(), false, false, true, parent, true), bRect(QRectF()), minRows(0), numberCards(_numberCards), origZone(_origZone), sortByName(false), sortByType(false)
|
||||
ZoneViewZone::ZoneViewZone(Player *_p, CardZone *_origZone, int _numberCards, bool _revealZone, QGraphicsItem *parent)
|
||||
: SelectZone(_p, _origZone->getName(), false, false, true, parent, true), bRect(QRectF()), minRows(0), numberCards(_numberCards), origZone(_origZone), revealZone(_revealZone), sortByName(false), sortByType(false)
|
||||
{
|
||||
if (!revealZone)
|
||||
origZone->setView(this);
|
||||
}
|
||||
|
||||
|
@ -15,6 +16,7 @@ ZoneViewZone::~ZoneViewZone()
|
|||
{
|
||||
emit beingDeleted();
|
||||
qDebug("ZoneViewZone destructor");
|
||||
if (!revealZone)
|
||||
origZone->setView(NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -15,9 +15,10 @@ private:
|
|||
int minRows, numberCards;
|
||||
void handleDropEvent(CardDragItem *dragItem, CardZone *startZone, const QPoint &dropPoint, bool faceDown);
|
||||
CardZone *origZone;
|
||||
bool revealZone;
|
||||
bool sortByName, sortByType;
|
||||
public:
|
||||
ZoneViewZone(Player *_p, CardZone *_origZone, int _numberCards = -1, QGraphicsItem *parent = 0);
|
||||
ZoneViewZone(Player *_p, CardZone *_origZone, int _numberCards = -1, bool _revealZone = false, QGraphicsItem *parent = 0);
|
||||
~ZoneViewZone();
|
||||
QRectF boundingRect() const;
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
|
|
Loading…
Reference in a new issue