mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-19 17:02:15 -07:00
implement thing
This commit is contained in:
parent
6ebe53f266
commit
4360288990
1 changed files with 23 additions and 6 deletions
|
|
@ -383,8 +383,17 @@ void CardItem::playCard(bool faceDown)
|
|||
TableZone *tz = qobject_cast<TableZone *>(zone);
|
||||
if (tz)
|
||||
tz->toggleTapped();
|
||||
else
|
||||
zone->getPlayer()->playCard(this, faceDown, info ? info->getCipt() : false);
|
||||
else {
|
||||
if (SettingsCache::instance().getClickPlaysAllSelected()) {
|
||||
if (faceDown) {
|
||||
zone->getPlayer()->actPlayFacedown();
|
||||
} else {
|
||||
zone->getPlayer()->actPlay();
|
||||
}
|
||||
} else {
|
||||
zone->getPlayer()->playCard(this, faceDown, info ? info->getCipt() : false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CardItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
|
|
@ -403,7 +412,11 @@ void CardItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||
hideCard = true;
|
||||
}
|
||||
if (zone && hideCard) {
|
||||
zone->removeCard(this);
|
||||
if (SettingsCache::instance().getClickPlaysAllSelected()) {
|
||||
zone->getPlayer()->actHide();
|
||||
} else {
|
||||
zone->removeCard(this);
|
||||
}
|
||||
} else {
|
||||
playCard(event->modifiers().testFlag(Qt::ShiftModifier));
|
||||
}
|
||||
|
|
@ -419,9 +432,13 @@ void CardItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
|
|||
{
|
||||
if ((event->modifiers() != Qt::AltModifier) && (SettingsCache::instance().getDoubleClickToPlay()) &&
|
||||
(event->buttons() == Qt::LeftButton)) {
|
||||
if (revealedCard)
|
||||
zone->removeCard(this);
|
||||
else
|
||||
if (revealedCard) {
|
||||
if (SettingsCache::instance().getClickPlaysAllSelected()) {
|
||||
zone->getPlayer()->actHide();
|
||||
} else {
|
||||
zone->removeCard(this);
|
||||
}
|
||||
} else
|
||||
playCard(event->modifiers().testFlag(Qt::ShiftModifier));
|
||||
}
|
||||
event->accept();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue