mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
battle support
This commit is contained in:
@@ -184,7 +184,7 @@ public class FCardImageRenderer {
|
|||||||
if (!card.isSplitCard() && !card.isFlipCard()) {
|
if (!card.isSplitCard() && !card.isFlipCard()) {
|
||||||
final CardStateView state = card.getState(card.isAdventureCard() ? false : altState);
|
final CardStateView state = card.getState(card.isAdventureCard() ? false : altState);
|
||||||
if ((state.isCreature() && !state.getKeywordKey().contains("Level up"))
|
if ((state.isCreature() && !state.getKeywordKey().contains("Level up"))
|
||||||
|| state.isPlaneswalker() || state.isVehicle())
|
|| state.isPlaneswalker() || state.isBattle() || state.isVehicle())
|
||||||
hasPTBox = true;
|
hasPTBox = true;
|
||||||
}
|
}
|
||||||
if (hasPTBox) {
|
if (hasPTBox) {
|
||||||
@@ -294,7 +294,7 @@ 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.isVehicle()) {
|
if (state.isCreature() || state.isPlaneswalker() | state.isBattle() || state.isVehicle()) {
|
||||||
//if P/T box needed, make room for it
|
//if P/T box needed, make room for it
|
||||||
ptBoxHeight = headerHeight;
|
ptBoxHeight = headerHeight;
|
||||||
}
|
}
|
||||||
@@ -839,6 +839,12 @@ public class FCardImageRenderer {
|
|||||||
TEXT_COLOR = Color.WHITE;
|
TEXT_COLOR = Color.WHITE;
|
||||||
pieces.add(String.valueOf(state.getLoyalty()));
|
pieces.add(String.valueOf(state.getLoyalty()));
|
||||||
}
|
}
|
||||||
|
else if (state.isBattle()) {
|
||||||
|
Color [] pwColor = { Color.BLACK };
|
||||||
|
colors = pwColor;
|
||||||
|
TEXT_COLOR = Color.WHITE;
|
||||||
|
pieces.add(String.valueOf(state.getDefense()));
|
||||||
|
}
|
||||||
else if (state.isVehicle()) {
|
else if (state.isVehicle()) {
|
||||||
Color [] vhColor = { new Color(128, 96, 64) };
|
Color [] vhColor = { new Color(128, 96, 64) };
|
||||||
colors = vhColor;
|
colors = vhColor;
|
||||||
@@ -865,7 +871,7 @@ public class FCardImageRenderer {
|
|||||||
int arcWidth = h / 3;
|
int arcWidth = h / 3;
|
||||||
fillRoundColorBackground(g, colors, x, y, w, h, arcWidth, h);
|
fillRoundColorBackground(g, colors, x, y, w, h, arcWidth, h);
|
||||||
g.setStroke(new BasicStroke(BOX_LINE_THICKNESS));
|
g.setStroke(new BasicStroke(BOX_LINE_THICKNESS));
|
||||||
g.setColor(state.isPlaneswalker() ? Color.WHITE : Color.BLACK);
|
g.setColor(state.isPlaneswalker() || state.isBattle() ? Color.WHITE : Color.BLACK);
|
||||||
g.drawRoundRect(x, y, w, h, arcWidth, h);
|
g.drawRoundRect(x, y, w, h, arcWidth, h);
|
||||||
|
|
||||||
x += (PT_BOX_WIDTH - totalPieceWidth) / 2;
|
x += (PT_BOX_WIDTH - totalPieceWidth) / 2;
|
||||||
|
|||||||
Reference in New Issue
Block a user