Search in sources :

Example 1 with IInteractionElement

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);
        }
    }
}
Also used : IInteractionElement(buildcraft.lib.gui.IInteractionElement) IGuiElement(buildcraft.lib.gui.IGuiElement)

Aggregations

IGuiElement (buildcraft.lib.gui.IGuiElement)1 IInteractionElement (buildcraft.lib.gui.IInteractionElement)1