Add Dev Tools Cursor Pos (#506)
This commit is contained in:
@@ -144,6 +144,11 @@ class DevToolsOverlay extends Overlay
|
|||||||
renderGraphicsObjects(graphics);
|
renderGraphicsObjects(graphics);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (plugin.getCursorPos().isActive())
|
||||||
|
{
|
||||||
|
renderCursorTooltip(graphics);
|
||||||
|
}
|
||||||
|
|
||||||
renderWidgets(graphics);
|
renderWidgets(graphics);
|
||||||
|
|
||||||
return null;
|
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)
|
private void renderTileTooltip(Graphics2D graphics, Tile tile)
|
||||||
{
|
{
|
||||||
Polygon poly = Perspective.getCanvasTilePoly(client, tile.getLocalLocation());
|
Polygon poly = Perspective.getCanvasTilePoly(client, tile.getLocalLocation());
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ class DevToolsPanel extends PluginPanel
|
|||||||
container.add(plugin.getLocation());
|
container.add(plugin.getLocation());
|
||||||
container.add(plugin.getWorldMapLocation());
|
container.add(plugin.getWorldMapLocation());
|
||||||
container.add(plugin.getTileLocation());
|
container.add(plugin.getTileLocation());
|
||||||
|
container.add(plugin.getCursorPos());
|
||||||
container.add(plugin.getCameraPosition());
|
container.add(plugin.getCameraPosition());
|
||||||
|
|
||||||
container.add(plugin.getChunkBorders());
|
container.add(plugin.getChunkBorders());
|
||||||
|
|||||||
@@ -121,6 +121,7 @@ public class DevToolsPlugin extends Plugin
|
|||||||
private DevToolsButton cameraPosition;
|
private DevToolsButton cameraPosition;
|
||||||
private DevToolsButton worldMapLocation;
|
private DevToolsButton worldMapLocation;
|
||||||
private DevToolsButton tileLocation;
|
private DevToolsButton tileLocation;
|
||||||
|
private DevToolsButton cursorPos;
|
||||||
private DevToolsButton interacting;
|
private DevToolsButton interacting;
|
||||||
private DevToolsButton examine;
|
private DevToolsButton examine;
|
||||||
private DevToolsButton detachedCamera;
|
private DevToolsButton detachedCamera;
|
||||||
@@ -154,6 +155,7 @@ public class DevToolsPlugin extends Plugin
|
|||||||
location = new DevToolsButton("Location");
|
location = new DevToolsButton("Location");
|
||||||
worldMapLocation = new DevToolsButton("World Map Location");
|
worldMapLocation = new DevToolsButton("World Map Location");
|
||||||
tileLocation = new DevToolsButton("Tile Location");
|
tileLocation = new DevToolsButton("Tile Location");
|
||||||
|
cursorPos = new DevToolsButton("Cursor Position");
|
||||||
cameraPosition = new DevToolsButton("Camera Position");
|
cameraPosition = new DevToolsButton("Camera Position");
|
||||||
|
|
||||||
chunkBorders = new DevToolsButton("Chunk Borders");
|
chunkBorders = new DevToolsButton("Chunk Borders");
|
||||||
|
|||||||
Reference in New Issue
Block a user