simple manacost display shows split card costs aside

This commit is contained in:
Maxmtg
2013-03-06 16:00:36 +00:00
parent 48dcd5bed4
commit 3a7c0787d6

View File

@@ -36,10 +36,12 @@ import javax.swing.border.EtchedBorder;
import org.apache.commons.lang3.StringUtils;
import forge.Card;
import forge.CardCharacteristicName;
import forge.CounterType;
import forge.GameEntity;
import forge.Singletons;
import forge.card.CardEdition;
import forge.card.CardSplitType;
import forge.game.player.Player;
import forge.game.zone.ZoneType;
import forge.gui.toolbox.FLabel;
@@ -205,9 +207,11 @@ public class CardDetailPanel extends FPanel {
if (card.getManaCost().isNoCost()) {
this.nameCostLabel.setText(card.getName());
} else {
// If you want to make a special view of split cards, keep that special code in this class.
// Better if you make several labels that that draw mana symbols
this.nameCostLabel.setText(card.getName() + " - " + card.getManaCost());
String manaCost = card.getManaCost().toString();
if ( card.getRules() != null && card.getRules().getSplitType() == CardSplitType.Split && card.getCurState() == CardCharacteristicName.Original) {
manaCost = card.getRules().getMainPart().getManaCost().toString() + " // " + card.getRules().getOtherPart().getManaCost().toString();
}
this.nameCostLabel.setText(card.getName() + " - " + manaCost);
}
this.typeLabel.setText(GuiDisplayUtil.formatCardType(card));