101 Commits

Author SHA1 Message Date
RickyRister
d57bec8ec6 [DeckList] Move decklist node classes into new folder (#6381)
* [DeckList] Move decklist node classes into new folder

* reformat

* fix
2025-11-30 13:05:49 +01:00
BruebachL
9f2ac78609 Split filters into libraries where applicable. (#6293)
* Split filters into libraries where applicable.

Took 23 minutes

Took 2 minutes

* Include filter string.

Took 5 minutes

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-11-09 12:19:27 +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
RickyRister
636aa72141 Remove redundant prefix from libcockatrice_card folders (#6237)
Took 28 minutes
2025-10-09 23:09:20 +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
d31b044529 [Card DB] Split out database loading and querying from main class (#6175)
* Simplify add card.

Took 25 minutes

Took 8 minutes

# Commit time for manual adjustment:
# Took 16 minutes

Took 7 seconds

* Refactor out db loading from card db.

Took 39 minutes

Took 9 minutes

Took 2 minutes


Took 17 seconds

* Refactor out db queries from card db.

Took 42 minutes

* Lint.

Took 3 minutes

* I guess.

Took 7 minutes

* Tests.

Took 15 minutes

* I don't understand this.

Took 9 minutes

* fix linker errors

* Rename to querier and promote to QObject

Took 39 minutes

* Lint.

Took 3 minutes

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2025-09-27 00:27:15 +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
BruebachL
93c15c8151 Home tab to replace generic deck editor on startup (#6114) 2025-09-11 15:36:34 -04:00
BruebachL
2eba126ed7 Modularize and Doxygen decklist.cpp (#6099) 2025-09-04 22:52:46 -04:00
Paul Carroll
5e88a0f0cc Fix multi-word type matching in card filters (#6060)
* Fix multi-word type matching in card filters

Add phrase matching to StringValue before word-based fallback.
Enables searches like t:"time lord" for multi-word creature types.

* Use existing typedef

* Don't inline lambda

* update filter func

* Update card type FilterString unit tests

* refactor string matcher

* update card db test

* fix sets count in test

* Add regex cache in string matcher

* Update cockatrice/src/game/filters/filter_string.cpp

* Revert "Add regex cache in string matcher"

---------

Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
2025-08-24 12:37:25 -04:00
BruebachL
09381575a7 Add option to share decklists on load. (#6029)
* Add option to share decklists on load.

Took 1 hour 58 minutes

Took 9 minutes


Took 39 minutes

* Lint.

Took 14 minutes


Took 2 minutes

* Stuffs

Took 39 minutes

Took 4 seconds

Took 43 minutes

* Process local player first.

Took 45 minutes

* Consider if the setting is set on the game info first.

Took 4 minutes

* Save an indent level.

Took 43 seconds

* Don't commit logging config.

Took 3 minutes

* Remove a debug print.

Took 10 seconds


Took 7 seconds

* Add another optional guard.

Took 5 minutes

* Hide the tab bar if only one (own deck) is visible.

Took 9 minutes

* Rename setting label for clarity

Took 2 minutes

* Capitalization.

Took 3 minutes

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-08-15 17:31: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
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
BruebachL
c388cee1fe Add a new dialog that allows editing the default suggested tags. (#5979)
* Add a new dialog that allows editing the default suggested tags.

* Lint.

* Actually hand linting, lol.

* Fix Build

* Add dialog.

* Use show() instead of exec(), properly size hint list item widgets.

* Fix... something to do with the build?

* Cast to abstract tab deck editor instead of regular.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
2025-06-13 09:16:57 -04:00
RickyRister
da2488f7d8 Add option to hide status bar (#5983)
* reorganize actions

* add setting to settingsCache

* use setting

* add shortcut

* fix typo
2025-06-13 08:55:04 -04:00
RickyRister
7e08f7df67 [VDS] Remove searchFolderName setting (#5970)
* [VDS] Remove searchFolderName setting

* rename property in ExtraDeckSearchInfo
2025-06-12 20:45:01 -04:00
RickyRister
d51620640b [VDS] Add setting to show deck filepath in tooltip (#5899)
* [VDS] Show deck filepath in tooltip

* Make tooltip type into a setting

* Fix build failure
2025-05-12 17:39:58 -04:00
BruebachL
34400c7f60 [VDE] Sample Hand Improvements (#5917)
* Actually call retranslateUi, add spinBox to change sample hand size, add card size slider.

* Lint.

* Fix include.

* Fix include again.

* Fix overloads.

* Update visual_deck_editor_sample_hand_widget.cpp

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: Zach H <zahalpern+github@gmail.com>
2025-05-06 21:28:03 -04:00
RickyRister
69107f79e3 Add setting to auto focus search bar when opening card view window (#5906)
* add new setting

* implement thing

* Rename setting

* fix build failure
2025-05-04 20:09:11 -04:00
RickyRister
57c6f2716f Add setting for which deck editor tab to open deck in (#5895)
* Create new setting

* Update settings dlg

* implement functionality

* Make setting into an enum
2025-05-02 13:00:32 -04:00
BruebachL
873e0d346e Make a setting for filtering to the most recent sets. (#5865)
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-04-20 14:39:20 +00:00
ebbit1q
6b39f6f6fa fix indenting in test cards.xml (#5866) 2025-04-20 14:36:38 +00:00
BruebachL
81a911dc11 Add the option to hide banner card and tags in deck editor. (#5857)
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-04-20 04:11:32 +00:00
lilyhuang-github
574ea01e08 update handling of keywords: AND, OR, NOT in card search (#5788)
* update hnadling of keywords: AND, OR, NOT in card search

* added and

* update test

* update test

* update OR to not be [oO][rR] and just look for OR

* keyword testing

* adjusted new test

* implement test case for cards with keyword in name

* implement test case to cards with keyword in name

* format

* update test case

* change test cas

* update truth test case

* changed test card search from real cards to fake and added cards

* Update tests/carddatabase/data/cards.xml

Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>

* Update tests/carddatabase/filter_string_test.cpp

Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>

* Update tests/carddatabase/filter_string_test.cpp

Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>

* update formatting

* update cardatabase_test to include +2 cards

* update test case +1 set + 1 type

---------

Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
2025-04-20 04:08:00 +00:00
RickyRister
26dcb015ce Refactor function structs into lambdas (#5675)
* change signature to use lambda

* reuse comparator

* inline structs in forEachCard

* inline structs

* Refactor exportDeckToDecklist

* fix unit test
2025-04-20 04:07:22 +00:00
BruebachL
8af1f2b6d9 Implement a little "raise on enter" animation for deck preview widgets. (#5844)
* Implement a little "raise on enter" animation for deck preview widgets.

* Why does the linter need to be run twice?

* Fix build.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-04-18 03:31:47 +00:00
BruebachL
c4d0921a15 Visual Database Display Tab. (#5822)
* Visual Database Display Tab.

* Address comments.

* Readd dropped method.

* Update filterTree properly in case the filter is empty after modification.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-04-15 01:25:49 +00:00
ebbit1q
300a37a199 change settings entry of the cod conversion prompt to a combobox (#5801)
* change settings entry of the cod conversion prompt to a combobox

replace the two checkboxes of which one state is ignored if one is
checked with a three state combobox for better user experience

* Update dlg_settings.cpp

---------

Co-authored-by: Zach H <zahalpern+github@gmail.com>
2025-04-11 23:12:34 -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
Basile Clement
c71685b261 Add option to disable card rounding (#5760)
* Add option to disable card rounding

* Effing mocks

* format

* Get rid of cardCornerRadius property
2025-03-22 01:07:52 -04: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
RickyRister
0d2061365c Fix edit deck in clipboard clearing values (#5732)
* Fix edit deck in clipboard clearing values

* fix build failures
2025-03-16 23:30:12 +00:00
RickyRister
3a11ccb854 Update cipt parsing (#5712)
* refactor

* move thing out

* write unit tests

* get thing to work

* optimization?

* fix build failure
2025-03-14 21:44:13 -04:00
RickyRister
4b7d1ebb59 Refactor: split card_database into two files (#5715)
* make the duplicate

* restore original

* Refactor: split card_database into two files
2025-03-14 00:02:10 +00:00
RickyRister
6df97a156f Change "include folder name in VDS search" into a setting (#5659)
* add new setting

* implement thing
2025-02-26 12:01:30 -05:00
RickyRister
47311b1dfd Expand/shrink card view window on double click (#5652) 2025-02-25 18:32:45 -05:00
BruebachL
23f4c9c4e4 Tags in deck editor (#5608) 2025-02-12 03:18:00 +00:00
BruebachL
7c9bf75393 Overhaul quick settings for VDS and PrintingSelector (#5602)
* Move show folders option next to the search bar.

* Add a new settings button and settings popup, move the folder visibility checkbox there and the ability to hide tags.

* Make popup not close when interacting with child widgets.

* Fix mocks.

* Include cog icon.

* Move PrintingSelector Display options to new quick settings widget.

* Adjust size before first show so as to not overflow.

* Add option to hide card size slider in VDS.

* Qt5 support.

* Fix some warnings by containerizing layouts because addChildLayout is silly.

* Fix an incorrect slot/signal assignment.

* Correct sub-categories for settings to persist them.

* Shuffle some slots and signals around to distinguish between the tag filter and the tags on the deck preview widgets.

* Add a quick setting to draw unused color identities and center them.

* Respect the setting on startup.

* Move card size slider to the quick settings menu.

* Move PrintingSelector card size slider to quick menu, adjust other layout from other options.

* Improve layout, add a gray border.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-02-10 16:50:08 +00:00
RickyRister
2c6e7d4d3a Add option to hide folder structure in Visual Deck Storage (#5575) 2025-02-07 15:36:24 +00:00
RickyRister
d951b082c4 Add setting to hide visual deck storage in game lobby (#5570) 2025-02-06 13:44:33 +00:00
BruebachL
ce416df3fb Add a dialog to prompt user to convert to .cod format if trying to apply tags to a .txt deck. (#5514)
* Add a dialog to prompt user to convert to .cod format if trying to apply tags to a .txt deck.

* Lint mocks.

* Address comments, move dialog to appropriate folder.

* Unlint.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-01-25 03:20:30 +00:00
RickyRister
97fdf11c8f Add setting to auto close card view when empty (#5502) 2025-01-21 03:08:01 +00:00
RickyRister
2def02e140 Remember which tabs are open between sessions (#5467) 2025-01-15 06:10:24 +00:00
BruebachL
dd8ac14f99 Visual deck storage v2 (#5427)
* Restore some button states (ready/sideboard locked) to sensible defaults when unloading a deck.

* Update last loaded timestamp in decklist file and then restore original last modified timestamp if a user requests a deck load.

* Add some todos.

* Loading a deck from local file dialog should swap out scenes, enable unload button.

* Lint.

* Shuffle some classes and signals around.

* More sort options, sort widgets directly.

* Banner cards should respect providerIds.

* Properly updateSortOrder on load.

* Add the color identity to the Deck Preview Widget.

* Properly set sort indices.

* Change replace visualDeckStorageWidget with deckView to be in deckSelectFinished so that it also works on remote deck load.

* Include settings for unused color identities display.

* Change opacity scaling.

* Overload for Qt.

* Lint.

* Lint.

* Include QMouseEvent

* Template because MacOs.

* Include a quick filter for color identities.

* Include a quick filter for color identities.

* Save some space.

* Refactor DeckPreviewWidgets to reside in their own folder.

* Add Deck Loader logging category.

* Introduce a tagging system.

* Add some more default tags.

* Even more default tags.

* Lint.

* Lint a comma.

* Remove extra set of braces.

* Lint some stuff.

* Refresh banner cards when tags are added.

* Lint.

* Wrestle with Qt Checkboxes.

* Lint.

* Adjust some sizes, relayout.

* Address comments.

* Lint.

* Reorder kindred types.

* Add a search bar for tags.

* Remove close button (for now) and change "Add tags ..." to "Edit tags ..."

* Retranslate window title for Deck Tag Manager Dialog.

* Style tag addition widget to be consistent.

* Lint.

* Override paintEvent.

* Override sizeHint

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2025-01-12 17:46:22 -05:00
BruebachL
62f7c7f9ce New visual deck storage (#5290)
* Add TabDeckStorageVisual

* Visual Deck Storage

* Add BannerCard to .cod format, use it in the visual deck storage widget.

* Show filename instead of deckname if deck name is empty.

* Lint.

* Don't delint cmake list through hooks.

* Add deck loading functionality.

* Open Decks on double click, not single click.

* Void event for now.

* Fix build issue with overload?

* Fix build issue with overload?

* Include QDebug.

* Turn the tab into a widget.

* Move the signals down to the widget, move the connections and slots up to the parent widgets.

* No banner card equals an empty CardInfoPtr.

* Add an option to sort by filename or last modified.

* Flip last modified comparison.

* Lint.

* Don't open decks twice in the storage tab.

* Fix unload deck not working by showing/hiding widgets instead of adding/removing to layout.

* Add a search bar.

* Add a card size slider.

* Lint.

* Lint.

* Lint.

* Fix settings mocks.

* No need to QDebug.

* No need to QDebug.

* Member variable.

* Member variable.

* Non-lambda.

* Change set to list conversion.

* Specify overload.

* Include MouseEvent

* Adjust font size dynamically.

* Add an option to show the visual deck storage on database load.

* Fix the close button not working on the tab, add an option to launch the visual deck storage tab to Cockatrice menu.

* Override virtual functions.

* Correct tab text.

* Add a setting to remember last used sorting order for visual deck storage widget.

* Update banner card combo box correctly.

* Fix mocks.

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: Zach H <zahalpern+github@gmail.com>
2025-01-05 18:12:20 -05:00
RickyRister
bb4214e28a Make SettingsManager params const ref (#5405)
* pass settingsPath by const ref

* pass params by const ref

* cleanup
2025-01-02 00:33:37 -05:00
RickyRister
25d21a3da6 refactor: remove ReleaseChannel keeping track of its own indexes (#5366) 2024-12-28 23:51:37 +00:00