mirror of
https://github.com/correl/mage.git
synced 2025-01-13 19:11:33 +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");
|
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
|
// Title Text
|
||||||
titleText = new GlowText();
|
titleText = new GlowText();
|
||||||
|
|
|
@ -187,7 +187,7 @@ public final class ImageCache {
|
||||||
String path;
|
String path;
|
||||||
if (collectorId.isEmpty() || "0".equals(collectorId)) {
|
if (collectorId.isEmpty() || "0".equals(collectorId)) {
|
||||||
info.setToken(true);
|
info.setToken(true);
|
||||||
path = CardImageUtils.generateTokenImagePath(info);
|
path = CardImageUtils.generateFullTokenImagePath(info);
|
||||||
if (path == null) {
|
if (path == null) {
|
||||||
path = DirectLinksForDownload.outDir + File.separator + DirectLinksForDownload.cardbackFilename;
|
path = DirectLinksForDownload.outDir + File.separator + DirectLinksForDownload.cardbackFilename;
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,6 +49,19 @@ public final class CardImageUtils {
|
||||||
return null;
|
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) {
|
private static String getTokenImagePath(CardDownloadData card) {
|
||||||
String filename = generateImagePath(card);
|
String filename = generateImagePath(card);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue