From d2c72ee59b43b31d729c30d77b9d1437c5896a1e Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 29 Jun 2021 20:51:32 -0400 Subject: [PATCH] tile indicators: add border width config --- .../tileindicators/TileIndicatorsConfig.java | 41 +++++++++++++++++-- .../tileindicators/TileIndicatorsOverlay.java | 11 ++--- 2 files changed, 43 insertions(+), 9 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 c1ab681930..f30b1c7667 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,12 +56,23 @@ public interface TileIndicatorsConfig extends Config return true; } + @ConfigItem( + keyName = "destinationTileBorderWidth", + name = "Destination border width", + description = "Width of the destination tile marker border", + position = 3 + ) + default double destinationTileBorderWidth() + { + return 2; + } + @Alpha @ConfigItem( keyName = "highlightHoveredColor", name = "Hovered tile", description = "Configures the highlight color of hovered tile", - position = 3 + position = 4 ) default Color highlightHoveredColor() { @@ -72,19 +83,30 @@ public interface TileIndicatorsConfig extends Config keyName = "highlightHoveredTile", name = "Highlight hovered tile", description = "Highlights tile player is hovering with mouse", - position = 4 + position = 5 ) default boolean highlightHoveredTile() { return false; } + @ConfigItem( + keyName = "hoveredTileBorderWidth", + name = "Hovered tile border width", + description = "Width of the hovered tile marker border", + position = 6 + ) + default double hoveredTileBorderWidth() + { + return 2; + } + @Alpha @ConfigItem( keyName = "highlightCurrentColor", name = "True tile", description = "Configures the highlight color of current true tile", - position = 5 + position = 7 ) default Color highlightCurrentColor() { @@ -95,10 +117,21 @@ public interface TileIndicatorsConfig extends Config keyName = "highlightCurrentTile", name = "Highlight true tile", description = "Highlights true tile player is on as seen by server", - position = 6 + position = 8 ) default boolean highlightCurrentTile() { return false; } + + @ConfigItem( + keyName = "currentTileBorderWidth", + name = "True tile border width", + description = "Width of the true tile marker border", + position = 9 + ) + default double currentTileBorderWidth() + { + return 2; + } } 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 b592684849..8abb968314 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 @@ -24,6 +24,7 @@ */ package net.runelite.client.plugins.tileindicators; +import java.awt.BasicStroke; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics2D; @@ -62,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()); + renderTile(graphics, client.getSelectedSceneTile().getLocalLocation(), config.highlightHoveredColor(), config.hoveredTileBorderWidth()); } } if (config.highlightDestinationTile()) { - renderTile(graphics, client.getLocalDestinationLocation(), config.highlightDestinationColor()); + renderTile(graphics, client.getLocalDestinationLocation(), config.highlightDestinationColor(), config.destinationTileBorderWidth()); } if (config.highlightCurrentTile()) @@ -85,13 +86,13 @@ public class TileIndicatorsOverlay extends Overlay return null; } - renderTile(graphics, playerPosLocal, config.highlightCurrentColor()); + renderTile(graphics, playerPosLocal, config.highlightCurrentColor(), config.currentTileBorderWidth()); } return null; } - private void renderTile(final Graphics2D graphics, final LocalPoint dest, final Color color) + private void renderTile(final Graphics2D graphics, final LocalPoint dest, final Color color, final double borderWidth) { if (dest == null) { @@ -105,6 +106,6 @@ public class TileIndicatorsOverlay extends Overlay return; } - OverlayUtil.renderPolygon(graphics, poly, color); + OverlayUtil.renderPolygon(graphics, poly, color, new BasicStroke((float) borderWidth)); } }