mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
Support setting directory for newly created decks by adding fullPath to StorageBase
This commit is contained in:
@@ -66,7 +66,7 @@ public class NetDeckCategory extends StorageBase<Deck> {
|
||||
NetDeckCategory category = categories.get(name);
|
||||
if (category != null && category.map.isEmpty()) {
|
||||
//if name passed in, try to load decks from current cached files
|
||||
File downloadDir = new File(category.getDownloadLocation());
|
||||
File downloadDir = new File(category.getFullPath());
|
||||
if (downloadDir.exists()) {
|
||||
for (File file : downloadDir.listFiles(DeckStorage.DCK_FILE_FILTER)) {
|
||||
Deck deck = DeckSerializer.fromFile(file);
|
||||
@@ -86,7 +86,7 @@ public class NetDeckCategory extends StorageBase<Deck> {
|
||||
WaitCallback<Boolean> callback = new WaitCallback<Boolean>() {
|
||||
@Override
|
||||
public void run() {
|
||||
String downloadLoc = c.getDownloadLocation();
|
||||
String downloadLoc = c.getFullPath();
|
||||
GuiBase.getInterface().download(new GuiDownloadZipService(c.getName(), "decks", c.getUrl(), downloadLoc, downloadLoc, null) {
|
||||
@Override
|
||||
protected void copyInputStream(InputStream in, String outPath) throws IOException {
|
||||
@@ -108,14 +108,10 @@ public class NetDeckCategory extends StorageBase<Deck> {
|
||||
private final String url;
|
||||
|
||||
private NetDeckCategory(String name0, String url0) {
|
||||
super(name0, new HashMap<String, Deck>());
|
||||
super(name0, ForgeConstants.DECK_NET_DIR + name0, new HashMap<String, Deck>());
|
||||
url = url0;
|
||||
}
|
||||
|
||||
public String getDownloadLocation() {
|
||||
return ForgeConstants.DECK_NET_DIR + name + "/";
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import java.util.Map;
|
||||
|
||||
public class ConquestDeckMap extends StorageBase<Deck> {
|
||||
public ConquestDeckMap(Map<String, Deck> in) {
|
||||
super("Conquest decks", in);
|
||||
super("Conquest decks", null, in);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -28,12 +28,11 @@ import forge.util.storage.StorageBase;
|
||||
*
|
||||
*/
|
||||
public class QuestDeckGroupMap extends StorageBase<DeckGroup> {
|
||||
|
||||
/**
|
||||
* Instantiates a new quest deck map.
|
||||
*/
|
||||
public QuestDeckGroupMap(Map<String, DeckGroup> in) {
|
||||
super("Quest draft decks", in == null ? new HashMap<String, DeckGroup>() : in);
|
||||
super("Quest draft decks", null, in == null ? new HashMap<String, DeckGroup>() : in);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -27,12 +27,11 @@ import java.util.Map;
|
||||
*
|
||||
*/
|
||||
public class QuestDeckMap extends StorageBase<Deck> {
|
||||
|
||||
/**
|
||||
* Instantiates a new quest deck map.
|
||||
*/
|
||||
public QuestDeckMap(Map<String, Deck> in) {
|
||||
super("Quest decks", in);
|
||||
super("Quest decks", null, in);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user