Implement ZoneToggleButton - a reusable UI component for toggling
zone visibility states.
Features:
- Click to toggle between hidden/revealed states
- Visual feedback showing current state
- Hover effects for discoverability
- Proper event handling for mouse interactions
This self-contained graphics component will be used by CommandZone
to provide users with intuitive visibility controls.
Implement CommanderTaxCounter - tracks casting cost increases for
commanders that have been cast multiple times.
Key components:
- CommanderTaxCounter: specialized counter with value clamping
- AbstractCounter modifications: support for counter ID system
- CounterGeneral/TranslateCounterName: UI integration for display
Design decisions:
- Counter values clamped to valid range (0 to max)
- Builds on counter_ids.h constants from commit 1
- Uses z_values.h from commit 4 for proper visual layering
- Counter visibility tied to zone state (hidden when zone hidden)
Test coverage:
- commander_tax_counter_test: verifies setValue clamping behavior
- counter_visibility_test: verifies visibility state transitions
Note: Tests include <climits> for INT_MIN usage (required on some compilers
like GCC on Debian 11 where INT_MIN is not transitively included).
Implement CommandZoneLogic - the card data management layer for zones.
This layer handles card insertion, removal, and ordering independently
of Qt graphics rendering.
Key components:
- CommandZoneLogic: manages card data within a zone
- AddCardAlgorithm: generic insertion algorithm for ordered zones
- CardZoneLogic modifications: integrate with existing zone hierarchy
Design decisions:
- Separation of data logic from graphics enables unit testing
- addCardImpl uses a stable insertion algorithm for consistent ordering
- Mock card items enable testing without Qt graphics dependencies
Test coverage verifies card insertion behavior across edge cases.
Implement CommandZoneState - a pure C++ state machine managing zone
visibility transitions (Hidden, Revealed, Peeking states).
The state machine is intentionally decoupled from Qt graphics:
- Pure logic with no Qt dependencies in the state class
- Testable in isolation without a GUI
- Clear state transition table with StateChangeResult outcomes
Test coverage verifies:
- Initial state is Hidden
- Valid transitions: Hidden->Revealed, Hidden->Peeking, etc.
- Invalid transitions return NoChange
- Peek timeout triggers return to previous state
This establishes the foundation for command zone visibility management
while keeping graphics concerns separate.
Add core type definitions and constants for the command zone feature:
- zone_names.h: Add command zone name constants (command, partner,
companion, background) for protocol and lookup operations
- command_zone_types.h: Define CommandZoneType enum, ZoneVisibility enum,
and StateChangeResult struct for state machine logic
- counter_ids.h: Define shared counter IDs and names for commander tax
tracking (IDs 8-9 reserved to avoid conflicts with user counters)
These headers are intentionally minimal and dependency-free to enable
inclusion in both production code and isolated unit tests.
Replace hardcoded Z-value numbers with ZValues::* constants:
- 2000000007 -> ZValues::DRAG_ITEM
- 2000000007 + offset -> ZValues::DRAG_ITEM_CHILD
- 2000000004 -> ZValues::HOVERED_CARD
- 2000000005 -> ZValues::ARROWS
This improves code readability by making the intent of these layer
values explicit and centralizes Z-ordering logic for easier maintenance.
Add centralized Z-value management for Qt's stacking order system. This
replaces scattered magic numbers with semantic constants, making the rendering
hierarchy explicit and maintainable.
The architecture defines three layers:
- Zone layer (0-999): Zone backgrounds and containers
- Card layer (1-40M): Cards on the table zone using position-based formula
- Overlay layer (200M+): UI elements that always render above cards
ZValueLayerManager provides validation utilities and the overlayZValue()
function for computing overlay Z-values. ZValues namespace provides the
semantic constants used throughout the codebase.
The 5x gap between card max (40M) and overlay base (200M) provides safety
margin for future table zone expansions.
Replace hardcoded zone name strings with ZoneNames::* constants
for existing zones. This improves maintainability and type safety.
Zones converted:
- "hand" -> ZoneNames::HAND
- "deck" -> ZoneNames::DECK
- "grave" -> ZoneNames::GRAVE
- "rfg" -> ZoneNames::EXILE
- "sb" -> ZoneNames::SIDEBOARD
Add a centralized header for zone name string constants used in protocol
messages and zone lookups. This replaces scattered hardcoded string literals
with type-safe constants, improving maintainability and reducing typo risks.
The ZoneNames namespace provides constants for core game zones: table, grave,
exile (rfg), hand, deck, sideboard, and stack.
Adds a new default theme that causes the QT Fusion theme to be
selected. This theme looks a bit nicer than 'Windows' and supports
both light and dark mode out of the box.
* add doxygen-theme-css submodule
* enable theme and disable not needed code references
* hide nav sync button
* css and cleanup
* Move comments to dedicated README to not fail config check
* [TabArchidekt] Cleaner filters, infinite scrolling, and a "go back button"
Took 46 minutes
Took 5 seconds
* Fix infinite scroll triggering in detail view.
Took 25 minutes
Took 3 seconds
* Use setLabelText() so it's white
Took 2 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>