mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-04 04:23:55 -07:00
[Game] Add Command Zone support with commander tax tracking
- Add CommandZone and CommandZoneLogic for commander - Add CommanderTaxCounter - Add counter active state protocol (show/hide tax counters) - Add "Enable Command Zone" option in game creation dialogs - Add context menu actions for command zone operations Took 9 minutes Took 11 minutes
This commit is contained in:
parent
687e6644bc
commit
75d59e2d82
73 changed files with 1540 additions and 86 deletions
|
|
@ -12,6 +12,7 @@
|
|||
|
||||
#include <QGraphicsObject>
|
||||
|
||||
class CommandZone;
|
||||
class HandZone;
|
||||
class PileZone;
|
||||
class PlayerDialogs;
|
||||
|
|
@ -112,6 +113,18 @@ public:
|
|||
{
|
||||
return handZoneGraphicsItem;
|
||||
}
|
||||
/** @brief Returns the command zone graphics item. */
|
||||
[[nodiscard]] CommandZone *getCommandZoneGraphicsItem() const
|
||||
{
|
||||
return commandZoneGraphicsItem;
|
||||
}
|
||||
/** @brief Returns the counter widget for the given counter ID, or nullptr if not found. */
|
||||
[[nodiscard]] AbstractCounter *getCounterWidget(int counterId) const
|
||||
{
|
||||
return counterWidgets.value(counterId, nullptr);
|
||||
}
|
||||
/** @brief Returns all tax counter widgets (commander tax and partner tax). */
|
||||
[[nodiscard]] QList<AbstractCounter *> getTaxCounterWidgets() const;
|
||||
|
||||
public slots:
|
||||
void onPlayerActiveChanged(bool _active);
|
||||
|
|
@ -120,6 +133,8 @@ public slots:
|
|||
void onCounterRemoved(int counterId);
|
||||
void rearrangeCounters();
|
||||
void retranslateUi();
|
||||
/** @brief Shows or hides the command zone and rearranges dependent zones. */
|
||||
void setCommandZoneVisible(bool visible);
|
||||
|
||||
signals:
|
||||
void sizeChanged();
|
||||
|
|
@ -142,10 +157,15 @@ private:
|
|||
TableZone *tableZoneGraphicsItem;
|
||||
StackZone *stackZoneGraphicsItem;
|
||||
HandZone *handZoneGraphicsItem;
|
||||
CommandZone *commandZoneGraphicsItem;
|
||||
QRectF bRect;
|
||||
bool mirrored;
|
||||
bool handVisible = false;
|
||||
|
||||
/** @brief Returns the command zone's display height, or 0 if hidden. */
|
||||
[[nodiscard]] qreal totalCommandZoneHeight() const;
|
||||
/** @brief Positions the command and stack zones vertically starting from base, updating base.y. */
|
||||
void positionCommandAndStackZones(const QPointF &base);
|
||||
private slots:
|
||||
void updateBoundingRect();
|
||||
void rearrangeZones();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue