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