Show info in card tooltip of permanents if controller not equal owner.

This commit is contained in:
LevelX2 2013-09-23 14:58:21 +02:00
parent 825277bad9
commit 0468fe7299
2 changed files with 15 additions and 1 deletions

View file

@ -158,7 +158,11 @@ public class CardInfoPaneImpl extends JEditorPane implements CardInfoPane {
buffer.append("<table cellspacing=0 cellpadding=0 border=0 width='100%' valign='bottom'><tr><td><b>");
buffer.append(pt).append("</b></td>");
buffer.append("<td align='right'>").append(card.getMageObjectType().toString()).append("</td>");
buffer.append("<td align='right'>");
if (!card.isControlledByOwner()) {
buffer.append("[only controlled] ");
}
buffer.append(card.getMageObjectType().toString()).append("</td>");
buffer.append("</tr></table>");
StringBuilder rule = new StringBuilder("<br/>");

View file

@ -101,6 +101,8 @@ public class CardView extends SimpleCardView {
protected boolean paid;
protected List<CounterView> counters;
protected boolean controlledByOwner = true;
public CardView(Card card, UUID cardId) {
this(card);
this.id = cardId;
@ -146,6 +148,9 @@ public class CardView extends SimpleCardView {
this.toughness = Integer.toString(card.getToughness().getValue());
this.loyalty = Integer.toString(permanent.getCounters().getCount(CounterType.LOYALTY));
this.pairedCard = permanent.getPairedCard();
if (!permanent.getControllerId().equals(permanent.getOwnerId())) {
controlledByOwner = false;
}
} else {
if (card.isCopy()) {
@ -544,4 +549,9 @@ public class CardView extends SimpleCardView {
public List<CounterView> getCounters() {
return counters;
}
public boolean isControlledByOwner() {
return controlledByOwner;
}
}