mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
[GUI] Add Token on type line. (#10813)
* [GUI] Add Token on type line. * rewrite comment.
This commit is contained in:
parent
64db75576e
commit
ea6f3c05de
2 changed files with 6 additions and 3 deletions
|
|
@ -1,7 +1,6 @@
|
|||
package org.mage.card.arcane;
|
||||
|
||||
import mage.abilities.hint.HintUtils;
|
||||
import mage.cards.ArtRect;
|
||||
import mage.client.dialog.PreferencesDialog;
|
||||
import mage.constants.AbilityType;
|
||||
import mage.constants.CardType;
|
||||
|
|
@ -504,6 +503,10 @@ public abstract class CardRenderer {
|
|||
|
||||
protected String getCardSuperTypeLine() {
|
||||
StringBuilder spType = new StringBuilder();
|
||||
if (cardView.isToken()) {
|
||||
// "Token" is shown on the type line. As recent printing of tokens do.
|
||||
spType.append("Token ");
|
||||
}
|
||||
for (SuperType superType : cardView.getSuperTypes()) {
|
||||
spType.append(superType).append(' ');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import mage.util.SubTypes;
|
|||
import mage.view.CardView;
|
||||
import mage.view.PermanentView;
|
||||
import org.apache.log4j.Logger;
|
||||
import static org.mage.card.arcane.ManaSymbols.getSizedManaSymbol;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
|
@ -28,8 +29,6 @@ import java.util.ArrayList;
|
|||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static org.mage.card.arcane.ManaSymbols.getSizedManaSymbol;
|
||||
|
||||
|
||||
/*
|
||||
private void cardRendererBasedRender(Graphics2D g) {
|
||||
|
|
@ -964,6 +963,7 @@ public class ModernCardRenderer extends CardRenderer {
|
|||
|
||||
// Replace "Legendary" in type line if there's not enough space
|
||||
if (g.getFontMetrics().stringWidth(types) > availableWidth) {
|
||||
types = types.replace("Token", "T.");
|
||||
types = types.replace("Legendary", "L.");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue