Commit graph

3633 commits

Author SHA1 Message Date
DawnFire42
78db49a9b3 feat(command-zone): add zone toggle button component
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.
2026-02-26 20:13:32 -05:00
DawnFire42
7a0a3ff9ac feat(command-zone): add commander tax counter system with tests
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).
2026-02-26 20:13:32 -05:00
DawnFire42
8422357878 feat(command-zone): add logic layer with tests
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.
2026-02-26 20:13:32 -05:00
DawnFire42
3c2e4a3fb2 feat(command-zone): add state machine with tests
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.
2026-02-26 20:13:32 -05:00
DawnFire42
ba1a388e5d feat(command-zone): add Z-value constants for command zones
Extend z_values.h with command-zone specific constants:

ZValues namespace additions:
- TOGGLE_BUTTON (0.5): Button above zone background, below cards
- PARTNER_ZONE (1.0): Partner zone level within command zone
- COMMAND_ZONE (1.0): Standard zone level for command zones
- TAX_COUNTERS (overlay+2): Commander tax counter overlay layer

ZoneSizes namespace (new):
- COMMAND_ZONE_HEIGHT: Card height plus 8px padding
- MINIMUM_STACK_HEIGHT: 100px minimum for usability
- TAX_COUNTER_SIZE: 24px for tax counter icons
- COMMAND_ZONE_WIDTH: 100.0 pixels
- MINIMIZED_HEIGHT_RATIO: 25% when minimized

GameColors namespace (new):
- OVERLAY_ALPHA: 191 (75% opaque)
- OVERLAY_BG_NORMAL/HOVERED: Consistent overlay styling

These constants enable visual consistency across command zone components.
2026-02-26 20:13:32 -05:00
DawnFire42
3a92505c5e feat(command-zone): add foundational type definitions
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.
2026-02-26 20:13:32 -05:00
DawnFire42
e2d5c7438d refactor(graphics): replace Z-value magic numbers with constants
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.
2026-02-26 19:53:58 -05:00
DawnFire42
2fb881ca60 refactor(graphics): introduce Z-value constants and layer manager
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.
2026-02-26 19:53:58 -05:00
DawnFire42
408fc2f14a refactor(zones): use ZoneNames constants instead of strings
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
2026-02-26 19:53:58 -05:00
DawnFire42
fe162025f1 refactor(zones): introduce ZoneNames constants header
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.
2026-02-26 19:53:58 -05:00
RickyRister
bdb42bbbbd
[VDE] Separate layout settings for visual deck editor (#6595) 2026-02-08 13:37:56 -08:00
RickyRister
ac7ff3a0e9
[LayoutSettings] Refactor how widgetSize settings are managed (#6594) 2026-02-08 05:07:53 -08:00
RickyRister
1eb6027443
clean up freeDocksSize in tabs with dockWidgets (#6593) 2026-02-08 05:07:40 -08:00
RickyRister
edc8691731
[LayoutSettings] Don't return by const value (#6592)
* [LayoutSettings] Don't return by const value

* fix compile failure
2026-02-07 20:42:23 -08:00
RickyRister
804a60f1ea
[LayoutSettings] Move over layout settings in global.ini (#6587)
* [LayoutSettings] Move over some settings from general

* remove unused setting
2026-02-07 19:51:12 -08:00
RickyRister
a096a0e3bb
[VDE] Reduce spacing in deck view toolbar (#6591) 2026-02-07 21:43:41 -05:00
BruebachL
d410078673
Refresh chat view colors on theme changed. (#6581)
Took 35 minutes

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2026-01-28 21:54:11 +01:00
BruebachL
bf5891a910
[ThemeManager] Proper Fusion Palettes (#6580) 2026-01-28 15:36:28 -05:00
RickyRister
c7249dfbd9
[PrintingSelector] Don't change font size (#6573)
* [PrintingSelector] Don't change font size

* remove connection to slider

* update comments
2026-01-28 09:39:54 -08:00
RickyRister
1b29e0bfa8
[PrintingSelector] Reduce spacing (#6574)
* [PrintingSelector] Reduce spacing

* align top

* reduce spacing in flowLayout
2026-01-27 20:50:46 -05:00
RickyRister
5cc5767c87
[CardInfoPictureWidget] Refactor constant fields to static const (#6575)
* [CardInfoPictureWidget] Refactor constant fields to static const

* rename constants

* reformat

* comment out unused
2026-01-27 20:50:19 -05:00
RickyRister
165c4ddd2a
[PrintingSelector] Properly clamp text size to picture on load (#6576) 2026-01-27 20:49:54 -05:00
Rob Blanckaert
7b64970e97
[App] Add Fusion Theme (#6577)
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.
2026-01-27 20:49:40 -05:00
ebbit1q
5309dd17be
fix typo (#6572) 2026-01-25 20:44:03 -05:00
transifex-integration[bot]
364470b3c8
Updates for project Cockatrice and language en_US (#6543)
* Translate oracle/oracle_en@source.ts in en_US

100% translated source file: 'oracle/oracle_en@source.ts'
on 'en_US'.

* Translate cockatrice_en@source.ts in en_US

100% translated source file: 'cockatrice_en@source.ts'
on 'en_US'.

---------

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2026-01-25 16:51:03 -05:00
transifex-integration[bot]
915da79cad
Translate cockatrice/cockatrice_en@source.ts in de (#6541)
100% translated source file: 'cockatrice/cockatrice_en@source.ts'
on 'de'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2026-01-25 16:50:40 -05:00
BruebachL
630c71f123
[VDE] Insert at correct index onDataChanged() instead of just appending. (#6556)
Took 25 minutes

Took 3 seconds

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2026-01-25 16:06:06 -05:00
ebbit1q
0b4e7be596
followup to #6563 (#6569)
* mess with the font rendering of the home screen until it works

* add more fonts

* increase font weight

* fix outline on the text
2026-01-25 16:05:53 -05:00
ebbit1q
303bd8b607
detect recursive redirects (#6570)
* detect recursive redirects

* handle failure with normal failure handler
2026-01-25 16:05:19 -05:00
RickyRister
c02cf5e89e
[VDE] Fix crash from alt-click when card has unknown set (#6566) 2026-01-25 01:36:10 -08:00
ebbit1q
92f02fa4ee
mess with the font rendering of the home screen until it works (#6563)
* mess with the font rendering of the home screen until it works

* add more fonts
2026-01-25 01:37:19 -05:00
BruebachL
ffc55aff10
[VDE] Add shortcut to increment cards [Alt + LMB] (#6555)
Took 13 minutes

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2026-01-24 11:28:06 +01:00
tooomm
2b372c14e4
Docs: Use doxygen-awesome-css theme (#6512)
* 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
2026-01-24 11:22:43 +01:00
BruebachL
12b5525a2d
[TabArchidekt] Cleaner filters, infinite scrolling, and a "go back button" (#6545)
* [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>
2026-01-24 11:21:12 +01:00
RickyRister
3c48d92663
[DeckEditor] Show info in PrintingSelector dock when override printings enabled (#6554)
* don't hide printing selector dock

* extract warning message to separate file

* create printing disabled info widget
2026-01-24 02:20:16 -08:00
BruebachL
948ec9e042
[VDE] Accurately represent card amounts (#6547) 2026-01-23 08:47:08 -05:00
RickyRister
d363ec5154
[VDS] Fix crash when tab is opened before card database is loaded (#6553) 2026-01-23 09:58:46 +01:00
RickyRister
999733fc0f
[VDE] Fix right click to remove card not working (#6549)
* fix typo

* fix crash
2026-01-23 09:18:05 +01:00
RickyRister
39ddaa0c35
[VDS] Reload deck on hover if file has been modified since last load (#6507)
* add reload to DeckLoader

* [VDS] Reload deck on hover if file has been modified since last load

* fix version incompatibility
2026-01-22 23:31:39 -05:00
RickyRister
d9b9c79112
[VDS] Add option to hide color identity (#6533) 2026-01-19 00:38:48 -08:00
RickyRister
af2995ba96
[VDS] Ignore tokens when calculating color identity (#6532) 2026-01-18 20:51:57 -05:00
BruebachL
f7ffcc58fe
[Sample hand widget] Create container widget before declaring it as parent (#6530) 2026-01-17 12:18:13 -05:00
RickyRister
792f077071
[VDE] Use splitter in sample hand widget (#6528)
* [VDE] Use splitter in sample hand widget

* remove unused code
2026-01-16 17:23:41 -08:00
RickyRister
9c07c7a963
[TabGame] Automatically sync view menu actions (#6529) 2026-01-16 17:22:48 -08:00
RickyRister
d579c82cb9
[DeckLoader] Make save/load methods static (#6476)
* const

* [DeckLoader] make methods static

* use static methods

* add docs

* add docs
2026-01-16 13:20:36 -05:00
RickyRister
c7c7bf550a
[TabGame] Don't create replay dock if not replay tab (#6527)
* [TabGame] Don't create replay dock if not replay tab

* use replayDock to determine if replay tab

* null check replayManager in dtor
2026-01-16 09:45:10 -08:00
RickyRister
84483c56d7
[TabDeckEditor] Generalize visibility filter and extract it to a separate file (#6526)
* create class

* use new class in old code
2026-01-16 10:12:46 -05:00
RickyRister
1b71519ec6
[VDE] Make sample hand widget look nicer (#6525) 2026-01-16 10:11:39 -05:00
RickyRister
154b9ace92
[TabDeckEditor] Move cardDatabase dock action to top of menu (#6523) 2026-01-16 10:10:36 -05:00
RickyRister
93f0715d02
[TabDeckEditor] Save cardDatabase dock size in settings (#6524) 2026-01-15 21:54:50 -05:00