Search in sources :

Example 16 with GuiProgress

use of mekanism.client.gui.element.progress.GuiProgress in project Mekanism by mekanism.

the class GuiElectrolyticSeparator method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    addButton(new GuiEnergyTab(this, tile.getEnergyContainer(), tile::getEnergyUsed));
    addButton(new GuiFluidGauge(() -> tile.fluidTank, () -> tile.getFluidTanks(null), GaugeType.STANDARD, this, 5, 10));
    addButton(new GuiGasGauge(() -> tile.leftTank, () -> tile.getGasTanks(null), GaugeType.SMALL, this, 58, 18));
    addButton(new GuiGasGauge(() -> tile.rightTank, () -> tile.getGasTanks(null), GaugeType.SMALL, this, 100, 18));
    addButton(new GuiVerticalPowerBar(this, tile.getEnergyContainer(), 164, 15));
    addButton(new GuiProgress(tile::getActive, ProgressType.BI, this, 80, 30).jeiCategory(tile));
    addButton(new GuiGasMode(this, 7, 72, false, () -> tile.dumpLeft, tile.getBlockPos(), 0));
    addButton(new GuiGasMode(this, 159, 72, true, () -> tile.dumpRight, tile.getBlockPos(), 1));
}
Also used : GuiFluidGauge(mekanism.client.gui.element.gauge.GuiFluidGauge) GuiProgress(mekanism.client.gui.element.progress.GuiProgress) GuiGasGauge(mekanism.client.gui.element.gauge.GuiGasGauge) GuiVerticalPowerBar(mekanism.client.gui.element.bar.GuiVerticalPowerBar) GuiGasMode(mekanism.client.gui.element.button.GuiGasMode) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab)

Example 17 with GuiProgress

use of mekanism.client.gui.element.progress.GuiProgress in project Mekanism by mekanism.

the class GuiFactory method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    addButton(new GuiSortingTab(this, tile));
    addButton(new GuiVerticalPowerBar(this, tile.getEnergyContainer(), imageWidth - 12, 16, tile instanceof TileEntitySawingFactory ? 73 : 52));
    addButton(new GuiEnergyTab(this, tile.getEnergyContainer(), tile::getLastUsage));
    if (tile.hasSecondaryResourceBar()) {
        if (tile instanceof TileEntityMetallurgicInfuserFactory) {
            TileEntityMetallurgicInfuserFactory factory = (TileEntityMetallurgicInfuserFactory) this.tile;
            addButton(new GuiChemicalBar<>(this, GuiChemicalBar.getProvider(factory.getInfusionTank(), tile.getInfusionTanks(null)), 7, 76, tile.tier == FactoryTier.ULTIMATE ? 172 : 138, 4, true));
            addButton(new GuiDumpButton<>(this, factory, tile.tier == FactoryTier.ULTIMATE ? 182 : 148, 76));
        } else if (tile instanceof TileEntityItemStackGasToItemStackFactory) {
            TileEntityItemStackGasToItemStackFactory factory = (TileEntityItemStackGasToItemStackFactory) this.tile;
            addButton(new GuiChemicalBar<>(this, GuiChemicalBar.getProvider(factory.getGasTank(), tile.getGasTanks(null)), 7, 76, tile.tier == FactoryTier.ULTIMATE ? 172 : 138, 4, true));
            addButton(new GuiDumpButton<>(this, factory, tile.tier == FactoryTier.ULTIMATE ? 182 : 148, 76));
        }
    }
    int baseX = tile.tier == FactoryTier.BASIC ? 55 : tile.tier == FactoryTier.ADVANCED ? 35 : tile.tier == FactoryTier.ELITE ? 29 : 27;
    int baseXMult = tile.tier == FactoryTier.BASIC ? 38 : tile.tier == FactoryTier.ADVANCED ? 26 : 19;
    for (int i = 0; i < tile.tier.processes; i++) {
        int cacheIndex = i;
        addProgress(new GuiProgress(() -> tile.getScaledProgress(1, cacheIndex), ProgressType.DOWN, this, 4 + baseX + (i * baseXMult), 33));
    }
}
Also used : TileEntityMetallurgicInfuserFactory(mekanism.common.tile.factory.TileEntityMetallurgicInfuserFactory) GuiProgress(mekanism.client.gui.element.progress.GuiProgress) TileEntitySawingFactory(mekanism.common.tile.factory.TileEntitySawingFactory) GuiSortingTab(mekanism.client.gui.element.tab.GuiSortingTab) TileEntityItemStackGasToItemStackFactory(mekanism.common.tile.factory.TileEntityItemStackGasToItemStackFactory) GuiVerticalPowerBar(mekanism.client.gui.element.bar.GuiVerticalPowerBar) GuiEnergyTab(mekanism.client.gui.element.tab.GuiEnergyTab) GuiChemicalBar(mekanism.client.gui.element.bar.GuiChemicalBar) GuiDumpButton(mekanism.client.gui.element.GuiDumpButton)

Example 18 with GuiProgress

use of mekanism.client.gui.element.progress.GuiProgress in project Mekanism by mekanism.

the class GuiIsotopicCentrifuge method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    addButton(new GuiHorizontalPowerBar(this, tile.getEnergyContainer(), 115, 75));
    addButton(new GuiEnergyTab(this, tile.getEnergyContainer(), tile::getEnergyUsed));
    addButton(new GuiGasGauge(() -> tile.inputTank, () -> tile.getGasTanks(null), GaugeType.STANDARD, this, 25, 13));
    addButton(new GuiGasGauge(() -> tile.outputTank, () -> tile.getGasTanks(null), GaugeType.STANDARD, this, 133, 13));
    addButton(new GuiProgress(tile::getActive, ProgressType.LARGE_RIGHT, this, 64, 39).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)

Example 19 with GuiProgress

use of mekanism.client.gui.element.progress.GuiProgress in project Mekanism by mekanism.

the class GuiNutritionalLiquifier 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, 133, 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)

Example 20 with GuiProgress

use of mekanism.client.gui.element.progress.GuiProgress in project Mekanism by mekanism.

the class GuiOredictionificator method addGuiElements.

@Override
protected void addGuiElements() {
    super.addGuiElements();
    // Filter holder
    addButton(new GuiElementHolder(this, 9, 17, 144, 68));
    // new filter button border
    addButton(new GuiElementHolder(this, 9, 85, 144, 22));
    scrollBar = addButton(new GuiScrollBar(this, 153, 17, 90, () -> tile.getFilters().size(), () -> FILTER_COUNT));
    addButton(new GuiProgress(() -> tile.didProcess, ProgressType.LARGE_RIGHT, this, 64, 119));
    addButton(new TranslationButton(this, 10, 86, 142, 20, MekanismLang.BUTTON_NEW_FILTER, () -> addWindow(GuiOredictionificatorFilter.create(this, tile))));
    // Add each of the buttons and then just change visibility state to match filter info
    for (int i = 0; i < FILTER_COUNT; i++) {
        addButton(new FilterButton(this, 10, 18 + i * 22, 142, 22, i, scrollBar::getCurrentSelection, tile::getFilters, this::onClick, filter -> {
            if (filter instanceof OredictionificatorItemFilter) {
                return Collections.singletonList(((OredictionificatorItemFilter) filter).getResult());
            }
            return Collections.emptyList();
        })).warning(WarningType.INVALID_OREDICTIONIFICATOR_FILTER, filter -> filter != null && !filter.hasFilter());
    }
    // While we track and show warnings on the slots themselves we also need to track the warning
    // for if any of the set filters have it even if one of them is not visible
    // Note: We add this after all the buttons have their warnings added so that it is further down the tracker
    // so the tracker can short circuit on this type of warning and not have to check all the filters if one of
    // the ones that are currently being shown has the warning
    trackWarning(WarningType.INVALID_OREDICTIONIFICATOR_FILTER, () -> tile.getFilters().stream().anyMatch(filter -> !filter.hasFilter()));
}
Also used : TranslationButton(mekanism.client.gui.element.button.TranslationButton) GuiOredictionificatorFilter(mekanism.client.gui.element.window.filter.GuiOredictionificatorFilter) GuiProgress(mekanism.client.gui.element.progress.GuiProgress) PlayerInventory(net.minecraft.entity.player.PlayerInventory) GuiElementHolder(mekanism.client.gui.element.GuiElementHolder) FilterButton(mekanism.client.gui.element.button.FilterButton) GuiConfigurableTile(mekanism.client.gui.GuiConfigurableTile) ITextComponent(net.minecraft.util.text.ITextComponent) WarningType(mekanism.client.gui.warning.WarningTracker.WarningType) OredictionificatorItemFilter(mekanism.common.content.oredictionificator.OredictionificatorItemFilter) ProgressType(mekanism.client.gui.element.progress.ProgressType) TileEntityOredictionificator(mekanism.common.tile.machine.TileEntityOredictionificator) MekanismTileContainer(mekanism.common.inventory.container.tile.MekanismTileContainer) MekanismLang(mekanism.common.MekanismLang) GuiScrollBar(mekanism.client.gui.element.scroll.GuiScrollBar) IFilter(mekanism.common.content.filter.IFilter) Collections(java.util.Collections) Nonnull(javax.annotation.Nonnull) MatrixStack(com.mojang.blaze3d.matrix.MatrixStack) TranslationButton(mekanism.client.gui.element.button.TranslationButton) GuiProgress(mekanism.client.gui.element.progress.GuiProgress) GuiElementHolder(mekanism.client.gui.element.GuiElementHolder) FilterButton(mekanism.client.gui.element.button.FilterButton) GuiScrollBar(mekanism.client.gui.element.scroll.GuiScrollBar) OredictionificatorItemFilter(mekanism.common.content.oredictionificator.OredictionificatorItemFilter)

Aggregations

GuiProgress (mekanism.client.gui.element.progress.GuiProgress)25 GuiEnergyTab (mekanism.client.gui.element.tab.GuiEnergyTab)23 GuiVerticalPowerBar (mekanism.client.gui.element.bar.GuiVerticalPowerBar)12 GuiGasGauge (mekanism.client.gui.element.gauge.GuiGasGauge)11 GuiHorizontalPowerBar (mekanism.client.gui.element.bar.GuiHorizontalPowerBar)9 GuiFluidGauge (mekanism.client.gui.element.gauge.GuiFluidGauge)5 GuiUpArrow (mekanism.client.gui.element.GuiUpArrow)3 GuiPigmentGauge (mekanism.client.gui.element.gauge.GuiPigmentGauge)3 GuiSlot (mekanism.client.gui.element.slot.GuiSlot)3 GuiDownArrow (mekanism.client.gui.element.GuiDownArrow)2 TranslationButton (mekanism.client.gui.element.button.TranslationButton)2 PacketGuiInteract (mekanism.common.network.to_server.PacketGuiInteract)2 GuiFusionReactorTab (mekanism.generators.client.gui.element.GuiFusionReactorTab)2 FusionReactorMultiblockData (mekanism.generators.common.content.fusion.FusionReactorMultiblockData)2 MatrixStack (com.mojang.blaze3d.matrix.MatrixStack)1 Collections (java.util.Collections)1 Nonnull (javax.annotation.Nonnull)1 GuiConfigurableTile (mekanism.client.gui.GuiConfigurableTile)1 GuiDumpButton (mekanism.client.gui.element.GuiDumpButton)1 GuiElementHolder (mekanism.client.gui.element.GuiElementHolder)1