Search in sources :

Example 1 with GuiDownArrow

use of mekanism.client.gui.element.GuiDownArrow 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)));
}
Also used : GuiFluidGauge(mekanism.client.gui.element.gauge.GuiFluidGauge) GuiDownArrow(mekanism.client.gui.element.GuiDownArrow) ToggleButton(mekanism.client.gui.element.button.ToggleButton) GuiHorizontalPowerBar(mekanism.client.gui.element.bar.GuiHorizontalPowerBar) GuiProgress(mekanism.client.gui.element.progress.GuiProgress) GuiGasGauge(mekanism.client.gui.element.gauge.GuiGasGauge) PacketGuiInteract(mekanism.common.network.to_server.PacketGuiInteract) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab) IBooleanProgressInfoHandler(mekanism.client.gui.element.progress.IProgressInfoHandler.IBooleanProgressInfoHandler)

Example 2 with GuiDownArrow

use of mekanism.client.gui.element.GuiDownArrow in project Mekanism by mekanism.

the class GuiDynamicTank method addGuiElements.

@Override
protected void addGuiElements() {
    // Add the side holder before the slots, as it holds a couple of the slots
    addButton(GuiSideHolder.armorHolder(this));
    addButton(new GuiElementHolder(this, 141, 16, 26, 56));
    super.addGuiElements();
    addButton(new GuiSlot(SlotType.INNER_HOLDER_SLOT, this, 145, 20));
    addButton(new GuiSlot(SlotType.INNER_HOLDER_SLOT, this, 145, 50));
    addButton(new GuiInnerScreen(this, 49, 21, 84, 46, () -> {
        List<ITextComponent> ret = new ArrayList<>();
        TankMultiblockData multiblock = tile.getMultiblock();
        long capacity = multiblock.getChemicalTankCapacity();
        switch(multiblock.mergedTank.getCurrentType()) {
            case EMPTY:
                ret.add(MekanismLang.EMPTY.translate());
                break;
            case FLUID:
                addStored(ret, multiblock.getFluidTank().getFluid(), FluidStack::getAmount);
                capacity = multiblock.getTankCapacity();
                break;
            case GAS:
                addStored(ret, multiblock.getGasTank());
                break;
            case INFUSION:
                addStored(ret, multiblock.getInfusionTank());
                break;
            case PIGMENT:
                addStored(ret, multiblock.getPigmentTank());
                break;
            case SLURRY:
                addStored(ret, multiblock.getSlurryTank());
                break;
        }
        ret.add(MekanismLang.CAPACITY.translate(""));
        ret.add(MekanismLang.GENERIC_MB.translate(TextUtils.format(capacity)));
        return ret;
    }).spacing(2));
    addButton(new GuiDownArrow(this, 150, 39));
    addButton(new GuiContainerEditModeTab<>(this, tile));
    addButton(new GuiMergedTankGauge<>(() -> tile.getMultiblock().mergedTank, tile::getMultiblock, GaugeType.MEDIUM, this, 7, 16, 34, 56));
}
Also used : GuiInnerScreen(mekanism.client.gui.element.GuiInnerScreen) GuiDownArrow(mekanism.client.gui.element.GuiDownArrow) FluidStack(net.minecraftforge.fluids.FluidStack) GuiElementHolder(mekanism.client.gui.element.GuiElementHolder) ITextComponent(net.minecraft.util.text.ITextComponent) ArrayList(java.util.ArrayList) TankMultiblockData(mekanism.common.content.tank.TankMultiblockData) GuiSlot(mekanism.client.gui.element.slot.GuiSlot)

Example 3 with GuiDownArrow

use of mekanism.client.gui.element.GuiDownArrow in project Mekanism by mekanism.

the class GuiThermalEvaporationController method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    addButton(new GuiInnerScreen(this, 48, 19, 80, 40, () -> {
        EvaporationMultiblockData multiblock = tile.getMultiblock();
        return Arrays.asList(MekanismLang.MULTIBLOCK_FORMED.translate(), MekanismLang.EVAPORATION_HEIGHT.translate(multiblock.height()), MekanismLang.TEMPERATURE.translate(MekanismUtils.getTemperatureDisplay(multiblock.getTemperature(), TemperatureUnit.KELVIN, true)), MekanismLang.FLUID_PRODUCTION.translate(Math.round(multiblock.lastGain * 100D) / 100D));
    }).spacing(1).jeiCategory(tile));
    addButton(new GuiDownArrow(this, 32, 39));
    addButton(new GuiDownArrow(this, 136, 39));
    addButton(new GuiHorizontalRateBar(this, new IBarInfoHandler() {

        @Override
        public ITextComponent getTooltip() {
            return MekanismUtils.getTemperatureDisplay(tile.getMultiblock().getTemperature(), TemperatureUnit.KELVIN, true);
        }

        @Override
        public double getLevel() {
            return Math.min(1, tile.getMultiblock().getTemperature() / EvaporationMultiblockData.MAX_MULTIPLIER_TEMP);
        }
    }, 48, 63));
    addButton(new GuiFluidGauge(() -> tile.getMultiblock().inputTank, () -> tile.getMultiblock().getFluidTanks(null), GaugeType.STANDARD, this, 6, 13));
    addButton(new GuiFluidGauge(() -> tile.getMultiblock().outputTank, () -> tile.getMultiblock().getFluidTanks(null), GaugeType.STANDARD, this, 152, 13));
    addButton(new GuiHeatTab(this, () -> {
        ITextComponent environment = MekanismUtils.getTemperatureDisplay(tile.getMultiblock().lastEnvironmentLoss, TemperatureUnit.KELVIN, false);
        return Collections.singletonList(MekanismLang.DISSIPATED_RATE.translate(environment));
    }));
}
Also used : GuiInnerScreen(mekanism.client.gui.element.GuiInnerScreen) GuiFluidGauge(mekanism.client.gui.element.gauge.GuiFluidGauge) GuiDownArrow(mekanism.client.gui.element.GuiDownArrow) IBarInfoHandler(mekanism.client.gui.element.bar.GuiBar.IBarInfoHandler) GuiHorizontalRateBar(mekanism.client.gui.element.bar.GuiHorizontalRateBar) ITextComponent(net.minecraft.util.text.ITextComponent) EvaporationMultiblockData(mekanism.common.content.evaporation.EvaporationMultiblockData) GuiHeatTab(mekanism.client.gui.element.tab.GuiHeatTab)

Example 4 with GuiDownArrow

use of mekanism.client.gui.element.GuiDownArrow 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 5 with GuiDownArrow

use of mekanism.client.gui.element.GuiDownArrow 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)

Aggregations

GuiDownArrow (mekanism.client.gui.element.GuiDownArrow)6 GuiFluidGauge (mekanism.client.gui.element.gauge.GuiFluidGauge)5 GuiInnerScreen (mekanism.client.gui.element.GuiInnerScreen)4 GuiEnergyTab (mekanism.client.gui.element.tab.GuiEnergyTab)4 ArrayList (java.util.ArrayList)3 FluidStack (net.minecraftforge.fluids.FluidStack)3 List (java.util.List)2 GuiHorizontalPowerBar (mekanism.client.gui.element.bar.GuiHorizontalPowerBar)2 GuiVerticalPowerBar (mekanism.client.gui.element.bar.GuiVerticalPowerBar)2 GuiProgress (mekanism.client.gui.element.progress.GuiProgress)2 ITextComponent (net.minecraft.util.text.ITextComponent)2 GuiElementHolder (mekanism.client.gui.element.GuiElementHolder)1 IBarInfoHandler (mekanism.client.gui.element.bar.GuiBar.IBarInfoHandler)1 GuiHorizontalRateBar (mekanism.client.gui.element.bar.GuiHorizontalRateBar)1 ToggleButton (mekanism.client.gui.element.button.ToggleButton)1 GuiGasGauge (mekanism.client.gui.element.gauge.GuiGasGauge)1 GuiSlurryGauge (mekanism.client.gui.element.gauge.GuiSlurryGauge)1 IBooleanProgressInfoHandler (mekanism.client.gui.element.progress.IProgressInfoHandler.IBooleanProgressInfoHandler)1 GuiSlot (mekanism.client.gui.element.slot.GuiSlot)1 GuiHeatTab (mekanism.client.gui.element.tab.GuiHeatTab)1