This FIXES a bug causing the Deck Editor to not properly restore its state after saving a Deck and not originally in Main Decksection.
This commit also avoids repeating code and reset tables only if necessary.
.Dec files have collector nr//art-index as separated by a Pipe.
RegExps with collector numbers have been extended to further support decks in this format (with simply copy & paste the listing).
Tests updated/added to verify the new regexp & behaviour.
DeckImport now avoids including non-deck and metadata info in decklist as UnknownText, whilst any line that looks like a card request (i.e. includes a card quantity in the beginning) is interpreted as Unknown card.
This seems a good compromise with showing typo and any mispelling in card list whilst avoiding flooding decklist with unnecessary info.
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>