Search in sources :

Example 11 with GuiEnergyTab

use of mekanism.client.gui.element.tab.GuiEnergyTab in project Mekanism by mekanism.

the class GuiChemicalWasher method addGuiElements.

@Override
protected void addGuiElements() {
    // Add the side holder before the slots, as it holds a couple of the slots
    addButton(GuiSideHolder.create(this, imageWidth, 66, 57, false, true, SpecialColors.TAB_CHEMICAL_WASHER));
    super.addGuiElements();
    addButton(new GuiDownArrow(this, imageWidth + 8, 91));
    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, 7, 13));
    addButton(new GuiSlurryGauge(() -> tile.inputTank, () -> tile.getSlurryTanks(null), GaugeType.STANDARD, this, 28, 13));
    addButton(new GuiSlurryGauge(() -> tile.outputTank, () -> tile.getSlurryTanks(null), GaugeType.STANDARD, this, 131, 13));
    addButton(new GuiProgress(tile::getActive, ProgressType.LARGE_RIGHT, this, 64, 39).jeiCategory(tile));
}
Also used : GuiFluidGauge(mekanism.client.gui.element.gauge.GuiFluidGauge) GuiDownArrow(mekanism.client.gui.element.GuiDownArrow) GuiHorizontalPowerBar(mekanism.client.gui.element.bar.GuiHorizontalPowerBar) GuiSlurryGauge(mekanism.client.gui.element.gauge.GuiSlurryGauge) GuiProgress(mekanism.client.gui.element.progress.GuiProgress) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab)

Example 12 with GuiEnergyTab

use of mekanism.client.gui.element.tab.GuiEnergyTab in project Mekanism by mekanism.

the class GuiDigitalMiner method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    addButton(new GuiInnerScreen(this, 7, 19, 77, 69, () -> {
        List<ITextComponent> list = new ArrayList<>();
        ILangEntry runningType;
        if (tile.getEnergyContainer().getEnergyPerTick().greaterThan(tile.getEnergyContainer().getMaxEnergy())) {
            runningType = MekanismLang.MINER_LOW_POWER;
        } else if (tile.isRunning()) {
            runningType = MekanismLang.MINER_RUNNING;
        } else {
            runningType = MekanismLang.IDLE;
        }
        list.add(runningType.translate());
        list.add(tile.searcher.state.getTextComponent());
        list.add(MekanismLang.MINER_TO_MINE.translate(TextUtils.format(tile.getToMine())));
        return list;
    }).spacing(1).clearFormat());
    addButton(new GuiDigitalSwitch(this, 19, 56, EJECT, tile::getDoEject, MekanismLang.AUTO_EJECT.translate(), () -> Mekanism.packetHandler.sendToServer(new PacketGuiInteract(GuiInteraction.AUTO_EJECT_BUTTON, tile)), SwitchType.LOWER_ICON));
    addButton(new GuiDigitalSwitch(this, 38, 56, INPUT, tile::getDoPull, MekanismLang.AUTO_PULL.translate(), () -> Mekanism.packetHandler.sendToServer(new PacketGuiInteract(GuiInteraction.AUTO_PULL_BUTTON, tile)), SwitchType.LOWER_ICON));
    addButton(new GuiDigitalSwitch(this, 57, 56, SILK, tile::getSilkTouch, MekanismLang.MINER_SILK.translate(), () -> Mekanism.packetHandler.sendToServer(new PacketGuiInteract(GuiInteraction.SILK_TOUCH_BUTTON, tile)), SwitchType.LOWER_ICON));
    addButton(new GuiVerticalPowerBar(this, tile.getEnergyContainer(), 157, 39, 47));
    addButton(new GuiVisualsTab(this, tile));
    addButton(new GuiSlot(SlotType.DIGITAL, this, 64, 21).setRenderAboveSlots().validity(() -> tile.missingStack).with(() -> tile.missingStack.isEmpty() ? SlotOverlay.CHECK : null).hover(getOnHover(() -> tile.missingStack.isEmpty() ? MekanismLang.MINER_WELL.translate() : MekanismLang.MINER_MISSING_BLOCK.translate())));
    addButton(new GuiEnergyTab(this, () -> {
        MinerEnergyContainer energyContainer = tile.getEnergyContainer();
        FloatingLong perTick = energyContainer.getEnergyPerTick();
        ArrayList<ITextComponent> ret = new ArrayList<>(4);
        ret.add(MekanismLang.MINER_ENERGY_CAPACITY.translate(EnergyDisplay.of(energyContainer.getMaxEnergy())));
        ret.add(MekanismLang.NEEDED_PER_TICK.translate(EnergyDisplay.of(perTick)));
        if (perTick.greaterThan(energyContainer.getMaxEnergy())) {
            ret.add(MekanismLang.MINER_INSUFFICIENT_BUFFER.translateColored(EnumColor.RED));
        }
        ret.add(MekanismLang.MINER_BUFFER_FREE.translate(EnergyDisplay.of(energyContainer.getNeeded())));
        return ret;
    }));
    int buttonStart = 19;
    startButton = addButton(new TranslationButton(this, 87, buttonStart, 61, 18, MekanismLang.BUTTON_START, () -> Mekanism.packetHandler.sendToServer(new PacketGuiInteract(GuiInteraction.START_BUTTON, tile))));
    stopButton = addButton(new TranslationButton(this, 87, buttonStart + 17, 61, 18, MekanismLang.BUTTON_STOP, () -> Mekanism.packetHandler.sendToServer(new PacketGuiInteract(GuiInteraction.STOP_BUTTON, tile))));
    configButton = addButton(new TranslationButton(this, 87, buttonStart + 34, 61, 18, MekanismLang.BUTTON_CONFIG, () -> Mekanism.packetHandler.sendToServer(new PacketGuiButtonPress(ClickedTileButton.DIGITAL_MINER_CONFIG, tile))));
    addButton(new TranslationButton(this, 87, buttonStart + 51, 61, 18, MekanismLang.MINER_RESET, () -> Mekanism.packetHandler.sendToServer(new PacketGuiInteract(GuiInteraction.RESET_BUTTON, tile))));
    updateEnabledButtons();
    trackWarning(WarningType.FILTER_HAS_BLACKLISTED_ELEMENT, () -> tile.getFilters().stream().anyMatch(MinerFilter::hasBlacklistedElement));
}
Also used : PacketGuiButtonPress(mekanism.common.network.to_server.PacketGuiButtonPress) TranslationButton(mekanism.client.gui.element.button.TranslationButton) GuiDigitalSwitch(mekanism.client.gui.element.GuiDigitalSwitch) ArrayList(java.util.ArrayList) GuiSlot(mekanism.client.gui.element.slot.GuiSlot) PacketGuiInteract(mekanism.common.network.to_server.PacketGuiInteract) GuiVerticalPowerBar(mekanism.client.gui.element.bar.GuiVerticalPowerBar) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab) GuiInnerScreen(mekanism.client.gui.element.GuiInnerScreen) FloatingLong(mekanism.api.math.FloatingLong) MinerEnergyContainer(mekanism.common.capabilities.energy.MinerEnergyContainer) ArrayList(java.util.ArrayList) List(java.util.List) GuiVisualsTab(mekanism.client.gui.element.tab.GuiVisualsTab) ILangEntry(mekanism.api.text.ILangEntry)

Example 13 with GuiEnergyTab

use of mekanism.client.gui.element.tab.GuiEnergyTab in project Mekanism by mekanism.

the class GuiElectricMachine method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    addButton(new GuiUpArrow(this, 68, 38));
    addButton(new GuiVerticalPowerBar(this, tile.getEnergyContainer(), 164, 15));
    addButton(new GuiEnergyTab(this, tile.getEnergyContainer(), tile::getActive));
    addButton(new GuiProgress(tile::getScaledProgress, ProgressType.BAR, this, 86, 38).jeiCategory(tile));
}
Also used : GuiProgress(mekanism.client.gui.element.progress.GuiProgress) GuiUpArrow(mekanism.client.gui.element.GuiUpArrow) GuiVerticalPowerBar(mekanism.client.gui.element.bar.GuiVerticalPowerBar) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab)

Example 14 with GuiEnergyTab

use of mekanism.client.gui.element.tab.GuiEnergyTab in project Mekanism by mekanism.

the class GuiElectricPump method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    addButton(new GuiInnerScreen(this, 54, 23, 80, 41, () -> {
        List<ITextComponent> list = new ArrayList<>();
        list.add(EnergyDisplay.of(tile.getEnergyContainer()).getTextComponent());
        FluidStack fluidStack = tile.fluidTank.getFluid();
        if (fluidStack.isEmpty()) {
            list.add(MekanismLang.NO_FLUID.translate());
        } else {
            list.add(MekanismLang.GENERIC_STORED_MB.translate(fluidStack, TextUtils.format(fluidStack.getAmount())));
        }
        return list;
    }));
    addButton(new GuiDownArrow(this, 32, 39));
    addButton(new GuiVerticalPowerBar(this, tile.getEnergyContainer(), 164, 15));
    addButton(new GuiFluidGauge(() -> tile.fluidTank, () -> tile.getFluidTanks(null), GaugeType.STANDARD, this, 6, 13));
    addButton(new GuiEnergyTab(this, tile.getEnergyContainer()));
}
Also used : GuiInnerScreen(mekanism.client.gui.element.GuiInnerScreen) GuiFluidGauge(mekanism.client.gui.element.gauge.GuiFluidGauge) GuiDownArrow(mekanism.client.gui.element.GuiDownArrow) FluidStack(net.minecraftforge.fluids.FluidStack) ArrayList(java.util.ArrayList) List(java.util.List) GuiVerticalPowerBar(mekanism.client.gui.element.bar.GuiVerticalPowerBar) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab)

Example 15 with GuiEnergyTab

use of mekanism.client.gui.element.tab.GuiEnergyTab in project Mekanism by mekanism.

the class GuiAdvancedElectricMachine 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 GuiProgress(tile::getScaledProgress, ProgressType.BAR, this, 86, 38).jeiCategory(tile));
    addButton(new GuiChemicalBar<>(this, GuiChemicalBar.getProvider(tile.gasTank, tile.getGasTanks(null)), 68, 36, 6, 12, false));
}
Also used : GuiProgress(mekanism.client.gui.element.progress.GuiProgress) GuiVerticalPowerBar(mekanism.client.gui.element.bar.GuiVerticalPowerBar) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab)

Aggregations

GuiEnergyTab (mekanism.client.gui.element.tab.GuiEnergyTab)42 GuiVerticalPowerBar (mekanism.client.gui.element.bar.GuiVerticalPowerBar)23 GuiProgress (mekanism.client.gui.element.progress.GuiProgress)23 GuiGasGauge (mekanism.client.gui.element.gauge.GuiGasGauge)13 GuiInnerScreen (mekanism.client.gui.element.GuiInnerScreen)12 GuiHorizontalPowerBar (mekanism.client.gui.element.bar.GuiHorizontalPowerBar)9 GuiFluidGauge (mekanism.client.gui.element.gauge.GuiFluidGauge)8 ArrayList (java.util.ArrayList)5 List (java.util.List)5 GuiEnergyGauge (mekanism.client.gui.element.gauge.GuiEnergyGauge)5 GuiSlot (mekanism.client.gui.element.slot.GuiSlot)5 GuiDownArrow (mekanism.client.gui.element.GuiDownArrow)4 GuiFusionReactorTab (mekanism.generators.client.gui.element.GuiFusionReactorTab)4 FusionReactorMultiblockData (mekanism.generators.common.content.fusion.FusionReactorMultiblockData)4 GuiUpArrow (mekanism.client.gui.element.GuiUpArrow)3 IBarInfoHandler (mekanism.client.gui.element.bar.GuiBar.IBarInfoHandler)3 GuiPigmentGauge (mekanism.client.gui.element.gauge.GuiPigmentGauge)3 GuiHeatTab (mekanism.client.gui.element.tab.GuiHeatTab)3 PacketGuiInteract (mekanism.common.network.to_server.PacketGuiInteract)3 EnergyDisplay (mekanism.common.util.text.EnergyDisplay)3