use of mekanism.client.gui.element.gauge.GuiEnergyGauge.IEnergyInfoHandler 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())));
}));
}
use of mekanism.client.gui.element.gauge.GuiEnergyGauge.IEnergyInfoHandler 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())));
}));
}
Aggregations