use of buildcraft.lib.gui.IInteractionElement in project BuildCraft by BuildCraft.
the class Ledger_Neptune method onMouseClicked.
@Override
public void onMouseClicked(int button) {
boolean childClicked = false;
for (IGuiElement elem : openElements) {
if (elem instanceof IInteractionElement) {
((IInteractionElement) elem).onMouseClicked(button);
childClicked |= elem.contains(gui.mouse);
}
}
for (IGuiElement elem : closedElements) {
if (elem instanceof IInteractionElement) {
((IInteractionElement) elem).onMouseClicked(button);
childClicked |= elem.contains(gui.mouse);
}
}
if (!childClicked && contains(gui.mouse)) {
boolean nowOpen = false;
if (currentDifference == 1) {
currentDifference = -1;
} else {
currentDifference = 1;
nowOpen = true;
}
if (isOpenProperty != null) {
isOpenProperty.set(nowOpen);
}
}
}
Aggregations