use of mekanism.client.gui.element.GuiInnerScreen in project Mekanism by mekanism.
the class GuiThermoelectricBoiler method addGuiElements.
@Override
protected void addGuiElements() {
super.addGuiElements();
addButton(new GuiInnerScreen(this, 60, 23, 96, 40, () -> {
BoilerMultiblockData multiblock = tile.getMultiblock();
return Arrays.asList(MekanismLang.TEMPERATURE.translate(MekanismUtils.getTemperatureDisplay(multiblock.getTotalTemperature(), TemperatureUnit.KELVIN, true)), MekanismLang.BOIL_RATE.translate(TextUtils.format(multiblock.lastBoilRate)), MekanismLang.MAX_BOIL_RATE.translate(TextUtils.format(multiblock.lastMaxBoil)));
}).jeiCategories(MekanismBlocks.BOILER_CASING.getRegistryName()));
addButton(new GuiBoilerTab(this, tile, BoilerTab.STAT));
addButton(new GuiVerticalRateBar(this, new IBarInfoHandler() {
@Override
public ITextComponent getTooltip() {
return MekanismLang.BOIL_RATE.translate(TextUtils.format(tile.getMultiblock().lastBoilRate));
}
@Override
public double getLevel() {
BoilerMultiblockData multiblock = tile.getMultiblock();
return Math.min(1, multiblock.lastBoilRate / (double) multiblock.lastMaxBoil);
}
}, 44, 13));
addButton(new GuiVerticalRateBar(this, new IBarInfoHandler() {
@Override
public ITextComponent getTooltip() {
return MekanismLang.MAX_BOIL_RATE.translate(TextUtils.format(tile.getMultiblock().lastMaxBoil));
}
@Override
public double getLevel() {
BoilerMultiblockData multiblock = tile.getMultiblock();
return Math.min(1, multiblock.lastMaxBoil * HeatUtils.getWaterThermalEnthalpy() / (multiblock.superheatingElements * MekanismConfig.general.superheatingHeatTransfer.get()));
}
}, 164, 13));
addButton(new GuiGasGauge(() -> tile.getMultiblock().superheatedCoolantTank, () -> tile.getMultiblock().getGasTanks(null), GaugeType.STANDARD, this, 6, 13).setLabel(MekanismLang.BOILER_HEATED_COOLANT_TANK.translateColored(EnumColor.ORANGE)));
addButton(new GuiFluidGauge(() -> tile.getMultiblock().waterTank, () -> tile.getMultiblock().getFluidTanks(null), GaugeType.STANDARD, this, 26, 13).setLabel(MekanismLang.BOILER_WATER_TANK.translateColored(EnumColor.INDIGO)));
addButton(new GuiGasGauge(() -> tile.getMultiblock().steamTank, () -> tile.getMultiblock().getGasTanks(null), GaugeType.STANDARD, this, 172, 13).setLabel(MekanismLang.BOILER_STEAM_TANK.translateColored(EnumColor.GRAY)));
addButton(new GuiGasGauge(() -> tile.getMultiblock().cooledCoolantTank, () -> tile.getMultiblock().getGasTanks(null), GaugeType.STANDARD, this, 192, 13).setLabel(MekanismLang.BOILER_COOLANT_TANK.translateColored(EnumColor.AQUA)));
addButton(new GuiHeatTab(this, () -> {
ITextComponent environment = MekanismUtils.getTemperatureDisplay(tile.getMultiblock().lastEnvironmentLoss, TemperatureUnit.KELVIN, false);
return Collections.singletonList(MekanismLang.DISSIPATED_RATE.translate(environment));
}));
}
use of mekanism.client.gui.element.GuiInnerScreen in project Mekanism by mekanism.
the class GuiFluidicPlenisher method addGuiElements.
@Override
protected void addGuiElements() {
super.addGuiElements();
addButton(new GuiInnerScreen(this, 54, 23, 80, 41, () -> {
List<ITextComponent> list = new ArrayList<>();
list.add(EnergyDisplay.of(tile.getEnergyContainer()).getTextComponent());
list.add(MekanismLang.FINISHED.translate(YesNo.of(tile.finishedCalc)));
FluidStack fluid = tile.fluidTank.getFluid();
if (fluid.isEmpty()) {
list.add(MekanismLang.NO_FLUID.translate());
} else {
list.add(MekanismLang.GENERIC_STORED_MB.translate(fluid, TextUtils.format(fluid.getAmount())));
}
return list;
}));
addButton(new GuiDownArrow(this, 32, 39));
addButton(new GuiVerticalPowerBar(this, tile.getEnergyContainer(), 164, 15));
addButton(new GuiFluidGauge(() -> tile.fluidTank, () -> tile.getFluidTanks(null), GaugeType.STANDARD, this, 6, 13));
addButton(new GuiEnergyTab(this, tile.getEnergyContainer()));
}
use of mekanism.client.gui.element.GuiInnerScreen in project Mekanism by mekanism.
the class GuiSeismicReader method addGuiElements.
@Override
protected void addGuiElements() {
super.addGuiElements();
addButton(new GuiInnerScreen(this, 7, 11, 63, 49));
addButton(new GuiInnerScreen(this, 74, 11, 51, 159));
scrollBar = addButton(new GuiScrollBar(this, 126, 25, 131, blockList::size, () -> 1));
addButton(new GuiArrowSelection(this, 76, 81, () -> {
int currentLayer = scrollBar.getCurrentSelection();
if (currentLayer >= 0) {
return blockList.get(blockList.size() - 1 - currentLayer).getBlock().getName();
}
return null;
}));
upButton = addButton(new MekanismImageButton(this, 126, 11, 14, MekanismUtils.getResource(ResourceType.GUI_BUTTON, "up.png"), () -> scrollBar.adjustScroll(1)));
downButton = addButton(new MekanismImageButton(this, 126, 156, 14, MekanismUtils.getResource(ResourceType.GUI_BUTTON, "down.png"), () -> scrollBar.adjustScroll(-1)));
updateEnabledButtons();
}
use of mekanism.client.gui.element.GuiInnerScreen in project Mekanism by mekanism.
the class GuiAntiprotonicNucleosynthesizer method addGuiElements.
@Override
protected void addGuiElements() {
super.addGuiElements();
addButton(new GuiInnerScreen(this, 45, 18, 104, 68).jeiCategory(tile));
addButton(new GuiEnergyTab(this, tile.getEnergyContainer(), tile::getEnergyUsed));
addButton(new GuiGasGauge(() -> tile.gasTank, () -> tile.getGasTanks(null), GaugeType.SMALL_MED, this, 5, 18));
addButton(new GuiEnergyGauge(tile.getEnergyContainer(), GaugeType.SMALL_MED, this, 172, 18));
addButton(new GuiDynamicHorizontalRateBar(this, new IBarInfoHandler() {
@Override
public ITextComponent getTooltip() {
return MekanismLang.PROGRESS.translate(TextUtils.getPercent(tile.getScaledProgress()));
}
@Override
public double getLevel() {
return Math.min(1, tile.getScaledProgress());
}
}, 5, 88, 183, ColorFunction.scale(Color.rgbi(60, 45, 74), Color.rgbi(100, 30, 170))));
}
use of mekanism.client.gui.element.GuiInnerScreen in project Mekanism by mekanism.
the class GuiQIORedstoneAdapter method addGuiElements.
@Override
protected void addGuiElements() {
super.addGuiElements();
addButton(new GuiQIOFrequencyTab(this, tile));
addButton(new GuiSlot(SlotType.NORMAL, this, 7, 30).setRenderHover(true)).setGhostHandler((IGhostItemConsumer) ingredient -> {
Mekanism.packetHandler.sendToServer(new PacketGuiInteract(GuiInteractionItem.QIO_REDSTONE_ADAPTER_STACK, tile, StackUtils.size((ItemStack) ingredient, 1)));
minecraft.getSoundManager().play(SimpleSound.forUI(MekanismSounds.BEEP.get(), 1.0F));
});
addButton(new GuiInnerScreen(this, 7, 16, imageWidth - 15, 12, () -> {
List<ITextComponent> list = new ArrayList<>();
QIOFrequency freq = tile.getQIOFrequency();
if (freq == null) {
list.add(MekanismLang.NO_FREQUENCY.translate());
} else {
list.add(MekanismLang.FREQUENCY.translate(freq.getKey()));
}
return list;
}).tooltip(() -> {
List<ITextComponent> list = new ArrayList<>();
QIOFrequency freq = tile.getQIOFrequency();
if (freq != null) {
list.add(MekanismLang.QIO_ITEMS_DETAIL.translateColored(EnumColor.GRAY, EnumColor.INDIGO, TextUtils.format(freq.getTotalItemCount()), TextUtils.format(freq.getTotalItemCountCapacity())));
list.add(MekanismLang.QIO_TYPES_DETAIL.translateColored(EnumColor.GRAY, EnumColor.INDIGO, TextUtils.format(freq.getTotalItemTypes(true)), TextUtils.format(freq.getTotalItemTypeCapacity())));
}
return list;
}));
addButton(new GuiInnerScreen(this, 27, 30, imageWidth - 27 - 8, 54, () -> {
List<ITextComponent> list = new ArrayList<>();
list.add(!tile.getItemType().isEmpty() ? tile.getItemType().getStack().getHoverName() : MekanismLang.QIO_ITEM_TYPE_UNDEFINED.translate());
list.add(MekanismLang.QIO_TRIGGER_COUNT.translate(TextUtils.format(tile.getCount())));
if (!tile.getItemType().isEmpty() && tile.getQIOFrequency() != null) {
list.add(MekanismLang.QIO_STORED_COUNT.translate(TextUtils.format(tile.getStoredCount())));
}
return list;
}).clearFormat());
text = addButton(new GuiTextField(this, 29, 70, imageWidth - 39, 12));
text.setMaxStringLength(10);
text.setInputValidator(InputValidator.DIGIT);
text.setFocused(true);
text.configureDigitalInput(this::setCount);
}
Aggregations