use of mekanism.client.gui.element.bar.GuiVerticalPowerBar in project Mekanism by mekanism.
the class GuiFormulaicAssemblicator method addGuiElements.
@Override
protected void addGuiElements() {
super.addGuiElements();
addButton(new GuiVerticalPowerBar(this, tile.getEnergyContainer(), 159, 15));
// Overwrite the output slots with a "combined" slot
addButton(new GuiSlot(SlotType.OUTPUT_LARGE, this, 115, 16));
addButton(new GuiProgress(() -> tile.getOperatingTicks() / (double) tile.getTicksRequired(), ProgressType.TALL_RIGHT, this, 86, 43).jeiCrafting());
addButton(new GuiEnergyTab(this, tile.getEnergyContainer()));
encodeFormulaButton = addButton(new MekanismImageButton(this, 7, 45, 14, getButtonLocation("encode_formula"), () -> Mekanism.packetHandler.sendToServer(new PacketGuiInteract(GuiInteraction.ENCODE_FORMULA, tile)), getOnHover(MekanismLang.ENCODE_FORMULA)));
stockControlButton = addButton(new MekanismImageButton(this, 26, 75, 16, getButtonLocation("stock_control"), () -> Mekanism.packetHandler.sendToServer(new PacketGuiInteract(GuiInteraction.STOCK_CONTROL_BUTTON, tile)), getOnHover(() -> MekanismLang.STOCK_CONTROL.translate(OnOff.of(tile.getStockControl())))));
fillEmptyButton = addButton(new MekanismImageButton(this, 44, 75, 16, getButtonLocation("fill_empty"), () -> Mekanism.packetHandler.sendToServer(new PacketGuiInteract(GuiInteraction.MOVE_ITEMS, tile)), getOnHover(MekanismLang.FILL_EMPTY)));
craftSingleButton = addButton(new MekanismImageButton(this, 71, 75, 16, getButtonLocation("craft_single"), () -> Mekanism.packetHandler.sendToServer(new PacketGuiInteract(GuiInteraction.CRAFT_SINGLE, tile)), getOnHover(MekanismLang.CRAFT_SINGLE)));
craftAvailableButton = addButton(new MekanismImageButton(this, 89, 75, 16, getButtonLocation("craft_available"), () -> Mekanism.packetHandler.sendToServer(new PacketGuiInteract(GuiInteraction.CRAFT_ALL, tile)), getOnHover(MekanismLang.CRAFT_AVAILABLE)));
autoModeButton = addButton(new MekanismImageButton(this, 107, 75, 16, getButtonLocation("auto_toggle"), () -> Mekanism.packetHandler.sendToServer(new PacketGuiInteract(GuiInteraction.NEXT_MODE, tile)), getOnHover(() -> MekanismLang.AUTO_MODE.translate(OnOff.of(tile.getAutoMode())))));
updateEnabledButtons();
}
use of mekanism.client.gui.element.bar.GuiVerticalPowerBar in project Mekanism by mekanism.
the class GuiMetallurgicInfuser method addGuiElements.
@Override
protected void addGuiElements() {
super.addGuiElements();
addButton(new GuiVerticalPowerBar(this, tile.getEnergyContainer(), 164, 15));
addButton(new GuiEnergyTab(this, tile.getEnergyContainer(), tile::getActive));
addButton(new GuiProgress(tile::getScaledProgress, ProgressType.RIGHT, this, 72, 47).jeiCategory(tile));
addButton(new GuiChemicalBar<>(this, GuiChemicalBar.getProvider(tile.infusionTank, tile.getInfusionTanks(null)), 7, 15, 4, 52, false));
addButton(new GuiDumpButton<>(this, tile, 16, 59));
}
use of mekanism.client.gui.element.bar.GuiVerticalPowerBar in project Mekanism by mekanism.
the class GuiIndustrialTurbine method addGuiElements.
@Override
protected void addGuiElements() {
super.addGuiElements();
addButton(new GuiInnerScreen(this, 50, 18, 112, 50, () -> {
List<ITextComponent> list = new ArrayList<>();
TurbineMultiblockData multiblock = tile.getMultiblock();
if (multiblock.isFormed()) {
list.add(GeneratorsLang.TURBINE_PRODUCTION_AMOUNT.translate(EnergyDisplay.of(multiblock.getProductionRate())));
list.add(GeneratorsLang.TURBINE_FLOW_RATE.translate(TextUtils.format(multiblock.clientFlow)));
list.add(GeneratorsLang.TURBINE_CAPACITY.translate(TextUtils.format(multiblock.getSteamCapacity())));
list.add(GeneratorsLang.TURBINE_MAX_FLOW.translate(TextUtils.format(multiblock.getMaxFlowRate())));
}
return list;
}));
addButton(new GuiTurbineTab(this, tile, TurbineTab.STAT));
addButton(new GuiVerticalPowerBar(this, new IBarInfoHandler() {
@Override
public ITextComponent getTooltip() {
TurbineMultiblockData multiblock = tile.getMultiblock();
if (multiblock.isFormed()) {
return EnergyDisplay.of(multiblock.energyContainer).getTextComponent();
}
return EnergyDisplay.ZERO.getTextComponent();
}
@Override
public double getLevel() {
TurbineMultiblockData multiblock = tile.getMultiblock();
if (multiblock.isFormed()) {
return multiblock.energyContainer.getEnergy().divideToLevel(multiblock.energyContainer.getMaxEnergy());
}
return 1;
}
}, 164, 16));
addButton(new GuiVerticalRateBar(this, new IBarInfoHandler() {
@Override
public ITextComponent getTooltip() {
return GeneratorsLang.TURBINE_STEAM_INPUT_RATE.translate(TextUtils.format(tile.getMultiblock().lastSteamInput));
}
@Override
public double getLevel() {
TurbineMultiblockData multiblock = tile.getMultiblock();
if (!multiblock.isFormed()) {
return 0;
}
double rate = Math.min(multiblock.lowerVolume * multiblock.getDispersers() * MekanismGeneratorsConfig.generators.turbineDisperserGasFlow.get(), multiblock.vents * MekanismGeneratorsConfig.generators.turbineVentGasFlow.get());
if (rate == 0) {
return 0;
}
return Math.min(1, multiblock.lastSteamInput / rate);
}
}, 40, 13));
addButton(new GuiGasGauge(() -> tile.getMultiblock().gasTank, () -> tile.getMultiblock().getGasTanks(null), GaugeType.MEDIUM, this, 6, 13));
addButton(new GuiEnergyTab(this, () -> {
EnergyDisplay storing;
EnergyDisplay producing;
TurbineMultiblockData multiblock = tile.getMultiblock();
if (multiblock.isFormed()) {
storing = EnergyDisplay.of(multiblock.energyContainer);
producing = EnergyDisplay.of(MekanismConfig.general.maxEnergyPerSteam.get().divide(TurbineValidator.MAX_BLADES).multiply(multiblock.clientFlow * Math.min(multiblock.blades, multiblock.coils * MekanismGeneratorsConfig.generators.turbineBladesPerCoil.get())));
} else {
storing = EnergyDisplay.ZERO;
producing = EnergyDisplay.ZERO;
}
return Arrays.asList(MekanismLang.STORING.translate(storing), GeneratorsLang.PRODUCING_AMOUNT.translate(producing));
}));
addButton(new GuiGasMode(this, 159, 72, true, () -> tile.getMultiblock().dumpMode, tile.getBlockPos(), 0));
}
use of mekanism.client.gui.element.bar.GuiVerticalPowerBar in project Mekanism by mekanism.
the class GuiSolarGenerator method addGuiElements.
@Override
protected void addGuiElements() {
super.addGuiElements();
addButton(new GuiInnerScreen(this, 48, 23, 80, 40, () -> Arrays.asList(EnergyDisplay.of(tile.getEnergyContainer()).getTextComponent(), GeneratorsLang.PRODUCING_AMOUNT.translate(EnergyDisplay.of(tile.getLastProductionAmount())), GeneratorsLang.OUTPUT_RATE_SHORT.translate(EnergyDisplay.of(tile.getMaxOutput())))));
addButton(new GuiEnergyTab(this, () -> Arrays.asList(GeneratorsLang.PRODUCING_AMOUNT.translate(EnergyDisplay.of(tile.getLastProductionAmount())), MekanismLang.MAX_OUTPUT.translate(EnergyDisplay.of(tile.getMaxOutput())))));
addButton(new GuiVerticalPowerBar(this, tile.getEnergyContainer(), 164, 15));
addButton(new GuiStateTexture(this, 18, 35, tile::canSeeSun, MekanismGenerators.rl(ResourceType.GUI.getPrefix() + "sees_sun.png"), MekanismGenerators.rl(ResourceType.GUI.getPrefix() + "no_sun.png")));
}
use of mekanism.client.gui.element.bar.GuiVerticalPowerBar 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")));
}
Aggregations