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.

This commit is contained in:
Krazy
2014-09-13 23:18:23 +00:00
parent 20ef2a9d27
commit 2544d5c8f5

View File

@@ -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,8 +179,8 @@ 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
@@ -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() {