447 Commits

Author SHA1 Message Date
BruebachL
a390c8ada7 [NetworkManager] Set Version string as user agent (#6411)
* [NetworkManager] Set Version string as user agent

Took 13 minutes

* Update in oracle.

Took 14 minutes

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-12-12 11:29:18 +01:00
RickyRister
b4e3f2cba9 [Oracle] Support importing tokens and spoilers from local file (#6387) 2025-12-03 00:19:56 -05:00
RickyRister
c46f6d1178 Support flavorName in PrintingInfo and cache the altNames in CardInfo (#6335)
* Support flavorName property and cache altNames

* update oracleimporter

* update cards.xsd
2025-11-20 14:54:23 +01:00
RickyRister
9a3104c5ac [CardInfo] refactor some fields into a UiAttributes struct (#6322)
* refactor CardInfo

* refactor everything else
2025-11-16 17:56:57 +01:00
RickyRister
1c1599a9f4 [Oracle] Move page classes to separate file (#6314)
* Move pages to separate file

* Fix shadowing complaint
2025-11-15 11:27:53 +01:00
RickyRister
6dff230e10 [Oracle] Use NoOp setting providers (#6312) 2025-11-15 11:26:39 +01:00
RickyRister
ae123587d7 [Oracle] clean up OracleImporter (#6313)
* Move variable declaration closer to usage

* Leave comments

* inline some constants

* make code easier to understand

* Use structured binding to iterate over maps

* move things around

* static const regex

* remove redundant parens

* Can't use asKeyValueRange because of Qt versions
2025-11-12 16:58:09 +01:00
ebbit1q
0ad31fea46 allow oracle to run in background with direct xml downloads (#6241)
Took 5 minutes
2025-11-09 09:52:46 +01:00
BruebachL
a8a3fca8c9 Clean up inter-library dependencies with interfaces (#6280)
* Have CardDatabase::getPreferredPrintingInfo respect card provider ID overrides (pinned printings)

Took 13 minutes

Took 37 seconds

Took 10 seconds

Took 10 seconds

# Commit time for manual adjustment:
# Took 30 seconds

Took 15 seconds


Took 8 minutes

Took 21 seconds

* Move settings cache and settings card preference provider out of libcockatrice_settings and into cockatrice

Took 52 minutes

Took 9 minutes

Took 1 minute

* Temp cache.

Took 16 minutes

* Dependency Injection for SettingsCache

* Turn SettingsCache into a QSharedPointer.
* Implement interfaces for settings that need it

Took 2 hours 38 minutes

* Adjust oracle.

Took 5 minutes

* Move abstract/noop interfaces to libcockatrice_interfaces so they can be linked against independently.

Took 52 minutes

* Clean up some links.

Took 3 minutes

* Cleanup two includes.

Took 3 minutes

* More fixes.

Took 7 minutes

* More includes that slipped past.

Took 3 minutes

* Stop mocking and start injecting for tests.

Took 15 minutes

* I don't know why remote_client was including main.

Took 4 minutes

* Include.

Took 3 minutes

* Lint.

Took 2 minutes

* Don't use Qt pointers.

Took 1 hour 7 minutes

* Make parser use CardSettingsInterface

Took 13 minutes

* Also adjust constructor lol.

Took 8 minutes

* Lint.

Took 32 minutes

* Revert "Lint."

This reverts commit ecb596c39e.


Took 3 minutes

* Test.

Took 3 minutes

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-11-08 22:19:40 +01:00
ebbit1q
d206a70b8a update format.sh (#6240)
* update format.sh

add shellcheck to format.sh
add statement macros to .clang-format
add no clang format to format.sh
add changed file list to format.sh diff
rename --cf-version to --print-version in format.sh
lint files

* enable --shell on ci runs

* remove useless semicolons

removes the semicolons after empty function definitions
these semicolons are optional, they don't do anything
this will have functions be consistently formatted
if we want to keep the option to have these on the same line like they
were before we should use the option AllowShortFunctionsOnASingleLine: None

* fix script

* update echo line in lint_cpp.sh which doesn't lint cpp only at all
2025-11-07 15:00:39 +01:00
transifex-integration[bot]
e4d256790f Updates for project Cockatrice and language en@pirate (#6256)
* Translate oracle_en@source.ts in en@pirate [Manual Sync]

7% of minimum 4% translated source file: 'oracle_en@source.ts'
on 'en@pirate'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

* Translate cockatrice_en@source.ts in en@pirate [Manual Sync]

8% of minimum 4% translated source file: 'cockatrice_en@source.ts'
on 'en@pirate'.

Sync of partially translated files: 
untranslated content is included with an empty translation 
or source language content depending on file format

---------

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2025-10-26 13:46:46 +01:00
github-actions[bot]
2152ddd99b Update translation files (#6255)
Co-authored-by: github-actions <github-actions@github.com>
2025-10-26 13:23:02 +01:00
github-actions[bot]
ac822fa084 Update translation files (#6244)
Co-authored-by: github-actions <github-actions@github.com>
2025-10-25 14:43:59 +02:00
transifex-integration[bot]
a265b865f6 Translate oracle/oracle_en@source.ts in nl (#6246)
100% translated source file: 'oracle/oracle_en@source.ts'
on 'nl'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2025-10-25 14:38:10 +02:00
RickyRister
636aa72141 Remove redundant prefix from libcockatrice_card folders (#6237)
Took 28 minutes
2025-10-09 23:09:20 +02:00
github-actions[bot]
14e6e6eff4 Update translation source strings (#6203)
Co-authored-by: github-actions <github-actions@github.com>
2025-10-09 23:05:12 +02:00
BruebachL
d9c65d4ae0 [Move refactor] Reparent orphan classes (#6236)
* Move orphaned classes to their correct parent folders.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-10-09 14:15:19 +02:00
BruebachL
1ef07309d6 Turn Card, Deck_List, Protocol, RNG, Network (Client, Server), Settings and Utility into libraries and remove cockatrice_common. (#6212)
---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2025-10-09 07:36:12 +02:00
BruebachL
89a8d0f6b8 [Refactor] Untangle card_info.cpp and split into individual files. (#6202)
* Untangle the card_info.cpp mess and split into individual files.

Took 53 minutes

* Auto-lint was disabled and my pre-commit hook didn't fire. Oh well.

Took 3 minutes

* Fix oracle.

Took 35 seconds

* Lint!

Took 20 seconds

* Fix tests.

Took 3 minutes

* CMakeLists.txt: The reason why I have to disable auto-lint.

Took 2 minutes

* dbconverter.

Took 3 minutes

* Oracle again.

Took 3 minutes

* dbconverter again.

Took 3 minutes

* dbconverter again again.

Took 2 minutes

* More fixes.

Took 4 minutes

Took 21 seconds

* Everything needs everything.

Took 3 minutes

* Everything means everything.

Took 4 minutes

* All the tests.

Took 4 minutes

* I hate everything about this.

Took 3 minutes

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-10-01 11:49:39 +02:00
BruebachL
1503394662 [Game/DB] Have landscape cards enter tapped and not untap normally when played to table. (#6183)
Took 16 minutes


Took 12 seconds

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-09-27 00:22:01 +02:00
ebbit1q
17dcaf9afa squash #6158 (#6160)
* move message_log_widget to game

* move files

* update headers

* fix cmakelists

* oracle fixes

* split implementation out to cpp

* fix recursive import

* fix main file

* format
2025-09-20 14:35:52 +02:00
RickyRister
7ac22a6ce8 Move cards and filters folder out of game (#6145)
* big move

* also move game_specific_terms

* fix imports

* alphabetize cmake

* fix build failure

* create database folder and move files into it

* fix includes

* run formatter
2025-09-16 12:02:57 +02:00
transifex-integration[bot]
e87b35e0bb Updates for project Cockatrice and language fr (#6079)
* Translate oracle/oracle_en@source.ts in fr

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

* Translate cockatrice/cockatrice_en@source.ts in fr

100% translated source file: 'cockatrice/cockatrice_en@source.ts'
on 'fr'.

---------

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2025-08-16 14:27:37 -04:00
transifex-integration[bot]
851fad3e3f Updates for project Cockatrice and language it (#6065)
* Translate oracle/oracle_en@source.ts in it

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

* Translate cockatrice/cockatrice_en@source.ts in it

100% translated source file: 'cockatrice/cockatrice_en@source.ts'
on 'it'.

---------

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2025-08-15 01:14:05 -04:00
RickyRister
ae2c55c33b Refactor: use ExactCard to represent specific printings (#6049)
* Create new class

* Update CardInfo and CardDatabase

* Use new class instead of CardInfoPtr

* fix cmake
2025-07-28 21:04:45 -04:00
RickyRister
a9b3be33e0 Refactor: Represent cardName + providerId with CardRef struct (#6039)
* card_ref.h

* update CardDatabase signatures

* make everything compile

* rename methods

* add docs

* mark stuff const

* set cardRef in CardItem

* cleanup

* fix build failure

* Fix builds on mac

---------

Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
2025-07-15 22:14:02 -04:00
github-actions[bot]
83b90d472f Update translation files (#6037)
Co-authored-by: github-actions <github-actions@github.com>
2025-07-14 23:07:14 -04:00
RickyRister
a9684f67cc Refactor: rename CardInfoPerSet to PrintingInfo (#6024)
* remove unnecessary consts

* removed unused

* rename class

* rename variables and methods

* rename again

* rename variables again

* rename field

* run formatter
2025-07-07 23:41:19 -04:00
transifex-integration[bot]
67a3b03b07 Translate oracle/oracle_en@source.ts in de (#6022)
100% translated source file: 'oracle/oracle_en@source.ts'
on 'de'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2025-07-05 11:56:02 -04:00
github-actions[bot]
c57b84cb17 Update translation source strings (#6012)
Co-authored-by: github-actions <github-actions@github.com>
2025-07-01 15:29:57 -04:00
BruebachL
f3913949b2 Automatic Card Database Updates (#6004)
* Add the option to background the oracle wizard, add an option to automatically launch oracle wizard in background every X days since last launch.

* Mocks and a typo.

* Lint.

* Lint?

* qOverload the spinBox.

* Change to a prompt instead.

* An Label.

* Update window_main.cpp

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: Zach H <zahalpern+github@gmail.com>
2025-06-29 22:21:52 -04:00
RickyRister
6f3a07b756 [PictureLoader] Fix freezes from local image search (#5994)
* [PictureLoader] Fix freezes/crashes from parallel folder search

* fix build failure
2025-06-21 21:10:29 -04:00
Basile Clement
33946e61bb feat: Configurable colors for card counter (#5882)
* feat: Configurable colors for card counter

This patch adds support for:

 - User-defined colors for card counters;
 - 3 additional types of card counters.

The colors used for counters is stored locally and not shared with other
users. This is intentional as the feature is likely to be used for
improved accessibility.

In order to preserve backwards-compatibility, and because I don't have a
better idea, counters keep their existing color-based names (Red, Green,
Yellow) in menus and in the message log. For consistency, the new
counters also get assigned color-based names (Cyan, Purple, Magenta).

This choice is a compromise, as allowing user-defined names for counters
raises many additional (UI/UX) questions that I don't know how to
answer. A good long-term solution would be to include counter names as
part of a game definition system and hence would be in scope for #1740.

The choice of adding 3 additional types of counters and the Cyan, Purple
and Magenta names are not random. The existing code for determining
counter colors goes: Red, Green, Yellow, Cyan, Purple, Magenta, Black
(unreadable) and thus 6 is the maximum number of counters that existing
versions of Cockatrice are able to support. This way, released clients
get a degraded experience (cannot interact with the new counters,
messages in the server log say "Player X places 1 on Card (now 1)"
without specifying 1 of what), but do see the counters properly.

Fixes #2020

* Do not use %n

* Use SettingsManager

* Use qSin instead of sin

Fix build failures with old GCC.

* Use letters for card counter names

* Place card counter actions in separate menu

* Remove copy-paste error

* include QtMath

* Do not color whole settings page

* derp

---------

Co-authored-by: Zach H <zahalpern+github@gmail.com>
2025-06-12 22:12:46 -04:00
BruebachL
fe57efb1a8 Parallel picture loader (#5977)
* Parallelize picture loader.

* Queue requests instead.

* Include a status bar for the picture loader.

* Save redirect cache on destruction.

* Address comments.

* Let's not overwrite an ambigious variable name.

* Lint.

* Oracle needs the status bar too.

* We actually get a free request if we hit a cached image.

* Fix cmake list.

* toString() the url.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-06-12 19:44:38 -04:00
transifex-integration[bot]
05914e38f0 Translate oracle/oracle_en@source.ts in pt_BR (#5918)
100% translated source file: 'oracle/oracle_en@source.ts'
on 'pt_BR'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2025-05-06 21:26:27 -04:00
RickyRister
ffe02e59c7 Refactor: clean up OracleImporter (#5871)
* remove unused dataDir variable

* inline setsMap

* join declaration and assignment

* make the protected methods static

* make getSetPriority static

* inline mainCardTypes list and make the method static

* pass by const ref when able

* rename param to match
2025-04-21 16:29:42 -04:00
RickyRister
ca73033aea Refactor files in oracle to new Qt Slot/Signal syntax (#5869)
* Refactor files in oracle to new Qt Slot/Signal syntax

* fix build failure
2025-04-20 23:53:37 -04:00
RickyRister
a1499854f9 Make OracleImporter not extend CardDatabase (#5868)
* Move TOKENS_SETNAME to CardSet

* make OracleImporter no longer extend CardDatabase
2025-04-21 01:48:13 +00:00
github-actions[bot]
e9d05e6271 Update translation files (#5828)
Co-authored-by: github-actions <github-actions@github.com>
2025-04-15 22:08:52 +00:00
transifex-integration[bot]
ac1ae4fed5 Translate oracle/oracle_en@source.ts in it (#5826)
100% translated source file: 'oracle/oracle_en@source.ts'
on 'it'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2025-04-14 05:32:55 +00:00
transifex-integration[bot]
a1f2617931 Translate oracle/oracle_en@source.ts in de (#5825)
100% translated source file: 'oracle/oracle_en@source.ts'
on 'de'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2025-04-13 04:16:33 +02:00
ebbit1q
351c77182c put multiple printings of the same dual face/split cards in the xml (#5823) 2025-04-11 23:02:48 -04:00
transifex-integration[bot]
0e7d7ffcb2 Translate oracle/oracle_en@source.ts in it (#5786)
100% translated source file: 'oracle/oracle_en@source.ts'
on 'it'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2025-04-04 03:40:14 +00:00
github-actions[bot]
787c551f5f Update translation source strings (#5781)
Co-authored-by: github-actions <github-actions@github.com>
2025-04-03 00:17:25 -04:00
Basile Clement
2fcdb52157 fix: Use isRebalanced to detect Arena cards (#5778)
* fix: Use isRebalanced to detect Arena cards

In #5759 we introduced a setting (off by default) to disable the use of
Arena cards. This was done by checking the `isOnlineOnly` property of
the card, which accidentally also disabled online *printings* of cards
that otherwise exist in paper (e.g. Vintage Masters).

This PR does the same thing but uses the `isRebalanced` property
instead, which is `true` for Arena cards only and should have been used
from the start. This setting does not impact online-only printings such
as Vintage Masters. The settings is still on by default.

* Update setting to mention Alchemy rather than Arena
2025-04-03 00:16:38 -04:00
github-actions[bot]
37356317a4 Update translation files (#5775)
Co-authored-by: github-actions <github-actions@github.com>
2025-03-27 21:31:05 -04:00
transifex-integration[bot]
91ee6097d2 Translate oracle/oracle_en@source.ts in it (#5770)
100% translated source file: 'oracle/oracle_en@source.ts'
on 'it'.

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2025-03-24 22:11:47 +00:00
Basile Clement
0ae7d01234 Hide arena only cards (#5759)
* Add settings (default: true) to ignore online-only cards

* Use QAbstractButton::toggled

Also, fix dbconverter build

* Mocks mocks mocks

* Update dlg_manage_sets.cpp

* translations

* Update dlg_manage_sets.cpp

---------

Co-authored-by: Zach H <zahalpern+github@gmail.com>
2025-03-22 01:07:42 -04:00
Basile Clement
d03f5388d4 Update translations (#5758) 2025-03-21 00:23:26 +00:00
RickyRister
c99afe7956 Optimize cipt parsing by early returning (#5727) 2025-03-15 21:23:41 +00:00