Commit Graph

2391 Commits

Author SHA1 Message Date
leriomaggio
c3f2c820be Re-enabled card image auto-download and better imagePanel alpha for disabled cards
CardPicturePanel now supports back auto-download of card image whenever a placeholder image is being used. This has been enabled for PaperCard instances only, and currently being activated from DeckImport UI. This change won't affect in any way the deck editor as card image is being downloaded from catalog.

Also, the alpha level set to image panel has been now set to 0.5 to control grey-coloured overlay.

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-30 07:06:05 +01:00
leriomaggio
1a8347805c Improved overlay effect to display "disabled" cards
The "disabled" card effect will be used in Deck Import to show the preview of those cards that won't be imported in the deck. The new improved overlay effect has been achieved by adding a grey colour to image with alpha.

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-30 07:02:50 +01:00
leriomaggio
7be8c1bf2a New method in ImageCache to get the full info of a card original image (img + is_placeholder)
ImageCache now includes a new method to get the full info pair (image, placeHolderFlag) when retrieving a card image.
This will be used in CardPicturePanel to re-enable support for auto-download now that default image is not being used anymore.

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-30 06:36:32 +01:00
leriomaggio
3e3cdc6808 Remove duplicated code to align all card tokens to have the same message.
All card tokens (those having an instance of PaperCard set) now share the same message with no code duplication.
The message has been also update - and so corresponding tests - to include set code in square brackets, and collector number (identified by sharp symbol).
This change will also simplify token formatting in Deck import.

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-29 08:03:39 +01:00
leriomaggio
1020c8d0f0 Added support for "include BnR" check from UI
Now statistics do also support to account for any "Limited Card"-Type token found in the list, if the flag to include them is set to true.

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-29 07:34:25 +01:00
leriomaggio
45114fc7e0 DeckRecognizer (and Tokens) extended with support for Banned and Restricted Cards
TokenType instantiated by the DeckRecognizer have been further specialised and extended to also include Banned and Restricted Cards.
Therefore, controls when recognising cards has also been extended and improved.

Now DeckRecognizer include specific extensions for additional constraints imposed by Game Format, Deck Format, release date and art preference. Consequently, all methods used to retrieve cards from CardDb have been updated accordingly, using recognizer settings.

Test suite has been updated accordingly - and all tests re-organised with comments for better code navigation.

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-27 18:53:04 +01:00
Michael Kamensky
c0efa887f4 - MayView improvement for Foretell on desktop Forge. 2021-09-27 20:06:45 +03:00
leriomaggio
76b19cc8a4 Quick FIX to AddBasicLandsDialog
This FIX includes:
- improvements to general UI for better rendering;
- full added support to localisation
- CardEditions in ComboBox are now sorted (using getSortedEditions) in descending order, from recent first.
- inverted order of + and - button (IMHO more intuitive)
2021-09-26 00:33:34 +01:00
Michael Kamensky
49d35d909d - Fix "Assorted Card Art" in the generate basic lands dialog. 2021-09-25 09:49:29 +03:00
leriomaggio
9a0c26b2a2 Fix Issue #1975
Fixed Issue in CardManager for Unique Card Filters.
Now, only one entry of card will be returned per-edition, also accounting for Card images.
In other words, Card entry will be selected considering the default Card Art Preference. Therefore, candidate editions will be iterated in order, looking for an entry having a card with an image.
If none could be found, the original first entry (even with no image) will be returned instead.
2021-09-23 13:21:19 +01:00
leriomaggio
6c782448dd Adding translation support in Tooltip for Unique Card Filter 2021-09-23 13:18:42 +01:00
leriomaggio
3f961a14ab Moving getBlockFormats from FModel to GameFormat.Collection
getBlockFormat becomes also getBlockList, inline with other methods in GameFormat.Collection. DeckManager and CardManager have been updated accordingly.

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-21 23:16:56 +01:00
leriomaggio
1b5564760a Latest UI changes
Latest version of the UI with expandable panel with options.
Options include Release Date, Card Art Preference, and Block Filter (if available).

This new UI update also fixes some small imperfections in the previous version, with better management of spacing.

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-18 14:10:51 +01:00
leriomaggio
7efb2167f4 FIX white border subimage cut with Foil effect
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-18 14:07:31 +01:00
leriomaggio
ee35fd9e37 FIX to recognise SB as Sideboard placeholder
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-18 12:17:28 +01:00
leriomaggio
bdd4a7083c New tests and FIX bug on foil request.
Added tests for new setting w/ CardArtPreference and FIX bug on foil request when no edition is specified.

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-18 10:46:31 +01:00
leriomaggio
7674d5c1fa Refactoring method in FModel to return all block formats
This method is currently used in CardManager and DeckManager for Block Filter when Historic format are supported in forge. However, now the same method will also be used in Deck Import so this refactoring was very much necessary!

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-16 20:34:55 +01:00
leriomaggio
4d90d4f7e4 Latest on Hyperlink display, Multicolor CSS, and FIX (right) panel sizes.
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-16 19:50:43 +01:00
leriomaggio
c8df68a947 Increased value of alpha when setting disabled.
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-16 19:12:57 +01:00
leriomaggio
4f86e9d494 adding support to sb as for sideboard, multicolo(u)r and swapping non-token recognition prior to card tokens.
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-16 19:12:35 +01:00
friarsol
74688f2a40 I think this fixes quest foil crash 2021-09-15 20:46:53 -04:00
leriomaggio
b3c825860a Latest updates and finalisation to deck import stats (with translation)
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-15 20:18:46 +01:00
leriomaggio
ac2c085324 Incorporating FIX to Image copy on subimage + method to reset alpha.
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-09-15 19:36:38 +01:00
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
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
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
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