Commit graph

5845 commits

Author SHA1 Message Date
DawnFire42
cd3d61dfcc build: update CMake configuration for command zones
Update FindQtRuntime.cmake to support command zone build requirements.

This final build system update ensures the command zone feature
integrates properly with the existing CMake build infrastructure.
2026-02-26 20:13:32 -05:00
DawnFire42
2b8090a69e docs(command-zone): add developer and user documentation
Add comprehensive documentation for the command zone feature.

Developer documentation:
- command_zone_architecture.md: detailed architecture overview
  - Layer separation (types, state, logic, graphics)
  - Component interactions and dependencies
  - Testing strategy and coverage
- Index update to include new architecture doc

User documentation:
- commander_format.md: how to use Commander format in Cockatrice
  - Zone configuration options
  - Gameplay mechanics (commander tax, zone reveals)
  - Tips for Commander games
- Index update to include new format doc
2026-02-26 20:13:32 -05:00
DawnFire42
c2a10466db feat(command-zone): add server-side support with tests
Implement server-side protocol and game logic for networked command
zone play.

Protocol changes:
- room_commands.proto: command zone messages and responses

Server components:
- ServerCounter: counter synchronization for commander tax
- ServerGame: command zone game state management
- ServerPlayer: player-level command zone handling
- Server/ServerProtocolHandler: command zone message routing
- Servatrice: command zone support in the main server

Design decisions:
- setCount() returns bool for event suppression (avoid duplicate events)
- Zone state synchronized across all connected clients
- Commander tax persists across zone transitions

Test coverage verifies setCount() return value behavior for proper
event suppression in networked scenarios.
2026-02-26 20:13:32 -05:00
DawnFire42
47fade7bcb feat(command-zone): add settings and theme support
Integrate command zones with the client settings and theming system.

Settings integration:
- CacheSettings: persist command zone preferences
- ShortcutsSettings: keyboard shortcuts for zone actions

Theme support:
- ThemeManager: command zone background loading
- Theme assets for Fabric, Leather, Plasma, VelvetMarble themes

Visual integration:
- MessageLogWidget: command zone action logging

Theme assets provide consistent visual styling across all bundled themes.
2026-02-26 20:13:32 -05:00
DawnFire42
4bd6ab56c5 feat(command-zone): add game creation UI
Implement UI components for configuring command zones when creating
new games.

New components:
- GameZoneOptionsWidget: reusable widget for zone configuration
- DlgLocalGameOptions: local game setup with command zone options

Integration points:
- DlgCreateGame: add command zone options to game creation dialog
- WindowMain: wire up command zone configuration in game flow

This allows players to:
- Enable/disable command zones for a game
- Select zone type (Commander, Companion, etc.)
- Configure zone-specific options
2026-02-26 20:13:32 -05:00
DawnFire42
437d2e4ed4 feat(command-zone): integrate into player system
Wire command zones into the player object hierarchy, making them
functional game elements.

Player class modifications:
- player.h/cpp: command zone ownership and lifecycle
- player_actions.h/cpp: command zone action handlers
- player_graphics_item.h/cpp: command zone visual positioning

This commit connects all previous command zone components to the
player, enabling:
- Zone creation during game setup
- Zone positioning relative to other player zones
- Action routing for command zone interactions
- Proper cleanup on player destruction
2026-02-26 20:13:32 -05:00
DawnFire42
1ae1d876b1 feat(command-zone): add context menu system
Implement CommandZoneMenu - context menu for interacting with cards
in the command zone.

Menu actions include:
- Cast commander (move to stack)
- Return to command zone
- View/reveal zone contents
- Commander-specific actions (tax reset, etc.)

Integration with existing menu system:
- CardMenuActionType: new action types for command zone
- CardMenu: command zone action routing
- MoveMenu: command zone as move destination
- PlayerMenu: command zone menu integration
- Zone menus: inherit from AbstractZoneMenu

This provides the right-click interaction layer for command zones.
2026-02-26 20:13:32 -05:00
DawnFire42
54e7ee1b42 feat(command-zone): add abstract zone menu base class
Introduce AbstractZoneMenu - a base class for zone-specific context
menus that provides common functionality.

This abstraction:
- Reduces code duplication across zone menu implementations
- Establishes consistent menu behavior patterns
- Provides foundation for CommandZoneMenu implementation

Small foundational commit to keep the menu hierarchy clean.
2026-02-26 20:13:32 -05:00
DawnFire42
6e83d64622 feat(command-zone): add graphics implementation with integration tests
Implement CommandZone - the main Qt graphics class for rendering and
interacting with command zones.

This commit brings together all previous components:
- Uses CommandZoneState for visibility management
- Uses CommandZoneLogic for card data handling
- Uses ZoneToggleButton for visibility controls
- Uses CommanderTaxCounter for tax display
- Uses z_values.h for proper visual layering

Zone modifications for command zone support:
- SelectZone: add command zone to zone selection
- StackZone: support command zone in stack operations
- TableZone: command zone positioning integration
- ViewZoneWidget: command zone viewing support

Integration tests verify:
- Counter parenting behavior
- Zone state coordination
- Full graphics stack interaction
2026-02-26 20:13:32 -05:00
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
transifex-integration[bot]
a80a0531a6
Translate oracle/oracle_en@source.ts in fr (#6544)
100% translated source file: 'oracle/oracle_en@source.ts'
on 'fr'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2026-02-07 21:48:00 -05:00
RickyRister
24bc713ba8
[DeckListModel] Fix deck hash not updating on card node add/remove (#6584) 2026-02-07 21:47:50 -05:00
dependabot[bot]
4884640070
Bump ssciwr/doxygen-install from 1 to 2 (#6585)
Bumps [ssciwr/doxygen-install](https://github.com/ssciwr/doxygen-install) from 1 to 2.
- [Release notes](https://github.com/ssciwr/doxygen-install/releases)
- [Commits](https://github.com/ssciwr/doxygen-install/compare/v1...v2)

---
updated-dependencies:
- dependency-name: ssciwr/doxygen-install
  dependency-version: '2'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-07 21:47:41 -05:00
RickyRister
8d7535c039
[LayoutSettings] Reorganize hierarchy in settings file (#6586)
* [LayoutSettings] Reorganize hierarchy in settings file

* rename stuff since we're moving settings later
2026-02-07 21:45:33 -05:00
RickyRister
32aa60bb14
[Oracle] Move oracle settings to separate file (#6588) 2026-02-07 21:44:49 -05:00
dependabot[bot]
3ada27eae1
Bump webpack from 5.99.9 to 5.105.0 in /webclient (#6590)
Bumps [webpack](https://github.com/webpack/webpack) from 5.99.9 to 5.105.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Changelog](https://github.com/webpack/webpack/blob/main/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack/compare/v5.99.9...v5.105.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-version: 5.105.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-07 21:43:51 -05: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
ebbit1q
49e6cf95c4
fix package description (#6565) 2026-01-24 22:34:53 -05:00
ebbit1q
8a126263a9
do not ignore return value of opening log in servatrice when rotating (#6564) 2026-01-24 15:05:26 -05:00
ebbit1q
afdb385770
move returning cards to server_game (#6561)
lock the game mutex instead of player mutex when returning cards
2026-01-24 12:54:29 -05:00
tooomm
5b8897231d
CI: Include submodules in repo checkout (Docs deployment) (#6557)
* Enable submodule checkout in documentation build

* Change submodule checkout to recursive
2026-01-24 13:24:19 +01:00