Add highlights to rendered card title and card type round boxes

This commit is contained in:
spjspj 2017-11-23 23:44:51 +11:00
parent 2720949440
commit 37fc07a256
2 changed files with 22 additions and 2 deletions

View file

@ -68,6 +68,11 @@ public final class CardRendererUtils {
g.fillOval(x + 2, y + 2, bevel * 2 - 4, h - 4); g.fillOval(x + 2, y + 2, bevel * 2 - 4, h - 4);
g.fillOval(x + 2 + w - bevel * 2, y + 2, bevel * 2 - 4, h - 4); g.fillOval(x + 2 + w - bevel * 2, y + 2, bevel * 2 - 4, h - 4);
g.fillRect(x + bevel, y + 2, w - 2 * bevel, h - 4); g.fillRect(x + bevel, y + 2, w - 2 * bevel, h - 4);
g.setPaint(border);
g.setColor(g.getColor().brighter().brighter());
g.drawLine(x + 1 + bevel, y + 1, x + 1 + bevel + w - 2 * bevel - 2, y + 1);
g.setColor(g.getColor().darker().darker());
g.drawLine(x + 1 + bevel, y + h - 2, x + 1 + bevel + w - 2 * bevel - 2, y + h - 2);
} }
// Get the width of a mana cost rendered with ManaSymbols.draw // Get the width of a mana cost rendered with ManaSymbols.draw

View file

@ -124,7 +124,6 @@ public final class ImageCache {
if (exists) { if (exists) {
LOGGER.debug("loading thumbnail for " + key + ", path=" + thumbnailPath); LOGGER.debug("loading thumbnail for " + key + ", path=" + thumbnailPath);
BufferedImage thumbnailImage = loadImage(thumbnailFile); BufferedImage thumbnailImage = loadImage(thumbnailFile);
if (thumbnailImage == null) { // thumbnail exists but broken for some reason if (thumbnailImage == null) { // thumbnail exists but broken for some reason
LOGGER.warn("failed loading thumbnail for " + key + ", path=" + thumbnailPath LOGGER.warn("failed loading thumbnail for " + key + ", path=" + thumbnailPath
+ ", thumbnail file is probably broken, attempting to recreate it..."); + ", thumbnail file is probably broken, attempting to recreate it...");
@ -361,6 +360,23 @@ public final class ImageCache {
} }
} }
public static boolean isFaceImagePresent(CardView card) {
String path;
path = CardImageUtils.generateFaceImagePath(card.getName(), card.getExpansionSetCode());
if (path == null) {
return false;
}
TFile file = getTFile(path);
if (file == null) {
return false;
}
if (file.exists()) {
return true;
}
return false;
}
public static BufferedImage getThumbnail(CardView card) { public static BufferedImage getThumbnail(CardView card) {
return getImage(getKey(card, card.getName(), "#thumb")); return getImage(getKey(card, card.getName(), "#thumb"));
} }
@ -464,7 +480,6 @@ public final class ImageCache {
// return alternateName + "#" + card.getExpansionSetCode() + "#" +card.getType()+ "#" + card.getCardNumber() + "#" // return alternateName + "#" + card.getExpansionSetCode() + "#" +card.getType()+ "#" + card.getCardNumber() + "#"
// + (card.getTokenSetCode() == null ? "":card.getTokenSetCode()); // + (card.getTokenSetCode() == null ? "":card.getTokenSetCode());
// } // }
/** /**
* Load image from file * Load image from file
* *