Commit Graph

2254 Commits

Author SHA1 Message Date
leriomaggio
835b05e573 Added support for corner case to match correct section accounting for unsupported sections.
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-10-06 20:13:25 +01:00
leriomaggio
c5ac93a12e Heavy refactoring of DeckRecognizer to introduce cardList parsing, allowed sections, and revised TokenTypes
This commit includes a substantial change//integration into main body of DeckRecognizer API.
First off, the types of tokens emitted by recognised as now increased, leaving place to newly specialised WARNING messages, as well as tokens for cards in invalid set or sections. Moreover, a new token for UNSUPPORTED_DECK_SECTION has been introduced, which works in pair with the new extra addition of allowed Deck sections.
This new list of allowed sections is also used whenever a new DeckSection token is created (constructor) so that if the section is not currently supported, an UNSUPPORTED_DECK_SECTION token is emitted instead.

Similarly, the card recognition step has been updated so that now deck validation mechanism has been integrated at the token level. In other words, everytime each card token is now matched to the most correct section, regardless of what's been specified in card list.

Last but not least, DeckRecognizer now includes the method to parse the whole card list (and not just a single line) to better encapsulate all the logics.
Added control to include Banned and Restricted cards, as well as a newly regExp to specify Mana colour tokens using MANA symbols placeholders (e.g. {G} for green).

Tests for new features have been added and internal documentation improved, and old ones updated with new tokens and APIs.

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-10-06 17:07:29 +01:00
leriomaggio
65001478b7 Heavy refactoring of DeckRecognizer to introduce cardList parsing, allowed sections, and revised TokenTypes
This commit includes a substantial change//integration into main body of DeckRecognizer API.
First off, the types of tokens emitted by recognised as now increased, leaving place to newly specialised WARNING messages, as well as tokens for cards in invalid set or sections. Moreover, a new token for UNSUPPORTED_DECK_SECTION has been introduced, which works in pair with the new extra addition of allowed Deck sections.
This new list of allowed sections is also used whenever a new DeckSection token is created (constructor) so that if the section is not currently supported, an UNSUPPORTED_DECK_SECTION token is emitted instead.

Similarly, the card recognition step has been updated so that now deck validation mechanism has been integrated at the token level. In other words, everytime each card token is now matched to the most correct section, regardless of what's been specified in card list.

Last but not least, DeckRecognizer now includes the method to parse the whole card list (and not just a single line) to better encapsulate all the logics.
Added control to include Banned and Restricted cards, as well as a newly regExp to specify Mana colour tokens using MANA symbols placeholders (e.g. {G} for green).

Tests for new features have been added and internal documentation improved, and old ones updated with new tokens and APIs.

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-10-06 16:43:24 +01:00
leriomaggio
2e1777265d Specialised Stats for Commander decks
Stats panel now includes card count also for commander deck section (instead of total) for commander (sub)type game format // editor.

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-10-06 15:54:00 +01:00
leriomaggio
73e5e5095d Setting constants for Localiser Mock so return value is testable
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-10-06 15:52:35 +01:00
TRT
68f3879f11 Fix Quicken + Suspend 2021-10-04 14:05:13 +02:00
leriomaggio
88ec398e8c Changed API to make isSectionImportable public rather than protected
This is to allow DeckImport to get all the supported DeckSections in current editor, without relying on using the content of the cbxSection dropdown UI component.

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-10-02 08:27:27 +01:00
leriomaggio
f065d460c3 Updated Parameter cast to pass in DeckImport Constructor
DeckImport will now get an instance of the CDeckEditor rather than the more generic ACEditorBase.
This is to allow more refined access to methods. Also, all lives in forge-gui-desktop, therefore there should be no conflict with mobile app ui.

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-10-02 08:25:47 +01:00
Michael Kamensky
bb421ea2e6 Merge branch 'gray_text' into 'master'
Gray text preference

See merge request core-developers/forge!5485
2021-10-01 17:09:36 +00:00
tool4EvEr
781de0fd5a Clean up 2021-10-01 16:28:03 +02:00
Northmoc
0d13edd84e clean up a few things 2021-09-30 22:13:19 -04:00
Northmoc
b3a7a8aecf add the pref to different rules sets 2021-09-30 21:59:45 -04:00
Northmoc
36a8c93bc8 setting up the pref 2021-09-30 12:21:52 -04:00
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