mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-22 06:43:54 -07:00
cipt code
This commit is contained in:
parent
888a64b0fd
commit
388e9255c7
10 changed files with 73 additions and 41 deletions
|
|
@ -173,8 +173,11 @@ void CardItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
|
|||
if (tz)
|
||||
tz->toggleTapped();
|
||||
else {
|
||||
bool faceDown = event->modifiers().testFlag(Qt::ShiftModifier);
|
||||
bool tapped = info->getCipt();
|
||||
|
||||
TableZone *table = zone->getPlayer()->getTable();
|
||||
QPoint gridPoint = table->getFreeGridPoint(info->getTableRow());
|
||||
table->handleDropEventByGrid(id, zone, gridPoint, false);
|
||||
table->handleDropEventByGrid(id, zone, gridPoint, faceDown, tapped);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,9 +66,9 @@ void TableZone::handleDropEvent(int cardId, CardZone *startZone, const QPoint &d
|
|||
handleDropEventByGrid(cardId, startZone, mapToGrid(dropPoint), faceDown);
|
||||
}
|
||||
|
||||
void TableZone::handleDropEventByGrid(int cardId, CardZone *startZone, const QPoint &gridPoint, bool faceDown)
|
||||
void TableZone::handleDropEventByGrid(int cardId, CardZone *startZone, const QPoint &gridPoint, bool faceDown, bool tapped)
|
||||
{
|
||||
player->sendGameCommand(new Command_MoveCard(-1, startZone->getName(), cardId, getName(), gridPoint.x(), gridPoint.y(), faceDown));
|
||||
player->sendGameCommand(new Command_MoveCard(-1, startZone->getName(), cardId, getName(), gridPoint.x(), gridPoint.y(), faceDown, tapped));
|
||||
}
|
||||
|
||||
void TableZone::reorganizeCards()
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@ public:
|
|||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
void reorganizeCards();
|
||||
void toggleTapped();
|
||||
void handleDropEvent(int cardId, CardZone *startZone, const QPoint &dropPoint, bool faceDown);
|
||||
void handleDropEventByGrid(int cardId, CardZone *startZone, const QPoint &gridPoint, bool faceDown);
|
||||
void handleDropEvent(int cardId, CardZone *startZone, const QPoint &dropPoint, bool faceDown = false);
|
||||
void handleDropEventByGrid(int cardId, CardZone *startZone, const QPoint &gridPoint, bool faceDown = false, bool tapped = false);
|
||||
CardItem *getCardFromGrid(const QPoint &gridPoint) const;
|
||||
QPointF mapFromGrid(const QPoint &gridPoint) const;
|
||||
QPoint mapToGrid(const QPointF &mapPoint) const;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue