Fix so card type appears properly on card list items

This commit is contained in:
drdev
2014-09-15 22:39:32 +00:00
parent 58c727ed66
commit b2af1be3ea

View File

@@ -268,7 +268,8 @@ public class CardRenderer {
drawCardListItem(g, font, foreColor, getCardArt(card), card, card.getSetCode(), drawCardListItem(g, font, foreColor, getCardArt(card), card, card.getSetCode(),
card.getRarity(), state.getPower(), state.getToughness(), card.getRarity(), state.getPower(), state.getToughness(),
state.getLoyalty(), count, suffix, x, y, w, h, compactMode); state.getLoyalty(), count, suffix, x, y, w, h, compactMode);
} else { //if fake card, just draw card name centered }
else { //if fake card, just draw card name centered
String name = state.getName(); String name = state.getName();
if (count > 0) { //preface name with count if applicable if (count > 0) { //preface name with count if applicable
name = count + " " + name; name = count + " " + name;
@@ -359,7 +360,7 @@ public class CardRenderer {
availableTypeWidth -= setWidth; availableTypeWidth -= setWidth;
drawSetLabel(g, typeFont, set, rarity, x + availableTypeWidth + SET_BOX_MARGIN, y - SET_BOX_MARGIN, setWidth, lineHeight + 2 * SET_BOX_MARGIN); drawSetLabel(g, typeFont, set, rarity, x + availableTypeWidth + SET_BOX_MARGIN, y - SET_BOX_MARGIN, setWidth, lineHeight + 2 * SET_BOX_MARGIN);
} }
String type = CardDetailUtil.formatCardId(card.getOriginal()); String type = CardDetailUtil.formatCardType(card.getOriginal());
if (card.getOriginal().isCreature()) { //include P/T or Loyalty at end of type if (card.getOriginal().isCreature()) { //include P/T or Loyalty at end of type
type += " (" + power + " / " + toughness + ")"; type += " (" + power + " / " + toughness + ")";
} }