Package mcp.mobius.waila.api
Interface IEventListener
Used to listen to generic Waila events.
Register implementations with IClientRegistrar.eventListener(mcp.mobius.waila.api.IEventListener, int)
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetHoveredItemModName
(ItemStack stack, IPluginConfig config) This event is fired when item tooltip is displayed on container screen and waila showing the item's mod name.default void
onAfterTooltipRender
(GuiGraphics ctx, Rectangle rect, ICommonAccessor accessor, IPluginConfig config) This event is fired just after the tooltip is rendered.default void
onBeforeTooltipRender
(GuiGraphics ctx, Rectangle rect, ICommonAccessor accessor, IPluginConfig config, IEventListener.Canceller canceller) This event is fired just before the tooltip is rendered.default void
onHandleTooltip
(ITooltip tooltip, ICommonAccessor accessor, IPluginConfig config) This event is fired just before the tooltip size is calculated.
-
Method Details
-
onHandleTooltip
This event is fired just before the tooltip size is calculated. This is the last chance to make edits to the information being displayed. -
onBeforeTooltipRender
default void onBeforeTooltipRender(GuiGraphics ctx, Rectangle rect, ICommonAccessor accessor, IPluginConfig config, IEventListener.Canceller canceller) This event is fired just before the tooltip is rendered.- Parameters:
rect
- the position and dimension of the tooltip, you can modify this to transform the tooltipcanceller
- callIEventListener.Canceller.cancel()
to cancel this event, if canceled, the tooltip will not render
-
onAfterTooltipRender
default void onAfterTooltipRender(GuiGraphics ctx, Rectangle rect, ICommonAccessor accessor, IPluginConfig config) This event is fired just after the tooltip is rendered.- Parameters:
rect
- the position and dimension of the tooltip
-
getHoveredItemModName
This event is fired when item tooltip is displayed on container screen and waila showing the item's mod name.- Returns:
- null if this listener doesn't decide the name, otherwise return a string
-