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