From ad6eb4652fd856bbd50b70a4be425a0ab7689223 Mon Sep 17 00:00:00 2001 From: Josh J <33074635+JoshJ96@users.noreply.github.com> Date: Mon, 6 Dec 2021 23:05:22 -0500 Subject: [PATCH] tile indicators: add fill color config Co-authored-by: Adam --- .../tileindicators/TileIndicatorsConfig.java | 50 ++++++++++++++++--- .../tileindicators/TileIndicatorsOverlay.java | 10 ++-- 2 files changed, 48 insertions(+), 12 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsConfig.java index f30b1c7667..b69bf953ad 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsConfig.java @@ -56,11 +56,23 @@ public interface TileIndicatorsConfig extends Config return true; } + @Alpha + @ConfigItem( + keyName = "destinationTileFillColor", + name = "Destination tile fill color", + description = "Configures the fill color of destination tile", + position = 3 + ) + default Color destinationTileFillColor() + { + return new Color(0, 0, 0, 50); + } + @ConfigItem( keyName = "destinationTileBorderWidth", name = "Destination border width", description = "Width of the destination tile marker border", - position = 3 + position = 4 ) default double destinationTileBorderWidth() { @@ -72,7 +84,7 @@ public interface TileIndicatorsConfig extends Config keyName = "highlightHoveredColor", name = "Hovered tile", description = "Configures the highlight color of hovered tile", - position = 4 + position = 5 ) default Color highlightHoveredColor() { @@ -83,18 +95,30 @@ public interface TileIndicatorsConfig extends Config keyName = "highlightHoveredTile", name = "Highlight hovered tile", description = "Highlights tile player is hovering with mouse", - position = 5 + position = 6 ) default boolean highlightHoveredTile() { return false; } + @Alpha + @ConfigItem( + keyName = "hoveredTileFillColor", + name = "Hovered tile fill color", + description = "Configures the fill color of hovered tile", + position = 7 + ) + default Color hoveredTileFillColor() + { + return new Color(0, 0, 0, 50); + } + @ConfigItem( keyName = "hoveredTileBorderWidth", name = "Hovered tile border width", description = "Width of the hovered tile marker border", - position = 6 + position = 8 ) default double hoveredTileBorderWidth() { @@ -106,7 +130,7 @@ public interface TileIndicatorsConfig extends Config keyName = "highlightCurrentColor", name = "True tile", description = "Configures the highlight color of current true tile", - position = 7 + position = 9 ) default Color highlightCurrentColor() { @@ -117,18 +141,30 @@ public interface TileIndicatorsConfig extends Config keyName = "highlightCurrentTile", name = "Highlight true tile", description = "Highlights true tile player is on as seen by server", - position = 8 + position = 10 ) default boolean highlightCurrentTile() { return false; } + @Alpha + @ConfigItem( + keyName = "currentTileFillColor", + name = "True tile fill color", + description = "Configures the fill color of current true tile", + position = 11 + ) + default Color currentTileFillColor() + { + return new Color(0, 0, 0, 50); + } + @ConfigItem( keyName = "currentTileBorderWidth", name = "True tile border width", description = "Width of the true tile marker border", - position = 9 + position = 12 ) default double currentTileBorderWidth() { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsOverlay.java index 8abb968314..99f81a298b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsOverlay.java @@ -63,13 +63,13 @@ public class TileIndicatorsOverlay extends Overlay // If we have tile "selected" render it if (client.getSelectedSceneTile() != null) { - renderTile(graphics, client.getSelectedSceneTile().getLocalLocation(), config.highlightHoveredColor(), config.hoveredTileBorderWidth()); + renderTile(graphics, client.getSelectedSceneTile().getLocalLocation(), config.highlightHoveredColor(), config.hoveredTileBorderWidth(), config.hoveredTileFillColor()); } } if (config.highlightDestinationTile()) { - renderTile(graphics, client.getLocalDestinationLocation(), config.highlightDestinationColor(), config.destinationTileBorderWidth()); + renderTile(graphics, client.getLocalDestinationLocation(), config.highlightDestinationColor(), config.destinationTileBorderWidth(), config.destinationTileFillColor()); } if (config.highlightCurrentTile()) @@ -86,13 +86,13 @@ public class TileIndicatorsOverlay extends Overlay return null; } - renderTile(graphics, playerPosLocal, config.highlightCurrentColor(), config.currentTileBorderWidth()); + renderTile(graphics, playerPosLocal, config.highlightCurrentColor(), config.currentTileBorderWidth(), config.currentTileFillColor()); } return null; } - private void renderTile(final Graphics2D graphics, final LocalPoint dest, final Color color, final double borderWidth) + private void renderTile(final Graphics2D graphics, final LocalPoint dest, final Color color, final double borderWidth, final Color fillColor) { if (dest == null) { @@ -106,6 +106,6 @@ public class TileIndicatorsOverlay extends Overlay return; } - OverlayUtil.renderPolygon(graphics, poly, color, new BasicStroke((float) borderWidth)); + OverlayUtil.renderPolygon(graphics, poly, color, fillColor, new BasicStroke((float) borderWidth)); } }