From 3bbf5d1d56b384c93334f43caa1553aeeaa5e6e7 Mon Sep 17 00:00:00 2001 From: spjspj Date: Mon, 12 Sep 2016 01:00:43 +1000 Subject: [PATCH] spjspj - Add in last ditch token attempt (for momir vig mainly) --- .../plugins/card/images/CardDownloadData.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/images/CardDownloadData.java b/Mage.Client/src/main/java/org/mage/plugins/card/images/CardDownloadData.java index 49a780eec6b..9c219e11a1d 100644 --- a/Mage.Client/src/main/java/org/mage/plugins/card/images/CardDownloadData.java +++ b/Mage.Client/src/main/java/org/mage/plugins/card/images/CardDownloadData.java @@ -43,6 +43,10 @@ public class CardDownloadData { this.secondSide = secondSide; this.tokenSetCode = tokenSetCode; this.tokenDescriptor = tokenDescriptor; + + if (this.tokenDescriptor == null || this.tokenDescriptor.equalsIgnoreCase("") == 0) { + this.tokenDescriptor = lastDitchTokenDescriptor(); + } } public CardDownloadData(final CardDownloadData card) { @@ -55,6 +59,8 @@ public class CardDownloadData { this.type = card.type; this.usesVariousArt = card.usesVariousArt; this.tokenSetCode = card.tokenSetCode; + this.tokenDescriptor = card.tokenDescriptor; + } @Override @@ -138,7 +144,15 @@ public class CardDownloadData { public void setTokenDescriptor(String tokenDescriptor) { this.tokenDescriptor = tokenDescriptor; - } + } + + private String lastDitchTokenDescriptor() { + String name = this.name.replaceAll("[^a-zA-Z0-9]", ""); + String descriptor = name + "...."; + descriptor = descriptor.toUpperCase(); + return descriptor; + } + public boolean isToken() { return token; }