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));
}
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));
}
}
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));
}
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));
}
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()));
}
Aggregations