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);
}
}
}
Aggregations