Merge remote-tracking branch 'runelite/master'

This commit is contained in:
Owain van Brakel
2020-02-09 01:30:26 +01:00
22 changed files with 729 additions and 221 deletions

View File

@@ -307,6 +307,17 @@ public enum Varbits
PERSONAL_POINTS(5422),
RAID_PARTY_SIZE(5424),
/**
* Making Friends with My Arm fire pits
*
* Expected values:
* 0 = Not built
* 1 = Built
*/
FIRE_PIT_GIANT_MOLE(6532),
FIRE_PIT_LUMBRIDGE_SWAMP(6533),
FIRE_PIT_MOS_LE_HARMLESS(6544),
/**
* Theatre of Blood 1=In Party, 2=Inside/Spectator, 3=Dead Spectating
*/

View File

@@ -26,6 +26,7 @@ package net.runelite.api.widgets;
import net.runelite.api.Point;
import java.awt.Rectangle;
import javax.annotation.Nullable;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.ToString;
@@ -64,19 +65,40 @@ public class WidgetItem
*/
private final Widget widget;
/**
* Whether or not this widget item is being dragged.
* The canvas bounds for the widget, if it is being dragged.
*/
private final boolean dragging;
@Nullable
private final Rectangle draggingCanvasBounds;
/**
* Get the area where the widget item is drawn on the canvas, accounting for drag
* @return
*/
public Rectangle getCanvasBounds()
{
return draggingCanvasBounds == null ? canvasBounds : draggingCanvasBounds;
}
/**
* Get the area where the widget item is drawn on the canvas
* @param dragging whether the returned area should account for widget drag
* @return
*/
public Rectangle getCanvasBounds(boolean dragging)
{
return dragging ? draggingCanvasBounds : canvasBounds;
}
/**
* Gets the upper-left coordinate of where the widget is being drawn
* on the canvas.
* on the canvas, accounting for drag.
*
* @return the upper-left coordinate of where this widget is drawn
*/
public Point getCanvasLocation()
{
return new Point((int) canvasBounds.getX(), (int) canvasBounds.getY());
Rectangle bounds = getCanvasBounds();
return new Point((int) bounds.getX(), (int) bounds.getY());
}
}