mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 03:22:00 -08:00
fix the CardViewer not displaying tokens (#10789)
This commit is contained in:
parent
2b18dc432c
commit
8457ce31c5
1 changed files with 18 additions and 12 deletions
|
|
@ -92,12 +92,14 @@ public class PermanentView extends CardView {
|
||||||
this.nameOwner = "";
|
this.nameOwner = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
Player controller = game.getPlayer(permanent.getControllerId());
|
String nameController = "";
|
||||||
if (controller != null) {
|
if (game != null) {
|
||||||
nameController = controller.getName();
|
Player controller = game.getPlayer(permanent.getControllerId());
|
||||||
} else {
|
if (controller != null) {
|
||||||
nameController = "";
|
nameController = controller.getName();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
this.nameController = nameController;
|
||||||
|
|
||||||
// add info for face down permanents
|
// add info for face down permanents
|
||||||
if (permanent.isFaceDown(game) && card != null) {
|
if (permanent.isFaceDown(game) && card != null) {
|
||||||
|
|
@ -125,15 +127,19 @@ public class PermanentView extends CardView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// determines if shown in it's own column
|
// determines if shown in it's own column
|
||||||
Permanent attachment = game.getPermanent(permanent.getAttachedTo());
|
boolean attachedToPermanent = false;
|
||||||
if (attachment != null) {
|
boolean attachedControllerDiffers = false;
|
||||||
attachedToPermanent = true;
|
if (game != null) {
|
||||||
attachedControllerDiffers = !attachment.getControllerId().equals(permanent.getControllerId());
|
Permanent attachment = game.getPermanent(permanent.getAttachedTo());
|
||||||
} else {
|
if (attachment != null) {
|
||||||
attachedToPermanent = false;
|
attachedToPermanent = true;
|
||||||
attachedControllerDiffers = false;
|
attachedControllerDiffers = !attachment.getControllerId().equals(permanent.getControllerId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
this.attachedToPermanent = attachedToPermanent;
|
||||||
|
this.attachedControllerDiffers = attachedControllerDiffers;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isTapped() {
|
public boolean isTapped() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue