Merge branch 'token-artwork' into 'master'

Token artwork

See merge request core-developers/forge!214
This commit is contained in:
Sol
2018-02-18 03:08:38 +00:00

View File

@@ -119,13 +119,22 @@ public final class ImageKeys {
if (file != null) { return file; }
}
// try without set name
if (dir.equals(CACHE_TOKEN_PICS_DIR)) {
int index = filename.lastIndexOf('_');
if (index != -1) {
String setlessFilename = filename.substring(0, index);
String setCode = filename.substring(index + 1, filename.length());
// try with upper case set
file = findFile(dir, setlessFilename + "_" + setCode.toUpperCase());
if (file != null) { return file; }
// try without set name
file = findFile(dir, setlessFilename);
if (file != null) { return file; }
// if there's an art variant try without it
if (setlessFilename.matches(".*[0-9]*$")) {
file = findFile(dir, setlessFilename.replaceAll("[0-9]*$", ""));
if (file != null) { return file; }
}
}
} else if (filename.contains("/")) {
String setlessFilename = filename.substring(filename.indexOf('/') + 1);