diff --git a/src/main/java/mcp/mobius/waila/api/IWailaVariableWidthTooltipRenderer.java b/src/main/java/mcp/mobius/waila/api/IWailaVariableWidthTooltipRenderer.java index 95cc74d..9782c9b 100644 --- a/src/main/java/mcp/mobius/waila/api/IWailaVariableWidthTooltipRenderer.java +++ b/src/main/java/mcp/mobius/waila/api/IWailaVariableWidthTooltipRenderer.java @@ -1,5 +1,7 @@ package mcp.mobius.waila.api; +import java.awt.Dimension; + /** * Interface for tooltip renderers that adjust their width depending on the width of the rest of the tooltip. * setMaxLineWidth is called by {@link mcp.mobius.waila.overlay.Tooltip} before every tooltip render to inform the @@ -7,6 +9,17 @@ package mcp.mobius.waila.api; */ public interface IWailaVariableWidthTooltipRenderer extends IWailaTooltipRenderer { + /** + * Return the size of the tooltip. for variable width renderers it is recommended to return the minimum width needed + * for the line, then draw the actual width using getMaxLineWidth(). They do not need to actually match. + * + * @param params Array of string parameters as passed to the RENDER arg in the tooltip + * ({rendername,param1,param2,...}) + * @param accessor A global accessor for TileEntities and Entities + * @return Dimension of the reserved area + */ + Dimension getSize(String[] params, IWailaCommonAccessor accessor); + /** * Informs the renderer of what the length of the longest line is.
* Called by {@link mcp.mobius.waila.overlay.Tooltip} before every tooltip render.