mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Add option to preferences to display full path to image of cards missing images.
This commit is contained in:
parent
78c5bf341c
commit
ed429b0c37
3 changed files with 15 additions and 2 deletions
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue