mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
Moved formats into separate folder so that additional custom format files can be added - added Pauper and Kaladesh_Standard as examples
This commit is contained in:
4
forge-gui/res/formats/customformats.txt
Normal file
4
forge-gui/res/formats/customformats.txt
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
[Pauper]
|
||||||
|
Rarities:L, C
|
||||||
|
[Kaladesh_Standard]
|
||||||
|
Sets:KLD, AER, EMN, SOI, BFZ, OGW
|
||||||
@@ -166,8 +166,19 @@ public final class FModel {
|
|||||||
ForgePreferences.DEV_MODE = preferences.getPrefBoolean(FPref.DEV_MODE_ENABLED);
|
ForgePreferences.DEV_MODE = preferences.getPrefBoolean(FPref.DEV_MODE_ENABLED);
|
||||||
ForgePreferences.UPLOAD_DRAFT = ForgePreferences.NET_CONN;
|
ForgePreferences.UPLOAD_DRAFT = ForgePreferences.NET_CONN;
|
||||||
|
|
||||||
formats = new GameFormat.Collection(new GameFormat.Reader(new File(ForgeConstants.BLOCK_DATA_DIR + "formats.txt")));
|
|
||||||
//add user custom formats if file present
|
final File[] files = new File(ForgeConstants.FORMATS_DATA_DIR).listFiles();
|
||||||
|
for (final File file : files) {
|
||||||
|
if(formats == null){
|
||||||
|
formats = new GameFormat.Collection(new GameFormat.Reader(file));
|
||||||
|
}else{
|
||||||
|
GameFormat.Collection additionalformats = new GameFormat.Collection(new GameFormat.Reader(file));
|
||||||
|
for (GameFormat format:additionalformats) {
|
||||||
|
formats.add(format);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//still support old user custom formats if file present
|
||||||
GameFormat.Collection customFormats = new GameFormat.Collection(new GameFormat.Reader(new File(ForgeConstants.USER_PREFS_DIR + "customformats.txt")));
|
GameFormat.Collection customFormats = new GameFormat.Collection(new GameFormat.Reader(new File(ForgeConstants.USER_PREFS_DIR + "customformats.txt")));
|
||||||
for (GameFormat format:customFormats){
|
for (GameFormat format:customFormats){
|
||||||
formats.add(format);
|
formats.add(format);
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ public final class ForgeConstants {
|
|||||||
public static final String TOKEN_DATA_DIR = RES_DIR + "tokenscripts" + PATH_SEPARATOR;
|
public static final String TOKEN_DATA_DIR = RES_DIR + "tokenscripts" + PATH_SEPARATOR;
|
||||||
public static final String EDITIONS_DIR = RES_DIR + "editions" + PATH_SEPARATOR;
|
public static final String EDITIONS_DIR = RES_DIR + "editions" + PATH_SEPARATOR;
|
||||||
public static final String BLOCK_DATA_DIR = RES_DIR + "blockdata" + PATH_SEPARATOR;
|
public static final String BLOCK_DATA_DIR = RES_DIR + "blockdata" + PATH_SEPARATOR;
|
||||||
|
public static final String FORMATS_DATA_DIR = RES_DIR + "formats" + PATH_SEPARATOR;
|
||||||
public static final String DECK_CUBE_DIR = RES_DIR + "cube" + PATH_SEPARATOR;
|
public static final String DECK_CUBE_DIR = RES_DIR + "cube" + PATH_SEPARATOR;
|
||||||
public static final String AI_PROFILE_DIR = RES_DIR + "ai" + PATH_SEPARATOR;
|
public static final String AI_PROFILE_DIR = RES_DIR + "ai" + PATH_SEPARATOR;
|
||||||
public static final String SOUND_DIR = RES_DIR + "sound" + PATH_SEPARATOR;
|
public static final String SOUND_DIR = RES_DIR + "sound" + PATH_SEPARATOR;
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ def initializeForgeCards():
|
|||||||
|
|
||||||
def initializeFormats():
|
def initializeFormats():
|
||||||
formats = {}
|
formats = {}
|
||||||
formatLocation = os.path.join(resDir, 'blockdata', 'formats.txt')
|
formatLocation = os.path.join(resDir, 'formats', 'coreformats.txt')
|
||||||
print "Looking for formats in ", formatLocation
|
print "Looking for formats in ", formatLocation
|
||||||
with open(formatLocation) as formatFile:
|
with open(formatLocation) as formatFile:
|
||||||
while formatFile:
|
while formatFile:
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ pathToMtgData = os.path.join(toolsDir, "mtg-data.txt")
|
|||||||
|
|
||||||
def initializeFormats():
|
def initializeFormats():
|
||||||
formats = {}
|
formats = {}
|
||||||
formatLocation = os.path.join(resDir, 'blockdata', 'formats.txt')
|
formatLocation = os.path.join(resDir, 'formats', 'coreformats.txt')
|
||||||
print "Looking for formats in ", formatLocation
|
print "Looking for formats in ", formatLocation
|
||||||
with open(formatLocation) as formatFile:
|
with open(formatLocation) as formatFile:
|
||||||
while formatFile:
|
while formatFile:
|
||||||
|
|||||||
Reference in New Issue
Block a user