tile indicators: add fill color config
Co-authored-by: Adam <Adam@sigterm.info>
This commit is contained in:
@@ -56,11 +56,23 @@ public interface TileIndicatorsConfig extends Config
|
|||||||
return true;
|
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(
|
@ConfigItem(
|
||||||
keyName = "destinationTileBorderWidth",
|
keyName = "destinationTileBorderWidth",
|
||||||
name = "Destination border width",
|
name = "Destination border width",
|
||||||
description = "Width of the destination tile marker border",
|
description = "Width of the destination tile marker border",
|
||||||
position = 3
|
position = 4
|
||||||
)
|
)
|
||||||
default double destinationTileBorderWidth()
|
default double destinationTileBorderWidth()
|
||||||
{
|
{
|
||||||
@@ -72,7 +84,7 @@ public interface TileIndicatorsConfig extends Config
|
|||||||
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 = 4
|
position = 5
|
||||||
)
|
)
|
||||||
default Color highlightHoveredColor()
|
default Color highlightHoveredColor()
|
||||||
{
|
{
|
||||||
@@ -83,18 +95,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 = 5
|
position = 6
|
||||||
)
|
)
|
||||||
default boolean highlightHoveredTile()
|
default boolean highlightHoveredTile()
|
||||||
{
|
{
|
||||||
return false;
|
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(
|
@ConfigItem(
|
||||||
keyName = "hoveredTileBorderWidth",
|
keyName = "hoveredTileBorderWidth",
|
||||||
name = "Hovered tile border width",
|
name = "Hovered tile border width",
|
||||||
description = "Width of the hovered tile marker border",
|
description = "Width of the hovered tile marker border",
|
||||||
position = 6
|
position = 8
|
||||||
)
|
)
|
||||||
default double hoveredTileBorderWidth()
|
default double hoveredTileBorderWidth()
|
||||||
{
|
{
|
||||||
@@ -106,7 +130,7 @@ public interface TileIndicatorsConfig extends Config
|
|||||||
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 = 7
|
position = 9
|
||||||
)
|
)
|
||||||
default Color highlightCurrentColor()
|
default Color highlightCurrentColor()
|
||||||
{
|
{
|
||||||
@@ -117,18 +141,30 @@ 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 = 8
|
position = 10
|
||||||
)
|
)
|
||||||
default boolean highlightCurrentTile()
|
default boolean highlightCurrentTile()
|
||||||
{
|
{
|
||||||
return false;
|
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(
|
@ConfigItem(
|
||||||
keyName = "currentTileBorderWidth",
|
keyName = "currentTileBorderWidth",
|
||||||
name = "True tile border width",
|
name = "True tile border width",
|
||||||
description = "Width of the true tile marker border",
|
description = "Width of the true tile marker border",
|
||||||
position = 9
|
position = 12
|
||||||
)
|
)
|
||||||
default double currentTileBorderWidth()
|
default double currentTileBorderWidth()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -63,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(), config.hoveredTileBorderWidth());
|
renderTile(graphics, client.getSelectedSceneTile().getLocalLocation(), config.highlightHoveredColor(), config.hoveredTileBorderWidth(), config.hoveredTileFillColor());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.highlightDestinationTile())
|
if (config.highlightDestinationTile())
|
||||||
{
|
{
|
||||||
renderTile(graphics, client.getLocalDestinationLocation(), config.highlightDestinationColor(), config.destinationTileBorderWidth());
|
renderTile(graphics, client.getLocalDestinationLocation(), config.highlightDestinationColor(), config.destinationTileBorderWidth(), config.destinationTileFillColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.highlightCurrentTile())
|
if (config.highlightCurrentTile())
|
||||||
@@ -86,13 +86,13 @@ public class TileIndicatorsOverlay extends Overlay
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
renderTile(graphics, playerPosLocal, config.highlightCurrentColor(), config.currentTileBorderWidth());
|
renderTile(graphics, playerPosLocal, config.highlightCurrentColor(), config.currentTileBorderWidth(), config.currentTileFillColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
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)
|
if (dest == null)
|
||||||
{
|
{
|
||||||
@@ -106,6 +106,6 @@ public class TileIndicatorsOverlay extends Overlay
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
OverlayUtil.renderPolygon(graphics, poly, color, new BasicStroke((float) borderWidth));
|
OverlayUtil.renderPolygon(graphics, poly, color, fillColor, new BasicStroke((float) borderWidth));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user