mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
Support loading Custom Cards & Editions from User Folder
This commit is contained in:
@@ -232,6 +232,9 @@ public final class ForgeConstants {
|
||||
public static final String USER_PUZZLE_DIR = USER_DIR + "puzzle" + PATH_SEPARATOR;
|
||||
public static final String LOG_FILE = USER_DIR + "forge.log";
|
||||
public static final String ACHIEVEMENTS_DIR = USER_DIR + "achievements" + PATH_SEPARATOR;
|
||||
public static final String USER_CUSTOM_DIR = USER_DIR + "custom" + PATH_SEPARATOR;
|
||||
public static final String USER_CUSTOM_EDITIONS_DIR = USER_CUSTOM_DIR + "editions" + PATH_SEPARATOR;
|
||||
public static final String USER_CUSTOM_CARDS_DIR = USER_CUSTOM_DIR + "cards" + PATH_SEPARATOR;
|
||||
public static final String DECK_DRAFT_DIR = DECK_BASE_DIR + "draft" + PATH_SEPARATOR;
|
||||
public static final String DECK_WINSTON_DIR = DECK_BASE_DIR + "winston" + PATH_SEPARATOR;
|
||||
public static final String DECK_SEALED_DIR = DECK_BASE_DIR + "sealed" + PATH_SEPARATOR;
|
||||
|
||||
@@ -176,7 +176,14 @@ public final class FModel {
|
||||
FModel.getPreferences().getPrefBoolean(FPref.LOAD_CARD_SCRIPTS_LAZILY));
|
||||
final CardStorageReader tokenReader = new CardStorageReader(ForgeConstants.TOKEN_DATA_DIR, progressBarBridge,
|
||||
FModel.getPreferences().getPrefBoolean(FPref.LOAD_CARD_SCRIPTS_LAZILY));
|
||||
magicDb = new StaticData(reader, tokenReader, ForgeConstants.EDITIONS_DIR, ForgeConstants.BLOCK_DATA_DIR, FModel.getPreferences().getPrefBoolean(FPref.UI_LOAD_UNKNOWN_CARDS), FModel.getPreferences().getPrefBoolean(FPref.UI_LOAD_NONLEGAL_CARDS));
|
||||
CardStorageReader customReader;
|
||||
try {
|
||||
customReader = new CardStorageReader(ForgeConstants.USER_CUSTOM_CARDS_DIR, progressBarBridge,
|
||||
FModel.getPreferences().getPrefBoolean(FPref.LOAD_CARD_SCRIPTS_LAZILY));
|
||||
} catch (Exception e) {
|
||||
customReader = null;
|
||||
}
|
||||
magicDb = new StaticData(reader, tokenReader, customReader, ForgeConstants.EDITIONS_DIR, ForgeConstants.USER_CUSTOM_EDITIONS_DIR,ForgeConstants.BLOCK_DATA_DIR, FModel.getPreferences().getPrefBoolean(FPref.UI_LOAD_UNKNOWN_CARDS), FModel.getPreferences().getPrefBoolean(FPref.UI_LOAD_NONLEGAL_CARDS));
|
||||
CardTranslation.preloadTranslation(preferences.getPref(FPref.UI_LANGUAGE), ForgeConstants.LANG_DIR);
|
||||
|
||||
//create profile dirs if they don't already exist
|
||||
|
||||
Reference in New Issue
Block a user