Merge branch 'experimental' of git://cockatrice.git.sourceforge.net/gitroot/cockatrice/cockatrice
This commit is contained in:
commit
60722e6e47
16 changed files with 897 additions and 784 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
#!/usr/bin/env xdg-open
|
||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Version=1.0
|
Version=1.0
|
||||||
Type=Application
|
Type=Application
|
||||||
|
|
|
@ -82,9 +82,8 @@ void AbstractCardItem::transformPainter(QPainter *painter, const QSizeF &transla
|
||||||
painter->setFont(f);
|
painter->setFont(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractCardItem::paintPicture(QPainter *painter, int angle)
|
void AbstractCardItem::paintPicture(QPainter *painter, const QSizeF &translatedSize, int angle)
|
||||||
{
|
{
|
||||||
QSizeF translatedSize = getTranslatedSize(painter);
|
|
||||||
QRectF totalBoundingRect = painter->combinedTransform().mapRect(boundingRect());
|
QRectF totalBoundingRect = painter->combinedTransform().mapRect(boundingRect());
|
||||||
qreal scaleFactor = translatedSize.width() / boundingRect().width();
|
qreal scaleFactor = translatedSize.width() / boundingRect().width();
|
||||||
|
|
||||||
|
@ -143,15 +142,20 @@ void AbstractCardItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *
|
||||||
{
|
{
|
||||||
painter->save();
|
painter->save();
|
||||||
|
|
||||||
paintPicture(painter, tapAngle);
|
QSizeF translatedSize = getTranslatedSize(painter);
|
||||||
|
paintPicture(painter, translatedSize, tapAngle);
|
||||||
|
|
||||||
|
painter->save();
|
||||||
|
painter->setRenderHint(QPainter::Antialiasing, false);
|
||||||
|
transformPainter(painter, translatedSize, tapAngle);
|
||||||
if (isSelected()) {
|
if (isSelected()) {
|
||||||
painter->setPen(Qt::red);
|
painter->setPen(Qt::red);
|
||||||
painter->drawRect(QRectF(0.5, 0.5, CARD_WIDTH - 1, CARD_HEIGHT - 1));
|
painter->drawRect(QRectF(0.5, 0.5, translatedSize.width() - 1, translatedSize.height() - 1));
|
||||||
} else if (isHovered) {
|
} else if (isHovered) {
|
||||||
painter->setPen(Qt::yellow);
|
painter->setPen(Qt::yellow);
|
||||||
painter->drawRect(QRectF(0.5, 0.5, CARD_WIDTH - 1, CARD_HEIGHT - 1));
|
painter->drawRect(QRectF(0.5, 0.5, translatedSize.width() - 1, translatedSize.height() - 1));
|
||||||
}
|
}
|
||||||
|
painter->restore();
|
||||||
|
|
||||||
painter->restore();
|
painter->restore();
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,8 @@ public:
|
||||||
AbstractCardItem(const QString &_name = QString(), Player *_owner = 0, QGraphicsItem *parent = 0);
|
AbstractCardItem(const QString &_name = QString(), Player *_owner = 0, QGraphicsItem *parent = 0);
|
||||||
~AbstractCardItem();
|
~AbstractCardItem();
|
||||||
QRectF boundingRect() const;
|
QRectF boundingRect() const;
|
||||||
void paintPicture(QPainter *painter, int angle);
|
QSizeF getTranslatedSize(QPainter *painter) const;
|
||||||
|
void paintPicture(QPainter *painter, const QSizeF &translatedSize, int angle);
|
||||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||||
CardInfo *getInfo() const { return info; }
|
CardInfo *getInfo() const { return info; }
|
||||||
QString getName() const { return name; }
|
QString getName() const { return name; }
|
||||||
|
@ -52,7 +53,6 @@ public:
|
||||||
void processHoverEvent();
|
void processHoverEvent();
|
||||||
void deleteCardInfoPopup() { emit deleteCardInfoPopup(name); }
|
void deleteCardInfoPopup() { emit deleteCardInfoPopup(name); }
|
||||||
protected:
|
protected:
|
||||||
QSizeF getTranslatedSize(QPainter *painter) const;
|
|
||||||
void transformPainter(QPainter *painter, const QSizeF &translatedSize, int angle);
|
void transformPainter(QPainter *painter, const QSizeF &translatedSize, int angle);
|
||||||
void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
||||||
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
|
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include "cardzone.h"
|
#include "cardzone.h"
|
||||||
#include "tablezone.h"
|
#include "tablezone.h"
|
||||||
#include "zoneviewzone.h"
|
#include "zoneviewzone.h"
|
||||||
#include <QGraphicsScene>
|
#include "gamescene.h"
|
||||||
#include <QGraphicsSceneMouseEvent>
|
#include <QGraphicsSceneMouseEvent>
|
||||||
#include <QCursor>
|
#include <QCursor>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
@ -22,7 +22,7 @@ void CardDragItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti
|
||||||
|
|
||||||
void CardDragItem::updatePosition(const QPointF &cursorScenePos)
|
void CardDragItem::updatePosition(const QPointF &cursorScenePos)
|
||||||
{
|
{
|
||||||
QList<QGraphicsItem *> colliding = scene()->items(cursorScenePos);
|
QList<QGraphicsItem *> colliding = scene()->items(cursorScenePos, Qt::IntersectsItemBoundingRect, Qt::DescendingOrder, static_cast<GameScene *>(scene())->getViewTransform());
|
||||||
|
|
||||||
CardZone *cardZone = 0;
|
CardZone *cardZone = 0;
|
||||||
ZoneViewZone *zoneViewZone = 0;
|
ZoneViewZone *zoneViewZone = 0;
|
||||||
|
|
|
@ -394,8 +394,10 @@ CardDragItem *CardItem::createDragItem(int _id, const QPointF &_pos, const QPoin
|
||||||
{
|
{
|
||||||
deleteDragItem();
|
deleteDragItem();
|
||||||
dragItem = new CardDragItem(this, _id, _pos, faceDown);
|
dragItem = new CardDragItem(this, _id, _pos, faceDown);
|
||||||
|
dragItem->setVisible(false);
|
||||||
scene()->addItem(dragItem);
|
scene()->addItem(dragItem);
|
||||||
dragItem->updatePosition(_scenePos);
|
dragItem->updatePosition(_scenePos);
|
||||||
|
dragItem->setVisible(true);
|
||||||
|
|
||||||
return dragItem;
|
return dragItem;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include <QGraphicsSceneMouseEvent>
|
#include <QGraphicsSceneMouseEvent>
|
||||||
#include <QSet>
|
#include <QSet>
|
||||||
#include <QBasicTimer>
|
#include <QBasicTimer>
|
||||||
|
#include <QGraphicsView>
|
||||||
|
|
||||||
GameScene::GameScene(PhasesToolbar *_phasesToolbar, QObject *parent)
|
GameScene::GameScene(PhasesToolbar *_phasesToolbar, QObject *parent)
|
||||||
: QGraphicsScene(parent), phasesToolbar(_phasesToolbar)
|
: QGraphicsScene(parent), phasesToolbar(_phasesToolbar)
|
||||||
|
@ -25,8 +26,8 @@ GameScene::~GameScene()
|
||||||
|
|
||||||
void GameScene::retranslateUi()
|
void GameScene::retranslateUi()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < views.size(); ++i)
|
for (int i = 0; i < zoneViews.size(); ++i)
|
||||||
views[i]->retranslateUi();
|
zoneViews[i]->retranslateUi();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameScene::addPlayer(Player *player)
|
void GameScene::addPlayer(Player *player)
|
||||||
|
@ -111,47 +112,52 @@ void GameScene::rearrange()
|
||||||
|
|
||||||
void GameScene::toggleZoneView(Player *player, const QString &zoneName, int numberCards)
|
void GameScene::toggleZoneView(Player *player, const QString &zoneName, int numberCards)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < views.size(); i++) {
|
for (int i = 0; i < zoneViews.size(); i++) {
|
||||||
ZoneViewZone *temp = views[i]->getZone();
|
ZoneViewZone *temp = zoneViews[i]->getZone();
|
||||||
if ((temp->getName() == zoneName) && (temp->getPlayer() == player)) { // view is already open
|
if ((temp->getName() == zoneName) && (temp->getPlayer() == player)) { // view is already open
|
||||||
views[i]->close();
|
zoneViews[i]->close();
|
||||||
if (temp->getNumberCards() == numberCards)
|
if (temp->getNumberCards() == numberCards)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ZoneViewWidget *item = new ZoneViewWidget(player, player->getZones().value(zoneName), numberCards, false);
|
ZoneViewWidget *item = new ZoneViewWidget(player, player->getZones().value(zoneName), numberCards, false);
|
||||||
views.append(item);
|
zoneViews.append(item);
|
||||||
connect(item, SIGNAL(closePressed(ZoneViewWidget *)), this, SLOT(removeZoneView(ZoneViewWidget *)));
|
connect(item, SIGNAL(closePressed(ZoneViewWidget *)), this, SLOT(removeZoneView(ZoneViewWidget *)));
|
||||||
addItem(item);
|
addItem(item);
|
||||||
item->setPos(100, 100);
|
item->setPos(50, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameScene::addRevealedZoneView(Player *player, CardZone *zone, const QList<ServerInfo_Card *> &cardList)
|
void GameScene::addRevealedZoneView(Player *player, CardZone *zone, const QList<ServerInfo_Card *> &cardList)
|
||||||
{
|
{
|
||||||
ZoneViewWidget *item = new ZoneViewWidget(player, zone, -2, true, cardList);
|
ZoneViewWidget *item = new ZoneViewWidget(player, zone, -2, true, cardList);
|
||||||
views.append(item);
|
zoneViews.append(item);
|
||||||
connect(item, SIGNAL(closePressed(ZoneViewWidget *)), this, SLOT(removeZoneView(ZoneViewWidget *)));
|
connect(item, SIGNAL(closePressed(ZoneViewWidget *)), this, SLOT(removeZoneView(ZoneViewWidget *)));
|
||||||
addItem(item);
|
addItem(item);
|
||||||
item->setPos(100, 100);
|
item->setPos(50, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameScene::removeZoneView(ZoneViewWidget *item)
|
void GameScene::removeZoneView(ZoneViewWidget *item)
|
||||||
{
|
{
|
||||||
views.removeAt(views.indexOf(item));
|
zoneViews.removeAt(zoneViews.indexOf(item));
|
||||||
removeItem(item);
|
removeItem(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameScene::clearViews()
|
void GameScene::clearViews()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < views.size(); ++i)
|
for (int i = 0; i < zoneViews.size(); ++i)
|
||||||
views[i]->close();
|
zoneViews[i]->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameScene::closeMostRecentZoneView()
|
void GameScene::closeMostRecentZoneView()
|
||||||
{
|
{
|
||||||
if (!views.isEmpty())
|
if (!zoneViews.isEmpty())
|
||||||
views.last()->close();
|
zoneViews.last()->close();
|
||||||
|
}
|
||||||
|
|
||||||
|
QTransform GameScene::getViewTransform() const
|
||||||
|
{
|
||||||
|
return views().at(0)->transform();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameScene::processViewSizeChange(const QSize &newSize)
|
void GameScene::processViewSizeChange(const QSize &newSize)
|
||||||
|
@ -191,7 +197,7 @@ void GameScene::processViewSizeChange(const QSize &newSize)
|
||||||
|
|
||||||
void GameScene::updateHover(const QPointF &scenePos)
|
void GameScene::updateHover(const QPointF &scenePos)
|
||||||
{
|
{
|
||||||
QList<QGraphicsItem *> itemList = items(scenePos);
|
QList<QGraphicsItem *> itemList = items(scenePos, Qt::IntersectsItemBoundingRect, Qt::DescendingOrder, getViewTransform());
|
||||||
|
|
||||||
// Search for the topmost zone and ignore all cards not belonging to that zone.
|
// Search for the topmost zone and ignore all cards not belonging to that zone.
|
||||||
CardZone *zone = 0;
|
CardZone *zone = 0;
|
||||||
|
|
|
@ -23,7 +23,7 @@ private:
|
||||||
PhasesToolbar *phasesToolbar;
|
PhasesToolbar *phasesToolbar;
|
||||||
QList<Player *> players;
|
QList<Player *> players;
|
||||||
QList<QList<Player *> > playersByColumn;
|
QList<QList<Player *> > playersByColumn;
|
||||||
QList<ZoneViewWidget *> views;
|
QList<ZoneViewWidget *> zoneViews;
|
||||||
QSize viewSize;
|
QSize viewSize;
|
||||||
QPointer<CardItem> hoveredCard;
|
QPointer<CardItem> hoveredCard;
|
||||||
QBasicTimer *animationTimer;
|
QBasicTimer *animationTimer;
|
||||||
|
@ -34,6 +34,7 @@ public:
|
||||||
~GameScene();
|
~GameScene();
|
||||||
void retranslateUi();
|
void retranslateUi();
|
||||||
void processViewSizeChange(const QSize &newSize);
|
void processViewSizeChange(const QSize &newSize);
|
||||||
|
QTransform getViewTransform() const;
|
||||||
|
|
||||||
void startRubberBand(const QPointF &selectionOrigin);
|
void startRubberBand(const QPointF &selectionOrigin);
|
||||||
void resizeRubberBand(const QPointF &cursorPoint);
|
void resizeRubberBand(const QPointF &cursorPoint);
|
||||||
|
|
|
@ -25,7 +25,7 @@ QRectF PileZone::boundingRect() const
|
||||||
void PileZone::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*option*/, QWidget * /*widget*/)
|
void PileZone::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*option*/, QWidget * /*widget*/)
|
||||||
{
|
{
|
||||||
if (!cards.isEmpty())
|
if (!cards.isEmpty())
|
||||||
cards.at(0)->paintPicture(painter, 90);
|
cards.at(0)->paintPicture(painter, cards.at(0)->getTranslatedSize(painter), 90);
|
||||||
|
|
||||||
painter->drawRect(QRectF(0.5, 0.5, CARD_WIDTH - 1, CARD_HEIGHT - 1));
|
painter->drawRect(QRectF(0.5, 0.5, CARD_WIDTH - 1, CARD_HEIGHT - 1));
|
||||||
|
|
||||||
|
|
|
@ -268,6 +268,9 @@ void WndDeckEditor::updateCardInfoRight(const QModelIndex ¤t, const QModel
|
||||||
void WndDeckEditor::updateSearch(const QString &search)
|
void WndDeckEditor::updateSearch(const QString &search)
|
||||||
{
|
{
|
||||||
databaseDisplayModel->setCardNameBeginning(search);
|
databaseDisplayModel->setCardNameBeginning(search);
|
||||||
|
QModelIndexList sel = databaseView->selectionModel()->selectedRows();
|
||||||
|
if (sel.isEmpty() && databaseDisplayModel->rowCount())
|
||||||
|
databaseView->selectionModel()->setCurrentIndex(databaseDisplayModel->index(0, 0), QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WndDeckEditor::confirmClose()
|
bool WndDeckEditor::confirmClose()
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
#include <QGraphicsLinearLayout>
|
#include <QGraphicsLinearLayout>
|
||||||
#include <QGraphicsProxyWidget>
|
#include <QGraphicsProxyWidget>
|
||||||
|
#include <QGraphicsSceneMouseEvent>
|
||||||
#include <QCheckBox>
|
#include <QCheckBox>
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QPushButton>
|
||||||
|
#include <QPainter>
|
||||||
|
#include <QPalette>
|
||||||
#include "zoneviewwidget.h"
|
#include "zoneviewwidget.h"
|
||||||
#include "carditem.h"
|
#include "carditem.h"
|
||||||
#include "zoneviewzone.h"
|
#include "zoneviewzone.h"
|
||||||
|
@ -8,19 +13,70 @@
|
||||||
#include "gamescene.h"
|
#include "gamescene.h"
|
||||||
#include "protocol_items.h"
|
#include "protocol_items.h"
|
||||||
#include "settingscache.h"
|
#include "settingscache.h"
|
||||||
|
#include "gamescene.h"
|
||||||
|
|
||||||
|
TitleLabel::TitleLabel()
|
||||||
|
: QGraphicsWidget(), text(" ")
|
||||||
|
{
|
||||||
|
setAcceptHoverEvents(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TitleLabel::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*option*/, QWidget * /*widget*/)
|
||||||
|
{
|
||||||
|
QBrush windowBrush = palette().window();
|
||||||
|
windowBrush.setColor(windowBrush.color().darker(150));
|
||||||
|
painter->fillRect(boundingRect(), windowBrush);
|
||||||
|
painter->drawText(boundingRect(), Qt::AlignLeft | Qt::AlignVCenter, text);
|
||||||
|
}
|
||||||
|
|
||||||
|
QSizeF TitleLabel::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const
|
||||||
|
{
|
||||||
|
QFont f;
|
||||||
|
QFontMetrics fm(f);
|
||||||
|
if (which == Qt::MaximumSize)
|
||||||
|
return QSizeF(constraint.width(), fm.size(Qt::TextSingleLine, text).height() + 10);
|
||||||
|
else
|
||||||
|
return fm.size(Qt::TextSingleLine, text);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TitleLabel::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||||
|
{
|
||||||
|
if (event->button() == Qt::LeftButton) {
|
||||||
|
buttonDownPos = static_cast<GameScene *>(scene())->getViewTransform().inverted().map(event->pos());
|
||||||
|
event->accept();
|
||||||
|
} else
|
||||||
|
event->ignore();
|
||||||
|
}
|
||||||
|
|
||||||
|
void TitleLabel::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||||
|
{
|
||||||
|
emit mouseMoved(event->scenePos() - buttonDownPos);
|
||||||
|
}
|
||||||
|
|
||||||
ZoneViewWidget::ZoneViewWidget(Player *_player, CardZone *_origZone, int numberCards, bool _revealZone, 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)
|
: QGraphicsWidget(0, Qt::Tool | Qt::FramelessWindowHint), player(_player)
|
||||||
{
|
{
|
||||||
|
setAcceptHoverEvents(true);
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
setZValue(2000000006);
|
setZValue(2000000006);
|
||||||
|
setFlag(ItemIgnoresTransformations);
|
||||||
|
setAutoFillBackground(true);
|
||||||
|
|
||||||
QFont font;
|
QGraphicsLinearLayout *hbox = new QGraphicsLinearLayout(Qt::Horizontal);
|
||||||
font.setPixelSize(10);
|
titleLabel = new TitleLabel;
|
||||||
setFont(font);
|
connect(titleLabel, SIGNAL(mouseMoved(QPointF)), this, SLOT(moveWidget(QPointF)));
|
||||||
|
closeButton = new QPushButton("X");
|
||||||
|
connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
|
||||||
|
closeButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||||
|
QGraphicsProxyWidget *closeButtonProxy = new QGraphicsProxyWidget;
|
||||||
|
closeButtonProxy->setWidget(closeButton);
|
||||||
|
|
||||||
|
hbox->addItem(titleLabel);
|
||||||
|
hbox->addItem(closeButtonProxy);
|
||||||
QGraphicsLinearLayout *vbox = new QGraphicsLinearLayout(Qt::Vertical);
|
QGraphicsLinearLayout *vbox = new QGraphicsLinearLayout(Qt::Vertical);
|
||||||
|
|
||||||
|
vbox->addItem(hbox);
|
||||||
|
|
||||||
if (numberCards < 0) {
|
if (numberCards < 0) {
|
||||||
sortByNameCheckBox = new QCheckBox;
|
sortByNameCheckBox = new QCheckBox;
|
||||||
QGraphicsProxyWidget *sortByNameProxy = new QGraphicsProxyWidget;
|
QGraphicsProxyWidget *sortByNameProxy = new QGraphicsProxyWidget;
|
||||||
|
@ -67,7 +123,7 @@ ZoneViewWidget::ZoneViewWidget(Player *_player, CardZone *_origZone, int numberC
|
||||||
|
|
||||||
void ZoneViewWidget::retranslateUi()
|
void ZoneViewWidget::retranslateUi()
|
||||||
{
|
{
|
||||||
setWindowTitle(zone->getTranslatedName(false, CaseNominative));
|
titleLabel->setText(zone->getTranslatedName(false, CaseNominative));
|
||||||
if (sortByNameCheckBox)
|
if (sortByNameCheckBox)
|
||||||
sortByNameCheckBox->setText(tr("sort by name"));
|
sortByNameCheckBox->setText(tr("sort by name"));
|
||||||
if (sortByTypeCheckBox)
|
if (sortByTypeCheckBox)
|
||||||
|
@ -76,6 +132,11 @@ void ZoneViewWidget::retranslateUi()
|
||||||
shuffleCheckBox->setText(tr("shuffle when closing"));
|
shuffleCheckBox->setText(tr("shuffle when closing"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ZoneViewWidget::moveWidget(QPointF scenePos)
|
||||||
|
{
|
||||||
|
setPos(scenePos);
|
||||||
|
}
|
||||||
|
|
||||||
void ZoneViewWidget::resizeToZoneContents()
|
void ZoneViewWidget::resizeToZoneContents()
|
||||||
{
|
{
|
||||||
QRectF zoneRect = zone->getOptimumRect();
|
QRectF zoneRect = zone->getOptimumRect();
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
#ifndef ZONEVIEWWIDGET_H
|
#ifndef ZONEVIEWWIDGET_H
|
||||||
#define ZONEVIEWWIDGET_H
|
#define ZONEVIEWWIDGET_H
|
||||||
|
|
||||||
#include <QDialog>
|
|
||||||
#include <QGraphicsScene>
|
|
||||||
#include <QGraphicsWidget>
|
#include <QGraphicsWidget>
|
||||||
|
|
||||||
|
class QLabel;
|
||||||
|
class QPushButton;
|
||||||
class CardZone;
|
class CardZone;
|
||||||
class ZoneViewZone;
|
class ZoneViewZone;
|
||||||
class Player;
|
class Player;
|
||||||
|
@ -13,12 +13,32 @@ class QScrollBar;
|
||||||
class QCheckBox;
|
class QCheckBox;
|
||||||
class GameScene;
|
class GameScene;
|
||||||
class ServerInfo_Card;
|
class ServerInfo_Card;
|
||||||
|
class QGraphicsSceneMouseEvent;
|
||||||
|
|
||||||
|
class TitleLabel : public QGraphicsWidget {
|
||||||
|
Q_OBJECT
|
||||||
|
private:
|
||||||
|
QString text;
|
||||||
|
QPointF buttonDownPos;
|
||||||
|
public:
|
||||||
|
TitleLabel();
|
||||||
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem * /*option*/, QWidget * /*widget*/);
|
||||||
|
void setText(const QString &_text) { text = _text; update(); }
|
||||||
|
signals:
|
||||||
|
void mouseMoved(QPointF scenePos);
|
||||||
|
protected:
|
||||||
|
QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const;
|
||||||
|
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
|
||||||
|
void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
||||||
|
};
|
||||||
|
|
||||||
class ZoneViewWidget : public QGraphicsWidget {
|
class ZoneViewWidget : public QGraphicsWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
private:
|
private:
|
||||||
ZoneViewZone *zone;
|
ZoneViewZone *zone;
|
||||||
|
|
||||||
|
TitleLabel *titleLabel;
|
||||||
|
QPushButton *closeButton;
|
||||||
QScrollBar *scrollBar;
|
QScrollBar *scrollBar;
|
||||||
QCheckBox *sortByNameCheckBox, *sortByTypeCheckBox, *shuffleCheckBox;
|
QCheckBox *sortByNameCheckBox, *sortByTypeCheckBox, *shuffleCheckBox;
|
||||||
|
|
||||||
|
@ -29,6 +49,7 @@ signals:
|
||||||
private slots:
|
private slots:
|
||||||
void resizeToZoneContents();
|
void resizeToZoneContents();
|
||||||
void zoneDeleted();
|
void zoneDeleted();
|
||||||
|
void moveWidget(QPointF scenePos);
|
||||||
public:
|
public:
|
||||||
ZoneViewWidget(Player *_player, CardZone *_origZone, int numberCards = 0, bool _revealZone = false, 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; }
|
ZoneViewZone *getZone() const { return zone; }
|
||||||
|
|
|
@ -5095,7 +5095,7 @@ Bitte geben Sie einen Namen ein:</translation>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/tab_game.cpp" line="294"/>
|
<location filename="../src/tab_game.cpp" line="294"/>
|
||||||
<source>&Concede</source>
|
<source>&Concede</source>
|
||||||
<translation></translation>
|
<translation>&Aufgeben</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../src/tab_game.cpp" line="295"/>
|
<location filename="../src/tab_game.cpp" line="295"/>
|
||||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -41,6 +41,7 @@ Section "Application" SecApplication
|
||||||
File data\QtSvg4.dll
|
File data\QtSvg4.dll
|
||||||
File data\QtXml4.dll
|
File data\QtXml4.dll
|
||||||
File data\QtMultimedia4.dll
|
File data\QtMultimedia4.dll
|
||||||
|
File data\QtScript4.dll
|
||||||
|
|
||||||
SetOutPath "$INSTDIR\zonebg"
|
SetOutPath "$INSTDIR\zonebg"
|
||||||
File /r ..\zonebg\*.*
|
File /r ..\zonebg\*.*
|
||||||
|
|
Loading…
Reference in a new issue