mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
Also render tokens and emblems when not using images
This commit is contained in:
@@ -6,6 +6,7 @@ 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) {
|
||||
@@ -29,6 +30,24 @@ 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;
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user