- Support foiling XLHQ card images.

This commit is contained in:
Agetian
2015-01-13 17:55:36 +00:00
parent 22c6f99af8
commit c9e4dd9ffc
2 changed files with 8 additions and 2 deletions

View File

@@ -60,7 +60,7 @@ public final class FImageUtil {
/**
* Applies a foil effect to a card image.
*/
private static BufferedImage getImageWithFoilEffect(BufferedImage plainImage, int foilIndex) {
public static BufferedImage getImageWithFoilEffect(BufferedImage plainImage, int foilIndex) {
if (!FModel.getPreferences().getPrefBoolean(ForgePreferences.FPref.UI_OVERLAY_FOIL_EFFECT)) {
return plainImage;
}

View File

@@ -251,6 +251,7 @@ public enum CardZoomer {
}
File file = ImageKeys.getImageFile(imageKey);
BufferedImage img = null;
if (file != null) {
Path path = file.toPath();
@@ -265,7 +266,12 @@ public enum CardZoomer {
if (xlhqFile != null && xlhqFile.exists()) {
try {
return ImageIO.read(xlhqFile);
img = ImageIO.read(xlhqFile);
final int foilIndex = thisCard.getCurrentState().getFoilIndex();
if (img != null && foilIndex > 0) {
img = FImageUtil.getImageWithFoilEffect(img, foilIndex);
}
return img;
} catch (IOException ex) {
System.err.println("IO exception caught when trying to open a XLHQ image: " + xlhqFile.getName());
}