Merge pull request #599 from runelite-extended/true

Updated Tile Indicator Plugin - Added true current tile
This commit is contained in:
Tyler Bochard
2019-06-15 02:24:29 -04:00
committed by GitHub
2 changed files with 51 additions and 12 deletions

View File

@@ -35,9 +35,9 @@ public interface TileIndicatorsConfig extends Config
{ {
@Alpha @Alpha
@ConfigItem( @ConfigItem(
keyName = "highlightDestinationColor", keyName = "highlightDestinationColor",
name = "Color of current destination highlighting", name = "Color of current destination highlighting",
description = "Configures the highlight color of current destination" description = "Configures the highlight color of current destination"
) )
default Color highlightDestinationColor() default Color highlightDestinationColor()
{ {
@@ -45,9 +45,9 @@ public interface TileIndicatorsConfig extends Config
} }
@ConfigItem( @ConfigItem(
keyName = "highlightDestinationTile", keyName = "highlightDestinationTile",
name = "Highlight destination tile", name = "Highlight destination tile",
description = "Highlights tile player is walking to" description = "Highlights tile player is walking to"
) )
default boolean highlightDestinationTile() default boolean highlightDestinationTile()
{ {
@@ -56,9 +56,30 @@ public interface TileIndicatorsConfig extends Config
@Alpha @Alpha
@ConfigItem( @ConfigItem(
keyName = "highlightHoveredColor", keyName = "highlightCurrentColor",
name = "Color of current hovered highlighting", name = "Color of current tile highlighting",
description = "Configures the highlight color of hovered tile" description = "Configures the highlight color of current tile position"
)
default Color highlightCurrentColor()
{
return Color.CYAN;
}
@ConfigItem(
keyName = "highlightCurrentTile",
name = "Highlight current tile",
description = "Highlights tile player is on"
)
default boolean highlightCurrentTile()
{
return false;
}
@Alpha
@ConfigItem(
keyName = "highlightHoveredColor",
name = "Color of current hovered highlighting",
description = "Configures the highlight color of hovered tile"
) )
default Color highlightHoveredColor() default Color highlightHoveredColor()
{ {
@@ -66,9 +87,9 @@ public interface TileIndicatorsConfig extends Config
} }
@ConfigItem( @ConfigItem(
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"
) )
default boolean highlightHoveredTile() default boolean highlightHoveredTile()
{ {

View File

@@ -32,6 +32,7 @@ import javax.inject.Inject;
import net.runelite.api.Client; import net.runelite.api.Client;
import net.runelite.api.Perspective; import net.runelite.api.Perspective;
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;
@@ -70,6 +71,23 @@ 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;
}
renderTile(graphics, playerPosLocal, config.highlightCurrentColor());
}
return null; return null;
} }