This commit is contained in:
Thomas Cylke
2019-09-28 11:44:32 -04:00
committed by Kyle
parent 4aa24c7737
commit 9258c8eff8
10 changed files with 162 additions and 17 deletions

View File

@@ -283,4 +283,15 @@ public interface GroundMarkerConfig extends Config
{
return 100;
}
@ConfigItem(
position = 16,
keyName = "thinMarkers",
name = "Thin markesr",
description = "Render marked tile borders as 1 pixel wide instead of 2"
)
default boolean thinMarkers()
{
return false;
}
}

View File

@@ -126,6 +126,13 @@ public class GroundMarkerOverlay extends Overlay
case 12:
color = plugin.getMarkerColor12();
}
OverlayUtil.renderPolygon(graphics, poly, color);
if (plugin.isThinMarkers())
{
OverlayUtil.renderPolygonThin(graphics, poly, color);
}
else
{
OverlayUtil.renderPolygon(graphics, poly, color);
}
}
}

View File

@@ -173,6 +173,8 @@ public class GroundMarkerPlugin extends Plugin
private boolean showMinimap;
@Getter(AccessLevel.PACKAGE)
private int minimapOverlayOpacity;
@Getter(AccessLevel.PACKAGE)
private boolean thinMarkers;
@Provides
GroundMarkerConfig provideConfig(ConfigManager configManager)
@@ -259,7 +261,7 @@ public class GroundMarkerPlugin extends Plugin
/**
* Rotate the chunk containing the given point to rotation 0
*
* @param point point
* @param point point
* @param rotation rotation
* @return world point
*/
@@ -271,7 +273,7 @@ public class GroundMarkerPlugin extends Plugin
/**
* Rotate the coordinates in the chunk according to chunk rotation
*
* @param point point
* @param point point
* @param rotation rotation
* @return world point
*/
@@ -509,5 +511,6 @@ public class GroundMarkerPlugin extends Plugin
this.markerColor12 = config.markerColor12();
this.showMinimap = config.showMinimap();
this.minimapOverlayOpacity = config.minimapOverlayOpacity();
this.thinMarkers = config.thinMarkers();
}
}

View File

@@ -121,4 +121,15 @@ public interface MultiIndicatorsConfig extends Config
return Color.WHITE;
}
@ConfigItem(
keyName = "thinnerLines",
name = "Thin lines",
description = "Render multi lines, safe zone lines, and wildy level lines as 1 pixel wide instead of 2",
position = 9
)
default boolean thinnerLines()
{
return false;
}
}

View File

@@ -64,7 +64,14 @@ public class MultiIndicatorsOverlay extends Overlay
private Color getTransparentColorVersion(Color c)
{
return new Color(c.getRed(), c.getGreen(), c.getBlue(), 92);
if (plugin.isThinnerLines()) //The thin lines are difficult to see with low opacity, but they are visible and less obtrusive with full opacity
{
return c;
}
else
{
return new Color(c.getRed(), c.getGreen(), c.getBlue(), 92);
}
}
private void renderPath(Graphics2D graphics, GeneralPath path, Color color)
@@ -77,8 +84,14 @@ public class MultiIndicatorsOverlay extends Overlay
MAX_LOCAL_DRAW_LENGTH * 2);
graphics.setColor(color);
graphics.setStroke(new BasicStroke(2));
if (plugin.isThinnerLines())
{
graphics.setStroke(new BasicStroke(1));
}
else
{
graphics.setStroke(new BasicStroke(2));
}
path = Geometry.clipPath(path, viewArea);
path = Geometry.filterPath(path, (p1, p2) ->
Perspective.localToCanvas(client, new LocalPoint((int) p1[0], (int) p1[1]), client.getPlane()) != null &&

View File

@@ -120,6 +120,8 @@ public class MultiIndicatorsPlugin extends Plugin
private Color safeZoneColor;
@Getter(AccessLevel.PACKAGE)
private Color wildernessLevelLinesColor;
@Getter(AccessLevel.PACKAGE)
private boolean thinnerLines;
@Provides
MultiIndicatorsConfig getConfig(ConfigManager configManager)
@@ -407,5 +409,6 @@ public class MultiIndicatorsPlugin extends Plugin
this.multicombatColor = config.multicombatColor();
this.safeZoneColor = config.safeZoneColor();
this.wildernessLevelLinesColor = config.wildernessLevelLinesColor();
this.thinnerLines = config.thinnerLines();
}
}

View File

@@ -37,7 +37,8 @@ public interface TileIndicatorsConfig extends Config
@ConfigItem(
keyName = "highlightDestinationColor",
name = "Color of current destination highlighting",
description = "Configures the highlight color of current destination"
description = "Configures the highlight color of current destination",
position = 0
)
default Color highlightDestinationColor()
{
@@ -47,18 +48,31 @@ public interface TileIndicatorsConfig extends Config
@ConfigItem(
keyName = "highlightDestinationTile",
name = "Highlight destination tile",
description = "Highlights tile player is walking to"
description = "Highlights tile player is walking to",
position = 1
)
default boolean highlightDestinationTile()
{
return true;
}
@ConfigItem(
keyName = "thinDestinationTile",
name = "Thin destination tile",
description = "Renders the tile border as 1 pixel wide instead of 2",
position = 2
)
default boolean thinDestinationTile()
{
return false;
}
@Alpha
@ConfigItem(
keyName = "highlightCurrentColor",
name = "Color of current tile highlighting",
description = "Configures the highlight color of current tile position"
description = "Configures the highlight color of current tile position",
position = 3
)
default Color highlightCurrentColor()
{
@@ -68,18 +82,31 @@ public interface TileIndicatorsConfig extends Config
@ConfigItem(
keyName = "highlightCurrentTile",
name = "Highlight current tile",
description = "Highlights tile player is on"
description = "Highlights tile player is on",
position = 4
)
default boolean highlightCurrentTile()
{
return false;
}
@ConfigItem(
keyName = "thinCurrentTile",
name = "Thin current tile",
description = "Renders the tile border as 1 pixel wide instead of 2",
position = 5
)
default boolean thinCurrentTile()
{
return false;
}
@Alpha
@ConfigItem(
keyName = "highlightHoveredColor",
name = "Color of current hovered highlighting",
description = "Configures the highlight color of hovered tile"
description = "Configures the highlight color of hovered tile",
position = 6
)
default Color highlightHoveredColor()
{
@@ -89,10 +116,22 @@ public interface TileIndicatorsConfig extends Config
@ConfigItem(
keyName = "highlightHoveredTile",
name = "Highlight hovered tile",
description = "Highlights tile player is hovering with mouse"
description = "Highlights tile player is hovering with mouse",
position = 7
)
default boolean highlightHoveredTile()
{
return false;
}
@ConfigItem(
keyName = "thinHoveredTile",
name = "Thin hovered tile",
description = "Renders the tile border as 1 pixel wide instead of 2",
position = 8
)
default boolean thinHoveredTile()
{
return false;
}
}

View File

@@ -63,12 +63,26 @@ public class TileIndicatorsOverlay extends Overlay
// If we have tile "selected" render it
client.getSelectedSceneTile() != null)
{
renderTile(graphics, client.getSelectedSceneTile().getLocalLocation(), plugin.getHighlightHoveredColor());
if (plugin.isThinHoveredTile())
{
renderTileThin(graphics, client.getSelectedSceneTile().getLocalLocation(), plugin.getHighlightHoveredColor());
}
else
{
renderTile(graphics, client.getSelectedSceneTile().getLocalLocation(), plugin.getHighlightHoveredColor());
}
}
if (plugin.isHighlightDestinationTile())
{
renderTile(graphics, client.getLocalDestinationLocation(), plugin.getHighlightDestinationColor());
if (plugin.isThinDestinationTile())
{
renderTileThin(graphics, client.getLocalDestinationLocation(), plugin.getHighlightDestinationColor());
}
else
{
renderTile(graphics, client.getLocalDestinationLocation(), plugin.getHighlightDestinationColor());
}
}
if (plugin.isHighlightCurrentTile())
@@ -85,7 +99,14 @@ public class TileIndicatorsOverlay extends Overlay
return null;
}
renderTile(graphics, playerPosLocal, plugin.getHighlightCurrentColor());
if (plugin.isThinCurrentTile())
{
renderTileThin(graphics, playerPosLocal, plugin.getHighlightCurrentColor());
}
else
{
renderTile(graphics, playerPosLocal, plugin.getHighlightCurrentColor());
}
}
return null;
@@ -107,4 +128,21 @@ public class TileIndicatorsOverlay extends Overlay
OverlayUtil.renderPolygon(graphics, poly, color);
}
private void renderTileThin(final Graphics2D graphics, final LocalPoint dest, final Color color)
{
if (dest == null)
{
return;
}
final Polygon poly = Perspective.getCanvasTilePoly(client, dest);
if (poly == null)
{
return;
}
OverlayUtil.renderPolygonThin(graphics, poly, color);
}
}

View File

@@ -63,13 +63,19 @@ public class TileIndicatorsPlugin extends Plugin
@Getter(AccessLevel.PACKAGE)
private boolean highlightDestinationTile;
@Getter(AccessLevel.PACKAGE)
private boolean thinDestinationTile;
@Getter(AccessLevel.PACKAGE)
private Color highlightCurrentColor;
@Getter(AccessLevel.PACKAGE)
private boolean highlightCurrentTile;
@Getter(AccessLevel.PACKAGE)
private boolean thinCurrentTile;
@Getter(AccessLevel.PACKAGE)
private Color highlightHoveredColor;
@Getter(AccessLevel.PACKAGE)
private boolean highlightHoveredTile;
@Getter(AccessLevel.PACKAGE)
private boolean thinHoveredTile;
@Provides
TileIndicatorsConfig provideConfig(ConfigManager configManager)
@@ -108,9 +114,12 @@ public class TileIndicatorsPlugin extends Plugin
{
this.highlightDestinationColor = config.highlightDestinationColor();
this.highlightDestinationTile = config.highlightDestinationTile();
this.thinDestinationTile = config.thinDestinationTile();
this.highlightCurrentColor = config.highlightCurrentColor();
this.highlightCurrentTile = config.highlightCurrentTile();
this.thinCurrentTile = config.thinCurrentTile();
this.highlightHoveredColor = config.highlightHoveredColor();
this.highlightHoveredTile = config.highlightHoveredTile();
this.thinHoveredTile = config.thinHoveredTile();
}
}

View File

@@ -72,6 +72,17 @@ public class OverlayUtil
graphics.setStroke(originalStroke);
}
public static void renderPolygonThin(Graphics2D graphics, Polygon poly, Color color)
{
graphics.setColor(color);
final Stroke originalStroke = graphics.getStroke();
graphics.setStroke(new BasicStroke(1));
graphics.drawPolygon(poly);
graphics.setColor(new Color(0, 0, 0, 50));
graphics.fillPolygon(poly);
graphics.setStroke(originalStroke);
}
public static void renderMinimapLocation(Graphics2D graphics, Point mini, Color color)
{
graphics.setColor(Color.BLACK);
@@ -286,12 +297,12 @@ public class OverlayUtil
public static void renderActorTextAndImage(Graphics2D graphics, Actor actor, String text, Color color, BufferedImage image, int yOffset, int xOffset)
{
Point textLocation = actor.getCanvasTextLocation(graphics, text, actor.getLogicalHeight() + yOffset);
Point textLocation = actor.getCanvasTextLocation(graphics, text, actor.getLogicalHeight() + yOffset);
if (textLocation != null)
{
renderImageLocation(graphics, textLocation, image);
textLocation = new Point(textLocation.getX() + xOffset , textLocation.getY());
textLocation = new Point(textLocation.getX() + xOffset, textLocation.getY());
renderTextLocation(graphics, textLocation, text, color);
}
}