use of forestry.core.gui.tooltips.IToolTipProvider in project ForestryMC by ForestryMC.
the class GuiUtil method drawToolTips.
public static void drawToolTips(GuiForestry gui, Collection<?> objects, int mouseX, int mouseY) {
for (Object obj : objects) {
if (!(obj instanceof IToolTipProvider)) {
continue;
}
IToolTipProvider provider = (IToolTipProvider) obj;
if (!provider.isToolTipVisible()) {
continue;
}
ToolTip tips = provider.getToolTip(mouseX - gui.getGuiLeft(), mouseY - gui.getGuiTop());
if (tips == null) {
continue;
}
boolean mouseOver = provider.isMouseOver(mouseX - gui.getGuiLeft(), mouseY - gui.getGuiTop());
tips.onTick(mouseOver);
if (mouseOver && tips.isReady()) {
tips.refresh();
drawToolTips(gui, tips, mouseX, mouseY);
}
}
}
Aggregations