diff --git a/forge-game/src/main/java/forge/game/card/CardView.java b/forge-game/src/main/java/forge/game/card/CardView.java index 02e54357926..0d59026e743 100644 --- a/forge-game/src/main/java/forge/game/card/CardView.java +++ b/forge-game/src/main/java/forge/game/card/CardView.java @@ -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 diff --git a/forge-gui-desktop/src/main/java/forge/toolbox/imaging/FCardImageRenderer.java b/forge-gui-desktop/src/main/java/forge/toolbox/imaging/FCardImageRenderer.java index 5c5163e2353..deefc1ea486 100644 --- a/forge-gui-desktop/src/main/java/forge/toolbox/imaging/FCardImageRenderer.java +++ b/forge-gui-desktop/src/main/java/forge/toolbox/imaging/FCardImageRenderer.java @@ -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); - fillColorBackground(g, colors, x, y + yAdjust, w, h - yAdjust); + 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); diff --git a/forge-gui-mobile/src/forge/card/CardImageRenderer.java b/forge-gui-mobile/src/forge/card/CardImageRenderer.java index 2c5e91b7dcd..ac665e22964 100644 --- a/forge-gui-mobile/src/forge/card/CardImageRenderer.java +++ b/forge-gui-mobile/src/forge/card/CardImageRenderer.java @@ -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