mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
- Change CardDetailPanel to use Card.getManaDisplay() to show split cards cost separately
This commit is contained in:
@@ -1632,6 +1632,22 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
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>
|
||||
* addColor.
|
||||
|
||||
@@ -205,7 +205,7 @@ public class CardDetailPanel extends FPanel {
|
||||
if (card.getManaCost().toString().equals("") || card.isLand()) {
|
||||
this.nameCostLabel.setText(card.getName());
|
||||
} else {
|
||||
this.nameCostLabel.setText(card.getName() + " - " + card.getManaCost());
|
||||
this.nameCostLabel.setText(card.getName() + " - " + card.getManaDisplay());
|
||||
}
|
||||
this.typeLabel.setText(GuiDisplayUtil.formatCardType(card));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user