From 052e5ff3c36d7e1d572de3b0ae19a4cce85ba3db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Tue, 9 Sep 2025 02:48:36 +0200 Subject: [PATCH] Hook up tap logic again. Took 13 minutes --- cockatrice/src/game/board/card_item.cpp | 4 ++-- cockatrice/src/game/zones/logic/table_zone_logic.h | 1 + cockatrice/src/game/zones/table_zone.cpp | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cockatrice/src/game/board/card_item.cpp b/cockatrice/src/game/board/card_item.cpp index c7f323b81..dcb003a91 100644 --- a/cockatrice/src/game/board/card_item.cpp +++ b/cockatrice/src/game/board/card_item.cpp @@ -365,9 +365,9 @@ void CardItem::playCard(bool faceDown) if (!owner->getPlayerInfo()->getLocalOrJudge()) return; - TableZone *tz = qobject_cast(zone); + TableZoneLogic *tz = qobject_cast(zone); if (tz) - tz->toggleTapped(); + emit tz->toggleTapped(); else { if (SettingsCache::instance().getClickPlaysAllSelected()) { faceDown ? zone->getPlayer()->getPlayerActions()->actPlayFacedown() diff --git a/cockatrice/src/game/zones/logic/table_zone_logic.h b/cockatrice/src/game/zones/logic/table_zone_logic.h index bd0c62070..9c28ff3ef 100644 --- a/cockatrice/src/game/zones/logic/table_zone_logic.h +++ b/cockatrice/src/game/zones/logic/table_zone_logic.h @@ -7,6 +7,7 @@ class TableZoneLogic : public CardZoneLogic Q_OBJECT signals: void contentSizeChanged(); + void toggleTapped(); public: TableZoneLogic(Player *_player, diff --git a/cockatrice/src/game/zones/table_zone.cpp b/cockatrice/src/game/zones/table_zone.cpp index 3af329efe..bc5f29c04 100644 --- a/cockatrice/src/game/zones/table_zone.cpp +++ b/cockatrice/src/game/zones/table_zone.cpp @@ -23,6 +23,7 @@ const QColor TableZone::GRADIENT_COLORLESS = QColor(255, 255, 255, 0); TableZone::TableZone(TableZoneLogic *_logic, QGraphicsItem *parent) : SelectZone(_logic, parent), active(false) { connect(_logic, &TableZoneLogic::contentSizeChanged, this, &TableZone::resizeToContents); + connect(_logic, &TableZoneLogic::toggleTapped, this, &TableZone::toggleTapped); connect(themeManager, &ThemeManager::themeChanged, this, &TableZone::updateBg); connect(&SettingsCache::instance(), &SettingsCache::invertVerticalCoordinateChanged, this, &TableZone::reorganizeCards);