tileindicators: Add true current tile (#7790)

Add true current tile to tile indicator plugin
This commit is contained in:
Tomas Slusny
2020-05-10 14:40:55 +02:00
committed by GitHub
2 changed files with 39 additions and 0 deletions

View File

@@ -74,4 +74,25 @@ public interface TileIndicatorsConfig extends Config
{
return false;
}
@Alpha
@ConfigItem(
keyName = "highlightCurrentColor",
name = "Color of current true tile highlighting",
description = "Configures the highlight color of current true tile"
)
default Color highlightCurrentColor()
{
return Color.CYAN;
}
@ConfigItem(
keyName = "highlightCurrentTile",
name = "Highlight current true tile",
description = "Highlights true tile player is on as seen by server"
)
default boolean highlightCurrentTile()
{
return false;
}
}

View File

@@ -32,6 +32,7 @@ import javax.inject.Inject;
import net.runelite.api.Client;
import net.runelite.api.Perspective;
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.OverlayLayer;
import net.runelite.client.ui.overlay.OverlayPosition;
@@ -70,6 +71,23 @@ public class TileIndicatorsOverlay extends Overlay
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, playerPos);
if (playerPosLocal == null)
{
return null;
}
renderTile(graphics, playerPosLocal, config.highlightCurrentColor());
}
return null;
}