mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
A hardcode to use cards from 6ED whenever S00 card is not found
This commit is contained in:
@@ -32,14 +32,14 @@ final class ImageLoader extends CacheLoader<String, BufferedImage> {
|
|||||||
path = ForgeProps.getFile(NewConstants.IMAGE_BASE);
|
path = ForgeProps.getFile(NewConstants.IMAGE_BASE);
|
||||||
}
|
}
|
||||||
|
|
||||||
File file = null;
|
File file = makeImageFile(path, filename);
|
||||||
boolean isPng = filename.endsWith(".png");
|
boolean fileExists = file.exists();
|
||||||
final String fName = isPng || filename.endsWith(".jpg") ? filename : filename + ".jpg";
|
if (!fileExists && filename.startsWith("S00") ) {
|
||||||
file = new File(path, fName);
|
file = makeImageFile(path, filename.replace("S00", "6ED"));
|
||||||
if (!file.exists()) {
|
fileExists = file.exists();
|
||||||
// DEBUG
|
}
|
||||||
//System.out.println("File not found, no image created: "
|
if (!fileExists ) {
|
||||||
//+ file);
|
//System.out.println("File not found, no image created: " + file);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final BufferedImage image = getImage(file);
|
final BufferedImage image = getImage(file);
|
||||||
@@ -47,6 +47,18 @@ final class ImageLoader extends CacheLoader<String, BufferedImage> {
|
|||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TODO: Write javadoc for this method.
|
||||||
|
* @param path
|
||||||
|
* @param filename
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private File makeImageFile(File path, String filename) {
|
||||||
|
boolean isPng = filename.endsWith(".png");
|
||||||
|
final String fName = isPng || filename.endsWith(".jpg") ? filename : filename + ".jpg";
|
||||||
|
return new File(path, fName);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* getImage.
|
* getImage.
|
||||||
|
|||||||
Reference in New Issue
Block a user