Fix token related crash

This commit is contained in:
Lyu Zong-Hong
2021-08-02 14:29:53 +09:00
parent 7a615c3a7c
commit 1cd8255ab6
2 changed files with 0 additions and 25 deletions

View File

@@ -6,7 +6,6 @@ import forge.card.CardDb;
import forge.card.CardRules;
import forge.card.CardSplitType;
import forge.item.PaperCard;
import forge.item.PaperToken;
public class ImageUtil {
public static float getNearestHQSize(float baseSize, float actualSize) {
@@ -30,28 +29,6 @@ public class ImageUtil {
return cp;
}
public static PaperToken getPaperTokenFromImageKey(String key) {
if ( key == null ) {
return null;
}
key = key.substring(2);
int index = key.lastIndexOf('_');
if (index != -1) {
String script = key.substring(0, index);
String edition = key.substring(index + 1);
if (script.startsWith("emblem"))
return null;
if (null == StaticData.instance().getCardEdition(edition)) {
script = key;
edition = "???";
}
script = script.replaceAll("[0-9]*$", "");
return StaticData.instance().getAllTokens().getToken(script, edition);
}
return null;
}
public static String getImageRelativePath(PaperCard cp, boolean backFace, boolean includeSet, boolean isDownloadUrl) {
final String nameToUse = cp == null ? null : getNameToUse(cp, backFace);
if (nameToUse == null) {

View File

@@ -165,8 +165,6 @@ public class ImageCache {
if (StringUtils.isBlank(imageKey)) {
return _defaultImage;
}
} else if (imageKey.startsWith(ImageKeys.TOKEN_PREFIX) && cardView != null && cardView.isToken()) {
ipc = ImageUtil.getPaperTokenFromImageKey(imageKey);
}
// Load from file and add to cache if not found in cache initially.