Interface IOverlayListener


public interface IOverlayListener
Interface for receiving user events related to an Overlay.
  • Method Details

    • onActivate

      default void onActivate(UIState mapState)
      Called when the Overlay is actively displayed.
      Parameters:
      mapState - current UIState of the UI where the overlay is active.
    • onDeactivate

      default void onDeactivate(UIState mapState)
      Called when Overlay is no longer displayed.
      Parameters:
      mapState - current UIState of the UI where the overlay is inactive.
    • onMouseMove

      default void onMouseMove(UIState mapState, Point2D.Double mousePosition, BlockPos blockPosition)
      Called when the mouse moves within the bounds of the overlay.
      Parameters:
      mapState - current UIState of the UI where the overlay is active.
      mousePosition - screen coordinates of the mouse
      blockPosition - the block position under the mouse
    • onMouseOut

      default void onMouseOut(UIState mapState, Point2D.Double mousePosition, BlockPos blockPosition)
      Called when the mouse first leaves the bounds of the overlay.
      Parameters:
      mapState - current UIState of the UI where the overlay is active.
      mousePosition - screen coordinates of the mouse
      blockPosition - the block position under the mouse
    • onMouseClick

      default boolean onMouseClick(UIState mapState, Point2D.Double mousePosition, BlockPos blockPosition, int button, boolean doubleClick)
      Called when the mouse is clicked within the bounds of the overlay.
      Parameters:
      mapState - current UIState of the UI where the overlay is active.
      mousePosition - screen coordinates of the mouse
      blockPosition - the block position under the mouse
      button - the mouse button clicked
      doubleClick - true if the mouse button was double-clicked
      Returns:
      true if click event can bubble up to other overlays which occupy the same area.
    • onOverlayMenuPopup

      default void onOverlayMenuPopup(UIState mapState, Point2D.Double mousePosition, BlockPos blockPosition, ModPopupMenu modPopupMenu)
      Called when the popup menu is displayed on an overlay.
      Parameters:
      mapState - current UIState of the UI where the overlay is active.
      mousePosition - screen coordinates of the mouse
      blockPosition - the block position under the mouse
      modPopupMenu - the modMenuPopup