From 10fa8ce5f369e6ca8d0ed5b1fb8ee5f97d56c16b Mon Sep 17 00:00:00 2001 From: jesse1412 Date: Sun, 10 Feb 2019 18:26:56 +0000 Subject: [PATCH 1/5] Add current tile indicator to tileindicators plugin --- .../tileindicators/TileIndicatorsConfig.java | 21 +++++++++++++++++ .../tileindicators/TileIndicatorsOverlay.java | 23 +++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsConfig.java index 9d9cd96e69..3b04d635b4 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsConfig.java @@ -54,6 +54,27 @@ public interface TileIndicatorsConfig extends Config 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( keyName = "highlightHoveredTile", name = "Highlight hovered tile", diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsOverlay.java index f92a76f6de..fd42553ce1 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsOverlay.java @@ -33,6 +33,7 @@ import net.runelite.api.Client; import net.runelite.api.Perspective; import net.runelite.api.Point; 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; @@ -84,6 +85,28 @@ 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, 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; } From d0b4038abeabecc15a3aa9285975f3d517f9981e Mon Sep 17 00:00:00 2001 From: jesse1412 Date: Sun, 10 Feb 2019 18:54:44 +0000 Subject: [PATCH 2/5] Use current tile instead of target tile for current tile rendering --- .../plugins/tileindicators/TileIndicatorsOverlay.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsOverlay.java index fd42553ce1..b4909e76e3 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsOverlay.java @@ -66,8 +66,8 @@ public class TileIndicatorsOverlay extends Overlay { Point p = client.getMouseCanvasPosition(); p = new Point( - p.getX() - client.getViewportXOffset(), - p.getY() - client.getViewportYOffset()); + p.getX() - client.getViewportXOffset(), + p.getY() - client.getViewportYOffset()); client.setCheckClick(true); client.setMouseCanvasHoverPosition(p); @@ -99,12 +99,7 @@ public class TileIndicatorsOverlay extends Overlay return null; } - Polygon poly = Perspective.getCanvasTilePoly(client, playerPosLocal); - if (poly == null) - { - return null; - } - renderTile(graphics, client.getLocalDestinationLocation(), config.highlightCurrentColor()); + renderTile(graphics, playerPosLocal, config.highlightCurrentColor()); } return null; From 556da724b7634097a1692cff0ab9689b707c27e1 Mon Sep 17 00:00:00 2001 From: jesse1412 Date: Mon, 11 Feb 2019 04:01:44 +0000 Subject: [PATCH 3/5] Change default configuration values and use proper styling --- .../tileindicators/TileIndicatorsConfig.java | 16 ++++++++-------- .../tileindicators/TileIndicatorsOverlay.java | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsConfig.java index 3b04d635b4..fcff77c540 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsConfig.java @@ -56,23 +56,23 @@ public interface TileIndicatorsConfig extends Config @Alpha @ConfigItem( - keyName = "highlightCurrentColor", - name = "Color of current tile highlighting", - description = "Configures the highlight color of current destination" + keyName = "highlightCurrentColor", + name = "Color of current tile highlighting", + description = "Configures the highlight color of current destination" ) default Color highlightCurrentColor() { - return Color.GRAY; + return Color.cyan; } @ConfigItem( - keyName = "highlightCurrentTile", - name = "Highlight current tile", - description = "Highlights tile player is on" + keyName = "highlightCurrentTile", + name = "Highlight current tile", + description = "Highlights tile player is on" ) default boolean highlightCurrentTile() { - return true; + return false; } @ConfigItem( diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsOverlay.java index b4909e76e3..b4c546ccc9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsOverlay.java @@ -66,8 +66,8 @@ public class TileIndicatorsOverlay extends Overlay { Point p = client.getMouseCanvasPosition(); p = new Point( - p.getX() - client.getViewportXOffset(), - p.getY() - client.getViewportYOffset()); + p.getX() - client.getViewportXOffset(), + p.getY() - client.getViewportYOffset()); client.setCheckClick(true); client.setMouseCanvasHoverPosition(p); From dba542d689af67bf4bffed78f5df8ec75fd866e6 Mon Sep 17 00:00:00 2001 From: James Munson Date: Fri, 14 Jun 2019 00:03:27 -0700 Subject: [PATCH 4/5] Update --- .../client/plugins/tileindicators/TileIndicatorsConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsConfig.java index d8d9fd7d36..69b22e5be9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsConfig.java @@ -62,7 +62,7 @@ public interface TileIndicatorsConfig extends Config ) default Color highlightCurrentColor() { - return Color.cyan; + return Color.CYAN; } @ConfigItem( From 67f6163f4c05d9bf430e47044b65078695f89e0b Mon Sep 17 00:00:00 2001 From: James Munson Date: Fri, 14 Jun 2019 00:27:50 -0700 Subject: [PATCH 5/5] Fix --- .../tileindicators/TileIndicatorsConfig.java | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsConfig.java index 69b22e5be9..0d1022d92f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/tileindicators/TileIndicatorsConfig.java @@ -35,9 +35,9 @@ public interface TileIndicatorsConfig extends Config { @Alpha @ConfigItem( - keyName = "highlightDestinationColor", - name = "Color of current destination highlighting", - description = "Configures the highlight color of current destination" + keyName = "highlightDestinationColor", + name = "Color of current destination highlighting", + description = "Configures the highlight color of current destination" ) default Color highlightDestinationColor() { @@ -45,9 +45,9 @@ public interface TileIndicatorsConfig extends Config } @ConfigItem( - keyName = "highlightDestinationTile", - name = "Highlight destination tile", - description = "Highlights tile player is walking to" + keyName = "highlightDestinationTile", + name = "Highlight destination tile", + description = "Highlights tile player is walking to" ) default boolean highlightDestinationTile() { @@ -56,9 +56,9 @@ public interface TileIndicatorsConfig extends Config @Alpha @ConfigItem( - keyName = "highlightCurrentColor", - name = "Color of current tile highlighting", - description = "Configures the highlight color of current tile position" + keyName = "highlightCurrentColor", + name = "Color of current tile highlighting", + description = "Configures the highlight color of current tile position" ) default Color highlightCurrentColor() { @@ -66,20 +66,20 @@ public interface TileIndicatorsConfig extends Config } @ConfigItem( - keyName = "highlightCurrentTile", - name = "Highlight current tile", - description = "Highlights tile player is on" + 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" + keyName = "highlightHoveredColor", + name = "Color of current hovered highlighting", + description = "Configures the highlight color of hovered tile" ) default Color highlightHoveredColor() { @@ -87,9 +87,9 @@ public interface TileIndicatorsConfig extends Config } @ConfigItem( - keyName = "highlightHoveredTile", - name = "Highlight hovered tile", - description = "Highlights tile player is hovering with mouse" + keyName = "highlightHoveredTile", + name = "Highlight hovered tile", + description = "Highlights tile player is hovering with mouse" ) default boolean highlightHoveredTile() {