- A somewhat better temporary solution for the issue with foils: will now fully randomize the foil overlays inside the game (where there is no problem with them), but still set the default foil overlay of 1 for the deck editors (where the foil overlays "flicker" in case of randomization).

This commit is contained in:
Agetian
2014-09-30 18:08:04 +00:00
parent 5eaa5733df
commit ca2db87d6c
2 changed files with 16 additions and 2 deletions

View File

@@ -3,6 +3,7 @@ package forge.itemmanager.views;
import forge.ImageCache;
import forge.assets.FSkinProp;
import forge.deck.DeckProxy;
import forge.game.card.Card;
import forge.gui.framework.ILocalRepaint;
import forge.item.IPaperCard;
import forge.item.InventoryItem;
@@ -1102,7 +1103,13 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
if (paperCard.isFoil()) {
final CardView card = ViewUtil.getCardForUi(paperCard);
if (card.getOriginal().getFoilIndex() == 0) { //if foil finish not yet established, assign a random one
card.getOriginal().setFoilIndex(1); // FIXME should assign a random foil here
// FIXME should assign a random foil here in all cases
// (currently assigns 1 for the deck editors where foils "flicker" otherwise)
if (item instanceof Card) {
card.getOriginal().setRandomFoil();
} else if (item instanceof IPaperCard) {
card.getOriginal().setFoilIndex(1);
}
}
CardPanel.drawFoilEffect(g, card, bounds.x, bounds.y, bounds.width, bounds.height, borderSize);
}

View File

@@ -24,6 +24,7 @@ import java.awt.event.MouseWheelListener;
import javax.swing.JLabel;
import forge.UiCommand;
import forge.game.card.Card;
import forge.gui.CardPicturePanel;
import forge.gui.framework.ICDoc;
import forge.item.IPaperCard;
@@ -84,7 +85,13 @@ public enum CPicture implements ICDoc {
final IPaperCard paperCard = ((IPaperCard)item);
final CardView c = ViewUtil.getCardForUi(paperCard);
if (paperCard.isFoil() && c.getOriginal().getFoilIndex() == 0) {
c.getOriginal().setFoilIndex(1); // FIXME should assign random foil here
// FIXME should assign a random foil here in all cases
// (currently assigns 1 for the deck editors where foils "flicker" otherwise)
if (item instanceof Card) {
c.getOriginal().setRandomFoil();
} else if (item instanceof IPaperCard) {
c.getOriginal().setFoilIndex(1);
}
}
showCard(c, false);
} else {