mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
- Support foiling XLHQ card images.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user