Search in sources :

Example 1 with GuiEnergyGauge

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

the class GuiEnergyCube 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, 36, 98, false, true, SpecialColors.TAB_ARMOR_SLOTS));
    super.addGuiElements();
    addButton(new GuiEnergyGauge(tile.getEnergyContainer(), GaugeType.WIDE, this, 55, 18));
    addButton(new GuiEnergyTab(this, () -> Arrays.asList(MekanismLang.MATRIX_INPUT_RATE.translate(EnergyDisplay.of(tile.getInputRate())), MekanismLang.MAX_OUTPUT.translate(EnergyDisplay.of(tile.getTier().getOutput())))));
}
Also used : GuiEnergyGauge(mekanism.client.gui.element.gauge.GuiEnergyGauge) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab)

Example 2 with GuiEnergyGauge

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

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

the class GuiLaserAmplifier method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    addButton(new GuiEnergyGauge(tile.getEnergyContainer(), GaugeType.STANDARD, this, 6, 10));
    addButton(new GuiAmplifierTab(this, tile));
    timerField = addButton(new GuiTextField(this, 96, 28, 36, 11));
    timerField.setMaxStringLength(4);
    timerField.setEnterHandler(this::setTime);
    timerField.setInputValidator(InputValidator.DIGIT);
    minField = addButton(new GuiTextField(this, 96, 43, 72, 11));
    minField.setMaxStringLength(10);
    minField.setEnterHandler(this::setMinThreshold);
    minField.setInputValidator(InputValidator.SCI_NOTATION);
    maxField = addButton(new GuiTextField(this, 96, 58, 72, 11));
    maxField.setMaxStringLength(10);
    maxField.setEnterHandler(this::setMaxThreshold);
    maxField.setInputValidator(InputValidator.SCI_NOTATION);
}
Also used : GuiAmplifierTab(mekanism.client.gui.element.tab.GuiAmplifierTab) GuiEnergyGauge(mekanism.client.gui.element.gauge.GuiEnergyGauge) GuiTextField(mekanism.client.gui.element.text.GuiTextField)

Example 4 with GuiEnergyGauge

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

the class GuiMatrixStats method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    addButton(new GuiMatrixTab(this, tile, MatrixTab.MAIN));
    addButton(new GuiEnergyGauge(new IEnergyInfoHandler() {

        @Override
        public FloatingLong getEnergy() {
            return tile.getMultiblock().getEnergy();
        }

        @Override
        public FloatingLong getMaxEnergy() {
            return tile.getMultiblock().getStorageCap();
        }
    }, GaugeType.STANDARD, this, 6, 13));
    addButton(new GuiVerticalRateBar(this, new IBarInfoHandler() {

        @Override
        public ITextComponent getTooltip() {
            return MekanismLang.MATRIX_RECEIVING_RATE.translate(EnergyDisplay.of(tile.getMultiblock().getLastInput()));
        }

        @Override
        public double getLevel() {
            MatrixMultiblockData multiblock = tile.getMultiblock();
            return !multiblock.isFormed() ? 0 : multiblock.getLastInput().divideToLevel(multiblock.getTransferCap());
        }
    }, 30, 13));
    addButton(new GuiVerticalRateBar(this, new IBarInfoHandler() {

        @Override
        public ITextComponent getTooltip() {
            return MekanismLang.MATRIX_OUTPUTTING_RATE.translate(EnergyDisplay.of(tile.getMultiblock().getLastOutput()));
        }

        @Override
        public double getLevel() {
            MatrixMultiblockData multiblock = tile.getMultiblock();
            if (!multiblock.isFormed()) {
                return 0;
            }
            return multiblock.getLastOutput().divideToLevel(multiblock.getTransferCap());
        }
    }, 38, 13));
    addButton(new GuiEnergyTab(this, () -> {
        MatrixMultiblockData multiblock = tile.getMultiblock();
        return Arrays.asList(MekanismLang.STORING.translate(EnergyDisplay.of(multiblock.getEnergy(), multiblock.getStorageCap())), MekanismLang.MATRIX_INPUT_RATE.translate(EnergyDisplay.of(multiblock.getLastInput())), MekanismLang.MATRIX_OUTPUT_RATE.translate(EnergyDisplay.of(multiblock.getLastOutput())));
    }));
}
Also used : IBarInfoHandler(mekanism.client.gui.element.bar.GuiBar.IBarInfoHandler) GuiVerticalRateBar(mekanism.client.gui.element.bar.GuiVerticalRateBar) MatrixMultiblockData(mekanism.common.content.matrix.MatrixMultiblockData) GuiMatrixTab(mekanism.client.gui.element.tab.GuiMatrixTab) IEnergyInfoHandler(mekanism.client.gui.element.gauge.GuiEnergyGauge.IEnergyInfoHandler) GuiEnergyGauge(mekanism.client.gui.element.gauge.GuiEnergyGauge) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab)

Example 5 with GuiEnergyGauge

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

the class GuiInductionMatrix 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, -26, 36, 98, true, true, SpecialColors.TAB_ARMOR_SLOTS));
    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, () -> {
        MatrixMultiblockData multiblock = tile.getMultiblock();
        return Arrays.asList(MekanismLang.ENERGY.translate(EnergyDisplay.of(multiblock.getEnergy())), MekanismLang.CAPACITY.translate(EnergyDisplay.of(multiblock.getStorageCap())), MekanismLang.MATRIX_INPUT_AMOUNT.translate(MekanismLang.GENERIC_PER_TICK.translate(EnergyDisplay.of(multiblock.getLastInput()))), MekanismLang.MATRIX_OUTPUT_AMOUNT.translate(MekanismLang.GENERIC_PER_TICK.translate(EnergyDisplay.of(multiblock.getLastOutput()))));
    }).spacing(2));
    addButton(new GuiMatrixTab(this, tile, MatrixTab.STAT));
    addButton(new GuiEnergyGauge(new IEnergyInfoHandler() {

        @Override
        public FloatingLong getEnergy() {
            return tile.getMultiblock().getEnergy();
        }

        @Override
        public FloatingLong getMaxEnergy() {
            return tile.getMultiblock().getStorageCap();
        }
    }, GaugeType.MEDIUM, this, 7, 16, 34, 56));
    addButton(new GuiEnergyTab(this, () -> {
        MatrixMultiblockData multiblock = tile.getMultiblock();
        return Arrays.asList(MekanismLang.STORING.translate(EnergyDisplay.of(multiblock.getEnergy(), multiblock.getStorageCap())), MekanismLang.MATRIX_INPUT_RATE.translate(EnergyDisplay.of(multiblock.getLastInput())), MekanismLang.MATRIX_OUTPUT_RATE.translate(EnergyDisplay.of(multiblock.getLastOutput())));
    }));
}
Also used : GuiInnerScreen(mekanism.client.gui.element.GuiInnerScreen) MatrixMultiblockData(mekanism.common.content.matrix.MatrixMultiblockData) GuiMatrixTab(mekanism.client.gui.element.tab.GuiMatrixTab) GuiElementHolder(mekanism.client.gui.element.GuiElementHolder) IEnergyInfoHandler(mekanism.client.gui.element.gauge.GuiEnergyGauge.IEnergyInfoHandler) GuiSlot(mekanism.client.gui.element.slot.GuiSlot) GuiEnergyGauge(mekanism.client.gui.element.gauge.GuiEnergyGauge) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab)

Aggregations

GuiEnergyGauge (mekanism.client.gui.element.gauge.GuiEnergyGauge)6 GuiEnergyTab (mekanism.client.gui.element.tab.GuiEnergyTab)5 GuiInnerScreen (mekanism.client.gui.element.GuiInnerScreen)2 IBarInfoHandler (mekanism.client.gui.element.bar.GuiBar.IBarInfoHandler)2 IEnergyInfoHandler (mekanism.client.gui.element.gauge.GuiEnergyGauge.IEnergyInfoHandler)2 GuiGasGauge (mekanism.client.gui.element.gauge.GuiGasGauge)2 GuiMatrixTab (mekanism.client.gui.element.tab.GuiMatrixTab)2 MatrixMultiblockData (mekanism.common.content.matrix.MatrixMultiblockData)2 GuiElementHolder (mekanism.client.gui.element.GuiElementHolder)1 GuiDynamicHorizontalRateBar (mekanism.client.gui.element.bar.GuiDynamicHorizontalRateBar)1 GuiVerticalRateBar (mekanism.client.gui.element.bar.GuiVerticalRateBar)1 GuiFluidGauge (mekanism.client.gui.element.gauge.GuiFluidGauge)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 GuiSlot (mekanism.client.gui.element.slot.GuiSlot)1 GuiAmplifierTab (mekanism.client.gui.element.tab.GuiAmplifierTab)1 GuiTextField (mekanism.client.gui.element.text.GuiTextField)1 GuiFusionReactorTab (mekanism.generators.client.gui.element.GuiFusionReactorTab)1 FusionReactorMultiblockData (mekanism.generators.common.content.fusion.FusionReactorMultiblockData)1