Search in sources :

Example 1 with IToolTipProvider

use of buildcraft.core.lib.gui.tooltips.IToolTipProvider in project BuildCraft by BuildCraft.

the class GuiBuildCraft method drawToolTips.

private void drawToolTips(Collection<?> objects, int mouseX, int mouseY, int offsetX, int offsetY) {
    for (Object obj : objects) {
        if (!(obj instanceof IToolTipProvider)) {
            continue;
        }
        IToolTipProvider provider = (IToolTipProvider) obj;
        if (!provider.isToolTipVisible()) {
            continue;
        }
        ToolTip tips = provider.getToolTip();
        if (tips == null) {
            continue;
        }
        boolean mouseOver = provider.isMouseOver(mouseX, mouseY);
        tips.onTick(mouseOver);
        if (mouseOver && tips.isReady()) {
            tips.refresh();
            drawToolTips(tips, mouseX + offsetX, mouseY + offsetY);
        }
    }
}
Also used : ToolTip(buildcraft.lib.gui.elem.ToolTip) IToolTipProvider(buildcraft.core.lib.gui.tooltips.IToolTipProvider)

Aggregations

IToolTipProvider (buildcraft.core.lib.gui.tooltips.IToolTipProvider)1 ToolTip (buildcraft.lib.gui.elem.ToolTip)1