mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
Some minor GUI fixes, amongst which fixes for Morph display and Ponder effects.
This commit is contained in:
@@ -33,7 +33,6 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import forge.card.CardDetailUtil;
|
||||
import forge.card.CardDetailUtil.DetailColors;
|
||||
import forge.card.CardEdition;
|
||||
import forge.game.zone.ZoneType;
|
||||
import forge.item.IPaperCard;
|
||||
import forge.item.InventoryItemFromSet;
|
||||
import forge.model.FModel;
|
||||
@@ -246,12 +245,6 @@ public class CardDetailPanel extends SkinnedPanel {
|
||||
// fill the card text
|
||||
this.cdArea.setText(FSkin.encodeSymbols(CardDetailUtil.composeCardText(state), true));
|
||||
|
||||
if (card.isFaceDown() && card.getZone() == ZoneType.Battlefield) {
|
||||
this.nameCostLabel.setText("???");
|
||||
this.typeLabel.setText("Creature");
|
||||
this.cdArea.setText(FSkin.encodeSymbols("(You may look at this card.)", true));
|
||||
}
|
||||
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
@@ -30,6 +30,7 @@ import forge.toolbox.FList;
|
||||
import forge.toolbox.FPanel;
|
||||
import forge.toolbox.FScrollPane;
|
||||
import forge.view.CardView;
|
||||
import forge.view.CardView.CardStateView;
|
||||
import forge.view.FDialog;
|
||||
import forge.view.SpellAbilityView;
|
||||
import forge.view.ViewUtil;
|
||||
@@ -328,6 +329,8 @@ public class DualListBox<T> extends FDialog {
|
||||
CardView card = null;
|
||||
if (obj instanceof CardView) {
|
||||
card = (CardView) obj;
|
||||
} else if (obj instanceof CardStateView) {
|
||||
card = ((CardStateView) obj).getCard();
|
||||
} else if (obj instanceof SpellAbilityView) {
|
||||
card = ((SpellAbilityView) obj).getHostCard();
|
||||
} else if (obj instanceof PaperCard) {
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.util.Map.Entry;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.ScrollPaneConstants;
|
||||
|
||||
import com.beust.jcommander.internal.Lists;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import forge.gui.framework.DragCell;
|
||||
|
||||
@@ -326,7 +326,7 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
||||
g2d.fillRoundRect(this.cardXOffset - n, (this.cardYOffset - n) + offset, this.cardWidth + (n * 2), this.cardHeight + (n * 2), cornerSize + n , cornerSize + n);
|
||||
|
||||
// White border if card is known to have it.
|
||||
if (this.getCard() != null && !this.getCard().isFaceDown()) {
|
||||
if (this.getCard() != null) {
|
||||
CardEdition ed = FModel.getMagicDb().getEditions().get(this.getCard().getSetCode());
|
||||
if (ed != null && ed.isWhiteBorder() && this.getCard().getFoilIndex() == 0) {
|
||||
g2d.setColor(Color.white);
|
||||
@@ -797,8 +797,7 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
|
||||
|
||||
private boolean showCardManaCostOverlay() {
|
||||
return isShowingOverlays() &&
|
||||
isPreferenceEnabled(FPref.UI_OVERLAY_CARD_MANA_COST) &&
|
||||
!this.getCard().isFaceDown();
|
||||
isPreferenceEnabled(FPref.UI_OVERLAY_CARD_MANA_COST);
|
||||
}
|
||||
|
||||
private boolean showCardIdOverlay() {
|
||||
|
||||
@@ -710,8 +710,7 @@ public class CardRenderer {
|
||||
|
||||
private static boolean showCardManaCostOverlay(CardView card) {
|
||||
return isShowingOverlays(card) &&
|
||||
isPreferenceEnabled(FPref.UI_OVERLAY_CARD_MANA_COST) &&
|
||||
!card.isFaceDown();
|
||||
isPreferenceEnabled(FPref.UI_OVERLAY_CARD_MANA_COST);
|
||||
}
|
||||
|
||||
private static boolean showCardIdOverlay(CardView card) {
|
||||
|
||||
@@ -573,24 +573,34 @@ public class PlayerControllerHuman extends PlayerController {
|
||||
|
||||
@Override
|
||||
public List<Card> orderMoveToZoneList(List<Card> cards, ZoneType destinationZone) {
|
||||
List<CardView> choices;
|
||||
mayLookAt.addAll(cards);
|
||||
switch (destinationZone) {
|
||||
case Library:
|
||||
return SGuiChoose.order(getGui(), "Choose order of cards to put into the library", "Closest to top", cards, null);
|
||||
choices = SGuiChoose.order(getGui(), "Choose order of cards to put into the library", "Closest to top", getCardViews(cards), null);
|
||||
break;
|
||||
case Battlefield:
|
||||
return SGuiChoose.order(getGui(), "Choose order of cards to put onto the battlefield", "Put first", cards, null);
|
||||
choices = SGuiChoose.order(getGui(), "Choose order of cards to put onto the battlefield", "Put first", getCardViews(cards), null);
|
||||
break;
|
||||
case Graveyard:
|
||||
return SGuiChoose.order(getGui(), "Choose order of cards to put into the graveyard", "Closest to bottom", cards, null);
|
||||
choices = SGuiChoose.order(getGui(), "Choose order of cards to put into the graveyard", "Closest to bottom", getCardViews(cards), null);
|
||||
break;
|
||||
case PlanarDeck:
|
||||
return SGuiChoose.order(getGui(), "Choose order of cards to put into the planar deck", "Closest to top", cards, null);
|
||||
choices = SGuiChoose.order(getGui(), "Choose order of cards to put into the planar deck", "Closest to top", getCardViews(cards), null);
|
||||
break;
|
||||
case SchemeDeck:
|
||||
return SGuiChoose.order(getGui(), "Choose order of cards to put into the scheme deck", "Closest to top", cards, null);
|
||||
choices = SGuiChoose.order(getGui(), "Choose order of cards to put into the scheme deck", "Closest to top", getCardViews(cards), null);
|
||||
break;
|
||||
case Stack:
|
||||
return SGuiChoose.order(getGui(), "Choose order of copies to cast", "Put first", cards, null);
|
||||
choices = SGuiChoose.order(getGui(), "Choose order of copies to cast", "Put first", getCardViews(cards), null);
|
||||
break;
|
||||
default:
|
||||
System.out.println("ZoneType " + destinationZone + " - Not Ordered");
|
||||
break;
|
||||
mayLookAt.clear();
|
||||
return cards;
|
||||
}
|
||||
return cards;
|
||||
mayLookAt.clear();
|
||||
return getCards(choices);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -38,7 +38,6 @@ public class CardView extends GameEntityView {
|
||||
private boolean isCloned, isFaceDown, isFlipCard, isFlipped, isSplitCard, isTransformed;
|
||||
private String setCode;
|
||||
private CardRarity rarity;
|
||||
private long timestamp;
|
||||
private boolean isAttacking, isBlocking, isPhasedOut, isSick, isTapped, isToken;
|
||||
private Map<CounterType, Integer> counters;
|
||||
private int damage, assignedDamage, regenerationShields, preventNextDamage;
|
||||
@@ -80,7 +79,6 @@ public class CardView extends GameEntityView {
|
||||
this.isTransformed = false;
|
||||
this.setCode = StringUtils.EMPTY;
|
||||
this.rarity = CardRarity.Unknown;
|
||||
this.timestamp = 0L;
|
||||
this.isAttacking = this.isBlocking = this.isPhasedOut = this.isSick = this.isTapped = false;
|
||||
this.counters = ImmutableMap.of();
|
||||
this.damage = this.assignedDamage = this.regenerationShields = this.preventNextDamage = 0;
|
||||
@@ -318,20 +316,6 @@ public class CardView extends GameEntityView {
|
||||
this.rarity = rarity;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the timestamp
|
||||
*/
|
||||
public long getTimestamp() {
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param timestamp the timestamp to set
|
||||
*/
|
||||
public void setTimestamp(long timestamp) {
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the isAttacking
|
||||
*/
|
||||
|
||||
@@ -40,7 +40,6 @@ public final class ViewUtil {
|
||||
view.setTransformed(c.getCurState().equals(CardCharacteristicName.Transformed));
|
||||
view.setSetCode(c.getCurSetCode());
|
||||
view.setRarity(c.getRarity());
|
||||
view.setTimestamp(c.getTimestamp());
|
||||
view.setPhasedOut(c.isPhasedOut());
|
||||
view.setSick(c.isInPlay() && c.isSick());
|
||||
view.setTapped(c.isTapped());
|
||||
|
||||
@@ -16,9 +16,13 @@ import forge.util.ITriggerEvent;
|
||||
public class WatchLocalGame extends LocalGameView {
|
||||
|
||||
private final InputQueue inputQueue;
|
||||
|
||||
/**
|
||||
* @param game
|
||||
* the @{link Game} to attach to.
|
||||
* @param inputQueue
|
||||
* the {@link InputQueue} of the game to enable playback
|
||||
* controls, or {@code null} to disallow them.
|
||||
*/
|
||||
public WatchLocalGame(final Game game, final InputQueue inputQueue) {
|
||||
super(game);
|
||||
@@ -40,6 +44,9 @@ public class WatchLocalGame extends LocalGameView {
|
||||
|
||||
@Override
|
||||
public void selectButtonOk() {
|
||||
if (this.inputQueue == null) {
|
||||
return;
|
||||
}
|
||||
final Input i = inputQueue.getInput();
|
||||
if (i instanceof InputPlaybackControl) {
|
||||
i.selectButtonOK();
|
||||
@@ -48,6 +55,9 @@ public class WatchLocalGame extends LocalGameView {
|
||||
|
||||
@Override
|
||||
public void selectButtonCancel() {
|
||||
if (this.inputQueue == null) {
|
||||
return;
|
||||
}
|
||||
final Input i = inputQueue.getInput();
|
||||
if (i instanceof InputPlaybackControl) {
|
||||
i.selectButtonCancel();
|
||||
|
||||
Reference in New Issue
Block a user