mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-13 17:27:46 +00:00
Merge branch 'master' into 'master'
Custom content fixes See merge request core-developers/forge!6437
This commit is contained in:
@@ -227,9 +227,6 @@ public class StaticData {
|
||||
public void attemptToLoadCard(String cardName, String setCode) {
|
||||
CardRules rules = cardReader.attemptToLoadCard(cardName);
|
||||
CardRules customRules = null;
|
||||
if (customCardReader != null) {
|
||||
customRules = customCardReader.attemptToLoadCard(cardName);
|
||||
}
|
||||
if (rules != null) {
|
||||
if (rules.isVariant()) {
|
||||
variantCards.loadCard(cardName, setCode, rules);
|
||||
@@ -237,13 +234,6 @@ public class StaticData {
|
||||
commonCards.loadCard(cardName, setCode, rules);
|
||||
}
|
||||
}
|
||||
if (customRules != null) {
|
||||
if (customRules.isVariant()) {
|
||||
variantCards.loadCard(cardName, setCode, customRules);
|
||||
} else {
|
||||
commonCards.loadCard(cardName, setCode, customRules);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,15 +27,6 @@ public class ImageUtil {
|
||||
return cp;
|
||||
}
|
||||
|
||||
public static PaperToken getPaperTokenFromImageKey(String key) {
|
||||
if (key == null) return null;
|
||||
String[] data = key.split("[_](?=[^_]*$)");
|
||||
if (data.length == 2) {
|
||||
return StaticData.instance().getAllTokens().getToken(data[0], data[1].toUpperCase());
|
||||
}
|
||||
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) {
|
||||
|
||||
@@ -115,8 +115,11 @@ public abstract class ImageFetcher {
|
||||
final String filename = imageKey.substring(2) + ".jpg";
|
||||
String tokenUrl = tokenImages.get(filename);
|
||||
if (tokenUrl == null) {
|
||||
PaperToken T = ImageUtil.getPaperTokenFromImageKey(imageKey.substring(2));
|
||||
if (T.getRules().isCustom()) return; //Custom token, do not fetch image.
|
||||
String[] tempdata = imageKey.split("[_](?=[^_]*$)"); //We want to check the edition first.
|
||||
if(tempdata.length == 2){
|
||||
CardEdition E = StaticData.instance().getEditions().get(tempdata[1]);
|
||||
if (E.getType() == CardEdition.Type.CUSTOM_SET) return; //Custom set token, skip fetching.
|
||||
}
|
||||
System.err
|
||||
.println("No specified file for '" + filename + "'.. Attempting to download from default Url");
|
||||
tokenUrl = String.format("%s%s", ForgeConstants.URL_TOKEN_DOWNLOAD, filename);
|
||||
|
||||
Reference in New Issue
Block a user