mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
Fixed a bug that the owner of controlled cards were no longer shown in the card tooltip.
This commit is contained in:
parent
e7337f66b7
commit
d03bd3bf57
1 changed files with 11 additions and 9 deletions
|
@ -347,16 +347,18 @@ public class CardView extends SimpleCardView {
|
|||
if (card instanceof Permanent) {
|
||||
this.mageObjectType = MageObjectType.PERMANENT;
|
||||
Permanent permanent = (Permanent) card;
|
||||
if (game != null && permanent.getCounters(game) != null && !permanent.getCounters(game).isEmpty()) {
|
||||
this.loyalty = Integer.toString(permanent.getCounters(game).getCount(CounterType.LOYALTY));
|
||||
this.pairedCard = permanent.getPairedCard() != null ? permanent.getPairedCard().getSourceId() : null;
|
||||
if (game != null) {
|
||||
if (permanent.getCounters(game) != null && !permanent.getCounters(game).isEmpty()) {
|
||||
this.loyalty = Integer.toString(permanent.getCounters(game).getCount(CounterType.LOYALTY));
|
||||
this.pairedCard = permanent.getPairedCard() != null ? permanent.getPairedCard().getSourceId() : null;
|
||||
counters = new ArrayList<>();
|
||||
for (Counter counter : permanent.getCounters(game).values()) {
|
||||
counters.add(new CounterView(counter));
|
||||
}
|
||||
}
|
||||
if (!permanent.getControllerId().equals(permanent.getOwnerId())) {
|
||||
controlledByOwner = false;
|
||||
}
|
||||
counters = new ArrayList<>();
|
||||
for (Counter counter : permanent.getCounters(game).values()) {
|
||||
counters.add(new CounterView(counter));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (card.isCopy()) {
|
||||
|
@ -1011,11 +1013,11 @@ public class CardView extends SimpleCardView {
|
|||
public boolean isTribal() {
|
||||
return cardTypes.contains(CardType.TRIBAL);
|
||||
}
|
||||
|
||||
|
||||
public void setInViewerOnly(boolean inViewerOnly) {
|
||||
this.inViewerOnly = inViewerOnly;
|
||||
}
|
||||
|
||||
|
||||
public boolean inViewerOnly() {
|
||||
return inViewerOnly;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue