mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
Add highlights to rendered card title and card type round boxes
This commit is contained in:
parent
2720949440
commit
37fc07a256
2 changed files with 22 additions and 2 deletions
|
@ -68,6 +68,11 @@ public final class CardRendererUtils {
|
|||
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.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
|
||||
|
|
|
@ -124,7 +124,6 @@ public final class ImageCache {
|
|||
if (exists) {
|
||||
LOGGER.debug("loading thumbnail for " + key + ", path=" + thumbnailPath);
|
||||
BufferedImage thumbnailImage = loadImage(thumbnailFile);
|
||||
|
||||
if (thumbnailImage == null) { // thumbnail exists but broken for some reason
|
||||
LOGGER.warn("failed loading thumbnail for " + key + ", path=" + thumbnailPath
|
||||
+ ", 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) {
|
||||
return getImage(getKey(card, card.getName(), "#thumb"));
|
||||
}
|
||||
|
@ -464,7 +480,6 @@ public final class ImageCache {
|
|||
// return alternateName + "#" + card.getExpansionSetCode() + "#" +card.getType()+ "#" + card.getCardNumber() + "#"
|
||||
// + (card.getTokenSetCode() == null ? "":card.getTokenSetCode());
|
||||
// }
|
||||
|
||||
/**
|
||||
* Load image from file
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue