Search in sources :

Example 1 with GuiHorizontalRateBar

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

Aggregations

GuiDownArrow (mekanism.client.gui.element.GuiDownArrow)1 GuiInnerScreen (mekanism.client.gui.element.GuiInnerScreen)1 IBarInfoHandler (mekanism.client.gui.element.bar.GuiBar.IBarInfoHandler)1 GuiHorizontalRateBar (mekanism.client.gui.element.bar.GuiHorizontalRateBar)1 GuiFluidGauge (mekanism.client.gui.element.gauge.GuiFluidGauge)1 GuiHeatTab (mekanism.client.gui.element.tab.GuiHeatTab)1 EvaporationMultiblockData (mekanism.common.content.evaporation.EvaporationMultiblockData)1 ITextComponent (net.minecraft.util.text.ITextComponent)1