Search in sources :

Example 1 with TileEntityMetallurgicInfuserFactory

use of mekanism.common.tile.factory.TileEntityMetallurgicInfuserFactory 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)

Aggregations

GuiDumpButton (mekanism.client.gui.element.GuiDumpButton)1 GuiChemicalBar (mekanism.client.gui.element.bar.GuiChemicalBar)1 GuiVerticalPowerBar (mekanism.client.gui.element.bar.GuiVerticalPowerBar)1 GuiProgress (mekanism.client.gui.element.progress.GuiProgress)1 GuiEnergyTab (mekanism.client.gui.element.tab.GuiEnergyTab)1 GuiSortingTab (mekanism.client.gui.element.tab.GuiSortingTab)1 TileEntityItemStackGasToItemStackFactory (mekanism.common.tile.factory.TileEntityItemStackGasToItemStackFactory)1 TileEntityMetallurgicInfuserFactory (mekanism.common.tile.factory.TileEntityMetallurgicInfuserFactory)1 TileEntitySawingFactory (mekanism.common.tile.factory.TileEntitySawingFactory)1