mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
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:
@@ -97,28 +97,28 @@ public class CardDetailPanel extends SkinnedPanel {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doLayout() {
|
public void doLayout() {
|
||||||
int insets = 3;
|
int insets = 3;
|
||||||
int setInfoWidth = 40;
|
int setInfoWidth = 40;
|
||||||
int x = insets;
|
int x = insets;
|
||||||
int y = insets;
|
int y = insets;
|
||||||
int lineWidth = getWidth() - 2 * insets;
|
int lineWidth = getWidth() - 2 * insets;
|
||||||
int lineHeight = this.nameCostLabel.getPreferredSize().height;
|
int lineHeight = this.nameCostLabel.getPreferredSize().height;
|
||||||
int dy = lineHeight + 1;
|
int dy = lineHeight + 1;
|
||||||
|
|
||||||
this.nameCostLabel.setBounds(x, y, lineWidth, lineHeight);
|
this.nameCostLabel.setBounds(x, y, lineWidth, lineHeight);
|
||||||
y += dy;
|
y += dy;
|
||||||
|
|
||||||
this.typeLabel.setBounds(x, y, lineWidth, lineHeight);
|
this.typeLabel.setBounds(x, y, lineWidth, lineHeight);
|
||||||
y += dy;
|
y += dy;
|
||||||
|
|
||||||
this.idLabel.setBounds(x, y, this.idLabel.getAutoSizeWidth(), lineHeight);
|
this.idLabel.setBounds(x, y, this.idLabel.getAutoSizeWidth(), lineHeight);
|
||||||
this.powerToughnessLabel.setBounds(x, y, lineWidth, 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
|
//+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);
|
this.setInfoLabel.setBounds(x + lineWidth - setInfoWidth + 1, y + 1, setInfoWidth, lineHeight);
|
||||||
y += dy;
|
y += dy;
|
||||||
|
|
||||||
this.scrArea.setBounds(0, y, getWidth(), getHeight() - y);
|
this.scrArea.setBounds(0, y, getWidth(), getHeight() - y);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setItem(InventoryItemFromSet item) {
|
public final void setItem(InventoryItemFromSet item) {
|
||||||
@@ -179,13 +179,13 @@ public class CardDetailPanel extends SkinnedPanel {
|
|||||||
|
|
||||||
if (card.isFaceDown() && !Singletons.getControl().maySeeFaceDownCard(card)) {
|
if (card.isFaceDown() && !Singletons.getControl().maySeeFaceDownCard(card)) {
|
||||||
if (card.isInZone(ZoneType.Battlefield)) {
|
if (card.isInZone(ZoneType.Battlefield)) {
|
||||||
this.nameCostLabel.setText("???");
|
this.nameCostLabel.setText("???");
|
||||||
this.typeLabel.setText("Creature");
|
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
|
else if (Singletons.getControl().mayShowCard(card) || FDialog.isModalOpen()) { //allow showing cards while modal open to account for revealing, picking, and ordering cards
|
||||||
canShowThis = true;
|
canShowThis = true;
|
||||||
|
|
||||||
if (card.getManaCost().isNoCost()) {
|
if (card.getManaCost().isNoCost()) {
|
||||||
this.nameCostLabel.setText(card.getName());
|
this.nameCostLabel.setText(card.getName());
|
||||||
}
|
}
|
||||||
@@ -197,7 +197,7 @@ public class CardDetailPanel extends SkinnedPanel {
|
|||||||
this.nameCostLabel.setText(FSkin.encodeSymbols(card.getName() + " - " + manaCost, true));
|
this.nameCostLabel.setText(FSkin.encodeSymbols(card.getName() + " - " + manaCost, true));
|
||||||
}
|
}
|
||||||
this.typeLabel.setText(CardDetailUtil.formatCardType(card));
|
this.typeLabel.setText(CardDetailUtil.formatCardType(card));
|
||||||
|
|
||||||
String set = card.getCurSetCode();
|
String set = card.getCurSetCode();
|
||||||
this.setInfoLabel.setText(set);
|
this.setInfoLabel.setText(set);
|
||||||
if (null != set && !set.isEmpty()) {
|
if (null != set && !set.isEmpty()) {
|
||||||
@@ -250,6 +250,12 @@ public class CardDetailPanel extends SkinnedPanel {
|
|||||||
// fill the card text
|
// fill the card text
|
||||||
this.cdArea.setText(FSkin.encodeSymbols(CardDetailUtil.composeCardText(card, canShowThis), true));
|
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() {
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|||||||
Reference in New Issue
Block a user