A new Option has been added in Forge Preferences to enable the use of custom cards.
This option (default is False for backward compatibility) will control whether custom cards can be read in custom editions, and so decks containing them can be used in game matches.
Also, en-US translation file received an update to clarify what is intended with Unknonw cards (to be distinguished from custom cards now)
This also fixes a BUG for DeckSetFilter that did not update properly the list of filters in ItemManager.
This had the effect of not updating the labels for set filters for deck, after edit.
The method is implemented in the abstract super class (ItemManager) and so inherited by `CardManager` (where there is no format nor game type that could be used), and specialised by `DeckManager`.
In particular, the only current format with limitations on sets is Brawl, and so the only one accounted for.
In any case, the list of (unique) allowed sets is automatically inferred by default from the cardpool (as in the case of `CardManager`).
It is important to note that this filter is stored into an attribute, and so the list is calculated only once.
The results of this list will be passed on the `DialogChooseSets` to update the content of the dialog panel, accordingly.
There are cases in which the set filter should be initialised with the white list of allowed set codes, rather than the blacklist (i.e. unselectableSets).
This is the case of CardCatalog or DeckCatalog with constraints or limitations on card pool (i.e. restricted cards, and or restricted sets).
This new set of constructors with extra parameters allow to handle this cases, so that the UI can easily adapt.
This new filter mirrors (and extends) the one on Sets, which also relies on the renewed buildPredicate implementatio which looks at the edition of
a DeckProxy.
Now this new implementation brings the deck set filter to finally work as expected.
In particular, instead of checking that all cards in Deck Pools belong to a unique edition, the predicate now leverages on the getEdition() method of DeckProxy instances, which returns the latest of the earliest
sets of cards. This function will be subject to change into a future Merge Request state.
This is the first step to finally make the DeckSetFilter working properly!
So far, the filter applies if **all** the cards in a deck matches selected specific set(s).
We will allow for customisation to simplify and correct this filter - more in the next commit.
The new CardBlockFilter extends the generic CardSetFilter by specialising the selection to set codes allowed in the corresponding Block GameFormat.
A new Label `lblBlock` has been added to language file (so far, English only)
CardManager now instantiate Quest World filters forcing a NO-REPRINT policy. The `allowReprints` option was set to true by default for card and deck catalog, resulting in just a weird and unexpected side-effect IMHO. Whenever a block is selected, no other reprints should be taken into account. That's the point of choosing a block.
The CardQuestWorldFilter has been updated with two extra constructors overload that also control the option to include or not the `allowReprints` attribute.
By default, the allowReprints attribute is true for backward compatibility.
The new constructor will be used (next commit) by CardManager when creating filters in Card Catalog.
First off, the status of the "allowReprints" checkbox is updated accordingly, when a filter is edited.
This fixes a previous bug that did not take this into account
(more on this, in the next commit msg).
Other improvements to the DialogChooseSets includes a better management of spaces, as well as dimension (width) of main windows that is now dynamically adapted to current resolution.
Also, this update fixes a bug having some panels dynamically adjusting height to fit components.
Now all the components should be correctly aligned, and spread across the panel.
This new version of the panel is completely interactive, and dynamically populated with card editions, types, and formats.
The selection of formats leads to selections of subsets of editions (and so type), updating other components accordingly.
Differently from standard JTree, this component leverages on a custom TreeCellRenderer that renders each node with a checkbox, therefore rewriting completely the selection mechanism of the JTree.
This component is currently used in the DialogChooseSets to represent card editions grouped per edition type.
In general, this component can be used elsewhere, whenever nested objects for selection should be used.
The class exposes a public API for easy interaction, as well as customised classes for nodes and nodes data, and specialised events and listeners.