mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-04 04:23:55 -07:00
Harden command zone tax counter handling and more clean up
- Initialize commandZoneGraphicsItem to nullptr so the pervasive null
checks have defined behavior before initializeZones() runs
- Remove unused getTaxCounterWidgets()
- Enforce the "reset tax to 0 before deactivating" invariant server-side
in cmdSetCounterActive, not just in the UI
- Hide tax increment/decrement menu actions at their bounds (0 and
MAX_COUNTER_VALUE) to avoid sending no-op commands
- Drop redundant/inconsistent toggle labels from CommandZoneMenu::
retranslateUi(); updateTaxCounterActionStates() owns them
- Add default=-1 to Event_SetCounterActive.counter_id for parity with
Command_SetCounterActive
This commit is contained in:
parent
4a4c767cae
commit
754b31cc29
5 changed files with 13 additions and 25 deletions
|
|
@ -123,8 +123,6 @@ public:
|
|||
{
|
||||
return counterWidgets.value(counterId, nullptr);
|
||||
}
|
||||
/** @brief Returns all tax counter widgets (commander tax and partner tax). */
|
||||
[[nodiscard]] QList<AbstractCounter *> getTaxCounterWidgets() const;
|
||||
/** @brief Returns the tax counter if it exists and is active, or nullptr otherwise. */
|
||||
[[nodiscard]] AbstractCounter *getTaxCounterIfActive(int counterId) const;
|
||||
|
||||
|
|
@ -159,7 +157,7 @@ private:
|
|||
TableZone *tableZoneGraphicsItem;
|
||||
StackZone *stackZoneGraphicsItem;
|
||||
HandZone *handZoneGraphicsItem;
|
||||
CommandZone *commandZoneGraphicsItem;
|
||||
CommandZone *commandZoneGraphicsItem = nullptr;
|
||||
QRectF bRect;
|
||||
bool mirrored;
|
||||
bool handVisible = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue