mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
- Change CardDetailPanel to use Card.getManaDisplay() to show split cards cost separately
This commit is contained in:
@@ -1631,6 +1631,22 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
public final ManaCost getManaCost() {
|
public final ManaCost getManaCost() {
|
||||||
return this.getCharacteristics().getManaCost();
|
return this.getCharacteristics().getManaCost();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Display for the field <code>manaCost</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @return a {@link java.lang.String} object.
|
||||||
|
*/
|
||||||
|
public final String getManaDisplay() {
|
||||||
|
// If this is a split card, display mana as X / Y. Otherwise, Display it as normal
|
||||||
|
if (this.getRules() != null && this.getRules().getSplitType() == CardSplitType.Split) {
|
||||||
|
return String.format("%s / %s", this.getState(CardCharacteristicName.LeftSplit).getManaCost(),
|
||||||
|
this.getState(CardCharacteristicName.RightSplit).getManaCost());
|
||||||
|
}
|
||||||
|
return this.getCharacteristics().getManaCost().toString();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ public class CardDetailPanel extends FPanel {
|
|||||||
if (card.getManaCost().toString().equals("") || card.isLand()) {
|
if (card.getManaCost().toString().equals("") || card.isLand()) {
|
||||||
this.nameCostLabel.setText(card.getName());
|
this.nameCostLabel.setText(card.getName());
|
||||||
} else {
|
} else {
|
||||||
this.nameCostLabel.setText(card.getName() + " - " + card.getManaCost());
|
this.nameCostLabel.setText(card.getName() + " - " + card.getManaDisplay());
|
||||||
}
|
}
|
||||||
this.typeLabel.setText(GuiDisplayUtil.formatCardType(card));
|
this.typeLabel.setText(GuiDisplayUtil.formatCardType(card));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user