use of mekanism.client.gui.element.scroll.GuiScrollBar in project Mekanism by mekanism.
the class GuiSeismicReader method addGuiElements.
@Override
protected void addGuiElements() {
super.addGuiElements();
addButton(new GuiInnerScreen(this, 7, 11, 63, 49));
addButton(new GuiInnerScreen(this, 74, 11, 51, 159));
scrollBar = addButton(new GuiScrollBar(this, 126, 25, 131, blockList::size, () -> 1));
addButton(new GuiArrowSelection(this, 76, 81, () -> {
int currentLayer = scrollBar.getCurrentSelection();
if (currentLayer >= 0) {
return blockList.get(blockList.size() - 1 - currentLayer).getBlock().getName();
}
return null;
}));
upButton = addButton(new MekanismImageButton(this, 126, 11, 14, MekanismUtils.getResource(ResourceType.GUI_BUTTON, "up.png"), () -> scrollBar.adjustScroll(1)));
downButton = addButton(new MekanismImageButton(this, 126, 156, 14, MekanismUtils.getResource(ResourceType.GUI_BUTTON, "down.png"), () -> scrollBar.adjustScroll(-1)));
updateEnabledButtons();
}
Aggregations