overlay: add mouseover callback

This commit is contained in:
Adam
2020-03-13 18:55:33 -04:00
committed by Adam
parent df18bdb542
commit ed5c0f7336
2 changed files with 12 additions and 3 deletions

View File

@@ -68,4 +68,8 @@ public abstract class Overlay implements LayoutableRenderableEntity
{
return this.getClass().getSimpleName();
}
public void onMouseOver()
{
}
}

View File

@@ -223,7 +223,7 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener
if (!isResizeable)
{
// On fixed mode, ABOVE_CHATBOX_RIGHT is in the same location as
// BOTTOM_RIGHT and CANVAST_TOP_RIGHT is same as TOP_RIGHT.
// BOTTOM_RIGHT and CANVAS_TOP_RIGHT is same as TOP_RIGHT.
// Just use BOTTOM_RIGHT and TOP_RIGHT to prevent overlays from
// drawing over each other.
switch (overlayPosition)
@@ -304,9 +304,14 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener
graphics.setColor(previous);
}
if (menuEntries == null && !client.isMenuOpen() && !client.getSpellSelected() && bounds.contains(mouse))
if (!client.isMenuOpen() && !client.getSpellSelected() && bounds.contains(mouse))
{
menuEntries = createRightClickMenuEntries(overlay);
if (menuEntries == null)
{
menuEntries = createRightClickMenuEntries(overlay);
}
overlay.onMouseOver();
}
}
}