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);
}
}
Aggregations