From 2544d5c8f501203fcd7b4596eabfafcf67e1363d Mon Sep 17 00:00:00 2001 From: Krazy Date: Sat, 13 Sep 2014 23:18:23 +0000 Subject: [PATCH] Fixed morphed card text not showing up in details panel with Lens of Clarity on the battlefield. Added reminder to the details panel that morphed cards can be looked at when you control a Lens of Clarity. --- .../main/java/forge/gui/CardDetailPanel.java | 48 +++++++++++-------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/forge-gui-desktop/src/main/java/forge/gui/CardDetailPanel.java b/forge-gui-desktop/src/main/java/forge/gui/CardDetailPanel.java index ade7ed65b88..2eba10b421c 100644 --- a/forge-gui-desktop/src/main/java/forge/gui/CardDetailPanel.java +++ b/forge-gui-desktop/src/main/java/forge/gui/CardDetailPanel.java @@ -97,28 +97,28 @@ public class CardDetailPanel extends SkinnedPanel { @Override public void doLayout() { - int insets = 3; - int setInfoWidth = 40; - int x = insets; - int y = insets; - int lineWidth = getWidth() - 2 * insets; - int lineHeight = this.nameCostLabel.getPreferredSize().height; - int dy = lineHeight + 1; + int insets = 3; + int setInfoWidth = 40; + int x = insets; + int y = insets; + int lineWidth = getWidth() - 2 * insets; + int lineHeight = this.nameCostLabel.getPreferredSize().height; + int dy = lineHeight + 1; - this.nameCostLabel.setBounds(x, y, lineWidth, lineHeight); - y += dy; + this.nameCostLabel.setBounds(x, y, lineWidth, lineHeight); + y += dy; - this.typeLabel.setBounds(x, y, lineWidth, lineHeight); - y += dy; + this.typeLabel.setBounds(x, y, lineWidth, lineHeight); + y += dy; - this.idLabel.setBounds(x, y, this.idLabel.getAutoSizeWidth(), lineHeight); - this.powerToughnessLabel.setBounds(x, y, lineWidth, lineHeight); + this.idLabel.setBounds(x, y, this.idLabel.getAutoSizeWidth(), lineHeight); + this.powerToughnessLabel.setBounds(x, y, lineWidth, lineHeight); - //+1 to x,y so set info label right up against border and the baseline matches ID and P/T - this.setInfoLabel.setBounds(x + lineWidth - setInfoWidth + 1, y + 1, setInfoWidth, lineHeight); - y += dy; + //+1 to x,y so set info label right up against border and the baseline matches ID and P/T + this.setInfoLabel.setBounds(x + lineWidth - setInfoWidth + 1, y + 1, setInfoWidth, lineHeight); + y += dy; - this.scrArea.setBounds(0, y, getWidth(), getHeight() - y); + this.scrArea.setBounds(0, y, getWidth(), getHeight() - y); } public final void setItem(InventoryItemFromSet item) { @@ -179,13 +179,13 @@ public class CardDetailPanel extends SkinnedPanel { if (card.isFaceDown() && !Singletons.getControl().maySeeFaceDownCard(card)) { if (card.isInZone(ZoneType.Battlefield)) { - this.nameCostLabel.setText("???"); - this.typeLabel.setText("Creature"); + this.nameCostLabel.setText("???"); + this.typeLabel.setText("Creature"); } } else if (Singletons.getControl().mayShowCard(card) || FDialog.isModalOpen()) { //allow showing cards while modal open to account for revealing, picking, and ordering cards canShowThis = true; - + if (card.getManaCost().isNoCost()) { this.nameCostLabel.setText(card.getName()); } @@ -197,7 +197,7 @@ public class CardDetailPanel extends SkinnedPanel { this.nameCostLabel.setText(FSkin.encodeSymbols(card.getName() + " - " + manaCost, true)); } this.typeLabel.setText(CardDetailUtil.formatCardType(card)); - + String set = card.getCurSetCode(); this.setInfoLabel.setText(set); if (null != set && !set.isEmpty()) { @@ -250,6 +250,12 @@ public class CardDetailPanel extends SkinnedPanel { // fill the card text this.cdArea.setText(FSkin.encodeSymbols(CardDetailUtil.composeCardText(card, canShowThis), true)); + if (card.isFaceDown() && card.isInZone(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() {