mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-11 16:26:22 +00:00
Basic renderer support for Spacecraft PT
This commit is contained in:
@@ -1401,6 +1401,11 @@ public class CardView extends GameEntityView {
|
||||
set(TrackableProperty.RulesText, rulesText);
|
||||
}
|
||||
|
||||
public boolean hasPrintedPower() {
|
||||
EnumMap props = getProps();
|
||||
return props.containsKey(TrackableProperty.Power);
|
||||
}
|
||||
|
||||
public int getPower() {
|
||||
return get(TrackableProperty.Power);
|
||||
}
|
||||
@@ -1480,7 +1485,6 @@ public class CardView extends GameEntityView {
|
||||
set(TrackableProperty.Loyalty, "0"); //alternates don't need loyalty
|
||||
}
|
||||
|
||||
|
||||
public String getDefense() {
|
||||
return get(TrackableProperty.Defense);
|
||||
}
|
||||
|
||||
@@ -294,7 +294,8 @@ public class FCardImageRenderer {
|
||||
int headerHeight = NAME_SIZE + 2 * HEADER_PADDING;
|
||||
int typeBoxHeight = TYPE_SIZE + 2 * TYPE_PADDING;
|
||||
int ptBoxHeight = 0;
|
||||
if (state.isCreature() || state.isPlaneswalker() | state.isBattle() || state.isVehicle()) {
|
||||
if (state.isCreature() || state.isPlaneswalker() | state.isBattle() || state.isVehicle() ||
|
||||
(state.getType().hasSubtype("Spacecraft") && state.hasPrintedPower())) {
|
||||
//if P/T box needed, make room for it
|
||||
ptBoxHeight = headerHeight;
|
||||
}
|
||||
@@ -682,7 +683,6 @@ public class FCardImageRenderer {
|
||||
new Rectangle(x, y, w, h), NAME_FONT, NAME_SIZE);
|
||||
}
|
||||
|
||||
|
||||
private static void drawArt(Graphics2D g, Color[] colors, int x, int y, int w, int h, BufferedImage art) {
|
||||
if (art != null) {
|
||||
int artWidth = art.getWidth();
|
||||
@@ -841,6 +841,14 @@ public class FCardImageRenderer {
|
||||
pieces.add(String.valueOf(state.getToughness()));
|
||||
}
|
||||
}
|
||||
else if (state.getType().hasSubtype("Spacecraft")) {
|
||||
Color [] scColor = { Color.BLACK };
|
||||
colors = scColor;
|
||||
TEXT_COLOR = Color.WHITE;
|
||||
pieces.add(String.valueOf(state.getPower()));
|
||||
pieces.add("/");
|
||||
pieces.add(String.valueOf(state.getToughness()));
|
||||
}
|
||||
else if (state.isPlaneswalker()) {
|
||||
Color [] pwColor = { Color.BLACK };
|
||||
colors = pwColor;
|
||||
|
||||
Reference in New Issue
Block a user