mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Merge branch 'fullborderfixes' into 'master'
Fullborderfixes See merge request core-developers/forge!3533
This commit is contained in:
@@ -167,8 +167,12 @@ public final class ImageKeys {
|
|||||||
file = findFile(dir, setlessFilename);
|
file = findFile(dir, setlessFilename);
|
||||||
if (file != null) { return file; }
|
if (file != null) { return file; }
|
||||||
|
|
||||||
// try lowering the art index to the minimum for regular cards
|
|
||||||
if (setlessFilename.contains(".full")) {
|
if (setlessFilename.contains(".full")) {
|
||||||
|
//try fullborder
|
||||||
|
String fullborderFile = TextUtil.fastReplace(setlessFilename, ".full", ".fullborder");
|
||||||
|
file = findFile(dir, fullborderFile);
|
||||||
|
if (file != null) { return file; }
|
||||||
|
// try lowering the art index to the minimum for regular cards
|
||||||
file = findFile(dir, setlessFilename.replaceAll("[0-9]*[.]full", "1.full"));
|
file = findFile(dir, setlessFilename.replaceAll("[0-9]*[.]full", "1.full"));
|
||||||
if (file != null) { return file; }
|
if (file != null) { return file; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import forge.model.FModel;
|
|||||||
import forge.properties.ForgeConstants;
|
import forge.properties.ForgeConstants;
|
||||||
import forge.util.ImageUtil;
|
import forge.util.ImageUtil;
|
||||||
import forge.util.TextUtil;
|
import forge.util.TextUtil;
|
||||||
|
import forge.ImageKeys;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@@ -63,21 +64,8 @@ public class GuiDownloadPicturesLQ extends GuiDownloadService {
|
|||||||
private void addDLObject(final PaperCard c, final boolean backFace) {
|
private void addDLObject(final PaperCard c, final boolean backFace) {
|
||||||
final String imageKey = ImageUtil.getImageKey(c, backFace, false);
|
final String imageKey = ImageUtil.getImageKey(c, backFace, false);
|
||||||
final String destPath = ForgeConstants.CACHE_CARD_PICS_DIR + imageKey + ".jpg";
|
final String destPath = ForgeConstants.CACHE_CARD_PICS_DIR + imageKey + ".jpg";
|
||||||
final String setcode2 = StaticData.instance().getEditions().getCode2ByCode(c.getEdition());
|
|
||||||
String modifier = !imageKey.contains(".full") ? ".fullborder" : "";
|
|
||||||
final String fullborderPath = ForgeConstants.CACHE_CARD_PICS_DIR + setcode2 + ForgeConstants.PATH_SEPARATOR + TextUtil.fastReplace(imageKey,".full",".fullborder") + modifier + ".jpg";
|
|
||||||
final File existingFB = new File (fullborderPath);
|
|
||||||
final File existingFB2 = new File (TextUtil.fastReplace(fullborderPath, "1.fullborder", ".fullborder"));
|
|
||||||
|
|
||||||
if (existingFB.exists()) {
|
if (ImageKeys.getImageFile(imageKey) != null) {
|
||||||
return; //don't download equivalent full image with an existing fullborder image
|
|
||||||
}
|
|
||||||
|
|
||||||
if (existingFB2.exists()) {
|
|
||||||
return; //check 2
|
|
||||||
}
|
|
||||||
|
|
||||||
if (existingImages.contains(imageKey + ".jpg")) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user