use of mekanism.client.gui.element.button.ToggleButton in project Mekanism by mekanism.
the class GuiRotaryCondensentrator method addGuiElements.
@Override
protected void addGuiElements() {
super.addGuiElements();
addButton(new GuiDownArrow(this, 159, 44));
addButton(new GuiHorizontalPowerBar(this, tile.getEnergyContainer(), 115, 75));
addButton(new GuiEnergyTab(this, tile.getEnergyContainer(), tile::getEnergyUsed));
addButton(new GuiFluidGauge(() -> tile.fluidTank, () -> tile.getFluidTanks(null), GaugeType.STANDARD, this, 133, 13));
addButton(new GuiGasGauge(() -> tile.gasTank, () -> tile.getGasTanks(null), GaugeType.STANDARD, this, 25, 13));
addButton(new GuiProgress(new IBooleanProgressInfoHandler() {
@Override
public boolean fillProgressBar() {
return tile.getActive();
}
@Override
public boolean isActive() {
return !tile.mode;
}
}, ProgressType.LARGE_RIGHT, this, 64, 39).jeiCategories(condensentrating));
addButton(new GuiProgress(new IBooleanProgressInfoHandler() {
@Override
public boolean fillProgressBar() {
return tile.getActive();
}
@Override
public boolean isActive() {
return tile.mode;
}
}, ProgressType.LARGE_LEFT, this, 64, 39).jeiCategories(decondensentrating));
addButton(new ToggleButton(this, 4, 4, () -> tile.mode, () -> Mekanism.packetHandler.sendToServer(new PacketGuiInteract(GuiInteraction.NEXT_MODE, tile)), getOnHover(MekanismLang.CONDENSENTRATOR_TOGGLE)));
}
use of mekanism.client.gui.element.button.ToggleButton 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