mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-14 17:58:01 +00:00
update textbox tint
This commit is contained in:
@@ -1360,6 +1360,21 @@ public class CardView extends GameEntityView {
|
||||
public boolean isPlaneswalker() {
|
||||
return getType().isPlaneswalker();
|
||||
}
|
||||
public boolean isMountain() {
|
||||
return getType().hasSubtype("Mountain");
|
||||
}
|
||||
public boolean isPlains() {
|
||||
return getType().hasSubtype("Plains");
|
||||
}
|
||||
public boolean isSwamp() {
|
||||
return getType().hasSubtype("Swamp");
|
||||
}
|
||||
public boolean isForest() {
|
||||
return getType().hasSubtype("Forest");
|
||||
}
|
||||
public boolean isIsland() {
|
||||
return getType().hasSubtype("Island");
|
||||
}
|
||||
}
|
||||
|
||||
//special methods for updating card and player properties as needed and returning the new collection
|
||||
|
||||
@@ -748,7 +748,29 @@ public class FCardImageRenderer {
|
||||
private static void drawTextBox(Graphics2D g, CardStateView state, String text, Color[] colors,
|
||||
int x, int y, int w, int h, int textBoxFlags) {
|
||||
int yAdjust = (textBoxFlags >> 16);
|
||||
if (state.isLand()) {
|
||||
DetailColors modColors = DetailColors.WHITE;
|
||||
if (state.isBasicLand()) {
|
||||
if (state.isForest())
|
||||
modColors = DetailColors.GREEN;
|
||||
else if (state.isIsland())
|
||||
modColors = DetailColors.BLUE;
|
||||
else if (state.isMountain())
|
||||
modColors = DetailColors.RED;
|
||||
else if (state.isSwamp())
|
||||
modColors = DetailColors.BLACK;
|
||||
else if (state.isPlains())
|
||||
modColors = DetailColors.LAND;
|
||||
}
|
||||
Color bgColor = fromDetailColor(modColors);
|
||||
bgColor = tintColor(Color.WHITE, bgColor, NAME_BOX_TINT);
|
||||
Paint oldPaint = g.getPaint();
|
||||
g.setColor(bgColor);
|
||||
g.fillRect(Math.round(x), Math.round(y), Math.round(w), Math.round(h));
|
||||
g.setPaint(oldPaint);
|
||||
} else {
|
||||
fillColorBackground(g, colors, x, y + yAdjust, w, h - yAdjust);
|
||||
}
|
||||
g.setStroke(new BasicStroke(BOX_LINE_THICKNESS));
|
||||
g.setColor(Color.BLACK);
|
||||
g.drawRect(x, y, w, h);
|
||||
|
||||
@@ -260,7 +260,26 @@ public class CardImageRenderer {
|
||||
private static final TextRenderer cardTextRenderer = new TextRenderer(true);
|
||||
|
||||
private static void drawTextBox(Graphics g, CardView card, CardStateView state, Color[] colors, float x, float y, float w, float h, boolean onTop) {
|
||||
if (state.isLand()) {
|
||||
DetailColors modColors = DetailColors.WHITE;
|
||||
if (state.isBasicLand()) {
|
||||
if (state.isForest())
|
||||
modColors = DetailColors.GREEN;
|
||||
else if (state.isIsland())
|
||||
modColors = DetailColors.BLUE;
|
||||
else if (state.isMountain())
|
||||
modColors = DetailColors.RED;
|
||||
else if (state.isSwamp())
|
||||
modColors = DetailColors.BLACK;
|
||||
else if (state.isPlains())
|
||||
modColors = DetailColors.LAND;
|
||||
}
|
||||
Color bgColor = FSkinColor.fromRGB(modColors.r, modColors.g, modColors.b);
|
||||
bgColor = FSkinColor.tintColor(Color.WHITE, bgColor, CardRenderer.NAME_BOX_TINT);
|
||||
g.fillRect(bgColor, x, y, w, h);
|
||||
} else {
|
||||
fillColorBackground(g, colors, x, y, w, h);
|
||||
}
|
||||
g.drawRect(BORDER_THICKNESS, Color.BLACK, x, y, w, h);
|
||||
|
||||
if (!onTop) { return; } //remaining rendering only needed if card on top
|
||||
|
||||
Reference in New Issue
Block a user