move default gauntlet files to defaults dir

This commit is contained in:
myk
2013-03-11 10:14:48 +00:00
parent 9c50bf79d1
commit be8326438d
8 changed files with 12 additions and 11 deletions

4
.gitattributes vendored
View File

@@ -12407,6 +12407,8 @@ res/cardsfolder/z/zuran_orb.txt svneol=native#text/plain
res/cardsfolder/z/zuran_spellcaster.txt svneol=native#text/plain
res/defaults/editor.preferences svneol=native#text/xml
res/defaults/editor.xml svneol=native#text/xml
res/defaults/gauntlet/LOCKED_DotP[!!-~]Preconstructed.dat -text
res/defaults/gauntlet/LOCKED_Swimming[!!-~]With[!!-~]Sharks.dat -text
res/defaults/home.xml svneol=native#text/xml
res/defaults/match.xml svneol=native#text/xml
res/draft/cube_juzamjedi.draft -text
@@ -12414,8 +12416,6 @@ res/draft/cube_skiera.draft -text
res/draft/rankings.txt -text
res/gamedata/NonStackingKWList.txt svneol=native#text/plain
res/gamedata/TypeLists.txt svneol=native#text/plain
res/gauntlet/LOCKED_DotP[!!-~]Preconstructed.dat -text
res/gauntlet/LOCKED_Swimming[!!-~]With[!!-~]Sharks.dat -text
res/howto.txt svneol=native#text/plain
res/licenses/java-yield-license.txt svneol=native#text/plain
res/licenses/log4j-license.txt svneol=native#text/plain

View File

@@ -27,7 +27,6 @@ public final class GauntletData {
/** Constructor. */
public GauntletData() {
new File(GauntletIO.DIR_GAUNTLETS).mkdir();
}
//========== Mutator / accessor methods

View File

@@ -24,12 +24,11 @@ import forge.deck.CardPool;
import forge.error.BugReporter;
import forge.item.CardDb;
import forge.item.CardPrinted;
import forge.properties.NewConstants;
import forge.util.IgnoringXStream;
/** */
public class GauntletIO {
/** Directory for storing gauntlet data files. */
public static final String DIR_GAUNTLETS = "res/gauntlet/";
/** Prompt in text field for new (unsaved) built gauntlets. */
public static final String TXF_PROMPT = "[New Gauntlet]";
/** Prefix for quick gauntlet save files. */
@@ -65,7 +64,7 @@ public class GauntletIO {
}
};
File folder = new File(GauntletIO.DIR_GAUNTLETS);
File folder = new File(NewConstants.GAUNTLET_DIR.defaultLoc);
return folder.listFiles(filter);
}
@@ -79,7 +78,7 @@ public class GauntletIO {
}
};
File folder = new File(GauntletIO.DIR_GAUNTLETS);
File folder = new File(NewConstants.GAUNTLET_DIR.defaultLoc);
return folder.listFiles(filter);
}
@@ -93,7 +92,7 @@ public class GauntletIO {
}
};
File folder = new File(GauntletIO.DIR_GAUNTLETS);
File folder = new File(NewConstants.GAUNTLET_DIR.defaultLoc);
return folder.listFiles(filter);
}

View File

@@ -28,6 +28,7 @@ import forge.game.player.PlayerType;
import forge.gauntlet.GauntletData;
import forge.gauntlet.GauntletIO;
import forge.gui.framework.ICDoc;
import forge.properties.NewConstants;
import forge.quest.QuestController;
import forge.quest.QuestEvent;
import forge.util.storage.IStorage;
@@ -47,7 +48,7 @@ public enum CSubmenuGauntletBuild implements ICDoc {
private final VSubmenuGauntletBuild view = VSubmenuGauntletBuild.SINGLETON_INSTANCE;
private final List<Deck> workingDecks = new ArrayList<Deck>();
private File previousDirectory = null;
private File openStartDir = new File(GauntletIO.DIR_GAUNTLETS);
private File openStartDir = new File(NewConstants.GAUNTLET_DIR.defaultLoc);
private final FileFilter filterDAT = new FileFilter() {
@Override
@@ -317,7 +318,7 @@ public enum CSubmenuGauntletBuild implements ICDoc {
return false;
}
final File f = new File(GauntletIO.DIR_GAUNTLETS + name + ".dat");
final File f = new File(NewConstants.GAUNTLET_DIR.defaultLoc + name + ".dat");
// Confirm if overwrite
if (f.exists()) {
final int m = JOptionPane.showConfirmDialog(null,

View File

@@ -32,6 +32,7 @@ import forge.gauntlet.GauntletIO;
import forge.gui.SOverlayUtils;
import forge.gui.framework.ICDoc;
import forge.model.FModel;
import forge.properties.NewConstants;
import forge.quest.QuestController;
import forge.quest.QuestEvent;
import forge.util.storage.IStorage;
@@ -224,7 +225,7 @@ public enum CSubmenuGauntletQuick implements ICDoc {
int num = 1;
while (lstNames.contains(GauntletIO.PREFIX_QUICK + num + ".dat")) { num++; }
FModel.SINGLETON_INSTANCE.getGauntletData().setActiveFile(new File(
GauntletIO.DIR_GAUNTLETS + GauntletIO.PREFIX_QUICK + num + ".dat"));
NewConstants.GAUNTLET_DIR.defaultLoc + GauntletIO.PREFIX_QUICK + num + ".dat"));
// Pull user deck
final Deck userDeck;

View File

@@ -78,6 +78,7 @@ public final class NewConstants {
public static final FileLocation HOME_LAYOUT_FILE = new FileLocation(_DEFAULTS_DIR, _USER_PREFS_DIR, "home.xml");
public static final FileLocation MATCH_LAYOUT_FILE = new FileLocation(_DEFAULTS_DIR, _USER_PREFS_DIR, "match.xml");
public static final FileLocation EDITOR_LAYOUT_FILE = new FileLocation(_DEFAULTS_DIR, _USER_PREFS_DIR, "editor.xml");
public static final FileLocation GAUNTLET_DIR = new FileLocation(_DEFAULTS_DIR, USER_DIR, "gauntlet/");
// data that is only in the cached dir
private static final String _DB_DIR = CACHE_DIR + "db/";