tile indicators: add border width config

This commit is contained in:
Adam
2021-06-29 20:51:32 -04:00
parent 887193148a
commit d2c72ee59b
2 changed files with 43 additions and 9 deletions

View File

@@ -56,12 +56,23 @@ public interface TileIndicatorsConfig extends Config
return true; 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 @Alpha
@ConfigItem( @ConfigItem(
keyName = "highlightHoveredColor", keyName = "highlightHoveredColor",
name = "Hovered tile", name = "Hovered tile",
description = "Configures the highlight color of hovered tile", description = "Configures the highlight color of hovered tile",
position = 3 position = 4
) )
default Color highlightHoveredColor() default Color highlightHoveredColor()
{ {
@@ -72,19 +83,30 @@ public interface TileIndicatorsConfig extends Config
keyName = "highlightHoveredTile", keyName = "highlightHoveredTile",
name = "Highlight hovered tile", name = "Highlight hovered tile",
description = "Highlights tile player is hovering with mouse", description = "Highlights tile player is hovering with mouse",
position = 4 position = 5
) )
default boolean highlightHoveredTile() default boolean highlightHoveredTile()
{ {
return false; 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 @Alpha
@ConfigItem( @ConfigItem(
keyName = "highlightCurrentColor", keyName = "highlightCurrentColor",
name = "True tile", name = "True tile",
description = "Configures the highlight color of current true tile", description = "Configures the highlight color of current true tile",
position = 5 position = 7
) )
default Color highlightCurrentColor() default Color highlightCurrentColor()
{ {
@@ -95,10 +117,21 @@ public interface TileIndicatorsConfig extends Config
keyName = "highlightCurrentTile", keyName = "highlightCurrentTile",
name = "Highlight true tile", name = "Highlight true tile",
description = "Highlights true tile player is on as seen by server", description = "Highlights true tile player is on as seen by server",
position = 6 position = 8
) )
default boolean highlightCurrentTile() default boolean highlightCurrentTile()
{ {
return false; 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;
}
} }

View File

@@ -24,6 +24,7 @@
*/ */
package net.runelite.client.plugins.tileindicators; package net.runelite.client.plugins.tileindicators;
import java.awt.BasicStroke;
import java.awt.Color; import java.awt.Color;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Graphics2D; import java.awt.Graphics2D;
@@ -62,13 +63,13 @@ public class TileIndicatorsOverlay extends Overlay
// If we have tile "selected" render it // If we have tile "selected" render it
if (client.getSelectedSceneTile() != null) if (client.getSelectedSceneTile() != null)
{ {
renderTile(graphics, client.getSelectedSceneTile().getLocalLocation(), config.highlightHoveredColor()); renderTile(graphics, client.getSelectedSceneTile().getLocalLocation(), config.highlightHoveredColor(), config.hoveredTileBorderWidth());
} }
} }
if (config.highlightDestinationTile()) if (config.highlightDestinationTile())
{ {
renderTile(graphics, client.getLocalDestinationLocation(), config.highlightDestinationColor()); renderTile(graphics, client.getLocalDestinationLocation(), config.highlightDestinationColor(), config.destinationTileBorderWidth());
} }
if (config.highlightCurrentTile()) if (config.highlightCurrentTile())
@@ -85,13 +86,13 @@ public class TileIndicatorsOverlay extends Overlay
return null; return null;
} }
renderTile(graphics, playerPosLocal, config.highlightCurrentColor()); renderTile(graphics, playerPosLocal, config.highlightCurrentColor(), config.currentTileBorderWidth());
} }
return null; 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) if (dest == null)
{ {
@@ -105,6 +106,6 @@ public class TileIndicatorsOverlay extends Overlay
return; return;
} }
OverlayUtil.renderPolygon(graphics, poly, color); OverlayUtil.renderPolygon(graphics, poly, color, new BasicStroke((float) borderWidth));
} }
} }