remove c.o.c.u.overlayutil - unused
This commit is contained in:
@@ -1,174 +0,0 @@
|
||||
package com.openosrs.client.ui.overlay;
|
||||
|
||||
|
||||
import java.awt.BasicStroke;
|
||||
import java.awt.Color;
|
||||
import java.awt.Font;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Polygon;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Shape;
|
||||
import java.awt.Stroke;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.util.List;
|
||||
import net.runelite.api.*;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.coords.WorldArea;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.vars.InterfaceTab;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
|
||||
|
||||
public class OverlayUtil extends net.runelite.client.ui.overlay.OverlayUtil
|
||||
{
|
||||
public static void drawTiles(Graphics2D graphics, Client client, WorldPoint point, WorldPoint playerPoint, Color color, int strokeWidth, int outlineAlpha, int fillAlpha)
|
||||
{
|
||||
if (point.distanceTo(playerPoint) >= 32)
|
||||
{
|
||||
return;
|
||||
}
|
||||
LocalPoint lp = LocalPoint.fromWorld(client, point);
|
||||
if (lp == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Polygon poly = Perspective.getCanvasTilePoly(client, lp);
|
||||
if (poly == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
drawStrokeAndFillPoly(graphics, color, strokeWidth, outlineAlpha, fillAlpha, poly);
|
||||
}
|
||||
|
||||
public static void drawStrokeAndFillPoly(Graphics2D graphics, Color color, int strokeWidth, int outlineAlpha, int fillAlpha, Polygon poly)
|
||||
{
|
||||
graphics.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), outlineAlpha));
|
||||
graphics.setStroke(new BasicStroke(strokeWidth));
|
||||
graphics.draw(poly);
|
||||
graphics.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), fillAlpha));
|
||||
graphics.fill(poly);
|
||||
}
|
||||
|
||||
public static Rectangle renderPrayerOverlay(Graphics2D graphics, Client client, Prayer prayer, Color color)
|
||||
{
|
||||
Widget widget = client.getWidget(prayer.getWidgetInfo());
|
||||
|
||||
if (widget == null || client.getVar(VarClientInt.INVENTORY_TAB) != InterfaceTab.PRAYER.getId())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
Rectangle bounds = widget.getBounds();
|
||||
renderPolygon(graphics, rectangleToPolygon(bounds), color);
|
||||
return bounds;
|
||||
}
|
||||
|
||||
private static Polygon rectangleToPolygon(Rectangle rect)
|
||||
{
|
||||
int[] xpoints = {rect.x, rect.x + rect.width, rect.x + rect.width, rect.x};
|
||||
int[] ypoints = {rect.y, rect.y, rect.y + rect.height, rect.y + rect.height};
|
||||
|
||||
return new Polygon(xpoints, ypoints, 4);
|
||||
}
|
||||
|
||||
public static void renderTextLocation(Graphics2D graphics, String txtString, int fontSize, int fontStyle, Color fontColor, Point canvasPoint, boolean shadows, int yOffset)
|
||||
{
|
||||
graphics.setFont(new Font("Arial", fontStyle, fontSize));
|
||||
if (canvasPoint != null)
|
||||
{
|
||||
final Point canvasCenterPoint = new Point(
|
||||
canvasPoint.getX(),
|
||||
canvasPoint.getY() + yOffset);
|
||||
final Point canvasCenterPoint_shadow = new Point(
|
||||
canvasPoint.getX() + 1,
|
||||
canvasPoint.getY() + 1 + yOffset);
|
||||
if (shadows)
|
||||
{
|
||||
renderTextLocation(graphics, canvasCenterPoint_shadow, txtString, Color.BLACK);
|
||||
}
|
||||
renderTextLocation(graphics, canvasCenterPoint, txtString, fontColor);
|
||||
}
|
||||
}
|
||||
|
||||
public static void setProgressIcon(Graphics2D graphics, Point point, BufferedImage currentPhaseIcon, int totalWidth, int bgPadding, int currentPosX, Color colorIconBackground, int overlayIconDistance, Color colorIconBorder, Color colorIconBorderFill)
|
||||
{
|
||||
graphics.setStroke(new BasicStroke(2));
|
||||
graphics.setColor(colorIconBackground);
|
||||
graphics.fillOval(
|
||||
point.getX() - totalWidth / 2 + currentPosX - bgPadding,
|
||||
point.getY() - currentPhaseIcon.getHeight() / 2 - overlayIconDistance - bgPadding,
|
||||
currentPhaseIcon.getWidth() + bgPadding * 2,
|
||||
currentPhaseIcon.getHeight() + bgPadding * 2);
|
||||
|
||||
graphics.setColor(colorIconBorder);
|
||||
graphics.drawOval(
|
||||
point.getX() - totalWidth / 2 + currentPosX - bgPadding,
|
||||
point.getY() - currentPhaseIcon.getHeight() / 2 - overlayIconDistance - bgPadding,
|
||||
currentPhaseIcon.getWidth() + bgPadding * 2,
|
||||
currentPhaseIcon.getHeight() + bgPadding * 2);
|
||||
|
||||
graphics.drawImage(
|
||||
currentPhaseIcon,
|
||||
point.getX() - totalWidth / 2 + currentPosX,
|
||||
point.getY() - currentPhaseIcon.getHeight() / 2 - overlayIconDistance,
|
||||
null);
|
||||
|
||||
graphics.setColor(colorIconBorderFill);
|
||||
}
|
||||
|
||||
public static List<WorldPoint> getHitSquares(WorldPoint npcLoc, int npcSize, int thickness, boolean includeUnder)
|
||||
{
|
||||
List<WorldPoint> little = new WorldArea(npcLoc, npcSize, npcSize).toWorldPointList();
|
||||
List<WorldPoint> big = new WorldArea(npcLoc.getX() - thickness, npcLoc.getY() - thickness, npcSize + (thickness * 2), npcSize + (thickness * 2), npcLoc.getPlane()).toWorldPointList();
|
||||
if (!includeUnder)
|
||||
{
|
||||
big.removeIf(little::contains);
|
||||
}
|
||||
return big;
|
||||
}
|
||||
|
||||
public static void renderFilledPolygon(Graphics2D graphics, Shape poly, Color color)
|
||||
{
|
||||
graphics.setColor(color);
|
||||
final Stroke originalStroke = graphics.getStroke();
|
||||
graphics.setStroke(new BasicStroke(2));
|
||||
graphics.draw(poly);
|
||||
graphics.fill(poly);
|
||||
graphics.setStroke(originalStroke);
|
||||
}
|
||||
|
||||
public static void renderAreaTilePolygon(Graphics2D graphics, Shape poly, Color color)
|
||||
{
|
||||
graphics.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), 10));
|
||||
graphics.fill(poly);
|
||||
}
|
||||
|
||||
public static void renderFullLine(Graphics2D graphics, int[][] line, Color color)
|
||||
{
|
||||
graphics.setColor(color);
|
||||
final Stroke originalStroke = graphics.getStroke();
|
||||
graphics.setStroke(new BasicStroke(2));
|
||||
graphics.drawLine(line[0][0], line[0][1], line[1][0], line[1][1]);
|
||||
graphics.setStroke(originalStroke);
|
||||
}
|
||||
|
||||
public static void renderDashedLine(Graphics2D graphics, int[][] line, Color color)
|
||||
{
|
||||
graphics.setColor(color);
|
||||
final Stroke originalStroke = graphics.getStroke();
|
||||
graphics.setStroke(new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, new float[]{9}, 0));
|
||||
graphics.drawLine(line[0][0], line[0][1], line[1][0], line[1][1]);
|
||||
graphics.setStroke(originalStroke);
|
||||
}
|
||||
|
||||
public static void renderOutlinePolygon(Graphics2D graphics, Shape poly, Color color)
|
||||
{
|
||||
graphics.setColor(color);
|
||||
final Stroke originalStroke = graphics.getStroke();
|
||||
graphics.setStroke(new BasicStroke(2));
|
||||
graphics.draw(poly);
|
||||
graphics.setStroke(originalStroke);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user