* 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
APPVEYOR_REPO_TAG_NAME:/([0-9]|[1-9][0-9])(\.([0-9]|[1-9][0-9])){2}-beta(\.([2-9]|[1-9][0-9]))?$/ # regex to match semver naming convention for beta pre-releases
<!-- this template comes from .ci/release_template.md -->
<!-- Don't forget to delete the previous betas after publishing this!
git push -d origin --REPLACE-WITH-BETA-LIST--
-->
<!-- This list of binaries should be updated every time the CI is changed to
include different targets -->
<pre>
<b>Pre-compiled binaries we serve:</b>
- <kbd>Windows 10+</kbd>
- <kbd>Windows 7+</kbd>
- <kbd>macOS 14+</kbd> ("Sonoma") / Apple M
- <kbd>macOS 13+</kbd> ("Ventura") / Intel
- <kbd>Ubuntu 24.04 LTS</kbd> ("Noble Numbat")
- <kbd>Ubuntu 22.04 LTS</kbd> ("Jammy Jellyfish")
- <kbd>Ubuntu 20.04 LTS</kbd> ("Focal Fossa")
- <kbd>Debian 12</kbd> ("Bookworm")
- <kbd>Debian 11</kbd> ("Bullseye")
- <kbd>Fedora 41</kbd>
- <kbd>Fedora 40</kbd>
<i>We are also packaged in <kbd>Arch Linux</kbd>'s official "extra" repository, courtesy of @FFY00</i>
<i>General Linux support is available via a <kbd>flatpak</kbd> package (Flathub)</i>
</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#get-involved-).
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. -->
First off, thanks for taking the time to contribute to our project! 🎉 ❤ ️✨
The following is a set of guidelines for contributing to Cockatrice. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
The following is a set of guidelines for contributing to Cockatrice. These are
mostly guidelines, not rules. Use your best judgment, and feel free to propose
changes to this document in a pull request.
# Recommended Setups #
For those developers who like the Linux or MacOS environment, many of our developers like working with a nifty program called [CLion](https://www.jetbrains.com/clion/). The program's a great asset and one of the best tools you'll find on these systems, but you're welcomed to use any IDE you most enjoy.
For those developers who like the Linux or MacOS environment, many of our
developers like working with a nifty program called [CLion](
https://www.jetbrains.com/clion/). The program's a great asset and one of the
best tools you'll find on these systems, but you're welcomed to use any IDE
you most enjoy.
Developers who like Windows development tend to find [Visual Studio](https://www.visualstudio.com/) the best tool for the job.
Developers who like Windows development tend to find [Visual Studio](
https://www.visualstudio.com/) the best tool for the job.
If you have any questions on IDEs, feel free to chat with us on [Gitter](https://gitter.im/Cockatrice/Cockatrice) and we would love to help answer your questions!
The CONTRIBUTING.md file mentioned in that message is the file you are
currently reading. Please see [this section](#formatting) below for full
information on our formatting guidelines.
### Compatibility ###
Cockatrice is currently compiled on all platforms using <kbd>C++11</kbd>. You'll notice <kbd>C++03</kbd> code throughout the codebase. Please feel free to help convert it over!
Cockatrice is currently compiled on all platforms using <kbd>C++11</kbd>.
You'll notice <kbd>C++03</kbd> code throughout the codebase. Please feel free
to help convert it over!
For consistency, we use Qt data structures where possible. For example,`QString` over
`std::string` and `QList` over `std::vector`.
For consistency, we use Qt data structures where possible. For example,
`QString` over `std::string` and `QList` over `std::vector`.
### Header files ###
Do not use old C style casts in new code, instead use a [`static_cast<>`](
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++
@@ -89,43 +161,49 @@ 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 ####
Braces should almost always go on their own line:
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();
}
else if (someOtherCondition1)
{
for (int i = 0; i < 100; i++)
{
{ // 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 (someOtherCondition2)
{
} else {
while (someOtherCondition2) {
doSomethingElse();
}
}
}
```
Braces should never be omitted for single-statement. Keeping the code legibile is a high priority of ours and we hope you share a similar belief :)
### Tabs vs Spaces ###
#### Indentation and Spacing ####
We _highly_ encourate the use of spaces. If you use tabs, please readjust them to 4 spaces per tab before submitting.
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 possible. Most IDEs check for this nowadays and clean it up for you.
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 120 characters or less, but you can exceed this if you find it necessary.
#### 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 ###
@@ -161,56 +239,129 @@ as `QScopedPointer`, or, less preferably, `QSharedPointer`.
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.
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.
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.
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.
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.
### 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 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.
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
`$UPSTREAM` - the remote for git@github.com:Cockatrice/Cockatrice.git
`$TAG_NAME` should be formatted as:
- `YYYY-MM-DD-Release-MAJ.MIN.PATCH` for **stable releases**
- `YYYY-MM-DD-Development-MAJ.MIN.PATCH-beta.X` for **beta releases**<br>
With *MAJ.MIN.PATCH* being the NEXT release version!
```
This will cause a tagged release to be established on the GitHub repository, which will then lead to the upload of binaries. If you use this method, the tags (releases) that you create will be marked as a "Pre-release". The `/latest` URL will not be impacted (for stable release downloads) so that's good.
This will cause a tagged release to be established on the GitHub repository,
with the binaries being added to the release whenever they are ready.
The release is initially a draft, where the path notes can be edited and after
all is good and ready it can be published on GitHub.
If you use a SemVer tag including "beta", the release that will be created at
GitHub will be marked as a "Pre-release" automatically.
The target of the `.../latest` URL will not be changed in that case, it always
points to the latest stable release and not pre-releases/betas.
If you accidentally push a tag incorrectly (the tag is outdated, you didn't pull in the latest branch accidentally, you named the tag wrong, etc.) you can revoke the tag by doing the following:
If you accidentally push a tag incorrectly (the tag is outdated, you didn't
pull in the latest branch accidentally, you named the tag wrong, etc.) you can
revoke the tag by doing the following:
```bash
git push --delete upstream $TAG_NAME
git tag -d $TAG_NAME
```
You can also do this on GitHub, you'll also want to delete the new release.
**NOTE:** Unfortunately, due to the method of how Travis and AppVeyor work, to publish a stable release you will need to make a copy of the release notes locally and then paste them into the GitHub GUI once the binaries have been uploaded by them. These CI services will automatically overwrite the name of the release (to "Cockatrice $TAG_NAME"), the status of the release (to "Pre-release"), and the release body (to "Beta build of Cockatrice").
* When the build has been completed you can verify all uploaded files on the
release are in order and hit the publish button.
* After the release is complete, update the CMake version number again to the
next targeted beta version, typically increasing `PROJECT_VERSION_PATCH` by
one.
**NOTE 2:** In the first lines of https://github.com/Cockatrice/Cockatrice/blob/master/CMakeLists.txt there's an hardcoded version number used when compiling custom (not tagged) versions. While on tagged versions these numbers are overriden by the version numbers coming from the tag title, it's a good practice to keep them aligned with the real ones.
The preferred flow of operations is:
* just before a release, update the version number in CMakeLists.txt to "next release version";
* tag the release following the previously described syntax in order to get it built by CI;
* wait for CI to upload the binaries, double check if everything is in order
* after the release is complete, update the version number again to "next targeted beta version", typically increasing `PROJECT_VERSION_PATCH` by one.
**NOTE 3:** When releasing a new stable version, all the previous beta versions should be deleted. This is needed for Cockatrice to pick up the stable release also for users that chose the "beta" release channel.
When releasing a new stable version, all previous beta releases (and tags)
should be deleted. This is needed for Cockatrice to update users of the "Beta"
release channel correctly to the latest stable version as well.
This can be done the same way as revoking tags, mentioned above.
condition:$BUILDTYPE = Release && $TRAVIS_TAG =~ ([0-9]|[1-9][0-9])(\.([0-9]|[1-9][0-9])){2}$ # regex to match semver naming convention for stable full releases
Downloads are available for full releases and the current beta version in development.<br>
Full releases are checkpoints featuring major feature or UI enhancements - we recommend to use those. There is no strict schedule for new full releases.
Downloads are available for full releases and the current beta version in development. There is no strict release schedule for either of them.
The beta release contains the most recently added features and bugfixes, but can be unstable. They are released as we feel need.
- Latest `stable` release: [](https://github.com/cockatrice/cockatrice/releases/latest) [](https://tooomm.github.io/github-release-stats/?username=Cockatrice&repository=Cockatrice)<br>
- Stable versions are checkpoints featuring major feature and UI enhancements.
- **Recommended for most users!**
- Latest `stable` release (**recommended**): [](https://github.com/cockatrice/cockatrice/releases/latest) [](https://tooomm.github.io/github-release-stats/?username=Cockatrice&repository=Cockatrice)<br>
- Latest `beta` release: [](https://github.com/cockatrice/cockatrice/releases) [](https://tooomm.github.io/github-release-stats/?username=Cockatrice&repository=Cockatrice)
- Beta versions may be unstable and contain bugs.
- Latest `beta` release: [](https://github.com/cockatrice/cockatrice/releases) [](https://tooomm.github.io/github-release-stats/?username=Cockatrice&repository=Cockatrice)
- Beta versions include the most recently added features and bugfixes, but can be unstable.
- To be a Cockatrice Beta Tester, use this version. Find more information [here](https://github.com/Cockatrice/Cockatrice/wiki/Release-Channels)!
# Get Involved [](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>
Join our [Discord community](https://discord.gg/3Z9yzmA) to connect with the project, contributors or fellow users of the app. Come here to talk about the application, features, or just to hang out.<br>
For support regarding specific servers, please contact that server's admin or forum for support rather than asking here.<br>
To contribute code to the project, please review [the guidelines](https://github.com/Cockatrice/Cockatrice/blob/master/.github/CONTRIBUTING.md).
We maintain two tags for contributors to find issues to work on:
@@ -52,8 +52,6 @@ We maintain two tags for contributors to find issues to work on:
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 review for changes they submit.
Read the long-term project **roadmap** to see planned edits and milestones [here](https://docs.google.com/document/d/1Ewe5uSaRE2nR2pNPMaGmP6gVZdqgFbBgwSscGqIr4W0/edit).
We try to be responsive to new issues. We'll provide advice on how best to implement a feature; alternately, we can show you where the codebase is doing something similar before you get too far along.
Cockatrice uses 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.
# Translations [](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 visiting our [Transifex project page](https://www.transifex.com/projects/p/cockatrice/).<br>
Cockatrice uses Transifex for translations. You can help us bring Cockatrice, Oracle and Webatrice to your language or just adjust single wordings right from within your browser by visiting our [Transifex project page](https://transifex.com/cockatrice/cockatrice/).<br>
Check out our [Translator FAQ](https://github.com/Cockatrice/Cockatrice/wiki/Translation-FAQ) for more information about contributing!<br>
# Build [](https://travis-ci.org/Cockatrice/Cockatrice) [](https://ci.appveyor.com/project/Daenyth/cockatrice/branch/master)
**Detailed compiling instructions are on the Cockatrice wiki under [Compiling Cockatrice](https://github.com/Cockatrice/Cockatrice/wiki/Compiling-Cockatrice)**
**Detailed compiling instructions can be found on the Cockatrice wiki under [Compiling Cockatrice](https://github.com/Cockatrice/Cockatrice/wiki/Compiling-Cockatrice)**
Oracle can optionally use zlib to load zipped files:
Oracle can optionally use zlib and xz to load compressed files:
- [xz](https://tukaani.org/xz/)
- [zlib](https://www.zlib.net/)
To compile:
@@ -116,6 +111,7 @@ The following flags can be passed to `cmake`:
-`-DWARNING_AS_ERROR=0` Whether to treat compilation warnings as errors in debug mode (default 1 = yes).
-`-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```.
-`-DFORCE_USE_QT5=1` Skip looking for Qt6 before trying to find Qt5
# Run
@@ -124,7 +120,6 @@ The following flags can be passed to `cmake`:
`Oracle` fetches card data<br>
`Servatrice` is the server<br>
**Servatrice Docker container**
You can run an instance of Servatrice (the Cockatrice server) using [Docker](https://www.docker.com/what-docker) and the Cockatrice Dockerfile.<br>
@@ -140,6 +135,26 @@ to permit connections to the server.
Find more information on how to use Servatrice with Docker in our [wiki](https://github.com/Cockatrice/Cockatrice/wiki/Setting-up-Servatrice#using-docker).
**Docker compose**
There is also a docker-compose file available which will configure and run both a MySQL server and Servatrice. The docker-compose setup scripts can be found in the `servatrice/docker` folder and vary only slightly from the default sql and server .ini files. The setup scripts can either be modified in place, or docker-compose can mount alternative files into the images, as you prefer.
To run Servatrice via docker-compose, first install docker-compose following the [install instructions](https://docs.docker.com/compose/install/). Once installed, run the following from the root of the repository:
```bash
docker-compose build # Build the Servatrice image using the same Dockerfile as above.
docker-compose up # Setup and run both the MySQL server and Servatrice.
```
>Note: Similar to the above Docker setup, this will expose TCP ports 4747 and 4748.
>Note: The first time running the docker-compose setup, the MySQL server will take a little time to run the initial setup scripts. Due to this, the Servatrice instance may fail the first few attempts to connect to the database. Servatrice is set to `restart: always` in the docker-compose.yml, which will allow it to continue attempting to start up. Once the MySQL scripts have completed, Servatrice should then connect automatically on the next attempt.
**Docker compose in Windows**
A out of box working docker-compose file has been added to help setup in Windows.
Docker in Windows requires additional steps in form of using Docker Desktop to allow resource sharing from the drive the volumes are mapped from, as well as potential workarounds needed to get file sharing working in Windows. This [StackOverflow discussion sheds some light on it](https://stackoverflow.com/questions/42203488/settings-to-windows-firewall-to-allow-docker-for-windows-to-share-drive)
<!-- 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"/>
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>
<text>You can suggest new Tips of the Day by reaching out to the development team on <a href="https://gitter.im/cockatrice/cockatrice">Gitter</a>!</text>
<image>gitter.png</image>
<date>2018-03-01</date>
<text>You can suggest new Tips of the Day by reaching out to the development team on <a href="https://discord.gg/3Z9yzmA">Discord</a>!</text>
<image>discord.png</image>
<date>2023-10-18</date>
</tip>
<tip>
<title>Reporting Bugs</title>
@@ -63,6 +63,7 @@
<br>Change Life: CTRL + L
<br>All shortcuts can be customized via Settings->Shortcuts!
</text>
<image>shortcuts.png</image>
<date>2018-03-01</date>
</tip>
<tip>
@@ -83,4 +84,16 @@
<image>face_down.png</image>
<date>2018-03-01</date>
</tip>
</tips>
<tip>
<title>Counter expressions</title>
<text>When setting a counter value, you can type a math expression in the box and the counter will be set to the result.<br>The "x" variable contains the current counter value.</text>
<image>counter_expression.png</image>
<date>2019-02-02</date>
</tip>
<tip>
<title>Power and Toughness</title>
<text>You can add and subtract to a creature's stats.<br>With a card selected, set the power and toughness ( default: ctrl + p ) and enter +3/-1 to increase power by three while decreasing toughness by one.<br>You can also reset it to the original value ( default: ctrl + alt + 0 ).</text>
d="m 51.28696,1001.834 0,-46.98372 1.434151,0.16768 c 5.155008,0.60274 9.462857,2.72154 12.938257,6.36366 4.74393,4.9715 6.87913,11.35611 6.16464,18.43328 -0.53702,5.31935 -3.09008,10.59498 -6.83833,14.13074 l -1.94072,1.83069 3.04083,2.20427 c 3.58084,2.5957 7.18975,6.4912 9.55296,10.3116 4.89572,7.9144 9.23593,21.4918 8.50487,26.6055 -0.81312,5.6877 -5.43872,9.6977 -13.62216,11.8093 -3.80822,0.9826 -7.68056,1.4713 -14.763321,1.8633 l -4.471177,0.2474 0,-46.9837 z"
id="left"
inkscape:connector-curvature="0" />
<path
style="display:inline;fill:url(#linearGradient3);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.77952756;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
d="M 49.84375,1.71875 C 36.719738,1.71875 26.0625,12.375988 26.0625,25.5 c 0,7.477454 3.475825,14.112734 8.875,18.46875 -10.497549,5.974948 -17.018351,18.227376 -20.625,31.6875 -5.2744126,19.6844 15.911513,22.5625 35.53125,22.5625 19.619736,0 40.705577,-3.2516 35.53125,-22.5625 C 81.693381,61.916246 75.224585,49.827177 64.8125,43.9375 70.181573,39.580662 73.59375,32.953205 73.59375,25.5 c 0,-13.124012 -10.625988,-23.78125 -23.75,-23.78125 z"
id="left"
transform="translate(0,952.36218)"/></g><g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="Layer 2"><path
style="display:inline;fill:url(#linearGradient3);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.77952756;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
d="m 51.054254,1001.4773 v -45.77683 l 1.097241,0.005 c 3.642211,0.0172 9.170661,2.46935 12.395732,5.49816 4.897489,4.59945 7.421654,10.97001 6.981907,17.62114 -0.389167,5.88609 -2.631878,10.66609 -6.951818,14.81672 l -2.05562,1.97506 2.959813,2.0746 c 3.467097,2.43015 7.403677,6.55065 9.666109,10.11765 3.325898,5.2437 6.79289,13.8355 8.153827,20.2065 2.584451,12.0989 -5.997953,18.2384 -26.592174,19.0232 l -5.655017,0.2154 v -45.7768 z"
d="m 51.28696,1001.834 0,-46.98372 1.434151,0.16768 c 5.155008,0.60274 9.462857,2.72154 12.938257,6.36366 4.74393,4.9715 6.87913,11.35611 6.16464,18.43328 -0.53702,5.31935 -3.09008,10.59498 -6.83833,14.13074 l -1.94072,1.83069 3.04083,2.20427 c 3.58084,2.5957 7.18975,6.4912 9.55296,10.3116 4.89572,7.9144 9.23593,21.4918 8.50487,26.6055 -0.81312,5.6877 -5.43872,9.6977 -13.62216,11.8093 -3.80822,0.9826 -7.68056,1.4713 -14.763321,1.8633 l -4.471177,0.2474 0,-46.9837 z"
id="left"
inkscape:connector-curvature="0" />
<path
d="m 46.656521,12.167234 18.055171,18.054184 a 6.6081919,6.6078288 0 0 1 -0.126303,9.352065 6.6804126,6.6800456 0 0 1 -8.233169,1.011048 l -7.944268,7.943843 6.463762,6.445343 a 6.9331851,6.9328042 0 0 1 5.741536,2.022073 l 28.057729,28.092294 a 6.9962797,6.9958953 0 0 1 -9.894222,9.893685 L 50.719018,66.907526 A 7.0595711,7.0591833 0 0 1 49.18433,59.270613 l -5.741527,-5.741238 -7.944298,7.943843 A 6.716523,6.7161541 0 0 1 25.134866,69.832263 L 7.079684,51.778091 a 6.716523,6.7161541 0 0 1 8.39566,-10.345064 L 36.31101,20.59853 a 6.716523,6.7161541 0 0 1 10.345612,-8.431329 z"
d="M 49.84375,1.71875 C 36.719738,1.71875 26.0625,12.375988 26.0625,25.5 c 0,7.477454 3.475825,14.112734 8.875,18.46875 -10.497549,5.974948 -17.018351,18.227376 -20.625,31.6875 -5.2744126,19.6844 15.911513,22.5625 35.53125,22.5625 19.619736,0 40.705577,-3.2516 35.53125,-22.5625 C 81.693381,61.916246 75.224585,49.827177 64.8125,43.9375 70.181573,39.580662 73.59375,32.953205 73.59375,25.5 c 0,-13.124012 -10.625988,-23.78125 -23.75,-23.78125 z"
id="left"
sodipodi:insensitive="true"
transform="translate(0,952.36218)"/>
<path
d="m 46.233565,28.34179 -1.622479,1.622479 a 0.59382712,0.59382712 0 0 1 -0.840444,-0.01135 0.60031703,0.60031703 0 0 1 -0.09086,-0.739851 l -0.713891,-0.71389 -0.579225,0.580848 a 0.62303175,0.62303175 0 0 1 -0.181718,0.515948 l -2.524576,2.521331 a 0.62870157,0.62870157 0 0 1 -0.889118,-0.889117 l 2.522954,-2.521332 a 0.63438908,0.63438908 0 0 1 0.686308,-0.137911 l 0.515949,-0.515947 -0.713891,-0.713892 a 0.603562,0.603562 0 0 1 -0.751204,-0.9313 l 1.622478,-1.62248 a 0.603562,0.603562 0 0 1 0.929682,0.754453 l 1.872338,1.87234 a 0.603562,0.603562 0 0 1 0.7577,0.92968 z"
* A cached list of the available sets, needed to cross-reference sets from cards.
*/
SetNameMapsets;
CardSetPtrinternalAddSet(constQString&setName,
constQString&longName="",
constQString&setType="",
constQDate&releaseDate=QDate());
voidloadCardsFromXml(QXmlStreamReader&xml);
voidloadSetsFromXml(QXmlStreamReader&xml);
signals:
voidaddCard(CardInfoPtrcard);
voidaddSet(CardSetPtrset);
};
#endif
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.