Add option to preferences to display full path to image of cards missing images.

This commit is contained in:
spjspj 2017-09-27 16:04:13 +10:00
parent 78c5bf341c
commit ed429b0c37
3 changed files with 15 additions and 2 deletions

View file

@ -222,7 +222,7 @@ public class CardPanelComponentImpl extends CardPanel {
}
displayTitleAnyway = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SHOW_CARD_NAMES, "true").equals("true");
displayFullImagePath = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SHOW_FULL_IMAGE_PATH, "true").equals("true");
displayFullImagePath = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SHOW_FULL_IMAGE_PATH, "false").equals("true");
// Title Text
titleText = new GlowText();

View file

@ -187,7 +187,7 @@ public final class ImageCache {
String path;
if (collectorId.isEmpty() || "0".equals(collectorId)) {
info.setToken(true);
path = CardImageUtils.generateTokenImagePath(info);
path = CardImageUtils.generateFullTokenImagePath(info);
if (path == null) {
path = DirectLinksForDownload.outDir + File.separator + DirectLinksForDownload.cardbackFilename;
}

View file

@ -48,6 +48,19 @@ public final class CardImageUtils {
log.warn("Token image file not found: " + card.getSet() + " - " + card.getTokenSetCode() + " - " + card.getName());
return null;
}
/**
*
* @param card
* @return String regardless of whether image exists
*/
public static String generateFullTokenImagePath(CardDownloadData card) {
if (card.isToken()) {
String filePath = getTokenImagePath(card);
return filePath;
}
return "";
}
private static String getTokenImagePath(CardDownloadData card) {
String filename = generateImagePath(card);