use of mekanism.client.gui.element.bar.GuiVerticalPowerBar in project Mekanism by mekanism.
the class GuiPRC method addGuiElements.
@Override
protected void addGuiElements() {
super.addGuiElements();
addButton(new GuiEnergyTab(this, tile.getEnergyContainer(), tile::getActive));
addButton(new GuiFluidGauge(() -> tile.inputFluidTank, () -> tile.getFluidTanks(null), GaugeType.STANDARD, this, 5, 10));
addButton(new GuiGasGauge(() -> tile.inputGasTank, () -> tile.getGasTanks(null), GaugeType.STANDARD, this, 28, 10));
addButton(new GuiGasGauge(() -> tile.outputGasTank, () -> tile.getGasTanks(null), GaugeType.SMALL, this, 140, 40));
addButton(new GuiVerticalPowerBar(this, tile.getEnergyContainer(), 163, 16));
addButton(new GuiProgress(tile::getScaledProgress, ProgressType.RIGHT, this, 77, 38).jeiCategory(tile));
}
use of mekanism.client.gui.element.bar.GuiVerticalPowerBar in project Mekanism by mekanism.
the class GuiPaintingMachine method addGuiElements.
@Override
protected void addGuiElements() {
super.addGuiElements();
addButton(new GuiVerticalPowerBar(this, tile.getEnergyContainer(), 164, 15));
addButton(new GuiEnergyTab(this, tile.getEnergyContainer(), tile::getActive));
addButton(new GuiPigmentGauge(() -> tile.pigmentTank, () -> tile.getPigmentTanks(null), GaugeType.STANDARD, this, 25, 13));
addButton(new GuiProgress(tile::getScaledProgress, ProgressType.LARGE_RIGHT, this, 64, 39).jeiCategory(tile).colored(new PigmentColorDetails()));
}
use of mekanism.client.gui.element.bar.GuiVerticalPowerBar in project Mekanism by mekanism.
the class GuiPortableTeleporter method addGuiElements.
@Override
protected void addGuiElements() {
super.addGuiElements();
addButton(new GuiTeleporterStatus(this, () -> getFrequency() != null, menu::getStatus));
addButton(new GuiVerticalPowerBar(this, new IBarInfoHandler() {
@Override
public ITextComponent getTooltip() {
IEnergyContainer container = StorageUtils.getEnergyContainer(menu.getStack(), 0);
return container == null ? EnergyDisplay.ZERO.getTextComponent() : EnergyDisplay.of(container).getTextComponent();
}
@Override
public double getLevel() {
IEnergyContainer container = StorageUtils.getEnergyContainer(menu.getStack(), 0);
return container == null ? 0 : container.getEnergy().divideToLevel(container.getMaxEnergy());
}
}, 158, 26));
teleportButton = addButton(new TranslationButton(this, 42, 147, 92, 20, MekanismLang.BUTTON_TELEPORT, () -> {
TeleporterFrequency frequency = getFrequency();
if (frequency != null && menu.getStatus() == 1) {
// This should always be true if the teleport button is active, but validate it just in case
ClientTickHandler.portableTeleport(getMinecraft().player, menu.getHand(), frequency.getIdentity());
getMinecraft().player.closeContainer();
} else {
// If something did go wrong make the teleport button not able to be pressed
teleportButton.active = false;
}
}));
// Teleporter button starts as deactivated until we have a frequency get synced
teleportButton.active = false;
addButton(new GuiFrequencySelector<>(this, 14));
}
use of mekanism.client.gui.element.bar.GuiVerticalPowerBar in project Mekanism by mekanism.
the class GuiPrecisionSawmill method addGuiElements.
@Override
protected void addGuiElements() {
super.addGuiElements();
addButton(new GuiUpArrow(this, 60, 38));
addButton(new GuiVerticalPowerBar(this, tile.getEnergyContainer(), 164, 15));
addButton(new GuiEnergyTab(this, tile.getEnergyContainer(), tile::getActive));
// Note: We just draw the wide slot on top of the normal slots so that it looks a bit better
addButton(new GuiSlot(SlotType.OUTPUT_WIDE, this, 111, 30));
addButton(new GuiProgress(tile::getScaledProgress, ProgressType.BAR, this, 78, 38).jeiCategory(tile));
}
use of mekanism.client.gui.element.bar.GuiVerticalPowerBar in project Mekanism by mekanism.
the class GuiSeismicVibrator method addGuiElements.
@Override
protected void addGuiElements() {
super.addGuiElements();
addButton(new GuiInnerScreen(this, 16, 23, 112, 40, () -> Arrays.asList(tile.getActive() ? MekanismLang.VIBRATING.translate() : MekanismLang.IDLE.translate(), MekanismLang.CHUNK.translate(tile.getBlockPos().getX() >> 4, tile.getBlockPos().getZ() >> 4))));
addButton(new GuiVerticalPowerBar(this, tile.getEnergyContainer(), 164, 15));
addButton(new GuiEnergyTab(this, tile.getEnergyContainer()));
}
Aggregations