Search in sources :

Example 21 with GuiVerticalPowerBar

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));
}
Also used : GuiFluidGauge(mekanism.client.gui.element.gauge.GuiFluidGauge) GuiProgress(mekanism.client.gui.element.progress.GuiProgress) GuiGasGauge(mekanism.client.gui.element.gauge.GuiGasGauge) GuiVerticalPowerBar(mekanism.client.gui.element.bar.GuiVerticalPowerBar) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab)

Example 22 with GuiVerticalPowerBar

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()));
}
Also used : GuiProgress(mekanism.client.gui.element.progress.GuiProgress) GuiPigmentGauge(mekanism.client.gui.element.gauge.GuiPigmentGauge) GuiVerticalPowerBar(mekanism.client.gui.element.bar.GuiVerticalPowerBar) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab)

Example 23 with GuiVerticalPowerBar

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));
}
Also used : IBarInfoHandler(mekanism.client.gui.element.bar.GuiBar.IBarInfoHandler) IEnergyContainer(mekanism.api.energy.IEnergyContainer) TranslationButton(mekanism.client.gui.element.button.TranslationButton) TeleporterFrequency(mekanism.common.content.teleporter.TeleporterFrequency) GuiTeleporterStatus(mekanism.client.gui.element.custom.GuiTeleporterStatus) GuiVerticalPowerBar(mekanism.client.gui.element.bar.GuiVerticalPowerBar)

Example 24 with GuiVerticalPowerBar

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));
}
Also used : GuiProgress(mekanism.client.gui.element.progress.GuiProgress) GuiUpArrow(mekanism.client.gui.element.GuiUpArrow) GuiSlot(mekanism.client.gui.element.slot.GuiSlot) GuiVerticalPowerBar(mekanism.client.gui.element.bar.GuiVerticalPowerBar) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab)

Example 25 with GuiVerticalPowerBar

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()));
}
Also used : GuiInnerScreen(mekanism.client.gui.element.GuiInnerScreen) GuiVerticalPowerBar(mekanism.client.gui.element.bar.GuiVerticalPowerBar) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab)

Aggregations

GuiVerticalPowerBar (mekanism.client.gui.element.bar.GuiVerticalPowerBar)25 GuiEnergyTab (mekanism.client.gui.element.tab.GuiEnergyTab)23 GuiProgress (mekanism.client.gui.element.progress.GuiProgress)12 GuiInnerScreen (mekanism.client.gui.element.GuiInnerScreen)10 ArrayList (java.util.ArrayList)5 List (java.util.List)5 GuiFluidGauge (mekanism.client.gui.element.gauge.GuiFluidGauge)5 GuiGasGauge (mekanism.client.gui.element.gauge.GuiGasGauge)4 GuiSlot (mekanism.client.gui.element.slot.GuiSlot)4 GuiUpArrow (mekanism.client.gui.element.GuiUpArrow)3 TranslationButton (mekanism.client.gui.element.button.TranslationButton)3 ILangEntry (mekanism.api.text.ILangEntry)2 GuiDownArrow (mekanism.client.gui.element.GuiDownArrow)2 IBarInfoHandler (mekanism.client.gui.element.bar.GuiBar.IBarInfoHandler)2 GuiGasMode (mekanism.client.gui.element.button.GuiGasMode)2 GuiTeleporterStatus (mekanism.client.gui.element.custom.GuiTeleporterStatus)2 GuiHeatTab (mekanism.client.gui.element.tab.GuiHeatTab)2 PacketGuiInteract (mekanism.common.network.to_server.PacketGuiInteract)2 GuiStateTexture (mekanism.generators.client.gui.element.GuiStateTexture)2 ITextComponent (net.minecraft.util.text.ITextComponent)2