Various new Drag & Drop deck editor improvements

* Shift-Click / Shift-Drag now work as expected as far as multi-selection
* Deck editor saves split pane split positions
* Card layout and sort settings are now saved along side the a deck when saving to the .dck format, so that you have back the exact same deck layout when you re-load the deck.
* Fixed the symbol image downloader to work around some of the large-size symbol images being missing on gatherer. Falls back to the medium sized images currently for those symbols.
This commit is contained in:
Mark Langen 2016-10-04 00:04:13 -06:00
parent 38cbf1a687
commit f6d50ce04f
11 changed files with 516 additions and 238 deletions

View file

@ -44,6 +44,8 @@ public class Deck implements Serializable {
private String name;
private final Set<Card> cards = new LinkedHashSet<>();
private final Set<Card> sideboard = new LinkedHashSet<>();
private DeckCardLayout cardsLayout;
private DeckCardLayout sideboardLayout;
private long deckHashCode = 0;
public static Deck load(DeckCardLists deckCardLists) throws GameException {
@ -57,6 +59,8 @@ public class Deck implements Serializable {
public static Deck load(DeckCardLists deckCardLists, boolean ignoreErrors, boolean mockCards) throws GameException {
Deck deck = new Deck();
deck.setName(deckCardLists.getName());
deck.cardsLayout = deckCardLists.getCardLayout();
deck.sideboardLayout = deckCardLists.getSideboardLayout();
List<String> deckCardNames = new ArrayList<>();
for (DeckCardInfo deckCardInfo : deckCardLists.getCards()) {
Card card = createCard(deckCardInfo, mockCards);
@ -141,10 +145,18 @@ public class Deck implements Serializable {
return cards;
}
public DeckCardLayout getCardsLayout() {
return cardsLayout;
}
public Set<Card> getSideboard() {
return sideboard;
}
public DeckCardLayout getSideboardLayout() {
return sideboardLayout;
}
public long getDeckHashCode() {
return deckHashCode;
}