mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
*Added multistate handling to Download Card LQ Pictures
This commit is contained in:
@@ -6,6 +6,7 @@ import forge.properties.ForgeProps;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
|
|
||||||
@@ -41,16 +42,10 @@ public class Gui_DownloadPictures_LQ extends GuiDownloader {
|
|||||||
|
|
||||||
String base = ForgeProps.getFile(IMAGE_BASE).getPath();
|
String base = ForgeProps.getFile(IMAGE_BASE).getPath();
|
||||||
for (Card c : AllZone.getCardFactory()) {
|
for (Card c : AllZone.getCardFactory()) {
|
||||||
String url = c.getSVar("Picture");
|
cList.addAll(createDLObjects(c,base));
|
||||||
String[] URLs = url.split("\\\\");
|
if(c.hasAlternateState()) {
|
||||||
|
c.changeState();
|
||||||
String iName = GuiDisplayUtil.cleanString(c.getImageName());
|
cList.addAll(createDLObjects(c,base));
|
||||||
cList.add(new DownloadObject(iName + ".jpg", URLs[0], base));
|
|
||||||
|
|
||||||
if (URLs.length > 1) {
|
|
||||||
for (int j = 1; j < URLs.length; j++) {
|
|
||||||
cList.add(new DownloadObject(iName + j + ".jpg", URLs[j], base));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,4 +78,22 @@ public class Gui_DownloadPictures_LQ extends GuiDownloader {
|
|||||||
return out;
|
return out;
|
||||||
} //getNeededImages()
|
} //getNeededImages()
|
||||||
|
|
||||||
|
private List<DownloadObject> createDLObjects(final Card c,final String base) {
|
||||||
|
ArrayList<DownloadObject> ret = new ArrayList<DownloadObject>();
|
||||||
|
|
||||||
|
String url = c.getSVar("Picture");
|
||||||
|
String[] URLs = url.split("\\\\");
|
||||||
|
|
||||||
|
String iName = GuiDisplayUtil.cleanString(c.getImageName());
|
||||||
|
ret.add(new DownloadObject(iName + ".jpg", URLs[0], base));
|
||||||
|
|
||||||
|
if (URLs.length > 1) {
|
||||||
|
for (int j = 1; j < URLs.length; j++) {
|
||||||
|
ret.add(new DownloadObject(iName + j + ".jpg", URLs[j], base));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user