Commit Graph

2168 Commits

Author SHA1 Message Date
leriomaggio
d056d2a683 Added "Special" placeholder for card rarity
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-10-15 19:40:02 +01:00
leriomaggio
30a7c6aed4 Adding support for Dual/Double-sided cards in parsing + patch for commander export from Deckstats
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-10-15 19:33:13 +01:00
leriomaggio
f56cf00a6f Adding DB tests for dual and double cards
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-10-15 19:32:28 +01:00
leriomaggio
80268e95fd Merge remote-tracking branch 'upstream/master' into deck-importer-decks-file-format 2021-10-15 19:15:38 +01:00
Hans Mackowiak
997e566af0 Resolve "Daybound & Nightbound" 2021-10-15 13:20:36 +00:00
leriomaggio
e91277f271 Merge remote-tracking branch 'upstream/master' into deck-importer-decks-file-format 2021-10-15 13:39:00 +01:00
leriomaggio
f35164c0d6 Full updates with latest translations and Token types
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>
2021-10-15 13:15:18 +01:00
tool4EvEr
3b86f4f0c2 Fix NPE with Mount Velus Manticore 2021-10-14 13:26:31 +02:00
leriomaggio
1718ca9020 Added full support to card preview with foil and correct updates
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>
2021-10-10 09:10:19 +01:00
leriomaggio
44cfc76552 Added support for Foiled cards in Token Key (w. tests)
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-10-10 08:24:47 +01:00
leriomaggio
89daddd643 New method to retrieve displayed item.
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-10-10 00:01:33 +01:00
leriomaggio
e9aa12bc46 Extensive code refactoring, updates with new token types, and new support for allowed deck sections
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-10-08 16:46:33 +01:00
leriomaggio
9f04f0cec7 Improved Token Mana Symbol Regexp with support for two colours tokens (and symbols)
All corresponding tests have been extended, and improved to cover the new supported Mana Tokens

Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-10-08 13:45:31 +01:00
leriomaggio
fd776a3ae9 Updated Stats Panel to be normal instances, as panel didn't get updated with singletons.
Signed-off-by: leriomaggio <valeriomaggio@gmail.com>
2021-10-06 20:34:08 +01:00
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