* 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>
* 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>
* 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>
* 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
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
* 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>
* 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
* 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
* 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
* 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 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
* 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
* 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
* 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
* Added failing test to demonstrate issue with dec loading
* Prevents empty lines between comments from being interpreted as the start of the sideboard
* oracle now can be run in spoiler or normal mode
* tests for travis
* only run on relaunch
* spoilers in client (not oracle now) and tray icon shows when done
* spoiler status will be checked before downloading spoiler file
* only download if they care about spoilers
* reload db on spoiler download
* manual update button, code cleanup, and fix enabling sets when new
* cleanup, nullchecks, and fixes to spoiler
* reload DB even if not in spoiler season; necessary as we have a check elsewhere to prevent the reload if spoiler check happens
* Implement changes from 2991#issuecomment-356169374
* Change implicit nullptrs, alert on file deletion, minor changes
* make reload thread safe and minor changes from 2991#issuecomment-356450302
* Fix locking
* Disable update now button while process running