update textbox tint

This commit is contained in:
Anthony Calosa
2021-08-21 14:20:47 +08:00
parent 2f78d910e1
commit b9205b4b1e
3 changed files with 58 additions and 2 deletions

View File

@@ -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) {
fillColorBackground(g, colors, x, y, w, h);
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