when card is token,do not display translation text .

This commit is contained in:
CCTV-1
2020-01-30 22:07:28 +08:00
parent 415f911e46
commit e09faa3b9f
2 changed files with 5 additions and 2 deletions

View File

@@ -271,7 +271,9 @@ public class CardImageRenderer {
g.drawImage(image, x + (w - iconSize) / 2, y + (h - iconSize) / 2, iconSize, iconSize); g.drawImage(image, x + (w - iconSize) / 2, y + (h - iconSize) / 2, iconSize, iconSize);
} }
else { else {
final String text = card.getText(state, CardTranslation.getTranslationTexts(state.getName(), "")); boolean needTranslation = !card.isToken();
final String text = card.getText(state,
needTranslation ? CardTranslation.getTranslationTexts(state.getName(), "") : null);
if (StringUtils.isEmpty(text)) { return; } if (StringUtils.isEmpty(text)) { return; }
float padding = TEXT_FONT.getCapHeight() * 0.75f; float padding = TEXT_FONT.getCapHeight() * 0.75f;

View File

@@ -280,7 +280,8 @@ public class CardDetailUtil {
area.append("\n"); area.append("\n");
} }
String text = card.getText(state, CardTranslation.getTranslationTexts(state.getName(), "")); boolean needTranslation = !card.isToken();
String text = card.getText(state, needTranslation ? CardTranslation.getTranslationTexts(state.getName(), "") : null);
// LEVEL [0-9]+-[0-9]+ // LEVEL [0-9]+-[0-9]+
// LEVEL [0-9]+\+ // LEVEL [0-9]+\+