Add interface and layer draw hooks for overlays

This allows overlays to request draw after any interface or layer. This
allows removal of the ABOVE_MAP layer which can now just be replaced
with requesting draw after the map interface. This also fixes item
overlays from drawing over top of the map by now drawing the item
overlay immediately after the interface and/or layer the item is on is
drawn.

For backwards compatability, ABOVE_WIDGETS is kept as a layer, but
internally just requests draw after the 3 TLIs.

Due to overlays defaulting to the UNDER_WIDGETS layer, a new layer
MANUAL has been added, which is intended for use when requesting draw
after specific interfaces or layers, so that the overlay is otherwise
not drawn a second time due to being UNDER_WIDGETS.
This commit is contained in:
Adam
2020-12-14 21:01:46 -05:00
parent a43a344aca
commit 34e37dcc57
14 changed files with 186 additions and 122 deletions

View File

@@ -28,7 +28,9 @@ import java.awt.Graphics;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.awt.event.MouseWheelEvent;
import java.util.List;
import net.runelite.api.MainBufferProvider;
import net.runelite.api.widgets.Widget;
import net.runelite.api.widgets.WidgetItem;
/**
@@ -70,8 +72,6 @@ public interface Callbacks
*/
void drawAboveOverheads();
void drawAfterWidgets();
/**
* Client top-most draw method, rendering over top of most of game interfaces.
*
@@ -83,9 +83,18 @@ public interface Callbacks
void draw(MainBufferProvider mainBufferProvider, Graphics graphics, int x, int y);
/**
* Called before the client will render an item widget.
* Called after an interface has been drawn
* @param interfaceId the interface id
* @param widgetItems Widget items within the interface
*/
void drawItem(int itemId, WidgetItem widgetItem);
void drawInterface(int interfaceId, List<WidgetItem> widgetItems);
/**
* Called after a widget layer has been drawn
* @param layer The layer
* @param widgetItems Widget items within the layer
*/
void drawLayer(Widget layer, List<WidgetItem> widgetItems);
/**
* Mouse pressed event. If this event will be consumed it will not be propagated further to client.