mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
fix backface not generating if art is missing
This commit is contained in:
@@ -203,7 +203,8 @@ public class RewardActor extends Actor implements Disposable, ImageFetcher.Callb
|
||||
}
|
||||
ImageCache.updateSynqCount(frontFace, count);
|
||||
//preload card back for performance
|
||||
if (hasbackface && ImageCache.imageKeyFileExists(reward.getCard().getImageKey(true))) {
|
||||
if (hasbackface) {
|
||||
if (ImageCache.imageKeyFileExists(reward.getCard().getImageKey(true))) {
|
||||
PaperCard cardBack = ImageUtil.getPaperCardFromImageKey(reward.getCard().getImageKey(true));
|
||||
File backFace = ImageKeys.getImageFile(cardBack.getCardAltImageKey());
|
||||
if (backFace != null) {
|
||||
@@ -238,6 +239,21 @@ public class RewardActor extends Actor implements Disposable, ImageFetcher.Callb
|
||||
System.err.println("Failed to load image: " + backFace.getPath());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
if (holdTooltip != null) {
|
||||
if (Talt == null)
|
||||
Talt = renderPlaceholder(new Graphics(), reward.getCard(), true);
|
||||
if (holdTooltip.tooltip_actor.getChildren().size <= 2) {
|
||||
holdTooltip.tooltip_actor.altcImage = new RewardImage(processDrawable(Talt));
|
||||
holdTooltip.tooltip_actor.addActorAt(2, holdTooltip.tooltip_actor.altcImage);
|
||||
holdTooltip.tooltip_actor.swapActor(holdTooltip.tooltip_actor.altcImage, holdTooltip.tooltip_actor.cImage);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.err.println("Failed to load alternate image: " + reward.getCard());
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
String imagePath = ImageUtil.getImageRelativePath(reward.getCard(), "", true, false);
|
||||
|
||||
Reference in New Issue
Block a user