diff --git a/forge-gui/CHANGES.txt b/forge-gui/CHANGES.txt index ddcde1ff09d..afcfe3a50ef 100644 --- a/forge-gui/CHANGES.txt +++ b/forge-gui/CHANGES.txt @@ -10,6 +10,8 @@ Release Notes - If hide tabs setting on, still show tabs for panes with multiple tabs - +- Multi-color cards containing a filtered color will no longer show up in catalogs - + - Select abilities using context menu - Instead of displaying a dialog to select abilities, you'll now get a context menu when left or right clicking cards with multiple ability choices. Each ability will have a keyboard shortcut of 1-9 based on order. diff --git a/forge-gui/src/main/java/forge/gui/toolbox/itemmanager/SFilterUtil.java b/forge-gui/src/main/java/forge/gui/toolbox/itemmanager/SFilterUtil.java index 930ded80379..0595c2411ea 100644 --- a/forge-gui/src/main/java/forge/gui/toolbox/itemmanager/SFilterUtil.java +++ b/forge-gui/src/main/java/forge/gui/toolbox/itemmanager/SFilterUtil.java @@ -33,6 +33,7 @@ public class SFilterUtil { */ public static Predicate buildColorAndTypeFilter(Map statLabels) { final List> colors = new ArrayList>(); + final List> notColors = new ArrayList>(); final List> types = new ArrayList>(); boolean wantMulticolor = false; @@ -41,6 +42,7 @@ public class SFilterUtil { switch (s) { case WHITE: case BLUE: case BLACK: case RED: case GREEN: case COLORLESS: if (statLabels.get(s).getSelected()) { colors.add(s.predicate); } + else { notColors.add(Predicates.not(s.predicate)); } break; case MULTICOLOR: wantMulticolor = statLabels.get(s).getSelected(); @@ -58,6 +60,10 @@ public class SFilterUtil { throw new RuntimeException("unhandled enum value: " + s); } } + + if (wantMulticolor && !colors.isEmpty() && !notColors.isEmpty()) { + preExceptMulti = Predicates.and(notColors); //ensure multicolor cards with filtered colors don't show up + } Predicate preColors = colors.size() == 6 ? null : Predicates.or(colors); Predicate preFinal = colors.isEmpty() && wantMulticolor ?