Commit Graph

2168 Commits

Author SHA1 Message Date
leriomaggio
62bd8efd1c Patch to CardPicturePanel to work on cropped Card Images
BufferedImage (deep) copy procedure applied in CardPicturePanel may not always work when the input image has been originally cropped.

The issue is caused by `image.copyData(null)` which may sometimes work on the original (uncropped) underlying raster.
This patch fixes this issue!

Source: https://stackoverflow.com/a/26894825/2969461
2021-09-15 11:46:22 +01:00
leriomaggio
c732289690 Updates to DeckRecognizer (& tests) by using the new methods from StaticData
(Any reference to CardDb has been dropped, along with corresponding card fetching methods).

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-14 08:18:24 +01:00
leriomaggio
d03bdb2773 Disabled benchmark tests to exclude in battery
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-14 07:57:13 +01:00
leriomaggio
9562064213 Updated (w/ tests) behaviour for compose with foil request, when input card Name is or isn't foil already
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-14 07:56:33 +01:00
leriomaggio
a9f1cd3c97 Merge remote-tracking branch 'upstream/master' into deck-importer-decks-file-format 2021-09-13 18:47:35 +01:00
leriomaggio
adf44be732 removed unused imports 2021-09-13 11:26:05 +01:00
leriomaggio
236fd99862 FIX cardDb tests in Maven for ImageKeys Mock configuration between subclasses 2021-09-13 10:15:32 +01:00
leriomaggio
60a1e1975a FIX full localisation support for V|CStatistics
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-12 19:55:32 +01:00
leriomaggio
ab0b964772 Full support to XMage format recognition with tests
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-12 18:30:59 +01:00
leriomaggio
5beb350faf Support for DeckNames as in NetDecks with brackets and hashtags
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-12 11:42:10 +01:00
leriomaggio
014783dfbe Added planes deck section to nonCardToken recognition (left out by mistake)
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-12 11:06:07 +01:00
leriomaggio
95f1d6df07 Updated Card Tokens (with test) to retain cards even if not legal.
This will be now used in DeckImporter in combination with Card Preview.

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-12 10:56:32 +01:00
leriomaggio
764ccd703c slightly reduce constraint on items' height
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-12 10:32:22 +01:00
leriomaggio
19b8865e10 New UI version with Hyperlinks and Card Preview
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-12 10:31:57 +01:00
leriomaggio
936bb15bf9 New methods to directly set a bufferedImage and to control alpha value of FImagePanel
This will be used in deck import card preview (default state)

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-12 10:31:34 +01:00
leriomaggio
b5bb07c827 New static method to return default card image
This will be used in deck import card preview (default state)

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-12 10:30:42 +01:00
leriomaggio
c0059c351f Adding support to add alpha over images (to show them as disabled)
This will be used in deck import card preview.

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-12 10:29:54 +01:00
Mark Wiggans
bcaf23c5ff Have ImageCache recognize images with white corners and crop them out 2021-09-11 11:32:37 -04:00
leriomaggio
f8d5eae4ce Removed unused import
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-11 16:03:42 +01:00
leriomaggio
0d022c0f7e Latest changes to DeckImporter UI using HTML text and Statistics borrowed from Deck Editor.
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-11 13:48:35 +01:00
tool4EvEr
052b73bda2 Minor Cleanup 2021-09-11 10:26:01 +02:00
Grimm
6d2dd7ad92 Merge branch 'master' of https://git.cardforge.org/core-developers/forge into adventure 2021-09-10 17:41:33 +02:00
Grimm
639cd42c43 Added some comments, cleaned up names and code 2021-09-10 17:36:05 +02:00
leriomaggio
e90b0323b7 Merge remote-tracking branch 'upstream/master' into deck-importer-decks-file-format 2021-09-10 16:10:13 +01:00
leriomaggio
27ab4c35a3 Re-add to carddb the integration with CardPreferences on Mobile version
On Mobile Forge Port (only) there is the possibility to set a preferred art for a card, from card catalog.
Once a card art is selected, it will always be returned for that specific art whenever no other specific edition is specified.
This commit adds changes to cardDb setPreferredArtMethod (API) and CardRequest.fromString to work with any preferred art (if any).

CardRequests reflects this change by adding another (private) constructor which expects to create a CardRequest from a preferredArt entry in the form of (CardName|SetCode|ArtIndex)
2021-09-10 14:09:25 +01:00
leriomaggio
9d235924ec Re-add to carddb the integration with CardPreferences on Mobile version
On Mobile Forge Port (only) there is the possibility to set a preferred art for a card, from card catalog.
Once a card art is selected, it will always be returned for that specific art.
This commit adds changes to cardDb setPreferredArtMethod (API) and CardRequest.fromString to work with any preferred art (if any).

CardRequests reflects this change by adding another (private) constructor which expects to create a CardRequest from a preferredArt entry in the form of (CardName|SetCode|ArtIndex)
2021-09-10 13:26:30 +01:00
Grimm
5f0656bf03 Merge branch 'master' of https://git.cardforge.org/core-developers/forge into adventure 2021-09-09 03:56:39 +02:00
leriomaggio
2297f34ce2 Added full support to all Deckstats deck exports + bug fix&extra tests
Now DeckRecognizer supports all the exports of decks from Deckstats.net.
This now also includes card lists grouped by Rarity, CMC, and Mana Colours.

A new set of tests have been also added to test for the new non-card token types parsing, as well as a condition with multiple constraints imposed on the deck recogniser at a time. In particular, now all the combinations of constraints (also together) have been tested, and therefore the types of token returned has been adjusted.

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-08 21:27:43 +01:00
Grimm
70f8302bcf commit res 2021-09-08 03:49:54 +02:00
leriomaggio
20d9dbdb57 Perf Impro to Deck Editor Loading Issue #1847
This is another extra improvement which avoids setting up card catalog in current editor whenever it is actually **not** needed.

To do so, ItemPool now implements and equal method, which reflects to equality of contained items.
This is because card pool is set up multiple times whenever the Deck Editor tab is initialised - and the operation of setting up the catalog manager is particularly expensive (let alone useless when it's already done!)

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-07 11:46:44 +01:00
leriomaggio
7c1bcaaf34 Re-enabling Basic Lands in Rarity Statistics
This is done similarly in DeckStats (Rarity grouped) deck export.

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-07 11:43:09 +01:00
leriomaggio
43196e7c74 FIX a bug which caused the deck catalog not to update after saving the deck when current game type was not constructed!
This commit FIX #1961

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-07 10:43:22 +01:00
leriomaggio
84763e5dbc Adding support for deck name in Forge Deck Format
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-07 00:35:08 +01:00
leriomaggio
dabb40714e Updated translations and added new DeckStats classes to automate stats report generation with less duplications.
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-07 00:24:35 +01:00
leriomaggio
ef1ea8e60d FIX Issue #1413
This commit includes support to the XMage format in Deck Recognizer along with corresponding new tests and updates to labels for UI

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-06 12:41:04 +01:00
leriomaggio
151c6d3ec9 Removed displaying comment tokens, and unsued translation labels + impros to UI
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-06 12:08:06 +01:00
leriomaggio
54193e0ac0 Added support to TappedOut Markdown format, and to TOARENA MTGGOLDFISH export.
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-06 12:07:11 +01:00
leriomaggio
544b7af746 Fixed Typo in Deck Importer Win title
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-06 02:06:42 +01:00
leriomaggio
59e1203b0c Completely redesigned DeckImport with new panel for statistics and full support for i18n 2021-09-06 01:45:17 +01:00
leriomaggio
71793fb747 Added tests for latest additions in supporting MTGGoldfish (special) format for collector numbers.
DeckRecognizer now also support the (special) format for request lines in MTGGoldfish deck exports.
In Addition, changes to reduce comparisons, and general performance in card matching.
2021-09-05 20:44:03 +01:00
leriomaggio
83853280b6 Completely re-implemented and tested Matchers for DeckRecognizer
The new DeckRecognizer implementation comes fully tested to check the new multiple line request format supported.
The DeckRecognizer has been made very versatile for card recognition - supporting request with multiple formats - as well as for NON-CARD tokens including "Deck Name", "Deck Sections", and "Card (Core) Types".

There is also integration for constraints imposed on card matching due to
restrictions (in set) from Game Format, Deck Format (banned cards), and Date (Release Before).
In those cases, new Token Types will be returned (i.e. "IllegalCard" and "InvalidCard", respectively) that could be pretty-printed or emphasised in DeckImport.
2021-09-02 17:43:13 +01:00
leriomaggio
e50ce6c7b9 Added new testcase to test whether lowercase set code are also accepted 2021-09-02 17:37:58 +01:00
leriomaggio
4576f7be6f Merge remote-tracking branch 'upstream/master' into deck-importer-decks-file-format 2021-08-31 08:49:41 +01:00
Michael Kamensky
9996bef604 Merge branch 'patch-carddb-performance' into 'master'
Code to cover cases for Randomly generated Deck (from Archetypes)

See merge request core-developers/forge!5268
2021-08-30 08:15:21 +00:00
Anthony Calosa
eb0a6d47b1 updateTest 2021-08-29 21:19:30 +08:00
leriomaggio
37283634b6 removed one line at the end of the file. 2021-08-29 07:58:59 +01:00
leriomaggio
872fca65a4 Extended CardDB API (w/ Tests) adding a Predicate filter for getCardFromEditions series
The getCardFromEditions series now include new variants (also for released before/after) accepting an extra filter to be
passed used as an extra filter for returned cards!
2021-08-29 01:40:45 +01:00
leriomaggio
8d35f747c0 Restored original implementation (but still using iterator) 2021-08-28 20:47:03 +01:00
leriomaggio
8768900cf8 FIX cardDb bug for lazy card loading when issuing a request with a non-existing set code.
Code FIX + Test
Now the implementation in CardDb will automatically try to get the card with that name from an existing edition
2021-08-28 18:29:07 +01:00
leriomaggio
a7d1e7398a FIX cardDb bug for lazy card loading when issuing a request with a non-existing set code.
Code FIX + Test
2021-08-28 17:54:53 +01:00