Draw effects with orange border to make them easier to distinguish from normal cards.

This commit is contained in:
elcnesh
2014-11-25 20:14:07 +00:00
parent e3cb0481a2
commit 871272971e

View File

@@ -290,11 +290,20 @@ public class CardPanel extends SkinnedPanel implements CardContainer, IDisposabl
// White border if card is known to have it. // White border if card is known to have it.
if (getCard() != null && MatchUtil.canCardBeShown(getCard())) { if (getCard() != null && MatchUtil.canCardBeShown(getCard())) {
CardStateView state = getCard().getCurrentState(); final CardStateView state = getCard().getCurrentState();
CardEdition ed = FModel.getMagicDb().getEditions().get(state.getSetCode()); final CardEdition ed = FModel.getMagicDb().getEditions().get(state.getSetCode());
if (ed != null && ed.isWhiteBorder() && state.getFoilIndex() == 0) { boolean colorIsSet = false;
g2d.setColor(Color.white); if (state.getType().hasStringType("Effect")) {
int ins = 1; // Effects are drawn with orange border
g2d.setColor(Color.ORANGE);
colorIsSet = true;
} else if (ed != null && ed.isWhiteBorder() && state.getFoilIndex() == 0) {
// Non-foil cards from white-bordered sets are drawn with white border
g2d.setColor(Color.WHITE);
colorIsSet = true;
}
if (colorIsSet) {
final int ins = 1;
g2d.fillRoundRect(cardXOffset + ins, cardYOffset + ins, cardWidth - ins*2, cardHeight - ins*2, cornerSize-ins, cornerSize-ins); g2d.fillRoundRect(cardXOffset + ins, cardYOffset + ins, cardWidth - ins*2, cardHeight - ins*2, cornerSize-ins, cornerSize-ins);
} }
} }