mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
Deck format checkbox also disables checks for limited and quest modes
This commit is contained in:
@@ -7194,15 +7194,13 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
if (!this.isInZone(realZone)) {
|
if (!this.isInZone(realZone)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
} else if (property.equals("ChosenType")) {
|
||||||
|
if (!this.isType(source.getChosenType())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (property.equals("ChosenType")) {
|
if (!this.isType(property)) {
|
||||||
if (!this.isType(source.getChosenType())) {
|
return false;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!this.isType(property)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -23,9 +23,11 @@ import java.util.Map.Entry;
|
|||||||
|
|
||||||
import org.apache.commons.lang.math.IntRange;
|
import org.apache.commons.lang.math.IntRange;
|
||||||
|
|
||||||
|
import forge.Singletons;
|
||||||
import forge.card.CardCoreType;
|
import forge.card.CardCoreType;
|
||||||
import forge.item.CardDb;
|
import forge.item.CardDb;
|
||||||
import forge.item.CardPrinted;
|
import forge.item.CardPrinted;
|
||||||
|
import forge.properties.ForgePreferences.FPref;
|
||||||
import forge.util.Aggregates;
|
import forge.util.Aggregates;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -109,6 +111,11 @@ public enum DeckFormat {
|
|||||||
|
|
||||||
@SuppressWarnings("incomplete-switch")
|
@SuppressWarnings("incomplete-switch")
|
||||||
public String getDeckConformanceProblem(Deck deck) {
|
public String getDeckConformanceProblem(Deck deck) {
|
||||||
|
// That's really a bad dependence
|
||||||
|
if (!Singletons.getModel().getPreferences().getPrefBoolean(FPref.ENFORCE_DECK_LEGALITY)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
int deckSize = deck.getMain().countAll();
|
int deckSize = deck.getMain().countAll();
|
||||||
|
|
||||||
int min = getMainRange().getMinimumInteger();
|
int min = getMainRange().getMinimumInteger();
|
||||||
|
|||||||
@@ -98,12 +98,10 @@ public enum CSubmenuConstructed implements ICDoc {
|
|||||||
private void startGame(final GameType gameType) {
|
private void startGame(final GameType gameType) {
|
||||||
Deck humanDeck = VSubmenuConstructed.SINGLETON_INSTANCE.getDcHuman().getDeck();
|
Deck humanDeck = VSubmenuConstructed.SINGLETON_INSTANCE.getDcHuman().getDeck();
|
||||||
|
|
||||||
if (Singletons.getModel().getPreferences().getPrefBoolean(FPref.ENFORCE_DECK_LEGALITY)) {
|
String errorMessage = gameType.getDecksFormat().getDeckConformanceProblem(humanDeck);
|
||||||
String errorMessage = gameType.getDecksFormat().getDeckConformanceProblem(humanDeck);
|
if (null != errorMessage) {
|
||||||
if (null != errorMessage) {
|
JOptionPane.showMessageDialog(null, "Your deck " + errorMessage, "Invalid deck", JOptionPane.ERROR_MESSAGE);
|
||||||
JOptionPane.showMessageDialog(null, "Your deck " + errorMessage, "Invalid deck", JOptionPane.ERROR_MESSAGE);
|
return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SwingUtilities.invokeLater(new Runnable() {
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
|||||||
Reference in New Issue
Block a user