use of mekanism.client.gui.element.custom.GuiModuleScreen 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));
}
}
Aggregations