mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
fixes backside picture assignment
flip card method simplified
This commit is contained in:
@@ -253,11 +253,13 @@ public class CardFactory {
|
||||
if (c.hasAlternateState()) {
|
||||
if (c.isFlipCard()) {
|
||||
c.setState(CardCharacteristicName.Flipped);
|
||||
c.setImageFilename(originalPicture); // should assign a 180 degrees rotated picture here?
|
||||
}
|
||||
if (c.isDoubleFaced()) {
|
||||
else if (c.isDoubleFaced()) {
|
||||
c.setState(CardCharacteristicName.Transformed);
|
||||
c.setImageFilename(CardUtil.buildFilename(cp, cp.getRules().getOtherPart().getName()));
|
||||
}
|
||||
if (c.getRules().getSplitType() == CardSplitType.Split) {
|
||||
else if (c.getRules().getSplitType() == CardSplitType.Split) {
|
||||
c.setState(CardCharacteristicName.LeftSplit);
|
||||
c.setImageFilename(originalPicture);
|
||||
c.setCurSetCode(cp.getEdition());
|
||||
@@ -267,6 +269,8 @@ public class CardFactory {
|
||||
} else {
|
||||
c.setImageFilename(CardUtil.buildFilename(c));
|
||||
}
|
||||
|
||||
|
||||
c.setCurSetCode(cp.getEdition());
|
||||
c.setRarity(cp.getRarity());
|
||||
c.setState(CardCharacteristicName.Original);
|
||||
|
||||
@@ -28,8 +28,6 @@ import javax.swing.JPanel;
|
||||
|
||||
import forge.Card;
|
||||
import forge.ImageCache;
|
||||
import forge.item.CardPrinted;
|
||||
import forge.item.IPaperCard;
|
||||
import forge.item.InventoryItem;
|
||||
import forge.view.arcane.ScaledImagePanel;
|
||||
|
||||
@@ -40,7 +38,7 @@ import forge.view.arcane.ScaledImagePanel;
|
||||
* @author Clemens Koza
|
||||
* @version V0.0 17.02.2010
|
||||
*/
|
||||
public final class CardPicturePanel extends JPanel implements CardContainer {
|
||||
public final class CardPicturePanel extends JPanel {
|
||||
/** Constant <code>serialVersionUID=-3160874016387273383L</code>. */
|
||||
private static final long serialVersionUID = -3160874016387273383L;
|
||||
|
||||
@@ -76,7 +74,7 @@ public final class CardPicturePanel extends JPanel implements CardContainer {
|
||||
update();
|
||||
}
|
||||
|
||||
@Override
|
||||
//@Override
|
||||
public void setCard(final Card c) {
|
||||
this.displayed = c;
|
||||
update();
|
||||
@@ -99,12 +97,4 @@ public final class CardPicturePanel extends JPanel implements CardContainer {
|
||||
this.panel.repaint();
|
||||
}
|
||||
}
|
||||
|
||||
public Card getCard() {
|
||||
if ( displayed instanceof Card )
|
||||
return (Card)displayed;
|
||||
if ( displayed instanceof CardPrinted )
|
||||
return ((IPaperCard)displayed).getMatchingForgeCard();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,8 @@ import javax.swing.JFileChooser;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.border.Border;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import com.google.common.base.Predicates;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
@@ -618,7 +620,9 @@ public final class GuiDisplayUtil {
|
||||
c.setCurSetCode(c.getMostRecentSet());
|
||||
}
|
||||
|
||||
c.setImageFilename(CardUtil.buildFilename(c));
|
||||
if (StringUtils.isBlank(c.getImageFilename()))
|
||||
c.setImageFilename(CardUtil.buildFilename(c));
|
||||
|
||||
cl.add(c);
|
||||
}
|
||||
return cl;
|
||||
|
||||
@@ -104,18 +104,17 @@ public enum CPicture implements ICDoc {
|
||||
/** */
|
||||
public void flipCard() {
|
||||
flipped = !flipped;
|
||||
Card cd = VPicture.SINGLETON_INSTANCE.getPnlPicture().getCard();
|
||||
if ( null == cd ) return;
|
||||
if ( null == currentCard ) return;
|
||||
|
||||
CardCharacteristicName newState = flipped && cd.isDoubleFaced() ? CardCharacteristicName.Transformed : CardCharacteristicName.Original;
|
||||
CardCharacteristicName oldState = cd.getCurState();
|
||||
CardCharacteristicName newState = flipped && currentCard.isDoubleFaced() ? CardCharacteristicName.Transformed : CardCharacteristicName.Original;
|
||||
CardCharacteristicName oldState = currentCard.getCurState();
|
||||
if ( oldState != newState ) {
|
||||
cd.setState(newState);
|
||||
currentCard.setState(newState);
|
||||
}
|
||||
CDetail.SINGLETON_INSTANCE.showCard(this.currentCard);
|
||||
VPicture.SINGLETON_INSTANCE.getPnlPicture().setImage();
|
||||
if ( oldState != newState ) {
|
||||
cd.setState(oldState);
|
||||
currentCard.setState(oldState);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user