diff --git a/forge-gui/src/main/java/forge/itemmanager/GroupDef.java b/forge-gui/src/main/java/forge/itemmanager/GroupDef.java index 559141e5c55..8376b31bf6c 100644 --- a/forge-gui/src/main/java/forge/itemmanager/GroupDef.java +++ b/forge-gui/src/main/java/forge/itemmanager/GroupDef.java @@ -74,12 +74,12 @@ public enum GroupDef { return -1; } }), - DEFAULT("Default", - new String[] { "Creatures", "Spells", "Lands" }, + DEFAULT("Default", //Beginning in DDU, "Artifacts" category is added at top of list + new String[] { "Artifacts", "Creatures", "Other Spells", "Lands" }, new Function() { @Override public ColumnDef apply(final Integer groupIndex) { - if (groupIndex == 2) { + if (groupIndex == 3) { return ColumnDef.NAME; //pile lands by name regardless } return null; @@ -90,21 +90,24 @@ public enum GroupDef { public Integer apply(final InventoryItem item) { if (item instanceof PaperCard) { CardType type = ((PaperCard) item).getRules().getType(); - if (type.isCreature()) { + if (type.isArtifact()) { //artifact lands/creatures, too return 0; } - if (type.isLand()) { //make Artifact Lands appear in Lands group - return 2; - } - if (type.isArtifact() || type.isEnchantment() || type.isPlaneswalker() || type.isInstant() || type.isSorcery()) { + if (type.isCreature()) { return 1; } + if (type.isLand()) { + return 3; + } + if (type.isEnchantment() || type.isPlaneswalker() || type.isInstant() || type.isSorcery()) { + return 2; + } } return -1; } }), CARD_TYPE("Type", - new String[] { "Creatures", "Artifacts", "Enchantments", "Planeswalkers", "Instants", "Sorceries", "Lands" }, + new String[] { "Planeswalker", "Creature", "Sorcery", "Instant", "Artifact", "Enchantment", "Land", "Tribal instant" }, new Function() { @Override public ColumnDef apply(final Integer groupIndex) { @@ -119,27 +122,60 @@ public enum GroupDef { public Integer apply(final InventoryItem item) { if (item instanceof PaperCard) { CardType type = ((PaperCard) item).getRules().getType(); - if (type.isCreature()) { //make Artifact and Land Creatures appear in Creatures group + if (type.isPlaneswalker()) { return 0; } - if (type.isLand()) { //make Artifact Lands appear in Lands group - return 6; - } - if (type.isArtifact()) { + if (type.isCreature()) { return 1; } - if (type.isEnchantment()) { + if (type.isSorcery()) { return 2; } - if (type.isPlaneswalker()) { - return 3; + if (type.isTribal() && type.isInstant()) { + return 7; } if (type.isInstant()) { + return 3; + } + if (type.isArtifact()) { return 4; } - if (type.isSorcery()) { + if (type.isEnchantment()) { return 5; } + if (type.isLand()) { + return 6; + } + } + return -1; + } + }), + PW_DECK_SORT("Planeswalker Deck Sort", + new String[] { "Planeswalker", "Rares", "Creature", "Land", "Other Spells" }, + new Function() { + @Override + public ColumnDef apply(final Integer groupIndex) { + return null; + } + }, + new Function() { + @Override + public Integer apply(final InventoryItem item) { + if (item instanceof PaperCard) { + CardType type = ((PaperCard) item).getRules().getType(); + if (type.isPlaneswalker()){ + return 0; + } + if (((PaperCard) item).getRarity().toString() == "R"){ + return 1; + } + if (type.isCreature()){ + return 2; + } + if (type.isLand()){ + return 3; + } + return 4; } return -1; } diff --git a/forge-gui/src/main/java/forge/itemmanager/SItemManagerUtil.java b/forge-gui/src/main/java/forge/itemmanager/SItemManagerUtil.java index 222b3321df9..a5df84f7e1a 100644 --- a/forge-gui/src/main/java/forge/itemmanager/SItemManagerUtil.java +++ b/forge-gui/src/main/java/forge/itemmanager/SItemManagerUtil.java @@ -157,7 +157,7 @@ public final class SItemManagerUtil { return builder.toString(); } - private static final GroupDef[] CARD_GROUPBY_OPTIONS = { GroupDef.DEFAULT, GroupDef.CARD_TYPE, GroupDef.COLOR, GroupDef.COLOR_IDENTITY, GroupDef.SET, GroupDef.CARD_RARITY }; + private static final GroupDef[] CARD_GROUPBY_OPTIONS = { GroupDef.DEFAULT, GroupDef.CARD_TYPE, GroupDef.COLOR, GroupDef.COLOR_IDENTITY, GroupDef.SET, GroupDef.CARD_RARITY, GroupDef.PW_DECK_SORT }; private static final GroupDef[] DECK_GROUPBY_OPTIONS = { GroupDef.COLOR, GroupDef.COLOR_IDENTITY, GroupDef.SET }; private static final ColumnDef[] CARD_PILEBY_OPTIONS = { ColumnDef.CMC, ColumnDef.COLOR, ColumnDef.NAME, ColumnDef.COST, ColumnDef.TYPE, ColumnDef.RARITY, ColumnDef.SET }; private static final ColumnDef[] DECK_PILEBY_OPTIONS = { ColumnDef.DECK_COLOR, ColumnDef.DECK_FOLDER, ColumnDef.NAME, ColumnDef.DECK_FORMAT, ColumnDef.DECK_EDITION };