diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.form b/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.form
index 1cf837043f..8fa93c55b0 100644
--- a/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.form
+++ b/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.form
@@ -206,6 +206,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
@@ -528,16 +540,18 @@
-
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.java b/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.java
index c2a7c23456..80b936a178 100644
--- a/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.java
+++ b/Mage.Client/src/main/java/mage/client/deckeditor/CardSelector.java
@@ -36,6 +36,7 @@ package mage.client.deckeditor;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
+import java.util.Map.Entry;
import javax.swing.*;
import javax.swing.table.DefaultTableCellRenderer;
import mage.MageObject;
@@ -74,6 +75,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
private BigCard bigCard;
private boolean limited = false;
private final SortSetting sortSetting;
+ private static final Map pdAllowed = new HashMap<>();
private final ActionListener searchAction = evt -> jButtonSearchActionPerformed(evt);
@@ -372,6 +374,12 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
try {
java.util.List filteredCards = new ArrayList<>();
setCursor(new Cursor(Cursor.WAIT_CURSOR));
+
+ boolean chkPD = chkPennyDreadful.isSelected();
+ if (chkPD) {
+ generatePennyDreadfulHash();
+ }
+
if (limited) {
for (Card card : cards) {
if (filter.match(card, null)) {
@@ -383,6 +391,11 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
for (CardInfo cardInfo : foundCards) {
Card card = cardInfo.getMockCard();
if (filter.match(card, null)) {
+ if (chkPD) {
+ if (!pdAllowed.containsKey(card.getName())) {
+ continue;
+ }
+ }
filteredCards.add(card);
}
}
@@ -419,6 +432,22 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
}
}
+ public void generatePennyDreadfulHash() {
+ if (pdAllowed.size() > 0) {
+ return;
+ }
+
+ Properties properties = new Properties();
+ try {
+ properties.load(CardSelector.class.getResourceAsStream("pennydreadful.properties"));
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ for (final Entry