Add current tile indicator to tileindicators plugin
This commit is contained in:
@@ -54,6 +54,27 @@ public interface TileIndicatorsConfig extends Config
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Alpha
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = "highlightCurrentColor",
|
||||||
|
name = "Color of current tile highlighting",
|
||||||
|
description = "Configures the highlight color of current destination"
|
||||||
|
)
|
||||||
|
default Color highlightCurrentColor()
|
||||||
|
{
|
||||||
|
return Color.GRAY;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = "highlightCurrentTile",
|
||||||
|
name = "Highlight current tile",
|
||||||
|
description = "Highlights tile player is on"
|
||||||
|
)
|
||||||
|
default boolean highlightCurrentTile()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "highlightHoveredTile",
|
keyName = "highlightHoveredTile",
|
||||||
name = "Highlight hovered tile",
|
name = "Highlight hovered tile",
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import net.runelite.api.Client;
|
|||||||
import net.runelite.api.Perspective;
|
import net.runelite.api.Perspective;
|
||||||
import net.runelite.api.Point;
|
import net.runelite.api.Point;
|
||||||
import net.runelite.api.coords.LocalPoint;
|
import net.runelite.api.coords.LocalPoint;
|
||||||
|
import net.runelite.api.coords.WorldPoint;
|
||||||
import net.runelite.client.ui.overlay.Overlay;
|
import net.runelite.client.ui.overlay.Overlay;
|
||||||
import net.runelite.client.ui.overlay.OverlayLayer;
|
import net.runelite.client.ui.overlay.OverlayLayer;
|
||||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||||
@@ -84,6 +85,28 @@ public class TileIndicatorsOverlay extends Overlay
|
|||||||
renderTile(graphics, client.getLocalDestinationLocation(), config.highlightDestinationColor());
|
renderTile(graphics, client.getLocalDestinationLocation(), config.highlightDestinationColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config.highlightCurrentTile())
|
||||||
|
{
|
||||||
|
final WorldPoint playerPos = client.getLocalPlayer().getWorldLocation();
|
||||||
|
if (playerPos == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
final LocalPoint playerPosLocal = LocalPoint.fromWorld(client, client.getLocalPlayer().getWorldLocation());
|
||||||
|
if (playerPosLocal == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Polygon poly = Perspective.getCanvasTilePoly(client, playerPosLocal);
|
||||||
|
if (poly == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
renderTile(graphics, client.getLocalDestinationLocation(), config.highlightCurrentColor());
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user