Search in sources :

Example 26 with GuiEnergyTab

use of mekanism.client.gui.element.tab.GuiEnergyTab in project Mekanism by mekanism.

the class GuiWindGenerator method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    addButton(new GuiInnerScreen(this, 48, 21, 80, 44, () -> {
        List<ITextComponent> list = new ArrayList<>();
        list.add(EnergyDisplay.of(tile.getEnergyContainer()).getTextComponent());
        list.add(GeneratorsLang.POWER.translate(MekanismUtils.convertToDisplay(MekanismGeneratorsConfig.generators.windGenerationMin.get().multiply(tile.getCurrentMultiplier())).toString(2)));
        list.add(GeneratorsLang.OUTPUT_RATE_SHORT.translate(EnergyDisplay.of(tile.getMaxOutput())));
        if (!tile.getActive()) {
            ILangEntry reason = tile.isBlacklistDimension() ? GeneratorsLang.NO_WIND : GeneratorsLang.SKY_BLOCKED;
            list.add(reason.translateColored(EnumColor.DARK_RED));
        }
        return list;
    }));
    addButton(new GuiEnergyTab(this, () -> Arrays.asList(GeneratorsLang.PRODUCING_AMOUNT.translate(tile.getActive() ? EnergyDisplay.of(MekanismGeneratorsConfig.generators.windGenerationMin.get().multiply(tile.getCurrentMultiplier())) : EnergyDisplay.ZERO), MekanismLang.MAX_OUTPUT.translate(EnergyDisplay.of(tile.getMaxOutput())))));
    addButton(new GuiVerticalPowerBar(this, tile.getEnergyContainer(), 164, 15));
    addButton(new GuiStateTexture(this, 18, 35, tile::getActive, MekanismGenerators.rl(ResourceType.GUI.getPrefix() + "wind_on.png"), MekanismGenerators.rl(ResourceType.GUI.getPrefix() + "wind_off.png")));
}
Also used : GuiInnerScreen(mekanism.client.gui.element.GuiInnerScreen) GuiStateTexture(mekanism.generators.client.gui.element.GuiStateTexture) ArrayList(java.util.ArrayList) List(java.util.List) GuiVerticalPowerBar(mekanism.client.gui.element.bar.GuiVerticalPowerBar) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab) ILangEntry(mekanism.api.text.ILangEntry)

Example 27 with GuiEnergyTab

use of mekanism.client.gui.element.tab.GuiEnergyTab 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 28 with GuiEnergyTab

use of mekanism.client.gui.element.tab.GuiEnergyTab in project Mekanism by mekanism.

the class GuiModificationStation method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    addButton(new GuiVerticalPowerBar(this, tile.getEnergyContainer(), 154, 40));
    addButton(new GuiEnergyTab(this, tile.getEnergyContainer()));
    addButton(new GuiProgress(tile::getScaledProgress, ProgressType.LARGE_RIGHT, this, 65, 123));
    removeButton = addButton(new TranslationButton(this, 34, 96, 108, 17, MekanismLang.BUTTON_REMOVE, () -> Mekanism.packetHandler.sendToServer(new PacketRemoveModule(tile.getBlockPos(), selectedModule.getData()))));
    removeButton.active = false;
    addButton(new GuiModuleScrollList(this, 34, 20, 108, 74, () -> tile.containerSlot.getStack().copy(), this::onModuleSelected));
}
Also used : TranslationButton(mekanism.client.gui.element.button.TranslationButton) GuiProgress(mekanism.client.gui.element.progress.GuiProgress) GuiVerticalPowerBar(mekanism.client.gui.element.bar.GuiVerticalPowerBar) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab) PacketRemoveModule(mekanism.common.network.to_server.PacketRemoveModule) GuiModuleScrollList(mekanism.client.gui.element.scroll.GuiModuleScrollList)

Example 29 with GuiEnergyTab

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

Example 30 with GuiEnergyTab

use of mekanism.client.gui.element.tab.GuiEnergyTab in project Mekanism by mekanism.

the class GuiChemicalOxidizer method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    addButton(new GuiHorizontalPowerBar(this, tile.getEnergyContainer(), 115, 75));
    addButton(new GuiEnergyTab(this, tile.getEnergyContainer(), tile::getActive));
    addButton(new GuiGasGauge(() -> tile.gasTank, () -> tile.getGasTanks(null), GaugeType.STANDARD, this, 131, 13));
    addButton(new GuiProgress(tile::getScaledProgress, ProgressType.LARGE_RIGHT, this, 64, 40).jeiCategory(tile));
}
Also used : GuiHorizontalPowerBar(mekanism.client.gui.element.bar.GuiHorizontalPowerBar) GuiProgress(mekanism.client.gui.element.progress.GuiProgress) GuiGasGauge(mekanism.client.gui.element.gauge.GuiGasGauge) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab)

Aggregations

GuiEnergyTab (mekanism.client.gui.element.tab.GuiEnergyTab)42 GuiVerticalPowerBar (mekanism.client.gui.element.bar.GuiVerticalPowerBar)23 GuiProgress (mekanism.client.gui.element.progress.GuiProgress)23 GuiGasGauge (mekanism.client.gui.element.gauge.GuiGasGauge)13 GuiInnerScreen (mekanism.client.gui.element.GuiInnerScreen)12 GuiHorizontalPowerBar (mekanism.client.gui.element.bar.GuiHorizontalPowerBar)9 GuiFluidGauge (mekanism.client.gui.element.gauge.GuiFluidGauge)8 ArrayList (java.util.ArrayList)5 List (java.util.List)5 GuiEnergyGauge (mekanism.client.gui.element.gauge.GuiEnergyGauge)5 GuiSlot (mekanism.client.gui.element.slot.GuiSlot)5 GuiDownArrow (mekanism.client.gui.element.GuiDownArrow)4 GuiFusionReactorTab (mekanism.generators.client.gui.element.GuiFusionReactorTab)4 FusionReactorMultiblockData (mekanism.generators.common.content.fusion.FusionReactorMultiblockData)4 GuiUpArrow (mekanism.client.gui.element.GuiUpArrow)3 IBarInfoHandler (mekanism.client.gui.element.bar.GuiBar.IBarInfoHandler)3 GuiPigmentGauge (mekanism.client.gui.element.gauge.GuiPigmentGauge)3 GuiHeatTab (mekanism.client.gui.element.tab.GuiHeatTab)3 PacketGuiInteract (mekanism.common.network.to_server.PacketGuiInteract)3 EnergyDisplay (mekanism.common.util.text.EnergyDisplay)3