Search in sources :

Example 1 with INumberInfoHandler

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

Aggregations

GuiEnergyGauge (mekanism.client.gui.element.gauge.GuiEnergyGauge)1 GuiFluidGauge (mekanism.client.gui.element.gauge.GuiFluidGauge)1 GuiGasGauge (mekanism.client.gui.element.gauge.GuiGasGauge)1 GuiNumberGauge (mekanism.client.gui.element.gauge.GuiNumberGauge)1 INumberInfoHandler (mekanism.client.gui.element.gauge.GuiNumberGauge.INumberInfoHandler)1 GuiProgress (mekanism.client.gui.element.progress.GuiProgress)1 GuiEnergyTab (mekanism.client.gui.element.tab.GuiEnergyTab)1 GuiFusionReactorTab (mekanism.generators.client.gui.element.GuiFusionReactorTab)1 FusionReactorMultiblockData (mekanism.generators.common.content.fusion.FusionReactorMultiblockData)1