* [VDE] Consolidate statistical analysis into a separate object so multiple widgets can re-use calculations and calculation is only performed once on data change.
* [VDE] Lint.
* [VDE] Move struct up to not confuse compiler.
* [VDE] NoDiscards
* [VDE] Move variables
* [VDE] Lint.
* TabArchidekt and Archidekt API integration.
Took 37 seconds
Took 4 minutes
Took 40 seconds
Took 4 minutes
* Lint.
* Lont.
* Search bar, fancier display, resolve providerId
* Delegate click to base.
* Be explicit for pedantic compilers.
* Liiint.
* Leave them default I guess
* Leave them default I guess
* Small fixes.
* New utility display widgets.
* New style for deck listing.
* Lint.
* Lont.
* Scale things.
* Delegate paint to base.
* Use default Archidekt preview image for decks without featured.
* Consistent sizes.
* Increase font size, qt version guard.
* More version guards.
* Clean up filter layout, use mana symbols.
* Set content margins.
* Refresh on filter change.
* Lint.
* Better elision.
* Query actual new endpoints, new query parameters.
* Doxygen, reorder fields in constructor, readability.
* Update page size doc to min size.
* Update initial min deck size value.
* Add label to page selection.
* Okay, so, people upload a lot of 1 card decks frequently.
* Whoops.
* Add a selection combobox for sorting logic.
* Debounce and limit searches.
* Include.
* Lint.
* Don't imply that Archidekt supports multiple cards/commander names.
* Let's not lambda it and slot it instead.
* Overload.
* Add button to home tab.
Took 8 minutes
* Adjust to selection model change.
Took 5 minutes
* Cleanup auto-generated comments.
Took 8 minutes
* Remember card sizes.
Took 1 minute
* Initialize with correct size.
Took 3 minutes
* Use correct placeholders.
Took 2 minutes
* Style lint.
Took 16 minutes
* Parse double-faced cards correctly.
* Parse double-faced cards correctly.
* Allow TabArchidekt to use VDE group/sort/display buttons
* Lint.
* Indicate that things are clickable.
* Min treshold for nicer display.
* Lint.
* We have good labels at home.
* We do a little linting.
* Qt version guards.
* Qt5 is the devil.
* Update comments.
* Lint comments.
* More doxys.
* One more doxy.
* Lint.
* Update.
* Small fixes.
Took 7 minutes
Took 13 seconds
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* [Cleanup] Unused #includes
Took 44 minutes
* [Cleanup] More unused #includes
Took 55 minutes
* [Cleanup] Include QSet
Took 4 minutes
* [Cleanup] Include QDebug in deck_list.cpp
Took 3 minutes
* [Cleanup] Include protocol stuff in servatrice_database_interface.h
Took 3 minutes
* [Cleanup] Include QDialogButtonBox
Took 8 minutes
* [Cleanup] Include QUrl
Took 8 minutes
* [Cleanup] Include QTextOption in header.
Took 3 minutes
* [Cleanup] Include QMap in user_list_manager.h
Took 8 minutes
* [Cleanup] Adjust qjson
Took 8 minutes
* [Cleanup] include button box.
Took 3 minutes
* [Cleanup] Redo fwd declarations.
* [Cleanup] Redo last removed fwd declarations.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* [DeckLoader] Refactor last load info into struct
* Use constant
* [[nodiscard]]
* do discard, I guess.
---------
Co-authored-by: Brübach, Lukas <lukas.bruebach@student.fhws.de>
* [VDD] Add sorting
Took 17 seconds
Took 3 minutes
* Adjust to contents.
Took 13 minutes
* Adjust sort order as well.
Took 5 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* protocol changes
* servatrice changes
* add new setting
* implement client side with static 4 phases
* reading the code explains the code
* add subphases to phase.cpp
* use new subphase definition
* [BannerCard] Try to restore by providerId
Took 27 minutes
Took 41 seconds
* Style lint.
Took 2 minutes
* Don't look up by providerId if it's empty.
Took 8 minutes
* Add extra name guard to providerId clause.
Took 4 minutes
* Update cockatrice/src/interface/widgets/deck_editor/deck_editor_deck_dock_widget.cpp
Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
* Update cockatrice/src/interface/widgets/deck_editor/deck_editor_deck_dock_widget.cpp
Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
* Adjust to comments.
Took 11 minutes
* Extract to helper function.
Took 3 minutes
* Make helper static.
Took 5 minutes
* Remove const qualifier.
Took 3 minutes
* Finally.
Took 5 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
* [DeckEditor] Deck List History Manager.
Took 23 minutes
Took 17 minutes
* Add icons.
Took 2 minutes
Took 3 seconds
* Small fixes.
Took 12 minutes
* Style lint.
Took 48 seconds
* tr() things.
Took 5 minutes
* Add tooltips for buttons.
Took 3 minutes
* Add explanation label to history.
Took 3 minutes
* Refactor to .cpp, delegate undo/redo to manager, don't return memento
Took 8 minutes
* Clear history when setting deck.
Took 6 minutes
* Move to value based stacks.
Took 52 seconds
* Default constructor.
Took 31 seconds
Took 3 minutes
Took 4 minutes
Took 2 minutes
* Have it listen to deck editor additions.
Took 18 minutes
* Don't connect buttons *and* actions.
Took 2 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* [DeckList] Disable copy constructor
Took 1 hour 44 minutes
Took 1 minute
# Commit time for manual adjustment:
# Took 28 seconds
Took 33 seconds
* Revert member to pointer.
Took 19 minutes
* Revert pulling up setters/getters now that getDeckList is no longer const.
Took 6 minutes
* Revert more.
Took 2 minutes
* One more fix.
Took 1 minute
* Update cockatrice/src/interface/deck_loader/deck_loader.cpp
Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
* [Refactor] Move AbstractGraphicsItem and GraphicsItemType to game_graphics/board folder.
Took 3 minutes
* Update CMakeLists.txt
Took 12 minutes
* Update CMakeLists.txt
Took 12 minutes
Took 2 minutes
Took 16 seconds
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Add button to join game as judge as well as convenience filters.
Took 1 hour 11 minutes
* Change button to filter to games created by buddies, set default filter settings to be very permissive.
Took 45 minutes
* Remove debug.
Took 3 minutes
* Update game_selector.cpp
* Add spacers, rearrange.
Took 20 minutes
Took 20 seconds
* Add explanation tooltip.
Took 39 seconds
* Try layouting.
Took 14 minutes
* Set min size, set spacing for mac os
Took 3 minutes
* Try without the labels.
Took 3 minutes
* Don't use labels.
Took 5 minutes
* Fine-tune.
Took 2 minutes
* AsJudge
Took 4 minutes
* Clear up comment.
Took 37 seconds
* Remove shift hotkey.
Took 4 minutes
* Spectate as judge.
Took 8 minutes
* Add checkBox to create game as judge.
Took 7 minutes
* Fix crash.
Took 12 minutes
* Rename, fix returns.
Took 19 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Include new pictures.
Took 57 minutes
* Update old pictures.
Took 6 minutes
Took 3 minutes
* Update export documentation.
Took 4 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Fix local variable double declaration.
Took 44 seconds
* Mark functions as [[nodiscard]]
Took 31 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* [Doxygen] Card Picture Loader
Took 25 minutes
Took 16 minutes
# Commit time for manual adjustment:
# Took 12 seconds
Took 14 seconds
* Remove placeholder file description.
Took 1 minute
* ... but do group PictureLoader again
Took 28 seconds
* Link to methods directly.
Took 6 minutes
* Forward declaration.
Took 49 seconds
* Remove redundant .cpp function documentation.
Took 15 minutes
* More fixes.
Took 7 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Helper to query deckList for DecklistCardNodes.
Took 30 minutes
Took 6 minutes
Took 2 minutes
* Fix unused.
Took 3 minutes
Took 1 minute
* Convert string to string list.
Took 2 minutes
* Adjust to rebase.
Took 2 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Give settings managers default groups instead of manually specifying them everywhere.
Took 1 hour 2 minutes
Took 41 seconds
Took 32 seconds
Took 5 minutes
* Fix dbconverter mock.
Took 2 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Docu stash
Took 1 hour 53 minutes
Took 5 minutes
Took 16 seconds
Took 33 seconds
* Remove file headers.
Took 8 minutes
* Group to card set.
Took 8 seconds
* More extra pages.
Took 28 seconds
* Small fix for now.
Took 3 minutes
* Expand on picture loading.
Took 44 minutes
* Fix line break breaking link.
Took 2 minutes
* Images and user documentation.
Took 1 hour 49 minutes
* Update doc/doxygen-extra-pages/developer_documentation/primer_cards.md
Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
* Initialize all deck list member variables in constructor.
Took 10 minutes
* Revert "Initialize all deck list member variables in constructor."
This reverts commit fba2455808.
* setParent
Took 1 hour 2 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* 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
* A DeckLoader is not a DeckList.
Took 2 hours 39 minutes
* Explicitly initialize base class in copy constructor?
Took 3 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* attempts to fix the problem
* add test to show the problem
* fix workflow
* move logger to cockatrice
* more attempts
* undo stuff
* mark different libraries as gui
* fix SC2145
* rename servatrice only build
* Deck loader is a gui class.
Took 31 minutes
Took 3 minutes
* Deck Loader is responsible for printing.
Took 8 minutes
Took 2 seconds
* Style proxy.
Took 14 minutes
Took 6 minutes
Took 1 minute
* Don't need to include QBrush anymore.
Took 3 minutes
Took 7 seconds
* Includes for printer.
Took 5 minutes
* Nuke getDeckList()
Took 9 minutes
* Adjust to rebase.
Took 35 seconds
* Lint.
Took 3 minutes
* Braces for one line return statements.
Took 13 minutes
Took 50 seconds
* Enum for model columns.
Took 9 minutes
* One more single line if.
Took 1 minute
* Another style lint on a sunday night
Took 5 minutes
* Move enum to namespace.
Took 3 minutes
* Fix a critical blocker.
Took 5 minutes
* Update docs.
Took 3 minutes
* Doxygen and namespace enums.
Took 2 minutes
Took 15 seconds
* Adjust to namespace.
Took 4 minutes
Took 1 minute
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Fix crash on rejoining game when reconnecting.
Took 2 minutes
Took 13 minutes
* Proper lib include.
Took 1 minute
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* 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>
The VIP Moderator (Head Moderator) star icon was flipped horizontally
and did not match the orientation of other moderator icons. Fixed by
inverting the scaleX value in the transform matrix and adjusting the
translateX value to maintain the star's position.
Fixes#6290
* Add more sort options to hand sort
Took 14 minutes
* Move defaultOptions up a level
* Directly pass sort order as param
* fix include
* revert
* fallback expandSortOption
* Introduce additional checks for playerMenu shortcut activation when they are accessed by a judge, only activating them if the player is a local player.
Took 2 hours 7 minutes
Took 17 minutes
* Undo example change.
Took 5 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* 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>
* 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
* ci: unify vcpkg jobs
* use build matrix variables: package_suffix
simplifying some convoluted logic, one variable at a time. work in progress.
* use build matrix variables: artifact_name
* use build matrix variables: qt stuff
* display cmake flags in builds
* add type to windows builds
* use build matrix variables: cmake stuff
* use build matrix variables: USE_CCACHE
* formatting
* more formatting
* spaces
* address review comments
* Move logger and key signals from libcockatrice_utility to Cockatrice.
Took 9 minutes
* Only link Qt::Core instead of COCKATRICE_QT_MODULES to libraries, if possible.
Took 2 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Move models to own library.
Took 35 minutes
Took 22 minutes
* Adjust CMakeLists
Took 20 seconds
* Reformat CMakeLists.
Took 2 minutes
* Revert "Reformat CMakeLists."
This reverts commit db5982ad1c.
Took 55 seconds
* Lint an include
Took 17 minutes
Took 9 seconds
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* 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>
4% of minimum 4% translated source file: 'cockatrice_en@source.ts'
on 'tr'.
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>
7% of minimum 4% translated source file: 'cockatrice_en@source.ts'
on 'nb'.
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>
* build: target older macos
* cleanup
* Align xcode versions
* Simplify --x86-macos
* use cmake flag in compile.sh i.s.o. env var in yml
* more cleanups
* adress initial reviews
* generate triplet file in compile.sh
* fix triplet name
* pass matrix.target as version
* small refactor
* another minor refactor
* ci: fix ccache cleaning
* add more comments
* try passing triplets config as cmake variables
* Revert "try passing triplets config as cmake variables"
This reverts commit 77e83e8590.
* move logic inside runner == macos if
* move logic to env var
* simplify script
* format script
"I just thinks it looks better like this"
* make script work for arm as well, might be useful
* use hyphen
* use DVCPKG_HOST_TRIPLET instead of DVCPKG_TARGET_TRIPLET
* use DVCPKG_HOST_TRIPLET AND DVCPKG_TARGET_TRIPLET
---------
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
* [PrintingSelector] Clearly warn users about disabling the providerId change, hide and disable the printingSelector, clear the networkCache.
Took 56 minutes
Took 4 seconds
Took 9 minutes
* Defer rollback so the rollback isn't swallowed logically.
Took 7 minutes
* Immediately enable select printing action.
Took 7 minutes
* Remove restart label.
Took 8 seconds
* Clear PixmapCache as well as NetworkCache.
Took 4 minutes
* Lint.
Took 3 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Player manager is responsible for deleting players.
Took 21 minutes
* Clean up dangling QAction* wrappers for PlayerMenus in TabGame::processPlayerLeave(Player* leavingPlayer)
Took 37 seconds
* Lint.
Took 11 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Populate playerLists for menus in their aboutToShow so they are always current and do not rely on playerMenu manually tracking them. Also add playerActions for previous playerListActions.
Took 1 hour 35 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Regroup a whole bunch of files.
Took 1 hour 38 minutes
* Reorder the structure.
Took 15 minutes
* Link some more things.
Took 18 minutes
* More links.
Took 14 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* 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>
* Add a doxy group for the PictureLoader.
Took 26 minutes
* Linting is a fun activity for children and adults of all ages and sizes.
Took 5 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Sort *every* file into a doxygen group.
Took 7 hours 9 minutes
Took 18 seconds
Took 2 minutes
* Lint some ingroup definitions.
Took 10 minutes
Took 2 seconds
* Just include the groups in the Doxyfile in this commit.
Took 3 minutes
* Update some group comments so they link!
Took 14 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Layout adjustments.
Took 1 hour 54 minutes
Took 2 minutes
Took 6 minutes
* Remove the empty building page.
Took 7 minutes
* Change to @page
Took 11 minutes
* Change to @page again
Took 52 seconds
* Change to @page again again
Took 2 minutes
* Fence the page declaration in CONTRIBUTING.md
Took 8 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Manual trigger, branch name fix, rename yml
* Update documentation-build.yml
* Run on changes to file but only deploy on tags
* Update documentation-build.yml
* [TabGame/GameEventHandler] Re-emit spectator addition signals in eventGameStateChanged.
Took 36 minutes
* Check spectators as a whole.
Took 2 minutes
* Lint.
Took 42 seconds
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Add workflow to generate doxygen on tag push.
Took 17 minutes
* Publish correct dir.
Took 3 minutes
* Don't include common/libs.
Took 20 minutes
* Update workflow
Took 1 hour 25 minutes
* Style Doxygen output.
Took 55 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Clean up game scene code.
Took 18 minutes
* Doxygen.
Took 18 minutes
Took 5 seconds
Took 10 minutes
* Move some methods.
Took 6 minutes
* Restore the original warning, I guess.
Took 3 minutes
* Accidentally some methods.
Took 5 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* build: use vcpkg for most dependencies on macos
* factor out common params
* refactor: factor out common parameters in macOS matrix
* use env vars instead of matrix
* add comment about jianmingyong/ccache-action
* Remove unused 'qt_tools' param
* Use system python
* Let ccache caches be handled by ccache-action
* Add comment about why we use install-qt-action
* set unique ccache key
* nit
* fix cache prefix
* pass gh-token
* Revert "pass gh-token"
This reverts commit cadfa253c6.
* Reapply "pass gh-token"
This reverts commit bd15e96e18.
* do not cache qt on macos
* 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>
* [TabRoom] Re-layout game creation dialog.
Took 18 minutes
* Don't squish because then they overlap. Use new layout instead.
Took 8 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Handle concession properly.
Took 57 minutes
Took 38 seconds
Took 18 seconds
Took 21 seconds
* Set text and enable/disable on game start/stop. (Does not fix the translation issue but at least disables the button.)
Took 51 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Fix timer starting twice, not stopping and not resetting correctly.
Took 39 minutes
* Don't stop/start, just start.
Took 29 minutes
* Fix build.
Took 2 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Simplify add card.
Took 25 minutes
Took 6 minutes
* Simplify guessCard.
Took 2 minutes
* Simplify loadCardDatabases.
Took 3 minutes
Took 6 seconds
* Clean up mutexes instead of manually locking/unlocking.
Took 5 minutes
* Fix null/empty check.
Took 3 minutes
* Move some stuff around inside the file.
Took 4 minutes
* Move some more things.
Took 2 minutes
* Clean up refreshCachedReverseRelatedCards.
Took 2 minutes
Took 6 seconds
* Clean up getCardFromSameSet.
Took 2 minutes
* Lint.
Took 5 minutes
* Fix compiler warning.
Took 4 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Refactor CardDatabaseDisplayModel, TokenDisplayModel and TokenEditModel out of CardDatabaseModel. Move every model into an appropriate folder.
Took 54 minutes
* No folder for database models.
Took 6 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* move common server files
* update includes with move
* create participant, move code
* fix linker errors
* fix regressions
* mark function as override to make clang happy
* split out spectator to new file
* forgot to add to cmakelists
* autocompleter picking wrong casing for var name
* clean up forwards declarations in player
* fix includes in game
* 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
* Disable shuffle if frequency is set to 0.
Took 13 minutes
Took 26 seconds
* Set special value text.
Took 12 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* check for null zone during card item teardown
Took 1 hour 32 minutes
Took 24 seconds
* Also check for it in the successful branch.
Took 6 minutes
* Comment.
Took 5 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Don't get local ID from playerInfo.
Took 39 minutes
Took 39 seconds
* Introduce isLocalPlayer convenience method.
Took 21 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Check if card has no PT set yet if dropped on table.
Took 22 minutes
* Use isEmpty() for comparison.
Took 6 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Disable view card database button until card db is loaded, add a new style for disabled buttons.
Took 4 minutes
Took 21 seconds
* Lint.
Took 8 minutes
* Rename variables, don't disable DB button anymore.
Took 4 minutes
Took 4 seconds
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Properly delete enlargedPixmapWidget.
Took 23 minutes
Took 13 seconds
Took 16 seconds
* Connect to QObject instead of emitting own signal.
Took 12 minutes
Took 7 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Refactor player menus into helper classes.
Took 2 hours 6 minutes
Took 11 minutes
* Lint.
Took 6 minutes
Took 22 seconds
* Refactor card and move menu.
Took 1 hour 6 minutes
Took 36 seconds
Took 52 seconds
* Set active shortcuts, move player info stuff to card menu.
Took 25 minutes
Took 18 seconds
* Refactor say and utility menu.
Took 54 minutes
Took 2 minutes
Took 5 minutes
Took 11 minutes
* Rename folder.
Took 24 minutes
Took 6 minutes
* Refactor sideboard menu.
Took 26 minutes
* Remove unused variable in constructor.
Took 42 seconds
* Lint.
Took 11 minutes
* Nullptr check
Took 8 minutes
* Use localOrJudge check
Took 6 minutes
* Fix the build.
Took 7 minutes
Took 35 seconds
* PlayerList things.
Took 16 minutes
* Retranslate and set shortcuts for everything.
Took 10 minutes
* Correctly nullptr out sayMenu if not local
Took 3 minutes
* Don't check playerInfo in sbMenu shortcutsActive
Took 3 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Player refactor.
Took 1 hour 43 minutes
Took 1 minute
Took 23 seconds
* Tiny lint.
Took 3 minutes
* Hook up tap logic again.
Took 13 minutes
* Fix an include.
Took 3 minutes
* Stuff.
Took 6 minutes
* Fix typo.
Took 7 minutes
* Include.
Took 1 minute
* Reorganize method/variable definitions, remove unused ones.
Took 1 hour 8 minutes
Took 24 seconds
* Clean up some unused imports.
Took 6 minutes
* Player holds the deck, emits deckChanged(), other elements player->getDeck() to respond to changes.
Took 37 minutes
* Connect player->openDeckEditor signal directly in the player constructor
Took 6 minutes
* Emit openDeckEditor signal in player_actions again.
Took 3 minutes
* Do to-do's
Took 3 hours 32 minutes
* Lint.
Took 3 minutes
* Lint again.
Took 2 minutes
* Fix include.
Took 32 minutes
* The stack should ensure card visibility.
Took 21 minutes
* Fine, the game can remember the tab.
Took 10 minutes
Took 21 seconds
Took 9 seconds
* zoneId is a dynamic gameplay property and thus belongs in player.cpp
Took 11 minutes
Took 19 seconds
* Signal view removal, addition.
Took 5 minutes
* Ensure all players are considered local in local game.
Took 10 minutes
* ENSURE they are.
Took 8 minutes
* Bounds check data sent by QAction()
Took 54 minutes
* Move comment.
Took 20 seconds
* Reimplement logging category for game_event_handler.cpp, remove linebreaks.
Took 36 seconds
* PlayerGraphicsItem is responsible for retranslateUi, not Player.
Took 14 seconds
* Set menu for sideboard again, translate some menu titles, reimplement actIncPT action
Took 54 seconds
* Comment spacing.
Took 43 seconds
* Change message_log_widget.cpp slots to take CardZoneLogic parameters as emitted by PlayerEventHandler.
Took 7 minutes
Took 14 seconds
* Remove unused player_logger.cpp
Took 2 minutes
* Query local game state correctly from tab_supervisor again
Took 3 minutes
* Revert Deck legality checker.
Took 3 minutes
* Instantiate menu before graphics item.
Took 1 hour 5 minutes
Took 55 minutes
* Differentiate games and replays.
Took 9 seconds
* Lint.
Took 10 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Move game state and event handling out of tab_game and into separate classes.
Took 6 hours 38 minutes
Took 23 seconds
* Meta Info
Took 14 hours 36 minutes
* Properly respond to game started again.
Took 49 minutes
* Hook up the message log widgets to game events again.
Took 33 minutes
Took 7 seconds
* Lint.
Took 4 minutes
* Hook up playerListWidget.
Took 1 hour 2 minutes
Took 10 seconds
* Hook up playerListWidget properly.
Took 1 hour 17 minutes
* Fix regressions.
Took 17 minutes
Took 9 seconds
* Log the local player joining too.
Took 2 minutes
* Connect some player signals unrelated to this refactor again.
Took 5 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* new protos
* implement commands on server
* add buttons
* icons
* run formatter
* Message on get replay code failure
* Add new commands to switch statement
* Better failure messages
* Fix permission check query
* Change hash method
* Prevent adding duplicate replays
* Clean up TabReplay ui
* Copy over replay name
* base64 encode the hash
* Shorten hash
* Better failure messages
* change icon back to search icon
* check hash before checking if user already has access
* update share icon
* Update label text
* 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>
* extract cardMenu from CardItem
* move cardMenu saving to TabGame
* delete TabGame::updateCardMenu
* move checking to updateCardMenu
* unset activeCard when all cards are unselected
Tokens created through Ctrl + T use the pinned printing, if available.
Tokens created through a related card menu use a token from the same set, if available.
Took 2 hours 25 minutes
Took 10 seconds
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Add sort hand shortcut
* add function to sort hand by type and name
* rig up the sort hand to the player
* fix sorting param
* use getShortcut instead of getSingleShortcut
* use correct method
* change default sorting
---------
Co-authored-by: Zach H <zahalpern+github@gmail.com>
* Add the option to load decklists from Archidekt, Deckstats, Moxfield, TappedOut in deck editor and lobby.
Took 3 hours 34 minutes
Took 9 seconds
Took 12 seconds
* Properly set quantities.
Took 11 minutes
* Warnings.
Took 5 minutes
* Static regexes.
Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
* Category loggings and better warnings.
Took 18 minutes
Took 42 seconds
* use loadFromStream_Plain instead of manually adding CardNodes to the DeckList.
Took 30 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
* Allow more naming schemes for custom pictures.
Order is cardName_providerId, cardName_setName_collectorNumber, setName-collectorNumber-cardName and then just generically cardName, if the user has decided to override every printing. Most-to-least specific.
Took 2 minutes
Took 8 seconds
* Fixups.
Took 2 minutes
* Even more naming schemes.
Took 6 minutes
* Finally yeet the bug warning in PrintingSelector
Took 3 minutes
* Adjust to PrintingInfo change.
Took 5 minutes
* Don't use suffixes.
Took 7 minutes
Took 9 seconds
* Comments.
Took 2 minutes
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Inline getCardFromMap
map.value already returns a default-constructed value if the key is not present
* Use for-each instead of iterator
* Add new method
* clean up method order
* fix build failure
* clean up getPreferredPrinting usage
* early returns
* remove unnecessary consts
* removed unused
* rename class
* rename variables and methods
* rename again
* rename variables again
* rename field
* run formatter
* [PictureLoader] Reduce downtime between load attempts
* rename some stuff
* better comments
* Fix segfault from status bar
Pass just the relevant data through the signals to the status bar, instead of passing the entire Work object.
That way the data is detached from the Work object and we won't segfault when Work self-deletes before status bar tries to use that data.
* Rename method
* [PictureLoader] Properly run reply processing on Work's thread
* emit cachedImageHit first
* Remove unused fields
* Remove unused fields
* Fix double free requests from cache hit
If we hit a cached url, the request already gets to skip the queue.
By sending another free request once the cached request finishes, we're actually sending two free requests on each cache hit.
* 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>
* Performance stuffs.
* Actually make widgets track their indices.
* Functional stuff.
* More display stuff.
* Determine where we will insert the card before actually inserting it in the model.
* Allow overlap layouts to insert widgets at specific positions.
* Modified signals.
* Raise trailing widgets on overlap layout widget insertion.
* Nix the logging config changes.
* Lint.
* Address comments.
* Address comments.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* 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>
* Consider local images, remove some unused variables.
* Move checking for local card images outside of card download loop, add NOT found debug line.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* 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>
* 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>
* Add a group criteria to the deck list model and a combo box to the deck dock widget to change it.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Although this config is not built on CI, while trying to compile locally, the build failed due to warnings and -Werror.
Some qt functions were actually deprecated (but not removed) before version 6.0.0 and clang (righfully) complains about comparison between different types of enums.
* Remove `isView` flag from CardZone
This flag is used for two purposes:
1. It is used as a check for casting to a zone to a `ZoneViewZone`;
2. Non-view zones are added to the player's zones on construction
This patch removes the `isView` flag and instead:
1. We directly cast zones to `ZoneViewZone` using a dynamic (qobject)
cast and use the result of the cast instead of the `isView` flag to
detect if we are a view zone or not;
2. The player records its own zones when they are created, simplifying
control flow.
* Review
* client: Support arbitrary game zones
Currently, the client ignores cards in unknown zones, as there is an
implicit assumption that the set of zones known by the server and the
client are the same.
This patch makes it so that the client accept "custom zones" from the
server (zones outside the builtin deck, graveyard, exile, sideboard,
table, stack and hand zones) using the information from the
ServerInfo_CardZone. Moving cards from/into these zones happens
through a "View custom zone" action in the Game > Player menu and
properly appears in the chat.
Note that this patch intentionally does not introduce any support for
having the server actually create such zones. Instead, this patch aims
to improve backwards compatibility for when we do get to adding this
capability in the future, by making sure that current clients will be
able to interact with future new zones (even if suboptimally).
There is an issue with run-vcpkg GHA not caching properly. This ends up wasting 20 minutes of redundant vcpkg depency compilation.
See https://github.com/lukka/run-vcpkg/issues/243
* feat: build and release docker images using github cicd
* fix: attempt to publish to specific image name
* fix: typo in pipeline step
* typo
* typo
* limit to certain paths for PRs & naming
* ci: configure image title and url
* docker: include only necessary files and directories
this should make caching more powerful
* docker: reorder COPY with best guess of what changes least
* build(docker): remove seemingly unnecessary files
* fix: clean up docker metadata
remove annotations, it seems they're applied from the labels already, add description
* fix(ci): add back docker image annotations
* Update desktop-build.yml
* Update desktop-lint.yml
* Update desktop-build.yml
* Update docker-release.yml
* fix: remove run on master and add affected files to PR trigger
* metadata
* ci: run pipeline on main
this will ensure the container can always build and keep caches ready for release. push should only happen on tag triggers
It also removes some files from the PR trigger that should never break the build, and would just invalidate cache.
* Update docker-release.yml
---------
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
* add new fields to proto
* update token dlg
* send facedown in command
* update server to get it to work
* disable certain edits when face down
* update client event processing
* log face-down token creation
* Don't support colors on face-down tokens
The other client doesn't know about the color, so it causes a desync
* Update wording
Co-authored-by: Basile Clement <Elarnon@users.noreply.github.com>
* Allow annotations on face-down tokens
---------
Co-authored-by: Basile Clement <Elarnon@users.noreply.github.com>
* Remove `isView` flag from CardZone
This flag is used for two purposes:
1. It is used as a check for casting to a zone to a `ZoneViewZone`;
2. Non-view zones are added to the player's zones on construction
This patch removes the `isView` flag and instead:
1. We directly cast zones to `ZoneViewZone` using a dynamic (qobject)
cast and use the result of the cast instead of the `isView` flag to
detect if we are a view zone or not;
2. The player records its own zones when they are created, simplifying
control flow.
* Review
* 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
* RetranslateUi instead of updating filter mode.
* Defer setting the filter tree on the database display model until AFTER all the filter widgets are initialized.
* Update visual_database_display_set_filter_widget.cpp
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: Zach H <zahalpern+github@gmail.com>
* Saner and more performant color filtering.
* Update visual_database_display_color_filter_widget.cpp
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: Zach H <zahalpern+github@gmail.com>
* 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>
* 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>
* Refactor things into more sensible folders.
* Add navigation widget for budget and game changers.
* Lint.
* Add a card price display widget.
* Qt version check.
* Lint some thangs.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Refactor files in src/client/tabs to new Qt Slot/Signal syntax
* Refactor DeckEditorMenu to use new signal/slot syntax
Add DeckEditorMenu as friend class to AbstractTabDeckEditor since the slots are protected
* fix build failure
* 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>
* Revert "Add CONFIGURE_DEPENDS to the cmake (#5739)"
This reverts commit 57b9f0e54c.
* Revert "Automatically find all files for cockatrice_SOURCES (#5716)"
This reverts commit 4a0e0ed954.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* 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
* Try to better reproduce pre-provider ID behavior
If "override all card art with personal preference" setting is set, look
for custom art for all sets instead of just the most preferred set.
* Warning when using both custom art and the printing selector
* QDirIterator::nextFileInfo is Qt 6.3+
* Translation
`refreshTags` is not connecting the signal to open the dialog to edit
the tags, so tags can only be edited once for a given deck.
Fix by only having the logic for creating the "Edit tags" button once
and call it from `connectDeckList`.
The divideCardSpaceInZone function introduced in #4930 is buggy and
sometimes returns an index that is too large for the current zone, which
causes us to call `cards.at(index)` with an `index` that's bigger than
the amount of cards.
This is the bug that #5609 intended to fix but was improperly diagnosed.
Remove part of #5609 as the cases it is guarding against (e.g. null card
pointer) cannot actually happen.
C++ does not require compilers to zero-initialize value types, so
depending on the platform (here: Linux), the deck editor starts up with
an uninitialized value in the `modified` flag, which is usually not
zero.
This is part of the code from #4974, including an improved drag-and-drop
API and its use to display visual feedback of card destination on the
board.
It does not include the improved logic for pushing cards around as I
still need to figure out edge cases there - the logic for choosing where
cards go is not changed, so some of the artifacts described in #4817
and #4975 (particularly around multi-card) are still present.
* Close the `TabGame`s when closing the `TabSupervisor`
This ensures that we go through the same code path (in terms of Qt
events) when closing the whole supervisor as when closing a single tab.
Also, use the `close` event instead of the `hide` event to detect when
we are closing a game.
Fixes#5697
* Compat with old Qt versions
* Old Qt, reloaded
* Review: use hideEvent and call super
* Use enum for ThemeManager brushes
This patch introduces an enum to distinguish the different brushes that
can be set by the theme (hand, stack, etc.) and generic functions taking
the enum rather than having one copy of each function for each brush.
This is preliminary work before merging StackZone and HandZone to
simplify #4974.
* Include <array> header
* Header spacing
Currently, zones must keep track of which cards they move in order to
manually call `updatePath` on arrows.
This patch sets the `ItemSendsScenePositionChanges` flag on
`ArrowTarget`s to automatically update arrow positions without requiring
zones to keep track of that information.
- Remove hardening flags to allow debug builds (otherwise GCC complains
because nix adds the FORTIFY_SOURCE flag, which is not compatible
with -O0)
- Allow ninja as build system
- Add clang-tools dependency for LSP support
* remove recursion from flattenFolderStructure
findChildren is already recursive by default
* only trigger the top-level updateVisibility on filter update
Every folder widget was connecting the filter update signals to their updateVisibility, but updateVisibility is already recursive.
That means a bunch of redundant updateVisibility calls happen every time a filter update signal is emitted
* reduce redundant recursion in updateVisibility
findChildren is recursive by default, so only the top-level updateVisibility needs to loop through the found children
* delete now-unused signals
* implement functionality in dlg
* add action to deck editor
* refactor and comments
* is this refactor even a good idea?
* remove the friend class stuff
* reorder
* add option for not annotated
* Generic mana symbols.
* Update black mana symbol skull and symbol color.
* Update white mana symbol contrast.
* Update black mana symbol contrast.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Make BannerWidget's dropdown icon more robust
* use isHidden
Otherwise, it doesn't work correctly if the BannerWidget is offscreen
* don't show icon if there's no buddy
* Fix move to top of library shuffling an extra card
* Update cockatrice/src/game/player/player.cpp
---------
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
* Implement new method for DeckList to return cardlist with providerId, a new carddatabase method to fetch a cardlist with name and providerId and changed PictureLoader to use providerId versions of cards for caching.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Generify TabDeckEditor.
* Connect dockTopLevelChanged signals.
* Connect eventFilters.
* Remove comments.
* Fix ze build (accidentally deleted a line)
* Fix some pointer chaining.
* Be a lot saner about some signals/slots, as in, individual Deck Editor widgets now internally determine their CardInfo and then simply communicate this to the DeckEditor
* Lint.
* DeckDock can handle its own menu.
* DeckDock can handle its own decrement.
* DeckDock now notifies the deck editor on deck change, instead of individually modifying menu items and modification status.
* Rename.
* Include pixelmap generator for icon.
* Directly use an AbstractTabDeckEditor as parent.
* Move clearing database filter into signal/slot relation.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* add svg
* update pixmap cache
* get icon to work
* hide icon when not clickable
* use consistent naming
* use expandOnly because apparently that leads to higher image quality
* move card to play before creating attached token
* leave comment
* hardcode createCard target zone to table
To get attached token from graveyard/exile to work
* 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>
* Only resize on folder widget to make sure it doesn't squish the loading indicator.
* Clamp scrollArea widget to viewport width on showEvent to prevent widget being instantiated with wrong width when not visible.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* 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>
* Move logging from QDebug to QCDebug and introduce LoggingCategories.
* Lint.
* Unlint like one change.
* Remove .debug category since this is autofilled by Qt and used to differentiate between QCDebug and QCWarning and QCError.
* Uncomment defaults, include main category.
* Make PictureLoader logging a bit more useful.
* Lint...?
* Address comments.
* Clean up some unnecessary classes in logging statements.
* Add a new message format to the logging handler.
* Lint.
* Lint.
* Support Windows in Regex
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
* Give deckList a signal to emit when the tags change and hook up the display widget to that.
* Reload from file when loading a visual deck to ensure latest changes propagate to the decklist.
* Eliminate loadVisualDeck and use loadDeckFromFile instead.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* rename method
* delete unused method
* refactor
* increase margins
* change visible buttons depending on if deck is loaded
* correctly send the ReadyStart command on unload
* fix force start button still being visible
* Add options to include/exclude set name and collector number during clipboard import/export.
* Missing parentheses in action label.
* Revert the silliest lint in the world.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* remove closeRequest override
* remove visualDeckStorage from WindowMain
* manage visual deck storage in TabSupervisor
* open on startup
* refresh vds on db load finish
* open deck editor tab first on startup
* 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>
* make closeRequest call close by default
* make all tabs closable by default
* closeRequest instead of deleteLater on stop
* null out pointer on destroy
* no need to manually null out the tabs anymore
* comment
* pass tabsMenu into ctor
* comment
* implement tabs menu
* fix segfault on close (again)
* remove deck editor action from WindowMain
* refactor closeTab
* always set tab parent to tabSupervisor
* set tabSupervisor parent
* use close instead of deleteLater
* be more clear about overloads
* add new param to closeRequest
* don't emit signals in dtors
* send closeRequest
* fix build failure
* fix build failure
* see if we can get away with the overloaded triggered
* fix build failure
* Get cardIds to update properly in bottom view (#5414)
* Get bottom view to update properly when card is inserted into known portion (#5415)
---------
Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
* Extend the decklist parsing from clipboard to also support SetName, CollectorNumber and Foil Status.
* Q_UNUSED foil for now but keep parsing logic for future PR's/compatibility.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* 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>
* Add a button to swap the card between mainboard and sideboard to the deck editor.
* Add new icon to cockatrice.qrc and force update.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* support multiselect in deck editor
* fix crash
* don't reset selection after each action
* maintain old reselecting behavior when changing cards from left side
* fix crash for real (probably)
* maintain reselection behavior when deleting single selection
* Update Dockerfile to non-outdated Ubuntu version
1. Updated image to jammy as it is still in it's LTS window. Didn't go with 24.04/Noble as it released after latest version of cockatrice released.
2. Had to add new ARG
3. No qt5-default library, so replaced with qt5-qmake
* Update Dockerfile
Upped from Jammy -> Noble
Upped from Qt5 -> Tt6
* Update Dockerfile - new port
Added Port 4748 for new features
* Update Dockerfile
Changed Noble - > 24.04
* indentation
* remove unused dependencies
---------
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
* refactor: clean up to use for-each loop
* track cards in rect so far and toggle isSelected on change
* only clear selection if ctrl isn't held
* fix build errors
* add "open recent" menu option to deck editor tab
* change texts
* also get it to work with loading from deck storage tab
* add error message when fail to open
* only update recents on successful open
* only update recents on successful open
* reword to "Clear"
4% of minimum 3% 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
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
19% of minimum 3% translated source file: 'i18n-default.json'
on 'nl'.
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>
99% of minimum 3% translated source file: 'i18n-default.json'
on 'es'.
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>
13% of minimum 3% translated source file: 'i18n-default.json'
on 'fi'.
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>
* Translate oracle_en@source.ts in tr [Manual Sync]
36% of minimum 3% translated source file: 'oracle_en@source.ts'
on 'tr'.
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 tr [Manual Sync]
6% of minimum 3% translated source file: 'cockatrice_en@source.ts'
on 'tr'.
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>
99% of minimum 3% translated source file: 'i18n-default.json'
on 'fr'.
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>
14% of minimum 3% translated source file: 'i18n-default.json'
on 'ru'.
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>
* Translate cockatrice_en@source.ts in it [Manual Sync]
99% of minimum 3% translated source file: 'cockatrice_en@source.ts'
on 'it'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* Translate i18n-default.json in it [Manual Sync]
100% translated source file: 'i18n-default.json'
on 'it'.
---------
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
3% of minimum 3% translated source file: 'oracle_en@source.ts'
on 'cs'.
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>
* Fix the image shrinking due to repeated scaling and FP precision loss.
* Add a setting for auto-rotating sideways layout cards.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Support C++20 Standard
* Update peglib.h
* Fix lambdas
* Move from for loops to std::any/all_of
* Support fixed CFG
* Fix Rarity Search to be more accurate
* Have the server respect gameType info when setting up zones.
* ServerPlayer::setupZones is now passed the room->getGameTypes();
* ServerPlayer::setupZones now checks if the GameType String includes "Commander" and then sets the life total to 40 instead.
* Formatting.
* Remove debug logging imports.
* Move game option value declarations to dlg_create_game.
* Lint.
* Fix mocks.
* Add a default for backwards compatibility.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Squashed Commits
Lint things.
Set focus back to deckView after selecting a card to enable keyboard navigation.
Bump scrollbar to top when selecting a new card.
Update card info on hover.
Layout cleanups
Add +- to buttons.
Merge buttons into card picture.
Cleanup size, min 2 cards by default in rows
Support layout settings config and set min to 525 so two cols are visible by default for printings, when opened
Move Printing Selector to before Deck, and visible true
Null safety for setCard.
Turn down the dropshadow a little.
Make PrintingSelector dockable, don't duplicate sets when bumping them to the front of the list.
When swapping cards between mainboard and sideboard, use preferred printing if no uuid is available (i.e. null).
Reorder includes...
Unwonk an include.
Give the card widget a snazzy drop shadow, appease the linter gods.
Handle jumping between segments
Remember scale factor when initializing new widgets.
Cleanup
Select Card works (Not M->SB tho)
Resize word-wrapped label properly.
Fix the layouting, mostly.
remove tx
Build Fix
Squashed Commits
Load and store redirects properly.
Layouting is fun :)
* Group PrintingSelectorCardDisplayWidgets into distinct containers for alignment purposes.
Override resizeEvent() properly.
Word wrap properly.
Keep widget sizes uniform for aesthetic reasons (grid pattern).
Label stuff, center card picture widget, allow cardSizeSlider to scale down.
Replace cards which have no uuid in the decklist when first selecting a printing.
Add buttons for previous and next card in DeckList.
Add a card size slider.
Move sort options initialization to implementation file.
Explicitly nullptr the parent for the PrintingSelector.
Address PR comments (minor cleanups).
Hook up to the rows removed signal to update card counts properly.
Include QDebug.
Add labels to the mainboard/sideboard button boxes.
Implement a search bar.
Expand node recursively when we add a new card.
Only create image widgets for the printing selector if it is visible in order to not slow down image loading.
Minor Tweaks
Invert decklist export logic to write out setName, collectorNumber, providerId value if it is NOT empty.
Linting.
Update CardCounts properly, update PrintingSelector on Database selection.
Initialize sideboard card count label properly.
Split mainboard/sideboard display and increment/decrement buttons.
Add button to sort all sortOptions by ascending or descending order.
Add option to sort by release date in ascending or descending order.
Add PrintingSelector to database view.
Display placeholder image before loading.
Fix deckEditor crash on mainboard/sideboard swap by correcting column index to providerId instead of shortName.
Include currentZoneName, fix the column when updating from DeckView indexChanged to be UUID and not setShortName so cards are properly fetched again.
The most minor linter change you've ever seen.
Null checks are important.
Linter again.
Linter and refactor to providerId.
Sort properly, (We don't need a map, we need a list, a map won't be ordered right [i.e. 1, 10, 11, 2, 3, 4, ..., 9])
Sort alphabetically or by preference.
Hook printingSelector up to the CardInfoFrameWidget.
Allow info from CardFrame to be retrieved, properly initialize PrintingSelector again.
Refactors to reflect CardInfoPicture becoming CardInfoPictureWidget.
Make PrintingSelector re-usable by introducing setCard().
Make PrintingSelector use the CardFrame, not the database index.
Add a new selector widget for printings.
* Support multiple <set> tags per card within the database
This will allow us to show off all different printings for cards that might appear multiple times in a set (alt arts, Secret Lairs, etc.)
* Support Flip Cards with related art
* Minor Cleanup
* Minor Cleanup
* Release Date DESC default
* Load widgets in batches.
* Refactor local batch variables to be class variables/defines.
* Clear timer on updateDisplay.
* Fix Timer & Builds on Qt5
* Not Override
* Yes Override
* Yes Override
* Lint
* Can't override in function definition.
* Resize setName to picture width on initialization.
Also add a new signal to card_info_picture_widget to emit when the scale factor changes.
Hook this up to the setName resizing method to ensure card size updates trigger it appropriately after initialization.
Clean up unused enter and resize methods that just delegated to base-class.
* Add ability to force preferred set art to be loaded for every card.
* Show related cards from printing selector by right-clicking card image.
* fix build
* Fix UST cards
* Inc QDebug
* Fix Qt5 Builds
* Fix Qt5 Builds
* Fix Qt5 Builds
* Fix Qt5 Builds
* Fix Qt5 Builds
* Fix cards being able to jump between side and mainboard
* Don't hide PrintingSelector button widgets if the deck contains a card from the set.
* Update PrintingSelector properly on DeckListModel::dataChanged
* Add option to disable bumping sets to the front of the list if the deck contains cards from the set.
* Linter behave.
* Linter behave.
* Fix mocks.
* Fix cards without providerIds being counted for all cards.
* Flip preference sort so descending means "Most to least preferred".
* Set the index correctly when removing a non-providerId printing for a providerId printing to avoid jumping to the next card.
* Move the "Next/Previous" card buttons to their own widget.
* Move the card size slider to its own widget.
* Lint the makelist.
* Linter
* Crash fix
* Move the sorting options to their own widget.
* Move the search bar to its own widget.
* Minor cleanup
* Minor cleanup
* Minor cleanup
* Only overwrite card in deck if UUID _and_ Number missing
* Adjust font size when adjusting card size.
* Clean up some imports.
* Pivot to a view options toolbar.
* Persist sort options and change default to 'preference'.
* Lint.
* Remember how many cards were originally in deck when replacing with uuid version.
* Relabel buttons for clarity.
* Fix tests.
* Fix tests properly.
* Fix dbconverter mock.
* Try to wrangle font sizes.
* Update mainboard/sideboard labels correctly.
* Initialize button sizes correctly.
* Label texts are supposed to be white.
* Adjust another deckModel->findCard call to include number parameter.
* Style buttons again.
* Negative currentSize means we don't render the widget yet, return a default value.
* Clean up debug statements.
* Boop the mainboard/sideboard label and the cardCount after a little bit of delay to make sure they initialize at the right size.
* Persist card size slider selection in SettingsCache.
* Good Lint Inc.
* updateCardCount to get white color in initializer
* Make the view display options functional.
* Comment ALL the things.
* Lint the things.
* Brief accidentally nuked some constants.
* Proper Qt slot for checkboxes.
* Don't use timers, Qt provides ShowEvent for anything necessary before the widget is shown.
* Cleanup from Reading
* Cleanup Lints
* Minor
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: Zach Halpern <zahalpern+github@gmail.com>
* play action now applies to all selected cards
* check card zone before applying action
* fix bug with wonky play from deck
* refactor
* don't play card if it's already on table
* add new setting
* make actPlay and friends public
* implement thing
* refactor card_item
* add attach and draw arrow actions to more card menus
* implement attaching from other zones
* disallow attaching from deck
* do nothing if target is already attached
* add null check
* rip shortcut for aDrawArrow
* implement thing
* add separator below hide
* shorten text by 1 word
* move shortcut to under Playing_Area
* rebind draw arrow shortcut to Alt+A
* remove auto hotkey
* shorten to "Select All"
* add back auto-hotkey
* hide action now applies to all selected cards
* check card zone before applying action
so that we don't nuke cards from existence when we select across multiple zones
* small fixes
* remove redundant loop
* nullcheck view
* update settingsCache
* implement thing
* add new setting to window
* rename setting
* make it compile on qt5
* fix typo
* somehow changing the order here fixes a bug?
The loaded value was getting clamped to 99
* feat: prefer 'Core' and 'Expansion' sets for prioritization
* rework set prioritization
* clean up priority enum
* formatting
* revert changes to CockatriceXml3Parser
* re-add missing null check
* remove priority fallback ternary from CardSet model
* make defaultSort logic easier to follow
* revert changes to v3 card database xsd
* remove unused invisible priority col from sets dialog
* move draft innovation and duel deck sets to secondary prio
* minor fixes
* change PriorityFallback to 1
* make priority optional in xml
* remove PriorityUndefined and set PriorityFallback to 0
* set priority when not found to PriorityOther
in case a new set type is added it's unlikey we want it sorted first,
it'll probably be a new product so it's probably best to sort it with
the funny things
* simplify sort function
---------
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
* fix QComboBox creation order in retranslateUi
* move bottom row creation closer to where it's used
* rename QGraphicsLinearLayout variables
hFilterbox and hPilebox don't make much sense now
* add comment about #5204
- References seem to go to 0 in newer Qt versions(?)
https://doc.qt.io/qt-6/qtime.html
> QTime objects should be passed by value rather than by reference to const; they simply package int.
- QLabel sizes weren't taken into account until the widget is rendered
- Long QLabels can cause exacerbated issues
- Force refresh after 1ms to take QLabels into account
* refactor to allow for sorting by property of choice
* implement thing
* prevent overlapping sort properties
* enable/disable pile view checkbox if groupBy is off
* fix compiler warnings
* check to disable pile view checkbox on init
* Fix builds on Qt5
* Fix builds on Qt5
---------
Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
* leave some documentation on Zone classes
* small refactor
* undo functional change from refactor and clean up comments
* move variables into if block
`QObject::connect: No such slot UserInterfaceSettingsPage::setNotificationEnabled(Qt::CheckState) in /Users/Ricky/GitHub/Cockatrice/cockatrice/src/dialogs/dlg_settings.cpp:448`
* Cache redirects properly by implementing our own QSettings cache for urls.
* Load and store redirects properly.
* Set the maximum network cache size from settings value on PictureLoaderWorker instantiation.
* Address comments.
* Lint.
* Adjust debug statements to be in line with existing ones.
* Minor Tweaks
* Make redirect cache ttl a user-adjustable setting.
* Fix Build
* Minor Cleanup
* Minor Cleanup
* Build Fix
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
* refactor to use confirmOpen
* implement extra button in confirmation
* use brackets in one-liner if statements
* refactor save confirmation window into function
* Refactor CardInfo Widgets to reside in their appropriate folder and to have a clearer naming structure.
* Added Zach's work on storing printing information in the DeckList (#1)
* Change CardInfo's PixmapCacheKey to be the UUID of the preferred set after database loading has finished. Otherwise, and if no UUID of a preferred set is available, default to the card name.
* Refactor CardDatabase *db global variable to singleton CardDatabaseManager.
This commit refactors the global variable CardDatabase *db into a singleton encapsulated by the DatabaseManager class, accessible via DatabaseManager::getInstance(). This change centralizes access to the database instance, improving code modularity and encapsulation, resolving dependencies on main.h for code that requires access to the database instance.
- Added DatabaseManager class with getInstance() method returning a pointer to the singleton CardDatabase.
- Removed global db variable and updated references across the codebase.
- Thread-safe static initialization for the singleton.
Impact: This refactor should have no functional impact on the application, as it maintains the same interface for accessing the CardDatabase instance. However, the codebase now benefits from improved encapsulation, lifetime management, and thread-safety.
* fixed db issue an renamed sets to set in picture loader
* canibalized zach work and added it to the decklist builder
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Reintroduce some changes lost in the merge.
* Introduce UUID attribute to abstract_card_item, card_item, deck_view_card, server_card and serverinfo_card.
* Have various game events respect the new UUID attribute on instantiation.
* Correct some calls to default to preferred printing.
* DeckList now tries to assign reasonable defaults for UUID and collectorNumber if none are found in loaded DeckLists.
Rename overloaded DeckListModel findChild() function to findCardChildByNameAndUUID() for clarity.
* canibalized zach work and added it to the decklist builder
* Change getPreferredPrintingForCard to getPreferredSetForCard to reflect refactor.
* Properly update and set the DeckEditor's CardFrame to fetch by name and UUID if a card was selected from the decklist.
* Mainboard/Sideboard swaps should respect the UUID from the old zone instead of just blindly adding preferredPrinting.
* If the card info is null, there's no point in trying to look for the sets.
* Don't define methods twice.
* Convenience method to fetch a specific CardInfoPerSet instance for a cardName and a UUID.
* Check if the uuid starts with card_ when comparing.
* Address pull request comments (nullptr checks and additional comments, mostly.)
* Reformat code so the linter will stop yelling at me.
* DeckList no longer pre-populates uuids.
* Update Event_MoveCard to include the card UUID.
* Update Player::MoveCard to include the card UUID.
* Set the uuid when we set the cardName, in terms of hidden zones.
* [TEST/RevertMe] Set the uuid everywhere to test.
* Don't inline setUUID and mimic setName for AbstractCardItem.
* Revert blindly setting uuid for testing.
* Address PR comments (AbstractCardItem).
* Combine if-statement.
* Re-order uuid to visually align with its field number.
* Remove unnecessary new uuid field from event_move_card.
* Remove unused imports.
* Include cardName in the PixmapCacheKey in order to not break double-faced cards.
* Refactor setCode to cardUUID and introduce new cardSetShortName field.
* Override
* Refactor UUID to be providerId and change QString comparisons with empty string to isEmpty().
* Update translations.
* Change parent to be the first argument.
* Pull Parent argument up for CardItem.
* Pull Parent argument up for CardItem.
* Linter.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: LunaticCat <39006478+LunyaticCat@users.noreply.github.com>
Co-authored-by: luna <yannbrun1507@outlook.fr>
Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
* Add FlowWidget class with flexible layout and scroll handling
- Implemented FlowWidget class to organize widgets in a flow layout with scrollable options.
- Integrated QScrollArea to handle overflow with configurable horizontal and vertical scroll policies.
- Incorporated dynamic layout selection (FlowLayout, HorizontalFlowLayout, VerticalFlowLayout) based on scroll policy.
* Add OverlapWidget and OverlapLayout for managing overlapping child widgets
- Implemented the OverlapWidget class to manage child widgets in an overlapping manner, supporting configurable overlap percentage, maximum columns, maximum rows, and layout direction.
- Introduced the OverlapLayout class, which arranges widgets with overlapping positions, allowing flexible stacking based on specified parameters.
* Add OverlapControlWidget.
* Delete FlowLayout items later to allow them to finish their event loop.
* Allow OverlapWidgets to adjust their rows/columns on resize.
* Clamp vertical FlowLayout to any available parent scrollAreas.
* Implement margins and spacing for FlowLayouts.
* Adjust/revert some things.
* Address pull request comments (nullptr checks and additional comments, mostly.)
* Reformat code so the linter will stop yelling at me.
* Remove undefined methods from FlowLayouts.
* Fix the build.
* Revert FlowLayout::takeAt to index check.
* Commits will continue until linter morale improves.
* Fix various warnings in FlowLayout.
* Fix various warnings in FlowLayout.h.
* Fix various warnings in the FlowLayout classes.
* Fix [[nodiscard]] warning.
* Fix more warnings.
* Final round of yellow squiggle fixing.
* Linter formatting.
* Refactor column/row calculation to be more readable.
* Code style.
* Address PR comments.
* Combine if-statements.
* Replace std::math functions with Qt equivalents.
* Fix non-consts and QtMath.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Refactor CardInfo Widgets to reside in their appropriate folder and to have a clearer naming structure.
* Add optional HoverToZoom functionality to CardInfoPictureWidget (default: disabled) and utility class to display text over a CardInfoPictureWidget.
* Patch CardInfoWidgets to use the new CardDatabaseManager.
* Add HoverToZoom to CardInfoPictureWithTextOverlayWidget
* Refactors and new signals for CardInfoPictureWidgets.
* Address pull request comments (nullptr checks and additional comments, mostly.)
* Reformat code so the linter will stop yelling at me.
* Linting.
* Fix the build.
* Fix warnings.
* Formatting, const qualifiers.
* Sensibly call the base class's (QWidget) paint event.
* Address PR comments (card picture).
* QT Version check because enterEvent signature changed.
* Linting.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* Change CardInfo's PixmapCacheKey to be the UUID of the preferred set after database loading has finished. Otherwise, and if no UUID of a preferred set is available, default to the card name.
* Clean up some variable names, clarify preferred Set insertion for PictureLoader, use the new CardDatabaseManager.
* Code formatting.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* [4191] fix: Move unfocusTextBox and aFocusChat shortcuts to Player family
* [4191] fix: fix formatting
* Revert "[4191] fix: fix formatting"
This reverts commit 86a4a675f3bc8118d4ba8dd45f408c4e8c348f33.
* Revert "[4191] fix: Move unfocusTextBox and aFocusChat shortcuts to Player family"
This reverts commit 3ec183628df81c48123a8a248d0416c529ee0c8e.
* [4191] fix: Textbox and tab_game shortcut groups cannot conflict with Player group
* Revert "[4191] fix: Textbox and tab_game shortcut groups cannot conflict with Player group"
This reverts commit 36800393339d997df1a932bb798f95d2d387399a.
* [4191] fix: Move unfocusTextBox and aFocusChat shortcuts to Player family
* [4191] fix: Migrate shortcuts if new version is detected
* [4191] fix: formatting
* [4191] fix: Maybe fix build issue on Windows7, Debian11, UbuntuBionic and UbuntuFocal
* Refactor CardDatabase *db global variable to singleton CardDatabaseManager.
This commit refactors the global variable CardDatabase *db into a singleton encapsulated by the DatabaseManager class, accessible via DatabaseManager::getInstance(). This change centralizes access to the database instance, improving code modularity and encapsulation, resolving dependencies on main.h for code that requires access to the database instance.
- Added DatabaseManager class with getInstance() method returning a pointer to the singleton CardDatabase.
- Removed global db variable and updated references across the codebase.
- Thread-safe static initialization for the singleton.
Impact: This refactor should have no functional impact on the application, as it maintains the same interface for accessing the CardDatabase instance. However, the codebase now benefits from improved encapsulation, lifetime management, and thread-safety.
* Refactor CardDatabase *db global variable to singleton CardDatabaseManager.
This commit refactors the global variable CardDatabase *db into a singleton encapsulated by the DatabaseManager class, accessible via DatabaseManager::getInstance(). This change centralizes access to the database instance, improving code modularity and encapsulation, resolving dependencies on main.h for code that requires access to the database instance.
- Added DatabaseManager class with getInstance() method returning a pointer to the singleton CardDatabase.
- Removed global db variable and updated references across the codebase.
- Thread-safe static initialization for the singleton.
Impact: This refactor should have no functional impact on the application, as it maintains the same interface for accessing the CardDatabase instance. However, the codebase now benefits from improved encapsulation, lifetime management, and thread-safety.
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* split event processing to own method
* implement rewind throttling
* don't throttle backward skips from clicks
* use the term 'buffering' instead
* remove initial backup logic; just always buffer shortcut backward skips
* prevent segfault
* turns out you can just reuse the same one-shot timer
* try scaling timeout based on event count
* rewrite timeout calculation code
* fix linker error
* fix bug with incorrectly highlighted phases
* fix new bug with phases continuously darkening
* use preincrement instead of postincrement
* simplify conditional
it will emit in loadCardDatabases(), mirroring the else branch where cardDatabaseLoadingFailed() is emitted.
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
* split skipToTime into own function
* implement shortcut
* fix shortcut warning bug
* check boundary conditions in skipToTime
* change default fast forward shortcut to .
* implement big skip shortcuts
* remove unnecessary arg in lambda
* change default fast forward shortcut to Ctrl+F
* rename constants
* change default fast forward shortcut to Ctrl+P
* use static const
* refactored cardzone.cpp, added doc and changed if to switch case
* started moving every files into different folders
* remove undercase to match with other files naming convention
* refactored dialog files
* ran format.sh
* refactored client/tabs folder
* refactored client/tabs folder
* refactored client/tabs folder
* refactored client folder
* refactored carddbparser
* refactored dialogs
* Create sonar-project.properties
temporary file for lint
* Create build.yml
temporary file for lint
* removed all files from root directory
* removed all files from root directory
* added current branch to workflow
* fixed most broken import
* fixed issues while renaming files
* fixed oracle importer
* fixed dbconverter
* updated translations
* made sub-folders for client
* removed linter
* removed linter folder
* fixed oracle import
* revert card_zone documentation
* renamed db parser files name and deck_view imports
* fixed dlg file issue
* ran format file and fixed test file
* fixed carddb test files
* moved player folder in game
* updated translations and format files
* fixed peglib import
* format cmake files
* removing vcpkg to try to add it back later
* tried fixing vcpkg file
* renamed filter to filters and moved database parser to cards folder
* reverted translation files
* reverted oracle translated
* Update cockatrice/src/dialogs/dlg_register.cpp
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
* Update cockatrice/src/client/ui/window_main.cpp
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
* removed empty line at file start
* removed useless include from tab_supervisor.cpp
* refactored cardzone.cpp, added doc and changed if to switch case
* started moving every files into different folders
* remove undercase to match with other files naming convention
* refactored dialog files
* ran format.sh
* refactored client/tabs folder
* refactored client folder
* refactored carddbparser
* refactored dialogs
* removed all files from root directory
* Create sonar-project.properties
temporary file for lint
* Create build.yml
temporary file for lint
* added current branch to workflow
* fixed most broken import
* fixed issues while renaming files
* fixed oracle importer
* fixed dbconverter
* updated translations
* made sub-folders for client
* removed linter
* removed linter folder
* fixed oracle import
* revert card_zone documentation
* renamed db parser files name and deck_view imports
* fixed dlg file issue
* ran format file and fixed test file
* fixed carddb test files
* moved player folder in game
* updated translations and format files
* fixed peglib import
* reverted translation files
* format cmake files
* removing vcpkg to try to add it back later
* tried fixing vcpkg file
* pre-updating of cockatrice changes
* removed empty line at file start
* reverted oracle translated
* Update cockatrice/src/dialogs/dlg_register.cpp
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
* Update cockatrice/src/client/ui/window_main.cpp
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
* removed useless include from tab_supervisor.cpp
---------
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
* #3945 deck list: Navigation keys (PageUp/Down, Home/End) interact with the deck list.
* make Home/End work normally when there is text in the search textbox
* fix debug build, explicit cast from int to Qt::Key enum
* Improve drag & drop behavior
This patch tweaks the drag & drop behavior (in particular, the grid
placement) to be more intuitive. More precisely, with this patch the
drag & drop will:
- Only use the "hot spot" (i.e. position of the cursor on the card)
for zones where the card is actually displayed around the cursor (in
particular, not on the table where the card snaps to the grid).
- Use better boundaries computed with respect to the center of the
card (rather than its top left corner) for determining which grid
cell a card should go to
- Align behavior of the preview and the actual effect when overflow of
the 3-card stacks occurs
- Avoid visual glitches where the cursor ends up outside of the card or
at incorrect offsets when moving the mouse too fast (which translates
to overflows of the hot spot computation)
* Address review comments
- Use simpler computation for restricting hotSpot range
- Prevent dropping cards onto full 3-card slots
* make cards on the stack slightly overlap to stress order
dragging cards to the stack now places the card at the location it is
dropped
* make default play action append to stack
* add vertical overlap to settings and vertical hand
* Update cockatrice/src/dlg_settings.cpp
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
* Fix format
---------
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
* simplify ci after 64bit only
* hint on macos 10.15 with qt6.2
* Update desktop-build.yml
* Update desktop-build.yml
* update xcode
* 14.3 finds 14.3.1, but 14.0 doesn't find 14.0.1
* Update desktop-build.yml
98% of minimum 80% translated source file: 'cockatrice_en@source.ts'
on 'en_US'.
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>
* Translate i18n-default.json in es [Manual Sync]
99% of minimum 80% translated source file: 'i18n-default.json'
on 'es'.
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 es [Manual Sync]
98% of minimum 80% translated source file: 'cockatrice_en@source.ts'
on 'es'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* Translate i18n-default.json in es [Manual Sync]
99% of minimum 95% translated source file: 'i18n-default.json'
on 'es'.
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 es [Manual Sync]
98% of minimum 95% translated source file: 'cockatrice_en@source.ts'
on 'es'.
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>
* Translate i18n-default.json in it [Manual Sync]
99% of minimum 80% translated source file: 'i18n-default.json'
on 'it'.
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 it [Manual Sync]
98% of minimum 80% translated source file: 'cockatrice_en@source.ts'
on 'it'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* Translate i18n-default.json in it [Manual Sync]
99% of minimum 95% translated source file: 'i18n-default.json'
on 'it'.
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>
* Translate cockatrice_en@source.ts in fr [Manual Sync]
98% of minimum 80% translated source file: 'cockatrice_en@source.ts'
on 'fr'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* Translate i18n-default.json in fr [Manual Sync]
99% of minimum 80% translated source file: 'i18n-default.json'
on 'fr'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* Translate i18n-default.json in fr [Manual Sync]
99% of minimum 95% translated source file: 'i18n-default.json'
on 'fr'.
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>
* Translate cockatrice_en@source.ts in pt_BR [Manual Sync]
98% of minimum 80% translated source file: 'cockatrice_en@source.ts'
on 'pt_BR'.
Sync of partially translated files:
untranslated content is included with an empty translation
or source language content depending on file format
* Translate webclient/src/i18n-default.json in pt_BR
100% translated source file: 'webclient/src/i18n-default.json'
on 'pt_BR'.
---------
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* add more default shortcuts
replace the ctrl a look at top of library shortcut with ctrl shift n
use ctl a for draw arrow
replace ctrl shift b for toggle sideboard lock
use ctrl b for move card to bottom of library
use ctrl shift l for start local game
add keyboard shortcuts for all 3 counter colors using , . / keys
use ctrl [ ] \ for the "other" counter
add ctrl = as an easy alternative to ctrl + for people without keypads
( on linux ctrl alt keypad + is a special key that is reserved in x
it produces the XF86_Next_VMode keyboard event which isn't bindable )
use alt u for toggling untapping
use alt l for peeking at cards
use ctrl alt u for unattaching cards
use alt n for set annotation
use alt y for milling one card
* use alt f for flipping cards
a bit of a hack, the client will use the play top card action and then
compare it with the propmpted expression, as if you were cascading
normally but really fast
the new keybind for this is ctrl shift y
I have ratelimited the action to 10 cards a second
100% translated for the source file 'cockatrice/cockatrice_en@source.ts'
on the 'pt_BR' language.
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
100% translated for the source file 'webclient/src/i18n-default.json'
on the 'pt_BR' language.
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* Set some CPack variables
WIP for DMG background image
* Use a .tif for background
* Add Background image and DS_Store script
Script is from https://www.kitware.com//creating-mac-os-x-packages-with-cmake/ with cmake.app changed to cockatrice.app
* Add position for all icons
* Adjust background size and icon position
This draws dbconverter off the screen as a hack to hide it, so hopefully it doesn't break.
* Add files via upload
* Change Icon Position
Icon position is probably relative to the window edge, not the edge of the screen so the numbers should be lower.
* Adjust Icon Position and Window Boundaries
Applescript seems to use the center of the icon rather than the left corner so the coordinates need to be adjusted by 64 px.
The finder window counts the 22 px of the title bar in the window size so 22 must be added to the fourth coord of position to fit the entire image.
* Fix spelling of Servatrice
* Satifsfy Code Style
* Use vector format (eps)
* Delete background.tif
* Use vector format (eps)
* Use the right file extention in the script
* Point to svg
* Use svg
* Add svg for background image
* Delete background.eps
* Use plain SVG, adjust text
* Move applescript to /cmake
* Move background to /cmake
* Point CPack to /cmake
background and applescript now reside there
* Revert to .tif
* Use compressed .tif
* Use more specific file name
* Script expects .background:background.tif
* Create Lunar Dockerfile
Note that qt6-svg-dev and qt6-websockets-dev are renamed replacements for libqt6svg6-dev and libqt6websockets6-dev, respectively.
* Add Ubuntu Lunar
* Add Ubuntu Lunar to Template
translation completed for the source file '/webclient/src/i18n-default.json'
on the 'es' language.
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* Make cards rounded
Magic cards have rounded corners, and playing cards tend to have rounded
corners as well, but Cockatrice currently displays rectangular cards.
This can cause visual glitches when using image scans where the border
does not extend in the corner, and for this reason Cockatrice always
draws a (rectangular) border around the card to try and make it look a
bit better.
In this patch I take a different approach: rather than try to make
rounded pegs, er, cards, go into a square hole, the hole is now rounded.
More precisely, the AbstractCardItem now has a rounded rectangular shape
(with a corner of 5% of the width of the card, identical to that of
modern M:TG physical cards).
As a side effect, the card drawing gets a bit simplified by getting rid
of transformPainter() when drawing the card outline and using the
QPainter::drawPixmap overloads that takes a target QRectF instead. This
means we no longer have to bother about card rotation when painting
since that's taken care of by the Graphics View framework (which
transformPainter() undoes).
* format
* Also give PileZone rounded corners
* Forgot untap status + bits of CardDragItem
* fix deckviewcard calculations
* Rounded CardInfoPicture
* PictureLoader: Replace downloadedPics cache with QNetworkCache
Currently when the "Download card pictures on the fly" option is
enabled, Cockatrice stores downloaded pictures into a downloadedPics
sub-folder, keyed on set and card name. If a picture is found in that
folder, we never try to download a picture for that card ever again
(until it is reprinted in a more recent set, I guess).
This has the unfortunate consequence that if you change the URLs for
downloading card images, the changes are not applied to cards that
already have their picture downloaded. In particular, if you use
localized card pictures (through !sflang!), you get a mix of cards in
different languages depending on the currently configured language at
the time each card was downloaded.
This patch removes that mechanism in favor of setting a
QNetworkDiskCache on the QNetworkAccessManager used by the PictureLoader
to download pictures. The QNetworkDiskCache caches the picture keyed on
their URL: if the URL changes, a new request will be made. In
particular, if you use picture URLs with !sflang! and change the
language, pictures for the current language will be downloaded even for
cards that already have a picture. The QNetworkDiskCache is configured
with a maximum size of 4GB, which should be enough to hold one
high-quality JPEG for each M:TG card in existence.
Note that this does not affect the existing mechanism for defining
custom card art, either through the CUSTOM directory or the set-based
one. Cockatrice will still read existing cards in the downloadedPics
directory as before, it will just no longer write into that directory
(since pictures are cached by the QNetworkDiskCache instead). To fully
switch to the new cache, users should use the "Delete Downloaded Images"
button in the settings: it will clear the QNetworkDiskCache but also
remove the downloadedPics directory.
* Do not use system cache dir for portable installs
* Add settings for network cache size
* Delete corrupted cache entries
* Use old-style connect() syntax (Qt5 build failure)
* Add setNetworkCacheSizeInMB to test mocks
* setTransferTimeout was added in Qt 5.15
* Improve logging messages
We now have the following messages
- "Trying to download picture from url: URL" before loading a picture
when picture download is enabled
- "Trying to load picture from cache: URL" before loading a picture
when picture download is disabled (i.e. cache-only offline mode)
- "Removing corrupted cache file for url URL and retrying (ERR)" when
when we fail to load a picture from the cache. Usually, this should
be due to the timeout, in which case ERR will be "Operation
Canceled".
- "Download failed for url URL (ERR)" when there was an error
downloading a picture from the network (ERR is the error message)
- "Following redirect to URL" and "Following cached redirect to URL"
when following a redirect (from network/from cache)
- "Image successfully downloaded from URL" and "Image successfully
loaded from cached url at URL" on success
- "Possible cached/downloaded picture at URL could not be loaded" on
ImageReader error
* Clarify that network cache is on disk
Also migrate "Delete Downloaded Image" to a "Clear" button right next to
the network cache size.
* Remove qPrintable
* Move pixmap cache settings to card sources
* qDebug().nospace()
* some formatting on debug messages
* format
* inverted condition
---------
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
* Better support Double-Faced Cards
This patch allows cards to be (virtually) transformed into other cards
while preserving their state, essentially implemeting the MTG mechanic
of the same name.
On the server side, this is implemented by allowing cards to be "stashed
away". A card that is stashed away is not in any zone, but is instead
owned by another card. When a token is destroyed due to a zone change,
if it had a card stashed away, that card is placed in the target zone
instead of the token.
On the database side, `attach="transform"` is used on `<reverse>` and
`<reverse-related>` to indicate that the created token should be
transformed this way.
Old servers ignore the new field in `Command_CreateToken` and will
perform a regular attachment, as currently.
* Address review comments
* Prevent tokens from being stashed
* format.sh
* Replaced "e:lea,leb" with "e:lea or e:leb"
* Removed "e:lea,leb -(e:lea e:leb) (Cards that appear in Alpha or Beta but not in both editions)" as this does not produce results in Cockatrice (even when using "or" instead of "," as above)
In b282df2e27 (#4728) the logic for
creating <pt> values was updated to avoid adding a final slash after an
existing power value and missing toughness value. This works by setting
the ptSeparator to an empty string when either the power or the
toughness is undefined. However, due to the ptSeparator variable being
scoped out of the `for` loop, this causes all remaining cards to have an
empty string as a separator, ending up with <pt> values of e.g. 21
instead of 2/1.
Moreover, the implementation from #4728 is ambiguous in the case of a
card having a toughness value but no power value: in that situation, it
creates a <pt> entry with the toughness value and no separator, which is
not a good idea since it is not possible to know if <pt>2</pt> means
power 2 and no toughness, or no power and toughness 2 (Cockatrice takes
the first interpretation).
To avoid ambiguities, the <pt> value is now one of:
1. A regular P/T value when the card has power and toughness
2. A simplified P value when the card has power but no toughness
3. A simplified /T value when the card has toughness but no power
4. Absent when the card has neither power nor toughness
Note that, as far as I can tell, Cockatrice seems to (incorrectly, IMO)
ignore the initial slash if present in Player::parsePT, and treat /T as
a power value. However that is a separate issue: this patch is concerned
with Oracle and ensuring proper values in cards.xml, not with how
Cockatrice interprets those values.
Currently Cockatrice allows revealing the whole hand, or one card at
random from the hand. Sometimes, a player needs to reveal a specific
card from their hand instead, which is not supported. To achieve a
similar effect, players usually move the corresponding card (or cards)
to a public zone, then back to their hand. While this works, it is
unsatisfactory (compared to a regular reveal, you can't keep the
"revealed" window around, for one) and somewhat unintuitive.
This patch adds a "Reveal to..." menu to cards and card selections in
the player's hand or in custom zones (this includes looking at the
player's library). This menu allows revealing a card or set of cards to
any given player, or to all players.
To implement this functionality at the protocol level, the existing
RevealCards command is extended to support revealing multiple specific
cards. This is done by making `card_id` a non-packed repeated field in
the `Command_RevealCards` and `Event_RevealCards` protobufs. Using a
non-packed repeated fields allows maintaining backwards compatibility:
an empty optional field is encoded the same way as an empty non-packed
list, an optional field with a value is encoded the same way as a
one-element non-packed list, and when decoding a multi-elements
non-packed list as an optional, only the last item in the list is read.
Since the RevealCards command already exists, and due to the compatible
encodings, a new client connecting to an old server can reveal a single
specific card from their hand. When trying to reveal multiple cards at
once, the old server will only see the request for one of the cards to
be revealed, and the player will have to reveal each card separately.
On the other hand, `Event_RevealedCards` already has an explicit list of
cards revealed by the server, and the `card_id` field is only used when
exactly one card has been revealed: thus, old and new clients will
behave identically when receiving a new `Event_RevealedCards`. In
particular, if a player using a new client reveals multiple cards from
their hand on a new server, another player using an old client will
correctly see all the revealed cards.
The approach used to build the "Reveal to..." menu is slightly different
from the approach used to build other player selection menus. Because
the "Reveal to..." menu is specific to each card, but must also be
updated whenever a player is added to or removed from the game, I chose
to re-create it on the fly whenever a card is clicked, as that seemed
the safest way to avoid both memory leaks and inconsistent state given
my understanding of the code.
* Enable buttons for current game when receiving server response
Previously, upon joining a game, we were unconditionally re-enabling the
"Join" button in the lobby, even if it was not enabled in the first
place, causing #4698. This could also lead to issues where if the user
selects a different game after joining (which they can do in case of
e.g. network connectivity issues), the "Join as spectator" button could
get incorrectly disabled.
This fixes#4698 by re-enabling the buttons based on the state of the
currently selected game at the time the response is received. This also
avoids inconsistencies if a different game has been selected in between
joining and receiving a response from the server.
* Typo: enable gameButton in enableButtons
The "create game" button was incorrectly being disabled in enableButtons
whereas (as the name indicates) it should have been enabled
* Remove misleading comment about race conditions
* Fix#4706: Exit linting early if a card with the exact name is found first
* Remove ampersand conversion
* put back
* Update tests
* Format
* don't use qsizetype
---------
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
* macOS-10.15 environment is deprecated
Build for 10.14 has to be dropped.
Build for 10.15 can be preserved via 11.
* update xcode versions
* Xcode 13.0 doesn't work for us on Big Sur
* [skip ci] update list of binaries
translation completed updated for the source file '/webclient/src/i18n-default.json'
on the 'it' language.
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* Add URL Link to Explain Message Macros
* Add URL Link to Explain Message Macros
* Revert custom shortcuts wiki link
* Conform to formatting guidelines
translation completed for the source file '/cockatrice/cockatrice_en@source.ts'
on the 'it' language.
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* Move Join Message Block
- Moves Join Message code block to after the for loop that gets old chat message, which makes the Join Message the most recent message in the chat box instead of the oldest
-Only the rc.enqueuePostResponseItem() line really needs to move for functionality, but I have moved the whole block for readability
* Comply with formatting guide
-Remove offending white space
* remove dependency on deprecated qt5 libraries for qt6
removes the use of qt6-5compat for builds
replaces use of QRegExp with QRegularExpression
fixes incorrect usage of QRegExp
removes use of QTextCodec
fixes incorrect usage of QTextCodec
sets qtlinguist as a required component for qt6
* fix anchoredPattern not existing in qt 5.11
* save work
* fix perf issue on i18n rollup
* fix reset styling
* move body line-height from reset
Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
* When trying to join a game from GameSelector that's already been joined by you, navigate to its game tab.
* return immediately, do not change button states
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
* Logging a player drawing 0 cards will now result in the message "player had no cards left to draw."
* Added hint when drawing when deck is empty
* Added hint when drawing when deck is empty
* Added hint when drawing when deck is empty
* Update cockatrice/src/messagelogwidget.cpp
update log message to present tense
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
* added deckIsEmpty parameter to messagelogwidget::logDrawCards
* run format
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
translation completed for the source file '/oracle/oracle_en@source.ts'
on the 'it' language.
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
translation completed updated for the source file '/webclient/src/i18n-default.json'
on the 'fr' language.
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
this happened when viewing a replay with the "view replay" option in the
top menu, instead of using the replays tab while connected to a server.
this uses the local game player instead of the online one which does not
initialize the player info of the local spectating player, this causes a
crash when opening the context menu on another player in the replay from
one of their chat messages as it tries to check if you're a registered
user and could add them as a friend etc.
it now regards the uninitialized player info as an unregistered user and
will not show these options.
* fix crash when a cardmenu becomes an orphan
when a cardmenu is closed the cursor on that card reverts to the open
hand, this crashed the client when that card would be destroyed or moved
the act of reverting to the open hand now happens as an emitted signal,
this way it just doesn't exist anymore when the card is deleted.
* simplify fix
* Conjured xml attr
Add conjured attribute to related xml tags that makes those cards not be destroyed when they leave the battlefield.
* fix build errors, add sarkhan to test
* update oracle importer to support spellbooks from json
* debugging
* fix weird spacing
* fix oracle spacing too
* simplify if/else
Co-authored-by: Zach H <zahalpern+github@gmail.com>
* rename, remove oracle update
* remove extra linebreak
* run format.sh again
* fix keepalive being multiplied in server timeout
a timeout happened after the client not receiving anything for
keepalive * keepalive * maxtimeout (5 * 5 * 10) seconds instead of what
you'd expect, it now only uses keepalive once instead of twice this
means it should now take 50 seconds to time out when disconnected
* change timeout to 15 seconds instead
change time between pings to 3 from 5 seconds
change timout to 5 from 10 repeats
translation completed for the source file '/cockatrice/cockatrice_en@source.ts'
on the 'es' language.
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* merge clangify and cmakify into format.sh
update desktop lint workflow to 22.04
print cmake-format version as well
um, rename things?
add extra examples to format.sh --help
add option to not run clang-format
fix version display in .ci/lint_cpp.sh
fix relative paths in format.sh
fix formatting dirs
* run ./format.sh --cmake --branch ""
* revert formatting of cmake comments
* Update configuration path to be backwards compatible
Windows users have used AppData/Local/Cockatrice, whereas the new system was using AppData/Roaming/Cockatrice. This reverts the behavior in a Qt5/6 way.
* Prevent bad access potential for removals by checking bounds
Fix#4616
Switch to removeOne instead of bound checking removeAt
* Revert server cardzone check
Add lock around deleting arrows for commanding cards
Add support for Qt6 w/ Backwards Qt5
Handle Qt5/6 cross compilation better
Last cleanups
caps matter
Fix serv
Prevent crash on 6.3.0 Linux & bump to 5.8 min
Prevent out of bounds indexing
Delete shutdown timer if it exists
Fixup ticket comments, remove unneeded guards
Try to add support for missing OSes
Update .ci/release_template.md
Update PR based on comments
Update XML name after done and remove Hirsute
Address local game crash
Address comments from PR (again)
Tests don't work on mac, will see if a problem on other OSes
make soundengine more consistent across qt versions
disable tests on distros that are covered by others
Fix Oracle Crash due to bad memory access
Update Oracle to use new Qt6 way of adding translations
Add support for Qt5/Qt6 compiling of Cockatrice
Remove unneeded calls to QtMath/cmath/math.h
Update how we handle bitwise comparisons for enums with Tray Icon
Change header guards to not duplicate function
Leave comment & Fix Path for GHA Qt
Update common/server.h
Update cockatrice/src/window_main.cpp
Rollback change on cmake module path for NSIS
check docker image requirements
add size limit to ccache
put variables in quotes
properly set build type on mac
avoid names used in cmake
fix up cmake module path
cmake 3.10 does not recognize prepend
Support Tests in FindQtRuntime
set ccache size on non debug builds as well
immediately return when removing non existing client
handle incTxBytes with a signal instead
don't set common link libraries in cockatrice/CMakeLists.txt
add comments
set macos qt version to 6
Try upgrading XCode versions to latest they can be supported on
Ensure Qt gets linked
add tmate so i can see what's going on
Qt6 points two directories further down than Qt5 with regard to the top lib path, so we need to account for this
Establish Plugins directory for Qt6
Establish TLS plugins for Qt6 services
Minor change for release channel network manager
Let windows build in parallel cores
Wrong symbols
Qt6 patch up for signal
add missing qt6 package on deb builds
boolean expressions are hard
negative indexes should go to the end
Intentionally fail cache
move size checks to individual zone types
Hardcode libs needed for building on Windows, as the regex was annoying
Update wording
use the --parallel option in all builds
clean up the .ci scripts some more
tweak fedora build
add os parameter to compile.sh
I don't really like this but it seems the easiest way
I'd prefer if these types of quirks would live in the main configuration
file, the yml
fixup yml
readd appended cache key to vcpkg step
fix windows 32 quirk
the json hash is already added to the key as well
remove os parameter and clean up ci files
set name_build.sh to output relative paths
set backwards compatible version of xcode and qt on mac
set QTDIR for mac builds on qt5
has no effect for qt6
export BUILD_DIR to name_build.sh
merge mac build steps
merge homebrew steps, set package suffix
link qt5
remove brew link
set qtdir to qt5 only
compile.sh vars need to be empty not 0
fix sets manager search bar on qt 5.12/15
fix oracle subprocess errors being ignored on qt 5
clean up translation loading
move en@source translation file so it will not get included in packages
NOTE: this needs to be done at transifex as well!
Use generator platform over osname
Short circuit if not Win defined
* fix the uid and gid of the user in the container
this fixes this error:
unsafe repository ('/src' is owned by someone else)
this caused the hash to go missing in the version number
* add --interactive option to .ci/docker.sh
* add --dir to .ci/compile.sh
* fix up the comments on the ci scripts
* add extra comment to docker.sh
* i18n: login container and form
* i18n: activate, host, and register forms
* i18n: reset password forms
* i18n: login dialogs, ICU formatting
* i18n: login containers and components
Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
* update workflow to use windows 2022 image
* return the version of the run vcpkg action
the action has been changed to now use a vcpkg.json file instead of the
txt file we use now, we should try to find a way to update it to the new
workflow in case the current one becomes obsolete
* clean up a bit for consistency
* run ctest directly instead of relying on the makefile
* set -C flag for ctest
* set config option for cmake --build
this option is ignored for other platforms
* fix saved label, and fix using hashedPassword when Save is unchecked
* update host only after successful login
* cleanup
* fix ability to deselect saved password on successful login
* cleanup
* clear options after connection
* fix registration saved username
* cleanup
* change label
* fix tests
Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
* create .env file for server configuration
* render client version
* automate env file
* add prestart command
* create server-props.json instead of using .env
* automate master proto file
Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
* turn autocomplete off by default on inputs
* trim input fields onSubmit
* move trim to form submit
* cleanup
* remove dead code
* protect trim against null values
* make password optional on Login for servers that allow unregisted logins
* cleanup
Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
* support hashed passwords in register and resetPassword
* lint
* support hashedPasswords for accountActivation
* use salt in post-register login step
Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
* draft: handle firing an event once
* lint
* Prevent rapid double-click on sending messages
* no rest spread on single primative when sibling components exist
* clear message instead of using a fireOnce handler.
* fix tests
* remove unnecessary validate mock
* remove xcode string in file name
* alphabetical ordering + newest to the top
* remove not needed entries
* append -bit to name
* chronological
* spaces
* prevent stretched layout in settings
* restore layout of settings pages with already expanding elements
* Support full screen resolution and set a minimum that works well no matter the screen size
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
* protocol changes
* server changes
* client changes for password reset and registration
* add hashed password to change password in client
* always use hashed password to log in
* add warning to client when using plain text password
* require real password for changing email on server
this is backwards compatible as users logged in with a real password on
older clients will not need this, only users logged in with a hashed
password
* implement password dialog when changing email
* require min password length
* use qstringlist to build query instead
* use clear instead of = ""
* add max to password dialog
* use proper const ness in abstractclient
* reject too long passwords instead of trimming
the long type has different sizes across operating systems and should
not be used
in the timeline an overflow could occur if the width in pixels
multiplied by the total amount of milliseconds in the replay is larger
than 2^31 which is easy enough considering with only 500 pixels width
you'll reach this number with only 1.2 hours of replay (about 4 million
millis), note that this would be windows exclusive as *nix uses 64 bits
~~qt-json's own repo suggests using qt5's implementation instead, testing
revealed this is quite a bit faster, contrary to #3480~~ testing proved
this to not be compatible with older qt versions
servatrice uses the qthread usleep function which used to be protected
but is now public
cockatrice is not compatible with qt4 and hasn't been for a while
* implement max lengths for input dialogs that are sent to the server
* missed a double setMaxLength
* implement max string lengths server side
* add custom getText dialog with max length
* fix deck storage tab and miscellaneous server side
* add max size for deck uploads
* final pass on client side limits
* Address macOS issue where right-clicking a username in the main chat (or game chat) areas would pop up a seemingly empty user profile. This is because the resize event is overridden and doesn't actually attempt to resize based on the size hint of the dialog. Now that we're explicit with the call, this resize should be forced and have comparable results to popping up user profile from the user list.
* use datetime for calculating account age (#4526)
* use datetime for calculating account age
make translating easier by using tr multiples
automatically account for leap days
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
* Revert "Fixed layout on Deck Editor not using last layout. It was reseting layout on ctor. (#4420)"
This reverts commit 3bc90003b3.
* restart layout on fresh installs
* deprecate the gender property from the protocol entirely
* use obsolete instead of deprecated
* add the database migration
* update internal database version as well
* Support getting a user's password salt via initial websocket connection (added to Event_ServerIdentification)
* Nonsense stuff to figure out later
* move passwordhasher to correct location
* protobuf changes
* add ext to protobuf
* implement request password salt server side
* add supportspasswordhash to server identification
* check backwards compatibility
* reset some changes to master
* implement get password salt client side
* implement checking hashed passwords on server login
* check for registration requirement on getting password salt
* properly check password salt response and show errors
* remove unused property
* add password salt to list of response types
Co-authored-by: ZeldaZach <zahalpern+github@gmail.com>
* Support password reset workflow. Also fix issue where a user would be disconnected "randomly" if they had a failed login, then successful one. Refactored a bit on Status Labels since they weren't really necessary and added complexity.
* Disconnect in default cases where we don't know what to do, but shouldn't stay connected to the server
* add ubuntu 21.10 to ci
remove ubuntu 20.10
* forgot to update dockerfile
* add googletest from repos
* update downloaded gtest
ideally this should just grab the master version
* fix hash
* fix cmake issue
* don't reset pt if there is nothing to reset
when the client resets the pt of a card it intentionally does not
include cards that already have the correct pt, this can lead to the
client sending an empty command to the server, which will be rejected
* clangify
* Support Registration on Webatrice with a baseline of handling. Still needs to support activation tokens & unit testing.
* Add support for account activation with token
* Activate Account refactor
* Fix typo
* Add Unit Testing for Commands/Events
* Changes based on review feedback
* add unit tests for websocket events
* add unit tests for KeepAliveService, clean up keepAlive termination flow
* put keepAlive command in protobuf service and expose thru webClient
* secure wss
* rename files tsx to ts
* add localhost support for ws/wss connection
Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
* put socket.updateHistory behind SessionCommand
* rename /websocket files from .tsx to .ts
* add unit tests to websocket commands
* complete unit tests for webClient commands
* secure wss
Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
* Fix for #4284
-> The menus have the update menu thing emitted when they get triggered.
| -> works surprising well https://youtu.be/KOOmhxvHA2c is a demo on a 10000ish card deck
* changed my comment to make sense
* fix to the issues that @ebbit1q found
what caued them idk
* Revert "fix to the issues that @ebbit1q found"
This reverts commit 20b1ad9f7a.
* actual fix for the issues @ebbit1q found
* its dirty but works
* fix cards in zoneviews not having a menu
* deleted isempty check as it is updated after the check
* key binds should work now
-> menus updated on zone change/attach/retranslate UI if selected
* clangify
* remove updateCardMenu from carditem entirely
updateCardMenu is done by the player and having it in carditem led to it
often being run multiple times, I've opted to instead run it in the
player and remove the signal entirely
the new logic updates the cardMenu every time a card is set as the
activeCard in the game tab
additionally a cardmenu can change while selected if the selected card:
moves zone, is flipped, or is attached (it receives the unattach action)
this is done in the player instead now, checking if the card is the
activeCard
this however exposes a flaw in the selection management where if you
unselect a card the activeCard is set to nullptr, this was an existing
bug and causes the action on selected cards to suddenly disappear, even
if there are other cards selected!
* revert null test of aCardMenu
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
* add option to delete a user's messages
add optional parameter remove_messages to the ban and warn commands
add event for clients to redact messages
implement server side command and message handling
implement server history removal
todo: client side implementation
add option to remove messages to moderator action dialogs
add storage of message beginnings to chatview
add redactMessage command
handle Event_RemoveMessages on rooms
this approach is favored over parsing the chatroom after the fact but
will use additional memory to store the block indexes
this also leaves a problem in that user messages from the chat backlog
are not removed in the same way because they don't have a user
associated with them
add workaround for old qt versions
add action for users to remove messages from users in chats
add chat history to userMessagePositions with regex
proper const usage for userName
allow removing the messages of unregistered users
add menus to usernames in chat history
this allows you to remove user messages on chat history as well
this also allows moderators to take actions on users in chat history
Apply suggestions from code review
* readd missing call to handler
* Support registration domain whitelist (registration/emailproviderwhitelist) that, if set, will require a user to have an email with one of the specified domain providers. Will require client updates to see the Whitelist message, otherwise they'll be greeted with a default alert.
This also works to remove the pain of Google Email addresses and their infinite combination of usernames for the same account (i.e. remove periods and everything after the first plus sign).
* Make blacklist response show custom dialog
the stop dump zone command was implemented as a courtesy to other
players in order to take into account when they would stop looking at
unknown information
however, this can be abused, a malicious client can send this command
whenever they would like
cockatrice is not a physical tabletop nor does it aim to be, if you can
take a screenshot of your deck and then close the view, you are not
cheating as you have been given this information
in order to prevent anyone from abusing this we should remove the
command from the protocol, this means servers will ignore this message
and clients will get a little invalid command reply in their debug log
the extension id will remain reserved
shuffling your deck will always invalidate any card view looking at
those cards
if players wish to signal that they stopped looking at their deck for
whatever reason they should just use the chat instead, optionally using
one of the chat macros
* add collapsable list
* make it show commit count
* why not have it also know the release type and name
* update the template as well
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
this can cause the iterator to become invalidated which will crash but
because of the data not always being moved it will often still work as
intended, giving the idea that it is random
* add menus for top and bottom actions
* style points
* github online editor is literally the worst
* add moving cards from bottom of deck to hand
fix getting multiple cards from the bottom
note that moving cards from the bottom of the deck does not get
remembered by or disrupt undoing draws
* Apply suggestions from code review
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
* add more info to dialogs
adds descriptive strings to the register, password reset request,
password reset challenge request, password reset token dialogs
adds tip to set manager to use ctrl a to select all sets
change sizes in set manager
moves default server info to settings instead of having it hardcoded in
each dialog
* make sets manager smaller
* clangify
* cleanup
* add button to open themes location to settings
botton creates directory if it doesn't exist yet
themes path is no longer hardcoded but included in settings
themes now default to None the default theme is no longer required
themes set to None will not look for empty directories anymore
this is backwards compatible
users with a nonexistant theme (Default) set will get the new None theme
* remove default theme from install instructions
The returned number of users from `getUsersWithAddress` will include the already connected user. The predicate `>= maxUsers` is incorrectly assuming that the new user is not already counted by `getUsersWithAddress`. This change corrects this off-by-one error by only closing connections after their are strictly too many users.
* Add option to always look at top card of deck
Similar to "always reveal", but reveals card only to the owner,
not all players.
* Add option to always look at top card of deck
Similar to "always reveal", but reveals card only to the owner,
not all players.
* Update bug_report.md (#4246)
* Update bug_report.md
* reproduction steps
* Update to address review comments
* Clangify
* set playerId on dumpEvent
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
Co-authored-by: Zach H <zahalpern+github@gmail.com>
* refactoring
* allow for creation of games as spectator
allow setting the amount of games per user to none
remove limit on amount of games when creating a game as judge as
spectator
* refactor common/server_player.cpp
* do not close games with spectating host automatically
* remove check that filters out 0 player games
this check didn't really do anything, deleted games are removed before
it would be reached
* don't transfer host to spectators
this seems to cause a bug, also present on master
the settings command_counting_interval and
max_command_count_per_interval are now in the [security] group as hinted
by their location in servatrice.ini.example
check values of comand interval settings before use
* don't sort split card halves alphabetically
fixes#4241
introduces new issue: aftermath cards are now switched upside down
* use list instead of multimap to enforce preservation of a given order
* add creation of release templates to ci and update guide
* touchups to markdown
* correct create release property
* correctly set fetch-depth and release body
* fix replacements, remove arrows
* check if there are no betas
* add extra output
* typo
correctly set prerelease flag
set prerelease names to their tag instead of full release name
detect version for use in release name during configuration
* Structure change
* Remove duplicate folders from previous structure
* Cleanup websocket protocol
* Updating from based off PR
* Fixup - remove wrong files during conflict and get the websocket working
* renaming tsx to ts
Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
* port webclient POC into react shell
* Abstract websocket messaging behind redux store
* refactor architecture
* add rooms store
* introduce application service layer and login form
* display room messages
* implement roomSay
* improve Room view styling
* display room games
* improve gameList update logic
* hide protected games
* improve game update logic
* move mapping to earlier lifecycle hook
* add autoscroll to bottom
* tabs to spaces, refresh guard
* implement server joins/leaves
* show users in room
* add material-ui to build
* refactor, add room joins/leaves to store and render
* begin using Material UI components
* fix spectatorsCount
* remove unused package
* improve Server and Room styling
* fix scroll context
* route on room join
* refactor room path
* add auth guard
* refactor authGuard export
* add missing files
* clear store on disconnect, add logout button to Account view
* fix disconnect handling
* Safari fixes
* organize current todos
* improve login page and server status tracking
* improve login page
* introduce sorting arch, refine reducers, begin viewLogHistory
* audit fix for handlebars
* implement moderator log view
* comply with code style rules
* remove original POC from codebase
* add missing semi
* minor improvements, begin registration functionality
* retry as ws when wss fails
additionally, dont mutate the default options when connecting
* retain user/pass in WebClient.options for login
* take protocol off of options, make it a connect param that defaults to wss
* cleanup server page styling
* match wss logic with desktop client
* add virtual scroll component, add context menu to UserDisplay
* revert VirtualTable on messages
* improve styling for Room view
* add routing to Player view
* increase tooltip delay
* begin implementing Account view
* disable app level contextMenu
* implement buddy/ignore list management
* fix gitignore
Co-authored-by: Jay Letto <jeremy.letto@merrillcorp.com>
Co-authored-by: skwerlman <skwerlman@users.noreply.github.com>
Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
* ci: Add vcpkg submodule
* cmake: Fix NSIS not detecting platform arch
* cmake: Add QTDIR(64|32)
This change adds a new var for QTDIR(32|64) which makes it easier
to specify a specific directory for Qt, rather than having to edit
the prefix path directly, which can get pretty messy. Functionally,
this shouldn't affect any builds that are already finding Qt as
part of path, and should not affect Linux/macOS.
* cmake: Bump min cmake version
* ci: Add GitHub Actions for Windows
* Fix#4043, Support MTGJSONv5 format in Oracle downloader
* Auto redirect V4 downloads to V5, as we won't support V4 after this change
* clangify >_>
* Remove null values and account for IDs missing
* fix split cards and double faced cards somewhat
* do not consider double faced cards duplicates
* fix promo double sided cards
* typo
* fix alternative versions of cards with (letter)
* zach says this is more readable
* pre qt 5.10 compatibility
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
* Fix#2820 by removing (this->setCursor) as this was null by the time we hit this component due to a racetime condition.
* check if card player pointer is valid before setting cursor
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
modify up the simplifyCardName function to ignore right halves
add guessCard function that prioritises full card names the simple ones
fix imports for misformatted split cards or double faced cards
introduces a small concession: not completely formatted names with a
shared name on the left side will get mixed up, eg "bind" but not "Bind"
this should be fine considering how this would fix a lot more cards
* free qprocess on oracle update fail
reload the database whenever oracle exits
search for oracle in ../oracle so you can use it from the build dir
* only ask for the db updater once
mana artifacts will use the stack and be placed in the normal tablerow
if you want to put it with your lands you're free to do so, as long as
you promise to not say oh this should not be here three turns after
shatterstorm resolved
* add proto files to clangify
* apply clangify to proto files
* remove blocksonsingleline, it didn't actually do anything
also add missing space to the travis warning, emoji are monospace too
* Part 1 for #3067: Basic combo box (dropdown) filtering mechanism for game age.
* Apply suggestions from draft review
# Conflicts:
# cockatrice/src/gamesmodel.cpp
# cockatrice/src/gamesmodel.h
* switch to using QTime
* check for games older than a day
* formatting for casts and more unnecessary cosmetic changes
* ebbit1q fixes
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
* consider cards with frameEffects promos
* skip duplicates entirely
all cards that are not "promo" or something like it will only retain the first copy instead of parsing all of them and keeping the last
* Fix#3957: Properly set filters to defaults on initial load and disable "Clear filters" button if filters are set to defaults
* Reuse resetFilterParameters() in GamesProxyModel constructor, and remove "off" designation for player min/max (as a default of 1/99 is enforced by the UI).
* Run tests on Windows CI.
* Add message logger
* Skip tests that cannot be linked.
* Fix test call
* Fix mock link issue on MSVC
* Fix PATH variable to find libraries for tests
* Fail test step on test errors
* add opening directory in file browser to linux
this uses QDesktopServices to open the url "file://[location]"
by default this is
"file://$HOME/.local/share/Cockatrice/Cockatrice/pics/CUSTOM"
any distro that has a file browser should have an accompanying mime type
specifying the file handler for the file:// protocol using the
inode/directory mime type
see https://specifications.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html
if a user were to have removed their mime database this will not work and
it will fail with nothing but a log message, this would be rare and not
worth checking in my opinion
* make opening directories the same for all oses
* sort headers
this specifically to support imports from mtg arena that have a set code
and then a collectors number like (ABC) 123 at the end, this pr strips
that from the card name (we don't use it anyway)
fixes#4011
* Add docker-compose document that works out of the box for Windows, and a storage location for the mysql-database.
* Documented Windows support in Readme file
* Some improvements to Servatice network code
1. fix crash on fuzzy connection (tcp server only)
2. ensure websockets are parent()ed to avoid leaking them
3. quick catch disconnect()ed sockets instead of waiting for a socket error to happen
4. supporto mulltiple connection pools on the websocket server; they are still bound to the same thread due to a qt5 limitation.
* Added keyboard shorcuts to focus and unfocus chat
* Fixed format
* Changed the Esc behavior to work on any QLineEdit in the main Window and ignore shortcut conflicts
* Fixed a conflict with shortcuts
* Configurable unfocus shortcut and format fixes
* minor style fix
* add pauper to the list of checked formats without a short form
l:p remains reserved for pioneer
* throw out weird hardcoded formats
this will at least still work whenever a format gets added
the shorthands are still kept
* ignore stars and promos but only sometimes
this will correct #3706 and #3715 being a bit overzealous in removing
cards and thus fix scheme cards being removed in entirety
fix#3845
note that this causes a lot more cards to be added that are in promo
sets, if these promo sets should prove to be problematic they should be
disabled somehow as having them as an option is still nice.
* remove debug lines
* Added few unsigned to ints in order to get rid of warnings.
Added column to users table, for when password is changed(issue#3015).
Moved password length check to separate method, to make it cleaner.
* Added migration file and changed schema version to 27 due to servatrice.sql schema modification.
* Make password length configurable.
* add osx mojave build+deploy
* add job names, change variables
* add zipping to packaging step
* see #3814
* update to high sierra
* update homebrew
* xcode 11.1
* [skip ci] add link to config explorer
* add support for adventures to oracle
this causes cockatrice to correctly fetch the front of the card for the adventure portion rather than sending lots of bad requests to scryfall
* treat adventures more like split cards
* dont hardcode `maintype: creature`
800b0f4b2f homebrew no longer provides a bottle for protobuf, which is so big we can't do without a precompiled version. This means we can no longer support sierra 10.12 and have to use high sierra 10.13, this does not seems like a very painful grade however as there are no differences in hardware requirements between the two and any user on sierra can upgrade to high sierra if they wanted to.
People keep complaining they can't compile on ubuntu 16.04 because of this warning message, while it just disables 2 "prettyness" warnings and only in the automatically generated code by protobuf which should never be a problem anyway!
original pr: #3432
* Deal with recent Qt methods deprecation
* Use std::sort, std::less instead of qSort/qLess
* Use QFontMetrics::horizontalAdvance instead of ::width
* Use qApp->primaryScreen() instead of QDesktopWidget
* use lambas instead of QSignalMapper
* Use QTreeWidgetItem::setForeground instead of ::setTextColor
* Use QDir::setPath instead of operator=(QString)
* Use QList::swapItemsAt instead of ::swap
* fix error
* add homebrew cache to cache
* use same image
* ruuun travis, ruunn
* remove extra space
* do these dashes do this?
* trigger ci
* these dashes confuse me, consistency is like woosh
* add a bunch of parents to dialogs
works on #3651
* use game as parent instead
* add more parents
* fix create token dialog modality
* add parent to game information window
* replace a bunch of nullptrs with the magic of sed
* add parent to tip of the day and counters
* reorder game ptr
* set parent for life counter
* clangify
* Fix#3618
* clanfigy me softly
* fix unused var and params
* Frce the dialog being modal; ensure self deletion
* More qt-like behavior
* Restore dialogSemaphore logic
* Shortcuts preference pane
* Honor and glory to the hypnoclangifier
* clanfigy: exclude deleted files from being checked
* keep the olf translation context to be able to reuse old translations
* Fix gcc; extract translations
* Moved generic buttons after the groupbox
* Update current item on "clear/reset all"
* Sequenceedit: make buttons larger and translatable, add text
* Event filter
* Don't filter arrow keys; added placeholder text
* group counters
* Fix crash on card relation to inexistent card; fix#3637
But that whole loop is a logic mess
* Check if related cards exists before creating the menu entry
* honor and glory to the hypnoclanfigier
* Only will auto-select RR if autoconnect is not checked off.
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* Only will auto-select RR if autoconnect is not checked off.
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* On disconnect, un-check autoconnect. Better naming.
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* rework pt setting
save pt as a string serverside
set the pt of cards that enter the battlefield to empty (was -1/0)
implement old behaviour as changePT clientside
display old pt to messagelog
add new keybind for new set behaviour (default ctrl+shift+p)
add flow pt actions and keybinds that increase while decreasing
put more braces everywhere
various refactors like adding consts and for loops
remove a single superfluous semicolon
does not change the way pt is displayed client side
does not fix 3455 fully
* fix drawing of pt
remove search for / in carditem's paint() (crash)
ptstring is now always orange unless it's a faceup card with a pt that
matches the cardinfo pt
set changept to remove the pt if the field is empty
set changept to keep the old value if one side is empty
return in changept for +0/+0
clean up some if statements
* return on change to +0/+0
* change log message for empty original pts
* typo
* remove changept
add parsept to unify reading pt strings
change setpt behavior to be an "upgraded" version of the old setpt
add arbitrary strings as anything that starts with /
* clangify
* remove debug lines
* add tip of the day
* add missing images
* clangify
* Add MagicCards.info like fitler parser.
* Use FilterString whenever one of [:=<>] is in the edit box.
* Opts
* Opt
* - Capture errors
- Allow querying any property by full name
* clang format
* Update cockatrice/src/filter_string.cpp
Co-Authored-By: basicer <basicer@basicer.com>
* - Some refactoring for clarity
- More filters
- Add filter help
* Clangify
* Add icon
* Fix test name
* Remove stay debug
* - Add Rarity filter
- Make " trigger filter string mode
* You have to pass both filter types
* clangify
* - Allow filtering by legality
- Import legality into card.xml
* Add format filter to filtertree
* More color search options
* RIP extended
* More fixes
* Fix c:m
* set syntax help parent
* Fix warning
* add additional explanations to syntax help
* Allow multiple ands/ors to be chained
* Cleanup and refactor
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* Move utility into guards
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* I heard you like refactors so I put a refactor inside your refactor (#3594)
* I heard you like refactors so I put a refactor inside your refactor
so you can refactor while you refactor
* clangify
* Update tab_deck_editor.h
* Minor cleanup & set RR default for new clients
* Handle case of no entries
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* Use RR as default on rebuilds
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* Click replay timeline to seek.
* Fix seek for long games
* Erase log when rewinding
* zach cleanup
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* - Allow shuffling a subset of a zone
- When moving cards to the bottom of library, shuffle them after
- Process events in the correct order serverside
* Zach fixes
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* Comments + additional guard
* Playing a tableRow 3 card from the stack puts it to grave.
* move to top by resetting pos
* Zach touch
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* removes the pt of face down cards
Instead of setting the pt of a hidden card to the value only known to
you, it's reset to nothing.
Resetting a card while it's already reset does nothing.
Removing the pt of a card is logged as "player removes the pt of card."
instead of "player sets the pt of card to ." (note the missing value).
* reset unknown cards to nothing instead
* replace cardname with card id for unknown cards
fixes#3543
* prefix #
* Add peglib
* - Add expression engine
- Take an expression when setting a counter
* Shift + Click = Middleclick for counters
* minor cleanup for clangify
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* Added tip entry
* Fix up Dockerfile to use ubuntu:bionic and actually build
* Remove commented PPA
* Fix up Dockerfile to use ubuntu:bionic and actually build
* cleanup
* fixup merge
## Short roundup of the initial problem
A beta release for 2.6.3 has been relesed, but the codebase is still at 2.6.2
## What will change with this Pull Request?
Bumped version to 2.6.3
* add the amount of cards logged to the reveal cards event
sets cardname to the amount for the call if not 1 for the fromstr only
add braces for single line statements
* zach cleanup
* CardDB: merge all card properties in a new structure
* Pre Json parser changes
* Cockatrice: use qt's builtin json support
* Move qt-json src dir from cockatrice to oracle
* Add dummy cockatricexml4 parser (yet to be implemented)
* Implement a new parser and xml format
* cockatricexml4: new xml parser following the "generic properties hash" pattern;
* oracleimporter: refactor the parsing code to better adapt to cockatricexml4; rewrote split cards parsing
* carddb: change "colors" from a stringlist to a string
* carddb: move the getMainCardType() method to the cockatricexml3 parser
*
* CardInfo: show all properties (stil missing: nice name + translation)
* Rework the "add related card" feature so that it doesn't change the card name in the carddb
Also, fix token count display
* Picture loader: Added support for transform cards
* Fix side information for flip cards
Mtgjson uses side a/b for flip cards, while scryfall doesn't
* Pictureloader: dynamic tag resolution from card properties
Examples old => new
* !cardid! => !set:muid!
* !uuid! => !set:uuid!
* !collectornumber! => !set:num!
New examples:
* !prop:type!
* !prop:manacost!
* Start moving mtg-related property names to a specific file
* Clangify
* Fix tests
* Make gcc an happy puppy
* Revert "Make gcc an happy puppy"
This reverts commit 446ec5f27516c4d3b32dbfc79557f4827c5c5bdf.
* Some gcc fixes
* Share set list between different db parsers, so they won't overwrite one each other
* All glory to the hypnoclangifier!
* Fix test compilation
* Cleanup edited files in the prior PR. (#3519)
* Cleanup edited files in the prior PR.
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* Fix includes
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* Update carddatabase.h
In #3439 the shortcuts got some overhaul but this shortcut wasn't
correctly renamed.
This fix will clear users' original shortcut for increasing toughness.
An improvement over the current state of it not working at all and being
unable to set to the default shortcut.
Fixes#3506
* Cockatrice Picture loader uses better defined URLs now
URLs are defined on the Card Management tab
Instead of Primary/Backup, you can now define a list of URLs
List of URLs can be drag/dropped for priority ordering
Oracle now uses scryfallId > mtgjsonUUID for !uuid!
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* Simplify to QStringList and remove metacall
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* fix issues brought up by Dae. Also fix how the defaults load to account for first time users.
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* clangify
* Fix save settings on row moved (#3495)
* merge model fix, and reclangify
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
* Sources > Resources
Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
## Short roundup of the initial problem
We released 2.6.2, but CMake still thinks it's 2.6.1
## What will change with this Pull Request?
Update CMake version to 2.6.2
* Use plural form whenever possible
Change for "%1 draws %2 card(s)" is self explanatory
Change for "look top X" switches var %2 and %3 so i can skip %3 for singular and translate as "top card", as explained in tr comment
For "counter(s)" i just moved it into %3 (each color) since plural form is already used there.
* clangify
* manual clangify attempt
* Add missing tr
* More missing tr
* Basic mtgjsonv4 support
* Fix set type
* [WIP] Oracle: use zx instead of zip
* clanfigy fixes
* Fix reading last block of xz
* Added back zip support
* [WIP] adding xz on ci + fixes
* typo
* resolve conflict
* Make gcc an happy puppy
* test appveyor build
* appveyor maybe
* Appveyor: add xz bindir
* Update ssl version (the old one is not available anymore)
* Windows is a really shitty platform to code on.
* test vcpkg
* again
* gosh
* nowarn
* warning 2
* static
* Maybe
* cmake fix
* fsck this pain
* FindWin32SslRuntime: add vcpkg path
* Appveyor: cache support, force usable of openssl from vcpkg
* updated as suggested
* ouch
* Import card uuids and expose this property as !uuid! for card image download
* Minor style fixes
* address changed URL
## Short roundup of the initial problem
Deployment conditions weren't met, because the $BUILDTYPE variable doesn't exist anymore.
@ebbit1q changed that, and there is a flag now that you pass to the compile script instead.
## What will change with this Pull Request?
- Remove that condition
It's not needed because we make sure via the build config itself that on tags no debug builds are run. This was a double check basically to prevent debug builds beeing deployed.
When i added the appended os nametags I didn't account for the dots inside the version, this will place the nametag before the last dot instead of after the first dot.
Set travis image to xcode9.2: this image uses sierra instead of
el_capitan, el_capitan no longer builds.
Disable homebrew autoupdates, this gives a major speedup.
* add fedora docker image to travis compilation
fixes#1746
* add dockerfile
* would you like to please install for me? [y/n]
* remove bc dependency
* save cache separately for different docker builds
* add development packages to fedora dockerfile
* add package names
* use env values to make these all look the same
* set docker image name correctly
* add missing dependency
* minor oversight, add %% to remove all braces in check schema
* add keybinds to mill cards
Add functions to move single card from top of deck to the graveyard and
exile.
Add keybinds to move single or multiple cards from top of deck to exile
or graveyard.
Add new keybinds to settings menu.
Move settings menu items around for a better fit.
Rename a few of the items in the settings menu.
Add default keybinds: ctrl alt d/e for single/multiple cards from top of
deck to the graveyard. No defaults are set for moving to exile.
* fix shortcut menu
* fix missing tag
* rename mismatched functions
* fixed your typos
* refactor shortcutsettings
correct a lot of typos
optimize a lot of functions
this could merit a pr on its own
* set mill keybinds
* refactor add related card actions
I found a function that was completely unintelligible so I made it
remotely legible and removed the duplication.
* shorten line by 17 characters
replace a lot of function calls with just a single reference
* add brackets
add brackets to all single line if statements etc.
readability improvements
* correct previous misstake in #3438
wrong, this fixes that.
* add checking for second argument to --package
nice to have
* split find result into path and file
* add more clang-format focus to CONTRIBUTING.md
Add more clang-format instructions and instructions on clangify.sh.
Move clang-format instructions to the section Formatting and make other format topics a subheader of it to articulate focus on it.
Add section about our ci formatting for people that look at this file after their test failed.
fixes#3065
also fixes#3340
* grammar
* grammar
* set error message to be conditional
#3443 fails on the git merge base for "some reason" but at least this error message should be clearer.
* fix issues created earlier in #3433
split version from actual diff
remove --color-diff argument as apparently it isn't supported
* add docker compilation to travis
add new matrix entry in .travis.yml for compiling on 18.04
add Dockerfile in .ci to build ubuntu 18.04 inside docker
remove release entry for uvuntu 16.04 to not conflict
refactor .travis.yml
refactor travis-comile.sh
merge travis-dependencies.sh into the travis.yml
remove travis-dependencies.sh
* enable debugging on travis-compile.sh
* set ubuntu16 buildtype to "Debug"
set buildtype Debug for as requirement for "test"
add --debug and --release flags to travis-compile.sh
* make output prettier
edit the format warning message and clangify.sh output
* fix clangify.sh
fix --cf-version flag
fix directory argument parsing
add directory parsing details to --help
add examples to --help
* test making packages
move dockerfile for bionic to make room for possibly other files
add missing file dependency
set macos brew to use protobuf --without-python@2
* remove test
* rm old Dockerfile
* add docker compilation to travis
add new matrix entry in .travis.yml for compiling on 18.04
add Dockerfile in .ci to build ubuntu 18.04 inside docker
remove release entry for uvuntu 16.04 to not conflict
refactor .travis.yml
refactor travis-comile.sh
merge travis-dependencies.sh into the travis.yml
remove travis-dependencies.sh
* enable debugging on travis-compile.sh
* set ubuntu16 buildtype to "Debug"
set buildtype Debug for as requirement for "test"
add --debug and --release flags to travis-compile.sh
* make output prettier
edit the format warning message and clangify.sh output
* fix clangify.sh
fix --cf-version flag
fix directory argument parsing
add directory parsing details to --help
add examples to --help
* Improve clangify.sh
Separated from #3433 merge this branch first!
* fix error codes on -n and -t
fix output on -n
format -h message
* separate color diff from diff
* set common protobuf files to compile with other tags in debug
force the same flags as release on debug builds
fixes#3431
* check for version first
* use Protobuf_VERSION instead of calling protoc --version
* lower verion requirement
* set tags to disable certain warnings instead of removing all
* improve loading from plain text
Fixes the loadFromStream_Plain function that is used to load plain text
decklists.
The rewritten function uses more regexes and is a bit cleaner.
This fixes multiple bugs with loading the various sources of decklists.
Note that the new function still has a few issues that are shared with
the original version like creating duplicate cards.
* clang format comments
apparently clang-format even complains about the spacing in your
comments
* refactor loading_from_clipboard tests
Remove all heap allocation and use references.
Use std::pair and std::string so gtest will show the cardnames in error messages.
(note that using QPair or QString does not work with gtest)
Improve the last two testcases to include weird names; and name and
comments testing.
Remove empty header file.
* fix compatibility with more formats
skip "sideboard" line
include everything in mainboard when there are multiple empty lines
add removal of the mwdeck cardversion selector in round braces
add replacal of lowercase ae combination that should never occur
Set cardname to lowercase as apparently our checks are hardcoded to only
accept lowercase.
* remove bugged test
The current load from plain is simply broken, removed checking the
comments for correct contents.
* rework load_from_clipboard tests again
rework the test to have less code duplication
add more tests and more special cases
note that text is still all lowercase
* improve loading from plain text
Fixes the loadFromStream_Plain function that is used to load plain text
decklists.
The rewritten function uses more regexes and is a bit cleaner.
This fixes multiple bugs with loading the various sources of decklists.
Note that the new function still has a few issues that are shared with
the original version like creating duplicate cards.
* clang format comments
apparently clang-format even complains about the spacing in your
comments
* refactor loading_from_clipboard tests
Remove all heap allocation and use references.
Use std::pair and std::string so gtest will show the cardnames in error messages.
(note that using QPair or QString does not work with gtest)
Improve the last two testcases to include weird names; and name and
comments testing.
Remove empty header file.
* fix compatibility with more formats
skip "sideboard" line
include everything in mainboard when there are multiple empty lines
add removal of the mwdeck cardversion selector in round braces
add replacal of lowercase ae combination that should never occur
Set cardname to lowercase as apparently our checks are hardcoded to only
accept lowercase.
* remove bugged test
The current load from plain is simply broken, removed checking the
comments for correct contents.
* rework load_from_clipboard tests again
rework the test to have less code duplication
add more tests and more special cases
note that text is still all lowercase
* remove forcing of lowercase cardnames
Cardnames in DeckList::loadFromStream_Plain will no longer be forced
lowercase if they aren't found in the database.
Empty lines in the comments of plaintext decklists will not be skipped.
The loading_from_clipboard_test gets its functions declared in a
separate header "clipboard_testing.h".
Add more edgecase tests.
Refactor code.
* add old QHash version support
QT 5.5 does not support using initializer lists for QHash.
Implement a preprocessor version check for conditionally using inserts
instead of a const with initializer list.
* add old QHash version support
QT 5.5 does not support using initializer lists for QHash.
Implement a preprocessor version check for conditionally using [] access
instead of a const with initializer list.
* add qHash on QRegularExpression below QT 5.6
Apparently QRegularExpression can't be hashed in lower QT versions,
so we add our own hash function, and everyone lived happily ever after,
and none the wiser.
* add header guards to clipboard_testing.h
Add extra rules that clang-format enforces, like the order of includes and the way single line comments should be formatted.
Correct some grammar ( what is up with the translation section ordering steps out of order?? ).
This is a web edit.
Remove the weird out of order numbering and replace it with just chapters for specific users.
Add a bit of explanation to adding translations as a developer.
This is just a recommendation for an improvement, jumplist could be added and/or #3423 merged with this. (it fixes the typos)
Add new brace guidelines, correct code sample.
Add detail to indentation guidelines.
Add basic clang-format information and a link to the documentation on llvm.
closes#3413
A quick edit to the contributing guide from the web ui, hope it comes out right.
* add reset power and toughness function on cards
Add actResetPT to set the power and toughness in the same way as
actSetPT but instead of prompting the user it will fetch the original
pt from the card info for each card.
Add the new command to the card rmb list, keybinds and settings.
* changed style to .clang-format
Please change the contributing guidelines to use this style instead.
* Added failing test to demonstrate issue with dec loading
* Prevents empty lines between comments from being interpreted as the start of the sideboard
* Translate curly apostrophe to ASCII apostrophe (#3395)
Treats the curly apostrophe as a straight apostrophe when searching in
the deck editor search bar.
* Moved logic for handeling translation to CardDatabaseDisplayModel.
This implementation was done with strings instead of characters because
the curly apostrophes and quotes are considered multi-characters.
Thus, the method of iterating through the string and replacing
the characters with the proper translations was difficult to cleanly
implement.
* clang-tidy modifications
* Implemented faster algorithm for string translation.
Optimized the algorithm for string translation, before it would compute
in O(N*M) time where N is the size of the string and M is the size of
the translation table. Now it will compute in O(N) time where N is the
length of the string.
* Renaming variables and methods.
* Fixed character literal type, was unicode, is now wide.
* Disable saving of decks when the deck is empty
* Replace tabs with spaces to conform with coding conventions
* Remove whitespace at end of line to satisfy the CI robot overlords
* Improve logic to check if deck is empty, fix functionality when a deck is loaded
* Fix code style issues
* Disable more menus when the deck is empty
* Streamline code for disabling save menus when the deck is empty
* Fix save-disabling when loading a deck from the clipboard
* Enable saving deck directly after loading deck
* 2479: Running clang-format
Reformatting files to be in line with style guidelines.
* 2479: Updates to remove set/url indices
This change removes set and Url indices in favor
of check for empty lists and removing items from them
instead.
* 2479: TransformUrl will now error on missing fields
If transformUrl is called with a template, and the card/set
is missing something required by that template, it will now
return an empty string, instead of the template with an empty
string substituted in.
* 2479: clang-format updates
* 2479: Fixing omission of ! from two properties
* 2479: Adding prefix on debug messages
Adding PictureLoader: to the front of each debug message
from this file, so that it can be more easily filtered out
by grep in the log of a running application.
* 2479: Remove outdated comment
* 2479: Remove unused method from intermediate work
* 2479: Updating QDebug messages to be more consistent
* 2479: clang-format updates
* 2479: Remove repeated code, replace with call to nextUrl
This removes some redundant code that is better replaced with a call
to nextUrl, in case the code needed to populate the nextUrl changes
significantly.
* 2479: Adding more detailed comments
* 2479: Refactor transformUrl
Refactor transformUrl to do everything in a single loop instead
of two almost identical loops. set information is populated if
present, but is added with empty strings if absent.
Url checking is now working as expected. In set order,
starting with custom sets, then going in priority
order by url template order, Urls will checked, and the
first successful one will be used.
Initial work on downloading cards through fallback URLs.
This change will add in the ability to proceed to the next URL
should the first one fail. First trial shows that it's working,
but needs more refinement.
Return a list instead of a single url. This is the start
of getting many possible urls instead of one. Functionally
identical except that the primary url will be attempted for
cards without a muid.
## Related Ticket(s)
- Fixes#3314
## Short roundup of the initial problem
When the view was sorted in the manage sets window, the "Enable/Disable All" buttons never toggled to "Enable/Disable selected" buttons, even when more sets were selected.
## What will change with this Pull Request?
- Selected sets can be enabled/disabled in sorted view as well
* version updates
- qt to 5.11.x
- openssl to 1.0.2o
- protobuf to 3.6
* undo protobuf change
* reapply with proper semver
* only qt latest
* combined env, protobuf 3.6
* slim build matrix config down
* fix env
* test
* fix env -eq
* test if script changes work
* /2
* enable cache again
* fix
* final
## Short roundup of the initial problem
It was mostly out of date because we have to manually update it with our current version number.
The use of that is suspect anyway, since it only displays in the appveyor build overview.
It also had a redundant info about the branch.
## What will change with this Pull Request?
- remove hard coded version number
- remove branch
- cleanup build trigger from [#3300](https://github.com/Cockatrice/Cockatrice/pull/3300/files#diff-11c909939117928998b102a1fff7d363)
- more readable style
## Screenshots
I did some tests, so don't be confused about the different styles displayed in the history:
<!-- simply drag & drop image files directly into this description! -->

* search field added; sortfilterproxy displayed in treeview
* searching works properly
* moving with filter on works; view isnt't updated yet
* clangify & view updating figured out
* moving disabled when sorting is active
* drag&drop disabled when view sorted
* clangified
* foreach replaced
* button rename & SORT_RESET defined
* changed variable names
* 'x' button added & searchlabel text modified
* 'enabled' column won't grow anymore
* column resize improvement
* button hint & restore original order added
* moving with filter on works; view isnt't updated yet
* sort disable build in column headers (3 clicks)
* codacy fix
* typo + wording
* background color for warning
* buttons moved down a bit
* clicking "default order" button will hide the warning text
## Related Ticket(s)
- Fixes#3212
## What will change with this Pull Request?
- `0` input on power/toughness filters will only return `0` values
- `relationCheck` method will only get called after simple string comparison failed
- due to their similar structure `acceptPower` and `acceptToughness` methods has been merged
## What will change with this Pull Request?
- cleanup of empty and unused languages files (catalan, lithuanian, hebrew, ukrainian)
- reflect language removing on transifex
* Osx: fix qt plugin installation
* Add make install step to travis debug build
* only install under osx
* Add "styles" plugins (for native look'n'feel)
* Osx: upgrade qt from 5.5 to current (5.10.1)
* Fix osx on travis
The qt homebrew formula now installs three qt* symlinks (qt, qt5, qt5@5.x) so we can't use/don't need bash globbing anymore
* "Tip of the Day" option added to Help menu
* Tip of the Day setting moved
* If no new tips are availabe, don't show tip of the day again
* list storing try #1
* first unseen tip shown first
* lastShownTip removed
* fixed next/previous buttons
* spaces > tab
* "Show this window on startup" is not checked by default
* Basic tip of the day with sample widget added
* "Show tips on startup" option added to settings
* tip cycling implemented
* Structure of the tipOfTheDay class and resource created
* tip getter function modified
* Resources added, feature works properly
* clangified
* accidental modification rolled back
* zach cleanup
* tips to spaces; cmake list combined
* cleanup img
* fix copy
* remove TOTD as QObject so we can copy construct it
* prevent mem leaks in dlg
* changed order of 'next' and 'previous' buttons
* Date and tip numbers added; content wraps around
* useless sizepolicy removed
* link support added & clangified
* Initial tips & memory management updates
* Shortcut setting checks for invalid keys
* Different message shown for invalid keys and used keys; warning message is displayed on start if conflic is detected
* Only shortcuts related to deck-builder are checked
* oracle now can be run in spoiler or normal mode
* tests for travis
* only run on relaunch
* spoilers in client (not oracle now) and tray icon shows when done
* spoiler status will be checked before downloading spoiler file
* only download if they care about spoilers
* reload db on spoiler download
* manual update button, code cleanup, and fix enabling sets when new
* cleanup, nullchecks, and fixes to spoiler
* reload DB even if not in spoiler season; necessary as we have a check elsewhere to prevent the reload if spoiler check happens
* Implement changes from 2991#issuecomment-356169374
* Change implicit nullptrs, alert on file deletion, minor changes
* make reload thread safe and minor changes from 2991#issuecomment-356450302
* Fix locking
* Disable update now button while process running
* Added “export deck” option to export deck to decklist.org for viewing/printing. Implemented using a new menu item, added shortcut ability, and functionality to parse the deck correctly and add main/sideboard cards to decklist. Per issue #2931
This change establishes the Google Developer Documentation Style Guide as the official style guide for the ReadMe. This will provide a starting point for editors or writers looking to work on documentation. This edit also does an initial patch on the readme based on that style guide
* prevent unnecessarybuilds
* readd qt5 string
sadly this is needed as of now:
ff6b0f86ec/cockatrice/src/releasechannel.cpp (L59-L68)
* wrap asterisks
* fixed with validator
https://ci.appveyor.com/tools/validate-yaml
* complete link
* add helpful links
this should not trigger a appveyor build
* add space in readme
this should not trigger a appveyor build
* highlight c++ types
this should not trigger a appveyor build
* remove empty line
this should not trigger a appveyor build
* declutter dockerignore
this should not trigger a appveyor build
* Appveyor updates
Remove unused stuff (mysql, choco)
Use MSVC 2015
Upgrade Qt to 5.9, protobuf to 3.4.1
* stick qith qt 5.6 for winxp 32bit compatibility; zlib test
* Appveyor is using a randmon clone path for pulls, get it from an env variable
Remove support for Fedora 22 (been EOL for a while)
Add support for Ubuntu 17.04 and 17.10
Note that debug builds for 17.04 and 17.10 are still affected by issue #2343, and so always fail.
* Portable mode for windows
* fix start menu in portable mode
* Make gcc an happy puppy
* Clean old installation if we are installing over an old portable mode installation
* Default to Desktop\CockatricePortable
* Settings dialog fixes
* wording
* enable cache
* caching on mac
* fix ci caching on mac
* fix
* add mac cache
* added homebrew cache and pretty print yaml (+ structural ordering)
* cleanup
* fix ccache on mac
* testing workaround
https://github.com/travis-ci/travis-ci/issues/7456#issuecomment-296505058
* try xcode7.3 instead of workaround
* cache timout value
more time for cache to upload
When checking unknown sets, consider sets with an empty long name,
set type and release date as 'incomplete'/'partial' sets.
Do not mark partial sets as known, or ask the user to enable them.
Instead, silently enable partial sets.
When a partial set becomes complete, the user is prompted to enable the
set as before. If they choose not to enable, those partial sets are
disabled, as we can no longer assume they are disabled by default.
* More descriptive reason for "to many requests" when registering
Currently the only way for a user to get a response of "to many registration attempts" is by the servers configuration to restrict the number of registration attempts but the error message presented to the user is very vague as to why they have been denied. This PR updates the reasoning. I'm open for suggestions on any clarity recommendations.
* Added more clarity
Updated error message to include email address information for even greater clarity.
* Colorless for color filter
Add 'colorless' as an option for color filter in deck editor / card list.
* Remove empty quote check
Empty quote does not work here. Add 'none' as optional string instead.
* Add C to colorless filters
Migrate from protobuf.js 5.x to 6.x (remove long.js and bytebuffer.js)
Upgrade jQuery from 1.x to 3.x
Upgrade jQueryUI to 1.12.x
Use minimized version of js libraries
Disable debug messages
Fix default value for Event_RoomSay’s RoomMessageType field
Looks like an addition to the table shifted things. We probably should look into some how use the actual column names (if it can be done). But for now this should fix the server room chat history.
* Update CONTRIBUTING.md
* Update CONTRIBUTING.md
"wait for CI upload" should be "wait for CI to upload"
"update again the version number" should be "update the version number again"
* Change version in about window and installer name
* Change version in about window and installer name
* Cmake get version updates
* dev snapshot format changed
* alignment changes
<sub>We are also packaged in <kbd>Arch Linux</kbd>'s <a href="https://archlinux.org/packages/extra/x86_64/cockatrice">official extra repository</a>, courtesy of @FFY00.</sub>
<sub>General Linux support is available via a <kbd>flatpak</kbd> package at <a href="https://flathub.org/apps/io.github.Cockatrice.cockatrice">Flathub</a>!</sub>
</pre>
## General Notes
We're pleased to announce the newest official release: <kbd>--REPLACE-WITH-RELEASE-TITLE--</kbd>
We hope you enjoy the changes made! All improvements with their corresponding tickets since the last version of Cockatrice are listed in the changelog below.
If you ever encounter a bug, have a suggestion or idea, or feel a need for a developer to look into something, please feel free to [open a ticket](https://github.com/Cockatrice/Cockatrice/issues). ([How to create a Ticket for Cockatrice](https://github.com/Cockatrice/Cockatrice/wiki/How-to-Create-a-GitHub-Ticket-Regarding-Cockatrice))
For basic information related to the app and getting started, please take a look at our official site: **https://cockatrice.github.io**
If you'd like to help and contribute to Cockatrice in any way, check out our [README](https://github.com/Cockatrice/Cockatrice#contribute).
We're always available to answer questions you may have on how the program works and how you can provide a meaningful contribution.
## Upgrading Cockatrice
<!-- this optional section puts a warning banner for problems with updating
> [!IMPORTANT]
> **With this release, we no longer provide a ready-to-install binary for:**
> --DEPRECATED-OS-HERE--
-->
Run the internal software updater: <kbd>Help → Check for Client Updates</kbd>
Don't forget to update your card database right after! (<kbd>Help → Check for Card Updates...</kbd>)
## Changelog
<!--
This list is generated and should be moved to their respective header and
possibly edited a little.
Append PR numbers of fixups to their main PR to keep the list coherent.
Put the quantity of remaining PR's below the highlights section.
Remove empty headers when done.
--REPLACE-WITH-GENERATED-LIST--
-->
<!-- Highlights of the release -->
### 🔖 Highlights:
### ✨ New Features:
### 🐛 Fixed Bugs / Resolved Issues:
<!-- Complete list of changes (foldable) -->
<details>
<summary>
<b>Show all changes</b> (--REPLACE-WITH-COMMIT-COUNT-- commits)
</summary>
### User Interface
### Under the Hood
### Oracle
### Servatrice
### Webatrice
</details>
## Translations
- **Thanks for over 300 people contributing to 20+ different languages up to now!**
- Without the help of the community we couldn't offer that great language support... keep up the good work!
- It's actually very easy to join and help for yourself - find out more here:
- [Help us Translate Cockatrice into your native language!](https://github.com/Cockatrice/Cockatrice/wiki/Translation-FAQ)
## Special Thanks
<!-- Personalise this a bit! -->
It's amazing that so many people contribute their time, knowledge, code, testing and more to the project.
We'd like to thank the entire Cockatrice community for their efforts! 🙏
<!-- We'd like to especially recognize @ZeldaZach, --ADD-CONTRIBUTORS-HERE-- for their help in preparing so many amazing new features for the user base. -->
Member variables aren't decorated in any way. Don't prefix or suffix them with
underscores, etc.
Use a separate line for each declaration, don't use a single line like this
`int one = 1, two = 2` and instead split them into two lines.
For arguments to constructors which have the same names as member variables,
prefix those arguments with underscores:
```c++
MyClass::MyClass(int _myData)
: myData(_myData)
{}
MyClass::MyClass(int _myData) : myData(_myData)
{
}
```
Pointers and references should be denoted with the `*` or `&` going with the
variable name:
```c++
// Good:
// Good
Foo *foo1 = new Foo;
Foo &foo2 = *foo1;
// Bad:
// Bad
Bar* bar1 = new Bar;
Bar& bar2 = *bar1;
```
Use `nullptr` instead of `NULL` (or `0`) for null pointers.
If you find any usage of the old keywords, we encourage you to fix it.
### Braces ###
#### Braces ####
Use K&R-style braces. Braces for function implementations go on their own
lines, but they go on the same line everywhere else:
Braces should go on their own line except for control statements, the use of
braces around single line statements is preferred.
See the following example:
```c++
int main()
{
if (someCondition) {
doSomething();
{ // function or class: own line
if (someCondition) { // control statement: same line
doSomething(); // single line statement, braces preferred
} else if (someOtherCondition1) { // else goes on the same line as a closing brace
for (int i = 0; i < 100; i++) {
doSomethingElse();
}
} else {
while (someOtherCondition) {
while (someOtherCondition2) {
doSomethingElse();
}
}
}
```
Braces can be omitted for single-statement if's and the like, as long as it is
still legible.
### Tabs ###
#### Indentation and Spacing ####
Use only spaces. Four spaces per tab.
Always indent using 4 spaces, do not use tabs. Opening and closing braces
should be on the same indentation layer, member access specifiers in classes or
structs should not be indented.
### Lines ###
All operators and braces should be separated by spaces, do not add a space next
to the inside of a brace.
Do not have trailing whitespace in your lines.
If multiple lines of code that follow eachother have single line comments
behind them, place all of them on the same indentation level. This indentation
level should be equal to the longest line of code for each of these comments,
without added spacing.
Lines should be 80 characters or less, as a soft limit.
#### Lines ####
Do not leave trailing whitespace on any line. Most IDEs check for this
nowadays and clean it up for you.
Lines should be 120 characters or less. Please break up lines that are too long
into smaller parts, for example at spaces or after opening a brace.
### Memory Management ###
@@ -125,53 +238,136 @@ mutating objects.)
When pointers can't be avoided, try to use a smart pointer of some sort, such
as `QScopedPointer`, or, less preferably, `QSharedPointer`.
### Database migrations ###
### Database Migrations ###
The servatrice database's schema can be found at `servatrice/servatrice.sql`.
Everytime the schema gets modified, some other steps are due:
1. Increment the value of `cockatrice_schema_version` in `servatrice.sql`;
2. Increment the value of `DATABASE_SCHEMA_VERSION` in `servatrice_database_interface.h` accordingly;
3. Create a new migration file inside the `servatrice/migrations` directory named after the new schema version.
4. Run the `servatrice/check_schema_version.sh` script to ensure everything is fine.
The migration file should include the sql statements needed to migrate the database schema and data from the previous to the new version, and an additional statement that updates `cockatrice_schema_version` to the correct value.
2. Increment the value of `DATABASE_SCHEMA_VERSION` in
`servatrice_database_interface.h` accordingly;
3. Create a new migration file inside the `servatrice/migrations` directory
named after the new schema version.
4. Run the `servatrice/check_schema_version.sh` script to ensure everything is
fine.
### Protocol buffer ###
The migration file should include the sql statements needed to migrate the
database schema and data from the previous to the new version, and an
additional statement that updates `cockatrice_schema_version` to the correct
value.
Cockatrice and Servatrice exchange data using binary messages. The syntax of these messages is defined in the `proto` files in the `common/pb` folder. These files defines the way data contained in each message is serialized using Google's [protocol buffer](https://developers.google.com/protocol-buffers/).
Any change to the `proto` file should be taken with caution and tested intensively before being merged, becaus a change to the protocol could make new clients incompatible to the old server and vice versa.
Ensure that the migration produces the expected effects; e.g. if you add a
new column, make sure the migration places it in the same order as
servatrice.sql.
### Translations: introduction ###
### Protocol Buffer ###
Cockatrice and Servatrice exchange data using binary messages. The syntax of
these messages is defined in the `proto` files in the `common/pb` folder. These
files define the way data contained in each message is serialized using
<b>If you're getting started ⇢ [view our webpage](https://cockatrice.github.io/)</b><br>
<b>If you're trying to get support or suggest changes ⇢ [file an issue](https://github.com/Cockatrice/Cockatrice/issues) ([How?](https://github.com/Cockatrice/Cockatrice/wiki/How-to-Create-a-GitHub-Ticket))</b>
</pre><br>
<br><pre><p align='center'>
<b>To get started with Cockatrice ⇢ [view our webpage](https://cockatrice.github.io/)</b><br>
<b>To get support, or suggest changes to the app ⇢ [file an issue](https://github.com/Cockatrice/Cockatrice/issues) ([How?](https://github.com/Cockatrice/Cockatrice/wiki/How-to-Create-a-GitHub-Ticket-Regarding-Cockatrice))</b>
<b>To help with development ⇢ learn [how to contribute](#contribute-)</b>
</pre><p><br>
# Cockatrice
Cockatrice is an open-source multiplatform supported program for playing tabletop card games over a network. The program's server design prevents any kind of client modifications to gain an unfair advantage in a game. The client also has a built in single-player mode where you can brew without being connected to a server. This project is written in C++ and is using the Qt5 libraries.<br>
Cockatrice is an open-source, multiplatform application for playing tabletop card games over a network. The program's server design prevents users from manipulating the game for unfair advantage. The client also provides a single-player mode, which allows users to brew while offline.<br><br>
This project uses <kbd>C++</kbd> and the <kbd>Qt</kbd> libraries.<br>
First work on a webclient with <kbd>Typescript</kbd> was started as well.<br>
We offer downloads for all full releases (recommended) and the latest development versions. Full releases are checkpoints with major feature or UI enhancements between them, but currently we don't have a set schedule for releasing new updates. The development version contains the most recently added features and bugfixes, but can be more unstable. Downloads for development versions are updated automatically with every change.
Downloads are available for **stable releases** and the current **beta version** in development.
There is no strict release schedule for either of them.
[](https://github.com/cockatrice/cockatrice/releases)  [](https://tooomm.github.io/github-release-stats/?username=Cockatrice&repository=Cockatrice&search=0) [](https://github.com/Cockatrice/Cockatrice/pulls?q=is%3Apr+is%3Aclosed)
<sub><i>While incorporating the latest fixes and features, beta builds may not be stable or contain new bugs!</i></sub>
<sub><b><i>Please report any findings and open new issues when testing them!</i></b></sub>
</pre>
- Latest full release (**recommended**): [Download from GitHub](https://github.com/cockatrice/cockatrice/releases/latest)<br>
# Related Repositories
-Latest development version: [Download from GitHub](https://github.com/cockatrice/cockatrice/releases/TBD)
-Development builds may not be stable and/or contain several bugs.
-If you'd like to be a Cockatrice Beta Tester, use this version.
- More information can be [found here](https://github.com/Cockatrice/Cockatrice/wiki/Release-Channels)
-[Magic-Token](https://github.com/Cockatrice/Magic-Token): MtG token data to use in Cockatrice
-[Magic-Spoiler](https://github.com/Cockatrice/Magic-Spoiler): Script to generate MtG spoiler data from [MTGJSON](https://github.com/mtgjson/mtgjson) to use in Cockatrice
-[cockatrice.github.io](https://github.com/Cockatrice/cockatrice.github.io): Code of the official webpage of the Cockatrice project
# Community Resources [](https://discord.gg/3Z9yzmA)
# Get Involved [](https://gitter.im/Cockatrice/Cockatrice)
[Chat](https://gitter.im/Cockatrice/Cockatrice) with the Cockatrice developers on Gitter. Come here to talk about the application, features, or just to hang out. For support regarding specific servers, please contact that server's admin or forum for support rather than asking here.<br>
If you'd like to contribute code to the project, we maintain a tag for "easy" changes on our issue tracker. Issues tagged in this way provide a simple way to get started. [Issues tagged as Easy Changes](https://github.com/Cockatrice/Cockatrice/issues?q=is%3Aopen+is%3Aissue+label%3A%22Easy+Change%22)
We try to be very responsive to new issues. We'll try to give you advice on how a feature should be implemented / advice on places the codebase is doing something similar before you get too far along with a PR.
# Community Resources
- [Cockatrice Official Site](https://cockatrice.github.io)
- [Cockatrice Official Wiki](https://github.com/Cockatrice/Cockatrice/wiki)
Join our [Discord community](https://discord.gg/3Z9yzmA) to connect with other projet contributors (`#dev` channel) or fellow users of the app. Come here to talk about the application, features, or just to hang out.
# Translation Status [](https://www.transifex.com/projects/p/cockatrice/)
Cockatrice uses Transifex for translations. You can help us bring Cockatrice and Oracle to your language or just edit single wordings right from within your browser by simply visiting our [Transifex project page](https://www.transifex.com/projects/p/cockatrice/).<br>
Check out our [Translator FAQ](https://github.com/Cockatrice/Cockatrice/wiki/Translation-FAQ) for more information about contributing!<br>
>[!IMPORTANT]
>For support regarding specific servers, please contact that server's admin/mods and use their dedicated communication channels rather than contacting the team building the software.
# Building [](https://travis-ci.org/Cockatrice/Cockatrice) [](https://ci.appveyor.com/project/Daenyth/cockatrice/branch/master)
# Contribute
**Detailed compiling instructions are on the Cockatrice wiki under [Compiling Cockatrice](https://github.com/Cockatrice/Cockatrice/wiki/Compiling-Cockatrice)**
### Code
Dependencies:
- [Qt](https://www.qt.io/developers/)
- [protobuf](https://github.com/google/protobuf)
To contribute code to the project, please review our [guidelines](https://github.com/Cockatrice/Cockatrice/blob/master/.github/CONTRIBUTING.md) first.<br>
We maintain two tags for contributors to easier find issues to potentially work on:
- [](https://github.com/Cockatrice/Cockatrice/issues?utf8=%E2%9C%93&q=is%3Aopen%20is%3Aissue%20label%3A%22Good%20first%20issue%22%20)<br>
Issues tagged in this way provide a simple way to get started. They don't require much experience to be worked on.
This tag is used for issues that we are looking for somebody to pick up. Often this is for feature suggestions we support, but don't have the time to work on ourselves.
For both tags, we're willing to provide help to contributors in showing them where and how they can make changes, as well as code reviews for submitted changes.<br>
We'll happily advice on how best to implement a feature, or we can show you where the codebase is doing something similar before you get too far along - put a note on an issue you want to discuss more on!
Cockatrice tries to use the [Google Developer Documentation Style Guide](https://developers.google.com/style/) to ensure consistent documentation. We encourage you to improve the documentation by suggesting edits based on this guide.
<details>
<summary><b>Kudos to our amazing contributors ❤️</b></summary>
Cockatrice uses Transifex to manage translations. You can help us bring <kbd>Cockatrice</kbd>, <kbd>Oracle</kbd> and <kbd>Webatrice</kbd> to your language and just adjust single wordings right from within your browser by visiting our [Transifex project page](https://explore.transifex.com/cockatrice/cockatrice/).<br>
Check out our [Translator FAQ](https://github.com/Cockatrice/Cockatrice/wiki/Translation-FAQ) for more information about getting invovled, and join a group of hundreds of others!<br>
Oracle can optionally use zlib to load zipped files:
- [zlib](http://www.zlib.net/) (no https!)
Oracle can *optionally* use some packages to load compressed card files:
- [xz](https://tukaani.org/xz/)
- [zlib](https://www.zlib.net/)
To compile:
<br>
mkdir build
cd build
cmake ..
make
You can then run
**Basic compilation steps:**
```bash
mkdir build
cd build
cmake ..
make
```
You can then
- Create a Cockatrice installation inside the `release` folder:
```bash
make install
to get a cockatrice installation inside the `release` folder, or:
```
- Or make an installation package specific to your system:
```bash
make package
```
to create a system-specific installation package.
>[!NOTE]
>Detailed compiling instructions can be found in the Cockatrice wiki at [Compiling Cockatrice](https://github.com/Cockatrice/Cockatrice/wiki/Compiling-Cockatrice)
The following flags can be passed to `cmake`:
<br>
-`-DWITH_SERVER=1` Whether to build the server (default 0 = no).
-`-DWITH_CLIENT=0` Whether to build the client (default 1 = yes).
-`-DWITH_ORACLE=0` Whether to build oracle (default 1 = yes).
-`-DCMAKE_BUILD_TYPE=Debug` Compile in debug mode. Enables extra logging output, debug symbols, and much more verbose compiler warnings (default `Release`).
-`-DUPDATE_TRANSLATIONS=1` Configure `make` to update the translation .ts files for new strings in the source code. Note: Running `make clean` will remove the .ts files (default 0 = no).
-`-DTEST=1` Enable regression tests (default 0 = no). Note: needs googletest, will be downloaded on the fly if unavailable. To run tests: ```make test```.
The following flags (with their non-default values) can be passed to `cmake`:
| Flag | Description |
| --- | --- |
| `-DWITH_SERVER=1` | Build <kbd>Servatrice</kbd> server |
| `-DCMAKE_BUILD_TYPE=Debug` | Compile in debug mode<br> Enables extra logging output, debug symbols, and much more verbose compiler warnings |
| `-DWARNING_AS_ERROR=0` | Don't treat compilation warnings as errors in debug mode |
| `-DUPDATE_TRANSLATIONS=1` | Configure `make` to update the translation .ts files for new strings in the source code<br> **Note:** `make clean` will remove the .ts files |
| `-DTEST=1` | Enable regression tests<br> **Note:** `make test` to run tests, *googletest* will be downloaded if not available |
| `-DFORCE_USE_QT5=1` | Skip looking for Qt6 before trying to find Qt5 |
# Running
# Run
`cockatrice` is the game client
`oracle` fetches card data
`servatrice` is the server<br>
<kbd>Cockatrice</kbd> is the game client<br>
<kbd>Oracle</kbd> fetches card data<br>
<kbd>Servatrice</kbd> is the server<br>
#### Docker
You can build an image & deploy a <kbd>Servatrice</kbd> (Cockatrice server) container using [Docker](https://www.docker.com/resources/what-container/) and our Dockerfile yourself.<br>
For more details, look into our wiki section on [Setting up Servatrice](https://github.com/Cockatrice/Cockatrice/wiki/Setting-up-Servatrice#using-docker).<br>
You'll also find more hints on our **pre-build image** there, or the **docker-compose** file which will configure and run both a MySQL server and Servatrice.
#### Servatrice Docker container
A Dockerfile is provided to run Servatrice (the Cockatrice server) using [Docker](https://www.docker.com/what-docker).<br>
You just need to create an image from the Dockerfile<br>
`docker build -t servatrice .`<br>
And then run it<br>
`docker run -i -p 4747:4747/tcp -t servatrice:latest`<br>
Please note that running this command will expose the TCP port 4747 of the docker container to permit connections to the server.<br>
More infos on how to use Servatrice with Docker can be found in our [wiki](https://github.com/Cockatrice/Cockatrice/wiki/Setting-up-Servatrice#using-docker).
This is an unordered list of possible todo items for Cockatrice.
Note that "improve" and "write" always also means: "document and comment"
##Improve packaging:
* Improve nsis file git hash extraction, it only works if the build directory is cleared as version_string.cpp does not seem to get updated by git pull/cmake
* Create script/... for creating Linux packages (deb, rpm, ebuild, ...) or at least an official tarball/git tags; package maintainers dislike using git snapshots so much that they rather ignore software without stable tarballs.
##Scripts
* Write example init script for servatrice.
##Create developer documentation:
* Create developer manual
* Add comments to code
* Describe which components exist and how they work and interact
* Describe the *.proto files
* Comment and document servatrice.sql
* Document everything!1!!
##Else
* Update SFMT library (http://www.math.sci.hiroshima-u.ac.jp/~m-mat@math.sci.hiroshima-u.ac.jp/MT/SFMT/) in common/sfmt and adapt common/rng_sfmt.cpp
* Move hardcoded URLs (especially from oracle and cockatrice) into a config file.
* Search git log for useful information/problems/bugs/...
<!-- Intersexual/Transgendered symbol by Gregory Maxwell. Copyright 2005. GFDL-1.2 only -->
<svg
xmlns="http://www.w3.org/2000/svg"
version="1.1"
width="210"
height="280">
<pathd="M 188,38 v 20 l 14,-8 v -42 h -42 l -8,14 h 20 l -37,37 a 79,79 0 1,0 -59,141 v 22 h -27 v 23 h 27 v 27 h 23 v -27 h 27 v -23 h -27 v -22 a 79,79 0 0,0 52,-125 zm -100,27 a 57,57 0 1,1 0,114 a 57,57 0 1,1 0,-114 z"/>
<dd><a href="#[[plains]]">[[plains]]</a> <small>(Any deck that contains at least one card with "plains" in its name)</small></dd>
<dd><a href="#[[t:legendary]]">[[t:legendary]]</a> <small>(Any deck that contains at least one legendary)</small></dd>
<dd><a href="#[[t:legendary]]>5">[[t:legendary]]>5</a> <small>(Any card that contains at least 5 legendaries)</small></dd>
<dd><a href="#[[]]:100">[[]]:100</a> <small>(Any deck that contains exactly 100 cards)</small></dd>
<dt>Negate:</dt>
<dd>[soldier -aggro](#soldier -aggro) <small>(Any deck filename that contains "soldier", but not "aggro")</small></dd>
<dt>Branching:</dt>
<dd>[t:aggro OR o:control](#t:aggro OR o:control) <small>(Any deck filename that contains either aggro or control)</small></dd>
<dt>Grouping:</dt>
<dd><a href="#red -([[]]:100 or aggro)">red -([[]]:100 or aggro)</a> <small>(Any deck that has red in its filename but is not 100 cards or has aggro in its filename)</small></dd>
The search bar recognizes a set of special commands similar to some other card databases.<br>
In this list of examples below, each entry has an explanation and can be clicked to test the query. Note that all searches are case insensitive.
<dl>
<dt>Name:</dt>
<dd>[birds of paradise](#birds of paradise) <small>(Any card name containing the words birds, of, and paradise)</small></dd>
<dd>["birds of paradise"](#%22birds of paradise%22) <small>(Any card name containing the exact phrase "birds of paradise")</small></dd>
<dt>Rules Text (<u>O</u>racle):</dt>
<dd>[o:flying](#o:flying) <small>(Any card text that has the word flying)</small></dd>
<dd>[o:"first strike"](#o:%22first strike%22) <small>(Any card text that has the exact phrase "first strike")</small></dd>
<dd>[o:"{T}" o:"add one mana of any color"](#o:%22{T}%22 o:%22add one mana of any color%22) <small>(Any card text that has a tap symbol and the phrase "add one mana of any color")</small></dd>
<dt><u>T</u>ypes:</dt>
<dd>[t:angel](#t:angel) <small>(Any card with the type angel)</small></dd>
<dd>[t:angel t:legendary](#t:angel t:legendary) <small>(Any angel that's also legendary)</small></dd>
<dd>[t:basic](#t:basic) <small>(Any card with the type basic)</small></dd>
<dd>[t:arcane t:instant](#t:arcane t:instant) <small>(Any card with the types arcane and instant)</small></dd>
<dt><u>C</u>olors:</dt>
<dd>[c:w](#c:w) <small>(Any card that is white)</small></dd>
<dd>[c:wu](#c:wu) <small>(Any card that is white or blue)</small></dd>
<dd>[c:wum](#c:wum) <small>(Any card that is white or blue, and multicolored)</small></dd>
<!--
<dd>[c!w](#c!w) <small>(Cards that are only white)</small></dd>
<dd>[c!wu](#c!wu) <small>(Cards that are only white or blue, or both)</small></dd>
<dd>[c!wum](#c!wum) <small>(Cards that are only white and blue, and multicolored)</small></dd>
<dd>[c=wubrg](#c%3Dwubrg) <small>(Cards that are all five colors)</small></dd>
<pathstyle=" stroke:none;fill-rule:nonzero;fill:#000000;fill-opacity:1;"d="M 24 2 C 17.398438 2 12 7.398438 12 14 L 12 16 C 9.789063 16 8 17.789063 8 20 L 8 40 C 8 42.210938 9.789063 44 12 44 L 36 44 C 38.210938 44 40 42.210938 40 40 L 40 20 C 40 17.789063 38.210938 16 36 16 L 36 14 C 36 7.398438 30.601563 2 24 2 Z M 24 6 C 28.4375 6 32 9.5625 32 14 L 32 16 L 16 16 L 16 14 C 16 9.5625 19.554688 6 24 6 Z M 23.9375 19.9375 C 29.929688 19.9375 30 24.398438 30 25.25 C 30 29.71875 25.125 29.96875 25.375 33.875 L 21.875 33.875 C 21.578125 28.632813 26.0625 28.398438 26.0625 25.4375 C 26.0625 23.3125 24.632813 23.125 23.9375 23.125 C 21.859375 23.125 21.757813 25.09375 21.75 25.5 L 17.8125 25.5 C 17.820313 24.554688 18.015625 19.9375 23.9375 19.9375 Z M 23.6875 35.9375 C 25.671875 35.9375 25.875 37.765625 25.875 38.0625 C 25.875 38.351563 25.671875 40.125 23.6875 40.125 C 21.632813 40.125 21.5 38.351563 21.5 38.0625 C 21.5 37.765625 21.671875 35.9375 23.6875 35.9375 Z "/>
d="m 299.67889,84.945431 c -118.26949,0 -214.122988,83.892719 -214.122988,187.357619 0,58.63289 30.863828,110.90901 79.041488,145.28579 8.02961,5.77129 12.71356,15.13917 11.29165,25.0089 l -7.86234,55.37086 c -1.17098,8.02962 5.01851,15.22281 13.13176,15.22281 h 64.98968 v -46.83939 c 0,-3.68025 3.01111,-6.69135 6.69135,-6.69135 h 13.38268 c 3.68024,0 6.69135,3.0111 6.69135,6.69135 v 46.83939 h 53.53075 v -46.83939 c 0,-3.68025 3.01111,-6.69135 6.69134,-6.69135 h 13.38269 c 3.68023,0 6.69134,3.0111 6.69134,6.69135 v 46.83939 h 64.98967 c 8.11327,0 14.30275,-7.19319 13.13177,-15.22281 l -7.86234,-55.37086 c -1.4219,-9.78609 3.1784,-19.23761 11.29165,-25.0089 48.17767,-34.37678 79.0415,-86.6529 79.0415,-145.28579 0,-103.4649 -95.8535,-187.357619 -214.123,-187.357619 z M 219.38277,352.59917 c -29.52555,0 -53.53075,-24.0052 -53.53075,-53.53075 0,-29.52555 24.0052,-53.53075 53.53075,-53.53075 29.52555,0 53.53075,24.0052 53.53075,53.53075 0,29.52555 -24.0052,53.53075 -53.53075,53.53075 z m 160.59225,0 c -29.52555,0 -53.53075,-24.0052 -53.53075,-53.53075 0,-29.52555 24.0052,-53.53075 53.53075,-53.53075 29.52555,0 53.53075,24.0052 53.53075,53.53075 0,29.52555 -24.0052,53.53075 -53.53075,53.53075 z"
d="m 488.52401,428.04591 -80.36527,-83.50228 h 30.81218 c 9.06362,0 17.08104,-4.61393 20.90363,-12.05153 3.82262,-7.41912 2.56521,-15.92714 -3.29949,-22.19282 l -78.59482,-83.87142 h 29.06188 c 9.15413,0 17.40291,-4.93688 20.98411,-12.55902 3.54092,-7.50219 1.87106,-16.23169 -4.26525,-22.22053 L 312.83499,83.240199 c -6.06588,-5.951919 -17.38282,-5.951919 -23.45873,0 L 178.44019,191.64831 c -6.13629,5.98884 -7.79612,14.71834 -4.26523,22.22053 3.58119,7.62214 11.84001,12.55902 20.99414,12.55902 h 29.06189 l -78.60489,83.88987 c -5.84454,6.25645 -7.10199,14.75525 -3.28944,22.18361 3.82262,7.42836 11.82996,12.04229 20.90363,12.04229 h 30.81222 l -80.36527,83.50228 c -6.03569,6.26567 -7.40379,14.84754 -3.58117,22.38663 3.7723,7.42839 12.07138,12.22682 21.13497,12.22682 h 129.63669 c 0,0 -36.12127,66.38546 0,62.75824 h 80.45578 c 33.50708,5.78651 0,-62.75824 0,-62.75824 h 129.63668 c 9.06361,0 17.36266,-4.79843 21.13499,-12.22682 3.82262,-7.53909 2.45452,-16.12096 -3.58117,-22.38663 z"
d="M 387.28106,302.711 A 85.962512,85.962512 0 0 1 301.31852,388.67353 85.962512,85.962512 0 0 1 215.35597,302.711 85.962512,85.962512 0 0 1 301.31852,216.74844 85.962512,85.962512 0 0 1 387.28106,302.711 Z M 191.75349,358.6114 143.05798,460.97151 245.4181,412.27601 A 121.73882,121.73882 0 0 1 191.75349,358.6114 Z M 178.33753,302.711 c 0,-13.16763 2.23687,-25.83857 5.96271,-38.01232 L 77.71657,302.711 184.30024,340.7233 a 119.25435,119.25435 0 0 1 -5.96271,-38.0123 z m 178.8814,109.56501 102.36011,48.6955 -48.6955,-102.36011 a 121.73882,121.73882 0 0 1 -53.66461,53.66461 z m -55.90041,13.41595 c -13.16762,0 -26.0869,-2.23687 -38.01232,-5.9627 l 38.01232,106.58368 38.01231,-106.58368 a 119.25435,119.25435 0 0 1 -38.01231,5.9627 z m 109.56502,-178.88139 48.6955,-102.36012 -102.36011,48.69551 a 122.98106,122.98106 0 0 1 53.66461,53.66461 z M 245.66643,193.14596 143.30658,144.45045 192.00209,246.81057 a 121.73882,121.73882 0 0 1 53.66434,-53.66461 z M 524.92046,302.711 418.33679,264.69868 a 119.25435,119.25435 0 0 1 0,76.02462 z M 301.31852,179.73 c 13.16761,0 26.0869,2.23688 38.01231,5.96271 L 301.31852,79.109036 263.3062,185.69271 A 119.25435,119.25435 0 0 1 301.31852,179.73 Z"
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.