Search in sources :

Example 1 with View

use of com.minecolonies.blockout.views.View in project minecolonies by Minecolonies.

the class WindowMultiBlock method rightClick.

@Override
public void rightClick(final int mx, final int my) {
    Pane pane = this.findPaneForClick(mx, my);
    if (pane instanceof View) {
        pane = ((View) pane).findPaneForClick(mx - pane.getX(), my - pane.getY());
    }
    if (pane instanceof ButtonImage && pane.isEnabled()) {
        final EnumFacing newFacing;
        switch(pane.getID()) {
            case BUTTON_UP:
                newFacing = UP;
                break;
            case BUTTON_DOWN:
                newFacing = DOWN;
                break;
            case BUTTON_FORWARD:
                newFacing = NORTH;
                break;
            case BUTTON_BACKWARD:
                newFacing = SOUTH;
                break;
            case BUTTON_RIGHT:
                newFacing = EAST;
                break;
            case BUTTON_LEFT:
                newFacing = WEST;
                break;
            default:
                newFacing = UP;
                break;
        }
        enable(output, newFacing, true);
    }
}
Also used : EnumFacing(net.minecraft.util.EnumFacing) ButtonImage(com.minecolonies.blockout.controls.ButtonImage) Pane(com.minecolonies.blockout.Pane) View(com.minecolonies.blockout.views.View)

Aggregations

Pane (com.minecolonies.blockout.Pane)1 ButtonImage (com.minecolonies.blockout.controls.ButtonImage)1 View (com.minecolonies.blockout.views.View)1 EnumFacing (net.minecraft.util.EnumFacing)1