int mX = mouseX - left;
int mY = mouseY - top;
for (Widget element : container.getElements()) {
if (element.hidden)
continue;
ToolTip tips = element.getToolTip();
if (tips == null)
continue;
boolean mouseOver = element.isMouseOver(mX, mY);
tips.onTick(mouseOver);
if (mouseOver && tips.isReady()) {
tips.refresh();
drawToolTips(tips, mouseX, mouseY);
}
}
for (Object button : buttonList) {
if (!(button instanceof GuiBetterButton))
continue;
GuiBetterButton betterButton = (GuiBetterButton) button;
if (!betterButton.visible)
continue;
ToolTip tips = betterButton.getToolTip();
if (tips == null)
continue;
boolean mouseOver = betterButton.isMouseOverButton(mouseX, mouseY);
tips.onTick(mouseOver);
if (mouseOver && tips.isReady()) {
tips.refresh();
drawToolTips(tips, mouseX, mouseY);
}
}
for (Object obj : inventorySlots.inventorySlots) {
if (!(obj instanceof SlotRailcraft))
continue;
SlotRailcraft slot = (SlotRailcraft) obj;
if (slot.getStack() != null)
continue;
ToolTip tips = slot.getToolTip();
if (tips == null)
continue;
boolean mouseOver = isMouseOverSlot(slot, mouseX, mouseY);
tips.onTick(mouseOver);
if (mouseOver && tips.isReady()) {
tips.refresh();
drawToolTips(tips, mouseX, mouseY);
}
}
}