This commit introduces major refactoring to code of Deck Import to extend support to all DeckRecognizer.Token types, as well as better-organised methods for message and status display. On this note, the CSS has been updated, along with decklist HTML which now leverages on HTML-table to display tokens and status messages separately and all well-aligned.
Card Preview has been also refined, with proper CSS classes and messages.
Finally, the HTML_WELCOME_TEXT now reflects the latest changes in translation file (e.g. included an additional example, and extra paragraph in Options)
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
Now all cards displayed in cardpreview panel will automatically adapt to any change in the decklist.
That is, the panel will be reset only if current-displayed card is not in decklist anymore. In all other cases, the preview will adjust depending on the new token status, and/or whether the card is/was foiled!
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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)
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.
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>
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>
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>
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>