use of mekanism.client.gui.element.scroll.GuiModuleScrollList in project Mekanism by mekanism.
the class GuiModuleTweaker method addGuiElements.
@Override
protected void addGuiElements() {
super.addGuiElements();
moduleScreen = addButton(new GuiModuleScreen(this, 138, 20, () -> menu.slots.get(selected).getSlotIndex()));
scrollList = addButton(new GuiModuleScrollList(this, 30, 20, 108, 116, () -> getStack(selected), this::onModuleSelected));
addButton(new GuiElementHolder(this, 30, 136, 108, 18));
optionsButton = addButton(new TranslationButton(this, 31, 137, 106, 16, MekanismLang.BUTTON_OPTIONS, this::openOptions));
optionsButton.active = false;
int size = menu.slots.size();
for (int i = 0; i < size; i++) {
Slot slot = menu.slots.get(i);
final int index = i;
// initialize selected item
if (selected == -1 && isValidItem(index)) {
select(index);
}
addButton(new GuiSlot(SlotType.NORMAL, this, slot.x - 1, slot.y - 1).click((e, x, y) -> select(index)).overlayColor(isValidItem(index) ? null : () -> 0xCC333333).with(() -> index == selected ? SlotOverlay.SELECT : null));
}
}
use of mekanism.client.gui.element.scroll.GuiModuleScrollList in project Mekanism by mekanism.
the class GuiModificationStation method addGuiElements.
@Override
protected void addGuiElements() {
super.addGuiElements();
addButton(new GuiVerticalPowerBar(this, tile.getEnergyContainer(), 154, 40));
addButton(new GuiEnergyTab(this, tile.getEnergyContainer()));
addButton(new GuiProgress(tile::getScaledProgress, ProgressType.LARGE_RIGHT, this, 65, 123));
removeButton = addButton(new TranslationButton(this, 34, 96, 108, 17, MekanismLang.BUTTON_REMOVE, () -> Mekanism.packetHandler.sendToServer(new PacketRemoveModule(tile.getBlockPos(), selectedModule.getData()))));
removeButton.active = false;
addButton(new GuiModuleScrollList(this, 34, 20, 108, 74, () -> tile.containerSlot.getStack().copy(), this::onModuleSelected));
}
Aggregations