mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Avoid errors due to loading cards for card-based deck generation when lazy loading is enabled (for now just disables card-based deck generation completely) - does not handle cases where card-based decks are currently selected in constructed, then the lazy loading is switched on, then forge restarted.
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
package forge.deck;
|
||||
|
||||
import forge.model.FModel;
|
||||
import forge.properties.ForgePreferences;
|
||||
|
||||
public enum DeckType {
|
||||
CUSTOM_DECK ("Custom User Decks"),
|
||||
CONSTRUCTED_DECK ("Constructed Decks"),
|
||||
@@ -21,19 +24,37 @@ public enum DeckType {
|
||||
NET_DECK ("Net Decks"),
|
||||
NET_COMMANDER_DECK ("Net Commander Decks");
|
||||
|
||||
public static final DeckType[] ConstructedOptions = new DeckType[] {
|
||||
DeckType.CUSTOM_DECK,
|
||||
DeckType.PRECONSTRUCTED_DECK,
|
||||
DeckType.QUEST_OPPONENT_DECK,
|
||||
DeckType.COLOR_DECK,
|
||||
DeckType.STANDARD_COLOR_DECK,
|
||||
DeckType.STANDARD_CARDGEN_DECK,
|
||||
DeckType.MODERN_CARDGEN_DECK,
|
||||
DeckType.MODERN_COLOR_DECK,
|
||||
DeckType.THEME_DECK,
|
||||
DeckType.RANDOM_DECK,
|
||||
DeckType.NET_DECK
|
||||
};
|
||||
public static DeckType[] ConstructedOptions;
|
||||
|
||||
static {
|
||||
if (!FModel.getPreferences().getPrefBoolean(ForgePreferences.FPref.LOAD_CARD_SCRIPTS_LAZILY)) {
|
||||
ConstructedOptions = new DeckType[]{
|
||||
DeckType.CUSTOM_DECK,
|
||||
DeckType.PRECONSTRUCTED_DECK,
|
||||
DeckType.QUEST_OPPONENT_DECK,
|
||||
DeckType.COLOR_DECK,
|
||||
DeckType.STANDARD_COLOR_DECK,
|
||||
DeckType.STANDARD_CARDGEN_DECK,
|
||||
DeckType.MODERN_CARDGEN_DECK,
|
||||
DeckType.MODERN_COLOR_DECK,
|
||||
DeckType.THEME_DECK,
|
||||
DeckType.RANDOM_DECK,
|
||||
DeckType.NET_DECK
|
||||
};
|
||||
} else {
|
||||
ConstructedOptions = new DeckType[]{
|
||||
DeckType.CUSTOM_DECK,
|
||||
DeckType.PRECONSTRUCTED_DECK,
|
||||
DeckType.QUEST_OPPONENT_DECK,
|
||||
DeckType.COLOR_DECK,
|
||||
DeckType.STANDARD_COLOR_DECK,
|
||||
DeckType.MODERN_COLOR_DECK,
|
||||
DeckType.THEME_DECK,
|
||||
DeckType.RANDOM_DECK,
|
||||
DeckType.NET_DECK
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private String value;
|
||||
private DeckType(final String value) {
|
||||
|
||||
@@ -214,7 +214,9 @@ public final class FModel {
|
||||
AiProfileUtil.loadAllProfiles(ForgeConstants.AI_PROFILE_DIR);
|
||||
|
||||
//generate Deck Gen matrix
|
||||
CardRelationMatrixGenerator.initialize();
|
||||
if(!FModel.getPreferences().getPrefBoolean(FPref.LOAD_CARD_SCRIPTS_LAZILY)) {
|
||||
CardRelationMatrixGenerator.initialize();
|
||||
}
|
||||
}
|
||||
|
||||
public static QuestController getQuest() {
|
||||
|
||||
Reference in New Issue
Block a user