mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
- Added a preference to support enabling/disabling foil overlay display in GUI.
- Tied the card panel foil display to the user preference setting.
This commit is contained in:
@@ -75,6 +75,7 @@ public enum CSubmenuPreferences implements ICDoc {
|
||||
lstControls.add(Pair.of(view.getCbSingletons(), FPref.DECKGEN_SINGLETONS));
|
||||
lstControls.add(Pair.of(view.getCbUploadDraft(), FPref.UI_UPLOAD_DRAFT));
|
||||
lstControls.add(Pair.of(view.getCbEnableAICheats(), FPref.UI_ENABLE_AI_CHEATS));
|
||||
lstControls.add(Pair.of(view.getCbDisplayFoil(), FPref.UI_OVERLAY_FOIL_EFFECT));
|
||||
lstControls.add(Pair.of(view.getCbRandomFoil(), FPref.UI_RANDOM_FOIL));
|
||||
lstControls.add(Pair.of(view.getCbEnableSounds(), FPref.UI_ENABLE_SOUNDS));
|
||||
lstControls.add(Pair.of(view.getCbAltSoundSystem(), FPref.UI_ALT_SOUND_SYSTEM));
|
||||
|
||||
@@ -76,6 +76,7 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
||||
private final JCheckBox cbEnforceDeckLegality = new OptionsCheckBox("Deck Conformance");
|
||||
private final JCheckBox cbCloneImgSource = new OptionsCheckBox("Clones Use Original Card Art");
|
||||
private final JCheckBox cbScaleLarger = new OptionsCheckBox("Scale Image Larger");
|
||||
private final JCheckBox cbDisplayFoil = new OptionsCheckBox("Display Foil Overlay");
|
||||
private final JCheckBox cbRandomFoil = new OptionsCheckBox("Random Foil");
|
||||
private final JCheckBox cbRandomArtInPools = new OptionsCheckBox("Randomize Card Art in Generated Card Pools");
|
||||
private final JCheckBox cbEnableSounds = new OptionsCheckBox("Enable Sounds");
|
||||
@@ -185,6 +186,9 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
||||
// Graphic Options
|
||||
pnlPrefs.add(new SectionLabel("Graphic Options"), sectionConstraints + ", gaptop 2%");
|
||||
|
||||
pnlPrefs.add(cbDisplayFoil, regularConstraints);
|
||||
pnlPrefs.add(new NoteLabel("Displays foil cards with the visual foil overlay effect."), regularConstraints);
|
||||
|
||||
pnlPrefs.add(cbRandomFoil, regularConstraints);
|
||||
pnlPrefs.add(new NoteLabel("Adds foiled effects to random cards."), regularConstraints);
|
||||
|
||||
@@ -421,6 +425,11 @@ public enum VSubmenuPreferences implements IVSubmenu<CSubmenuPreferences> {
|
||||
return cbEnableAICheats;
|
||||
}
|
||||
|
||||
/** @return {@link javax.swing.JCheckBox} */
|
||||
public JCheckBox getCbDisplayFoil() {
|
||||
return cbDisplayFoil;
|
||||
}
|
||||
|
||||
/** @return {@link javax.swing.JCheckBox} */
|
||||
public JCheckBox getCbRandomFoil() {
|
||||
return cbRandomFoil;
|
||||
|
||||
@@ -22,9 +22,11 @@ import java.awt.image.BufferedImage;
|
||||
import java.awt.image.ColorModel;
|
||||
|
||||
import forge.ImageCache;
|
||||
import forge.Singletons;
|
||||
import forge.card.CardCharacteristicName;
|
||||
import forge.game.card.Card;
|
||||
import forge.gui.toolbox.CardFaceSymbols;
|
||||
import forge.properties.ForgePreferences;
|
||||
|
||||
/**
|
||||
* Common image-related routines specific to Forge images.
|
||||
@@ -65,6 +67,10 @@ public final class FImageUtil {
|
||||
* Applies a foil effect to a card image.
|
||||
*/
|
||||
private static BufferedImage getImageWithFoilEffect(BufferedImage plainImage, int foilIndex) {
|
||||
if (!Singletons.getModel().getPreferences().getPrefBoolean(ForgePreferences.FPref.UI_OVERLAY_FOIL_EFFECT)) {
|
||||
return plainImage;
|
||||
}
|
||||
|
||||
ColorModel cm = plainImage.getColorModel();
|
||||
BufferedImage foilImage = new BufferedImage(cm, plainImage.copyData(null), cm.isAlphaPremultiplied(), null);
|
||||
final String fl = String.format("foil%02d", foilIndex);
|
||||
|
||||
Reference in New Issue
Block a user