use of mekanism.generators.client.gui.element.button.ReactorLogicButton in project Mekanism by mekanism.
the class GuiFissionReactorLogicAdapter method addGuiElements.
@Override
protected void addGuiElements() {
super.addGuiElements();
addButton(new GuiElementHolder(this, 16, 31, 130, 90));
scrollBar = addButton(new GuiScrollBar(this, 146, 31, 90, () -> tile.getModes().length, () -> DISPLAY_COUNT));
for (int i = 0; i < DISPLAY_COUNT; i++) {
int typeShift = 22 * i;
addButton(new ReactorLogicButton<>(this, 17, 32 + typeShift, i, tile, scrollBar::getCurrentSelection, tile::getModes, type -> {
if (type == null) {
return;
}
MekanismGenerators.packetHandler.sendToServer(new PacketGeneratorsGuiInteract(GeneratorsGuiInteraction.LOGIC_TYPE, tile, type.ordinal()));
}));
}
}
use of mekanism.generators.client.gui.element.button.ReactorLogicButton in project Mekanism by mekanism.
the class GuiFusionReactorLogicAdapter method addGuiElements.
@Override
protected void addGuiElements() {
super.addGuiElements();
addButton(new GuiElementHolder(this, 16, 31, 130, 90));
addButton(new ToggleButton(this, 16, 19, 11, tile::isActiveCooled, () -> Mekanism.packetHandler.sendToServer(new PacketGuiInteract(GuiInteraction.NEXT_MODE, tile)), getOnHover(GeneratorsLang.REACTOR_LOGIC_TOGGLE_COOLING)));
scrollBar = addButton(new GuiScrollBar(this, 146, 31, 90, () -> tile.getModes().length, () -> DISPLAY_COUNT));
for (int i = 0; i < DISPLAY_COUNT; i++) {
int typeShift = 22 * i;
addButton(new ReactorLogicButton<>(this, 17, 32 + typeShift, i, tile, scrollBar::getCurrentSelection, tile::getModes, type -> {
if (type == null) {
return;
}
MekanismGenerators.packetHandler.sendToServer(new PacketGeneratorsGuiInteract(GeneratorsGuiInteraction.LOGIC_TYPE, tile, type.ordinal()));
}));
}
}
Aggregations