Search in sources :

Example 1 with GuiFluidGauge

use of mekanism.client.gui.element.gauge.GuiFluidGauge 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 GuiFluidGauge

use of mekanism.client.gui.element.gauge.GuiFluidGauge in project Mekanism by mekanism.

the class GuiFluidTank 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));
    super.addGuiElements();
    addButton(new GuiContainerEditModeTab<>(this, tile));
    addButton(new GuiFluidGauge(() -> tile.fluidTank, () -> tile.getFluidTanks(null), GaugeType.WIDE, this, 48, 18));
}
Also used : GuiFluidGauge(mekanism.client.gui.element.gauge.GuiFluidGauge)

Example 3 with GuiFluidGauge

use of mekanism.client.gui.element.gauge.GuiFluidGauge 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 GuiFluidGauge

use of mekanism.client.gui.element.gauge.GuiFluidGauge in project Mekanism by mekanism.

the class GuiFusionReactorHeat method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    addButton(new GuiEnergyTab(this, () -> {
        FusionReactorMultiblockData multiblock = tile.getMultiblock();
        return Arrays.asList(MekanismLang.STORING.translate(EnergyDisplay.of(multiblock.energyContainer)), GeneratorsLang.PRODUCING_AMOUNT.translate(EnergyDisplay.of(multiblock.getPassiveGeneration(false, true))));
    }));
    addButton(new GuiNumberGauge(new INumberInfoHandler() {

        @Override
        public TextureAtlasSprite getIcon() {
            return MekanismRenderer.getBaseFluidTexture(Fluids.LAVA, FluidType.STILL);
        }

        @Override
        public double getLevel() {
            return tile.getMultiblock().getLastPlasmaTemp();
        }

        @Override
        public double getScaledLevel() {
            return Math.min(1, getLevel() / MAX_LEVEL);
        }

        @Override
        public ITextComponent getText() {
            return GeneratorsLang.REACTOR_PLASMA.translate(MekanismUtils.getTemperatureDisplay(getLevel(), TemperatureUnit.KELVIN, true));
        }
    }, GaugeType.STANDARD, this, 7, 50));
    addButton(new GuiProgress(() -> {
        FusionReactorMultiblockData multiblock = tile.getMultiblock();
        return multiblock.getLastPlasmaTemp() > multiblock.getLastCaseTemp();
    }, ProgressType.SMALL_RIGHT, this, 29, 76));
    addButton(new GuiNumberGauge(new INumberInfoHandler() {

        @Override
        public TextureAtlasSprite getIcon() {
            return MekanismRenderer.getBaseFluidTexture(Fluids.LAVA, FluidType.STILL);
        }

        @Override
        public double getLevel() {
            return tile.getMultiblock().getLastCaseTemp();
        }

        @Override
        public double getScaledLevel() {
            return Math.min(1, getLevel() / MAX_LEVEL);
        }

        @Override
        public ITextComponent getText() {
            return GeneratorsLang.REACTOR_CASE.translate(MekanismUtils.getTemperatureDisplay(getLevel(), TemperatureUnit.KELVIN, true));
        }
    }, GaugeType.STANDARD, this, 61, 50));
    addButton(new GuiProgress(() -> tile.getMultiblock().getCaseTemp() > 0, ProgressType.SMALL_RIGHT, this, 83, 61));
    addButton(new GuiProgress(() -> {
        FusionReactorMultiblockData multiblock = tile.getMultiblock();
        return multiblock.getCaseTemp() > 0 && !multiblock.waterTank.isEmpty() && multiblock.steamTank.getStored() < multiblock.steamTank.getCapacity();
    }, ProgressType.SMALL_RIGHT, this, 83, 91));
    addButton(new GuiFluidGauge(() -> tile.getMultiblock().waterTank, () -> tile.getFluidTanks(null), GaugeType.SMALL, this, 115, 84));
    addButton(new GuiGasGauge(() -> tile.getMultiblock().steamTank, () -> tile.getGasTanks(null), GaugeType.SMALL, this, 151, 84));
    addButton(new GuiEnergyGauge(tile.getMultiblock().energyContainer, GaugeType.SMALL, this, 115, 46));
    addButton(new GuiFusionReactorTab(this, tile, FusionReactorTab.FUEL));
    addButton(new GuiFusionReactorTab(this, tile, FusionReactorTab.STAT));
}
Also used : GuiFusionReactorTab(mekanism.generators.client.gui.element.GuiFusionReactorTab) FusionReactorMultiblockData(mekanism.generators.common.content.fusion.FusionReactorMultiblockData) GuiFluidGauge(mekanism.client.gui.element.gauge.GuiFluidGauge) GuiProgress(mekanism.client.gui.element.progress.GuiProgress) GuiGasGauge(mekanism.client.gui.element.gauge.GuiGasGauge) GuiEnergyGauge(mekanism.client.gui.element.gauge.GuiEnergyGauge) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab) INumberInfoHandler(mekanism.client.gui.element.gauge.GuiNumberGauge.INumberInfoHandler) GuiNumberGauge(mekanism.client.gui.element.gauge.GuiNumberGauge)

Example 5 with GuiFluidGauge

use of mekanism.client.gui.element.gauge.GuiFluidGauge in project Mekanism by mekanism.

the class GuiHeatGenerator method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    addButton(new GuiEnergyTab(this, () -> Arrays.asList(GeneratorsLang.PRODUCING_AMOUNT.translate(EnergyDisplay.of(tile.getProducingEnergy())), MekanismLang.MAX_OUTPUT.translate(EnergyDisplay.of(tile.getMaxOutput())))));
    addButton(new GuiFluidGauge(() -> tile.lavaTank, () -> tile.getFluidTanks(null), GaugeType.WIDE, this, 55, 18));
    addButton(new GuiVerticalPowerBar(this, tile.getEnergyContainer(), 164, 15));
    addButton(new GuiHeatTab(this, () -> {
        ITextComponent temp = MekanismUtils.getTemperatureDisplay(tile.getTotalTemperature(), TemperatureUnit.KELVIN, true);
        ITextComponent transfer = MekanismUtils.getTemperatureDisplay(tile.getLastTransferLoss(), TemperatureUnit.KELVIN, false);
        ITextComponent environment = MekanismUtils.getTemperatureDisplay(tile.getLastEnvironmentLoss(), TemperatureUnit.KELVIN, false);
        return Arrays.asList(MekanismLang.TEMPERATURE.translate(temp), MekanismLang.TRANSFERRED_RATE.translate(transfer), MekanismLang.DISSIPATED_RATE.translate(environment));
    }));
}
Also used : GuiFluidGauge(mekanism.client.gui.element.gauge.GuiFluidGauge) ITextComponent(net.minecraft.util.text.ITextComponent) GuiVerticalPowerBar(mekanism.client.gui.element.bar.GuiVerticalPowerBar) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab) GuiHeatTab(mekanism.client.gui.element.tab.GuiHeatTab)

Aggregations

GuiFluidGauge (mekanism.client.gui.element.gauge.GuiFluidGauge)11 GuiEnergyTab (mekanism.client.gui.element.tab.GuiEnergyTab)8 GuiDownArrow (mekanism.client.gui.element.GuiDownArrow)5 GuiVerticalPowerBar (mekanism.client.gui.element.bar.GuiVerticalPowerBar)5 GuiGasGauge (mekanism.client.gui.element.gauge.GuiGasGauge)5 GuiProgress (mekanism.client.gui.element.progress.GuiProgress)5 GuiInnerScreen (mekanism.client.gui.element.GuiInnerScreen)4 GuiHeatTab (mekanism.client.gui.element.tab.GuiHeatTab)3 ITextComponent (net.minecraft.util.text.ITextComponent)3 ArrayList (java.util.ArrayList)2 List (java.util.List)2 IBarInfoHandler (mekanism.client.gui.element.bar.GuiBar.IBarInfoHandler)2 GuiHorizontalPowerBar (mekanism.client.gui.element.bar.GuiHorizontalPowerBar)2 FluidStack (net.minecraftforge.fluids.FluidStack)2 GuiHorizontalRateBar (mekanism.client.gui.element.bar.GuiHorizontalRateBar)1 GuiVerticalRateBar (mekanism.client.gui.element.bar.GuiVerticalRateBar)1 GuiGasMode (mekanism.client.gui.element.button.GuiGasMode)1 ToggleButton (mekanism.client.gui.element.button.ToggleButton)1 GuiEnergyGauge (mekanism.client.gui.element.gauge.GuiEnergyGauge)1 GuiNumberGauge (mekanism.client.gui.element.gauge.GuiNumberGauge)1