Add Dev Tools Cursor Pos (#506)
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user