mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 03:51:58 -08:00
Vehicle P/T Rendering Enhancement
* Non-animated vehicle permanents have their P/T dimmed to distinugish their status past the type line changes.
This commit is contained in:
parent
3fb5a60202
commit
24beaa08f9
1 changed files with 15 additions and 1 deletions
|
|
@ -22,10 +22,12 @@ import java.text.CharacterIterator;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
import javax.swing.ImageIcon;
|
import javax.swing.ImageIcon;
|
||||||
|
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
import mage.cards.FrameStyle;
|
import mage.cards.FrameStyle;
|
||||||
|
import mage.client.cards.Permanent;
|
||||||
import mage.client.dialog.PreferencesDialog;
|
import mage.client.dialog.PreferencesDialog;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.view.CardView;
|
import mage.view.CardView;
|
||||||
|
|
@ -627,7 +629,19 @@ public class ModernCardRenderer extends CardRenderer {
|
||||||
partWidth - 2 * contentInset, 1);
|
partWidth - 2 * contentInset, 1);
|
||||||
|
|
||||||
// Draw text
|
// Draw text
|
||||||
g.setColor(isVehicle ? Color.white : getBoxTextColor());
|
Color textColor;
|
||||||
|
if (isVehicle) {
|
||||||
|
boolean isAnimated = !(cardView instanceof PermanentView) || cardView.getCardTypes().contains(CardType.CREATURE);
|
||||||
|
if (isAnimated) {
|
||||||
|
textColor = Color.white;
|
||||||
|
} else {
|
||||||
|
textColor = new Color(180, 180, 180);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
textColor = getBoxTextColor();
|
||||||
|
}
|
||||||
|
g.setColor(textColor);
|
||||||
g.setFont(ptTextFont);
|
g.setFont(ptTextFont);
|
||||||
String ptText = cardView.getPower() + "/" + cardView.getToughness();
|
String ptText = cardView.getPower() + "/" + cardView.getToughness();
|
||||||
int ptTextWidth = g.getFontMetrics().stringWidth(ptText);
|
int ptTextWidth = g.getFontMetrics().stringWidth(ptText);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue