diff --git a/forge-gui-desktop/src/main/java/forge/screens/home/settings/CSubmenuPreferences.java b/forge-gui-desktop/src/main/java/forge/screens/home/settings/CSubmenuPreferences.java index 1716bb5177b..4b7b85b8e71 100644 --- a/forge-gui-desktop/src/main/java/forge/screens/home/settings/CSubmenuPreferences.java +++ b/forge-gui-desktop/src/main/java/forge/screens/home/settings/CSubmenuPreferences.java @@ -115,6 +115,8 @@ public enum CSubmenuPreferences implements ICDoc { lstControls.add(Pair.of(view.getCbStackCreatures(), FPref.UI_STACK_CREATURES)); lstControls.add(Pair.of(view.getCbManaLostPrompt(), FPref.UI_MANA_LOST_PROMPT)); + lstControls.add(Pair.of(view.getCbFilterLandsByColorId(), FPref.UI_FILTER_LANDS_BY_COLOR_IDENTITY)); + for(final Pair kv : lstControls) { kv.getKey().addItemListener(new ItemListener() { @Override diff --git a/forge-gui-desktop/src/main/java/forge/screens/home/settings/VSubmenuPreferences.java b/forge-gui-desktop/src/main/java/forge/screens/home/settings/VSubmenuPreferences.java index ae413f159e4..185249ad5e4 100644 --- a/forge-gui-desktop/src/main/java/forge/screens/home/settings/VSubmenuPreferences.java +++ b/forge-gui-desktop/src/main/java/forge/screens/home/settings/VSubmenuPreferences.java @@ -82,6 +82,7 @@ public enum VSubmenuPreferences implements IVSubmenu { private final JCheckBox cbOpenPacksIndiv = new OptionsCheckBox("Open Packs Individually"); private final JCheckBox cbTokensInSeparateRow = new OptionsCheckBox("Display Tokens in a Separate Row"); private final JCheckBox cbStackCreatures = new OptionsCheckBox("Stack Creatures"); + private final JCheckBox cbFilterLandsByColorId = new OptionsCheckBox("Filter Lands by Color Identity"); private final Map shortcutFields = new HashMap<>(); @@ -171,6 +172,12 @@ public enum VSubmenuPreferences implements IVSubmenu { pnlPrefs.add(cbRemoveArtifacts, regularConstraints); pnlPrefs.add(new NoteLabel("Disables artifact cards in generated decks."), regularConstraints); + // Deck building options + pnlPrefs.add(new SectionLabel("Deck Editor Options"), sectionConstraints); + + pnlPrefs.add(cbFilterLandsByColorId, regularConstraints); + pnlPrefs.add(new NoteLabel("Filter lands by their color identity to make it easier to find relevant mana producing lands."), regularConstraints); + // Advanced pnlPrefs.add(new SectionLabel("Advanced Settings"), sectionConstraints); @@ -436,6 +443,11 @@ public enum VSubmenuPreferences implements IVSubmenu { return cbRemoveArtifacts; } + /** @return {@link javax.swing.JCheckBox} */ + public JCheckBox getCbFilterLandsByColorId() { + return cbFilterLandsByColorId; + } + /** @return {@link javax.swing.JCheckBox} */ public JCheckBox getCbEnableAICheats() { return cbEnableAICheats; diff --git a/forge-gui/CHANGES.txt b/forge-gui/CHANGES.txt index aa4a894937a..f8c2a8f1bbd 100644 --- a/forge-gui/CHANGES.txt +++ b/forge-gui/CHANGES.txt @@ -90,7 +90,12 @@ longer considered unless they can be produced by a land in the deck - Land Color Filtering in Deck Editor - When filtering colors in the Deck Editor, lands that produce all selected colors will now be shown This means if you filter to show only green and white cards, lands that produce green and white will now be shown -This should hopefully make finding multicolor lands for your decks easier +This should hopefully make finding multicolor lands for your decks easier. +An attempt was made to make this option behave in a more consistent and helpful way - now lands won't suddenly +disappear when one color is filtered out, basic lands of appropriate colors will be shown, lands that feature at +least one of the colors relevant for the deck will be shown. Also, the mode to filter lands in this way is now +optional and can be toggled on or off in the Preferences ("Filter Lands by Color Identity" under "Deck Editor +Options"). - Quest Starting Pool Configuration - diff --git a/forge-gui/src/main/java/forge/itemmanager/SFilterUtil.java b/forge-gui/src/main/java/forge/itemmanager/SFilterUtil.java index c0497e369af..ea50ca76f93 100644 --- a/forge-gui/src/main/java/forge/itemmanager/SFilterUtil.java +++ b/forge-gui/src/main/java/forge/itemmanager/SFilterUtil.java @@ -13,6 +13,8 @@ import forge.interfaces.IButton; import forge.item.InventoryItem; import forge.item.PaperCard; import forge.itemmanager.SItemManagerUtil.StatTypes; +import forge.model.FModel; +import forge.properties.ForgePreferences; import forge.util.BinaryUtil; import forge.util.PredicateString.StringOp; @@ -168,7 +170,7 @@ public class SFilterUtil { boolean allColorsFilteredOut = colors == 0; //use color identity for lands, which allows filtering to just lands that can be played in your deck - boolean useColorIdentity = rules.getType().isLand() && !allColorsFilteredOut; + boolean useColorIdentity = rules.getType().isLand() && !allColorsFilteredOut && FModel.getPreferences().getPrefBoolean(ForgePreferences.FPref.UI_FILTER_LANDS_BY_COLOR_IDENTITY); if (useColorIdentity) { color = rules.getColorIdentity(); } diff --git a/forge-gui/src/main/java/forge/properties/ForgePreferences.java b/forge-gui/src/main/java/forge/properties/ForgePreferences.java index 5451051b363..994659f2d31 100644 --- a/forge-gui/src/main/java/forge/properties/ForgePreferences.java +++ b/forge-gui/src/main/java/forge/properties/ForgePreferences.java @@ -79,6 +79,7 @@ public class ForgePreferences extends PreferencesStore { UI_PAUSE_WHILE_MINIMIZED("false"), UI_TOKENS_IN_SEPARATE_ROW("false"), // Display tokens in their own battlefield row. UI_DISPLAY_CURRENT_COLORS("Never"), + UI_FILTER_LANDS_BY_COLOR_IDENTITY("true"), UI_FOR_TOUCHSCREN("false"),