Add Dev Tools Cursor Pos (#506)

This commit is contained in:
Ganom
2019-06-05 18:37:41 -04:00
committed by Kyleeld
parent 102bbae108
commit 417c11122a
3 changed files with 16 additions and 0 deletions

View File

@@ -144,6 +144,11 @@ class DevToolsOverlay extends Overlay
renderGraphicsObjects(graphics);
}
if (plugin.getCursorPos().isActive())
{
renderCursorTooltip(graphics);
}
renderWidgets(graphics);
return null;
@@ -255,6 +260,14 @@ class DevToolsOverlay extends Overlay
}
}
private void renderCursorTooltip(Graphics2D graphics)
{
if (client.getMouseCanvasPosition().getX() >= 0 && client.getMouseCanvasPosition().getY() >= 0)
{
toolTipManager.add(new Tooltip("Cursor Point: " + client.getMouseCanvasPosition().getX() + ", " + client.getMouseCanvasPosition().getY()));
}
}
private void renderTileTooltip(Graphics2D graphics, Tile tile)
{
Polygon poly = Perspective.getCanvasTilePoly(client, tile.getLocalLocation());

View File

@@ -76,6 +76,7 @@ class DevToolsPanel extends PluginPanel
container.add(plugin.getLocation());
container.add(plugin.getWorldMapLocation());
container.add(plugin.getTileLocation());
container.add(plugin.getCursorPos());
container.add(plugin.getCameraPosition());
container.add(plugin.getChunkBorders());

View File

@@ -121,6 +121,7 @@ public class DevToolsPlugin extends Plugin
private DevToolsButton cameraPosition;
private DevToolsButton worldMapLocation;
private DevToolsButton tileLocation;
private DevToolsButton cursorPos;
private DevToolsButton interacting;
private DevToolsButton examine;
private DevToolsButton detachedCamera;
@@ -154,6 +155,7 @@ public class DevToolsPlugin extends Plugin
location = new DevToolsButton("Location");
worldMapLocation = new DevToolsButton("World Map Location");
tileLocation = new DevToolsButton("Tile Location");
cursorPos = new DevToolsButton("Cursor Position");
cameraPosition = new DevToolsButton("Camera Position");
chunkBorders = new DevToolsButton("Chunk Borders");