mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
Improve deck editing support for variants
This commit is contained in:
@@ -21,7 +21,7 @@ import org.w3c.dom.NodeList;
|
||||
*
|
||||
*/
|
||||
public class DeckPreferences {
|
||||
private static String currentDeck, draftDeck, sealedDeck;
|
||||
private static String currentDeck, draftDeck, sealedDeck, commanderDeck, planarDeck, schemeDeck;
|
||||
private static Map<String, DeckPreferences> allPrefs = new HashMap<String, DeckPreferences>();
|
||||
|
||||
public static String getCurrentDeck() {
|
||||
@@ -51,6 +51,33 @@ public class DeckPreferences {
|
||||
save();
|
||||
}
|
||||
|
||||
public static String getCommanderDeck() {
|
||||
return commanderDeck;
|
||||
}
|
||||
public static void setCommanderDeck(String commanderDeck0) {
|
||||
if (commanderDeck != null && commanderDeck.equals(commanderDeck0)) { return; }
|
||||
commanderDeck = commanderDeck0;
|
||||
save();
|
||||
}
|
||||
|
||||
public static String getPlanarDeck() {
|
||||
return planarDeck;
|
||||
}
|
||||
public static void setPlanarDeck(String planarDeck0) {
|
||||
if (planarDeck != null && planarDeck.equals(planarDeck0)) { return; }
|
||||
planarDeck = planarDeck0;
|
||||
save();
|
||||
}
|
||||
|
||||
public static String getSchemeDeck() {
|
||||
return schemeDeck;
|
||||
}
|
||||
public static void setSchemeDeck(String schemeDeck0) {
|
||||
if (schemeDeck != null && schemeDeck.equals(schemeDeck0)) { return; }
|
||||
schemeDeck = schemeDeck0;
|
||||
save();
|
||||
}
|
||||
|
||||
public static DeckPreferences getPrefs(DeckProxy deck) {
|
||||
String key = deck.getUniqueKey();
|
||||
DeckPreferences prefs = allPrefs.get(key);
|
||||
@@ -72,6 +99,9 @@ public class DeckPreferences {
|
||||
currentDeck = root.getAttribute("currentDeck");
|
||||
draftDeck = root.getAttribute("draftDeck");
|
||||
sealedDeck = root.getAttribute("sealedDeck");
|
||||
commanderDeck = root.getAttribute("commanderDeck");
|
||||
planarDeck = root.getAttribute("planarDeck");
|
||||
schemeDeck = root.getAttribute("schemeDeck");
|
||||
|
||||
final NodeList cards = document.getElementsByTagName("deck");
|
||||
for (int i = 0; i < cards.getLength(); i++) {
|
||||
@@ -101,6 +131,9 @@ public class DeckPreferences {
|
||||
root.setAttribute("currentDeck", currentDeck);
|
||||
root.setAttribute("draftDeck", draftDeck);
|
||||
root.setAttribute("sealedDeck", sealedDeck);
|
||||
root.setAttribute("commanderDeck", commanderDeck);
|
||||
root.setAttribute("planarDeck", planarDeck);
|
||||
root.setAttribute("schemeDeck", schemeDeck);
|
||||
document.appendChild(root);
|
||||
|
||||
for (Map.Entry<String, DeckPreferences> entry : allPrefs.entrySet()) {
|
||||
|
||||
@@ -42,12 +42,18 @@ public enum ItemManagerConfig {
|
||||
GroupDef.DEFAULT, ColumnDef.CMC, 4, 1),
|
||||
AVATAR_POOL(SColumnUtil.getSpecialCardPoolDefaultColumns(), true, false, false,
|
||||
null, null, 4, 0),
|
||||
SCHEME_POOL(SColumnUtil.getSpecialCardPoolDefaultColumns(), true, false, false,
|
||||
SCHEME_POOL(SColumnUtil.getSpecialCardPoolDefaultColumns(), true, false, true,
|
||||
null, null, 4, 0),
|
||||
PLANAR_POOL(SColumnUtil.getSpecialCardPoolDefaultColumns(), true, false, false,
|
||||
SCHEME_DECK_EDITOR(SColumnUtil.getCatalogDefaultColumns(true), true, false, true,
|
||||
null, null, 4, 0),
|
||||
PLANAR_POOL(SColumnUtil.getSpecialCardPoolDefaultColumns(), true, false, true,
|
||||
null, null, 4, 0),
|
||||
PLANAR_DECK_EDITOR(SColumnUtil.getCatalogDefaultColumns(true), true, false, true,
|
||||
null, null, 4, 0),
|
||||
COMMANDER_POOL(SColumnUtil.getCatalogDefaultColumns(true), true, false, false,
|
||||
null, null, 4, 0),
|
||||
COMMANDER_SECTION(SColumnUtil.getCatalogDefaultColumns(true), true, false, true,
|
||||
null, null, 1, 1),
|
||||
WORKSHOP_CATALOG(SColumnUtil.getCatalogDefaultColumns(true), true, true, false,
|
||||
null, null, 4, 0),
|
||||
DECK_VIEWER(SColumnUtil.getDeckViewerDefaultColumns(), false, false, false,
|
||||
|
||||
Reference in New Issue
Block a user