use of mekanism.client.gui.element.text.GuiTextField in project Mekanism by mekanism.
the class GuiQIOItemViewer method addGuiElements.
@Override
protected void addGuiElements() {
super.addGuiElements();
int slotsY = MekanismConfig.client.qioItemViewerSlotsY.get();
getMinecraft().keyboardHandler.setSendRepeatsToGui(true);
addButton(new GuiInnerScreen(this, 7, 15, imageWidth - 16, 12, () -> {
List<ITextComponent> list = new ArrayList<>();
FrequencyIdentity freq = getFrequency();
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<>();
if (getFrequency() != null) {
list.add(MekanismLang.QIO_ITEMS_DETAIL.translateColored(EnumColor.GRAY, EnumColor.INDIGO, TextUtils.format(menu.getTotalItems()), TextUtils.format(menu.getCountCapacity())));
list.add(MekanismLang.QIO_TYPES_DETAIL.translateColored(EnumColor.GRAY, EnumColor.INDIGO, TextUtils.format(menu.getTotalTypes()), TextUtils.format(menu.getTypeCapacity())));
}
return list;
}));
searchField = addButton(new GuiTextField(this, 50, 15 + 12 + 3, imageWidth - 50 - 10, 10));
searchField.setOffset(0, -1);
searchField.setInputValidator(this::isValidSearchChar);
searchField.setResponder(menu::updateSearch);
searchField.setMaxStringLength(50);
searchField.setBackground(BackgroundType.ELEMENT_HOLDER);
searchField.setVisible(true);
searchField.setTextColor(0xFFFFFF);
searchField.setFocused(true);
addButton(new GuiSlotScroll(this, 7, QIOItemViewerContainer.SLOTS_START_Y, MekanismConfig.client.qioItemViewerSlotsX.get(), slotsY, menu::getQIOItemList, menu));
addButton(new GuiDropdown<>(this, imageWidth - 9 - 54, QIOItemViewerContainer.SLOTS_START_Y + slotsY * 18 + 1, 41, ListSortType.class, menu::getSortType, menu::setSortType));
addButton(new GuiDigitalIconToggle<>(this, imageWidth - 9 - 12, QIOItemViewerContainer.SLOTS_START_Y + slotsY * 18 + 1, 12, 12, SortDirection.class, menu::getSortDirection, menu::setSortDirection));
addButton(new GuiResizeControls(this, (getMinecraft().getWindow().getGuiScaledHeight() / 2) - 20 - topPos, this::resize));
craftingWindowTab = addButton(new GuiCraftingWindowTab(this, () -> craftingWindowTab, menu));
}
use of mekanism.client.gui.element.text.GuiTextField in project Mekanism by mekanism.
the class GuiResistiveHeater method addGuiElements.
@Override
protected void addGuiElements() {
super.addGuiElements();
addButton(new GuiInnerScreen(this, 48, 23, 80, 42, () -> Arrays.asList(MekanismLang.TEMPERATURE.translate(MekanismUtils.getTemperatureDisplay(tile.getTotalTemperature(), TemperatureUnit.KELVIN, true)), MekanismLang.RESISTIVE_HEATER_USAGE.translate(EnergyDisplay.of(tile.getEnergyContainer().getEnergyPerTick())))).clearFormat());
addButton(new GuiVerticalPowerBar(this, tile.getEnergyContainer(), 164, 15));
addButton(new GuiEnergyTab(this, tile.getEnergyContainer()));
addButton(new GuiHeatTab(this, () -> {
ITextComponent environment = MekanismUtils.getTemperatureDisplay(tile.getLastEnvironmentLoss(), TemperatureUnit.KELVIN, false);
return Collections.singletonList(MekanismLang.DISSIPATED_RATE.translate(environment));
}));
energyUsageField = addButton(new GuiTextField(this, 50, 51, 76, 12));
energyUsageField.setText(energyUsageField.getText());
energyUsageField.setMaxStringLength(7);
energyUsageField.setInputValidator(InputValidator.DIGIT);
energyUsageField.configureDigitalInput(this::setEnergyUsage);
energyUsageField.setFocused(true);
}
use of mekanism.client.gui.element.text.GuiTextField in project Mekanism by mekanism.
the class GuiFusionReactorFuel method addGuiElements.
@Override
protected void addGuiElements() {
super.addGuiElements();
addButton(new GuiEnergyTab(this, () -> {
FusionReactorMultiblockData multiblock = tile.getMultiblock();
return Arrays.asList(MekanismLang.STORING.translate(EnergyDisplay.of(multiblock.energyContainer)), GeneratorsLang.PRODUCING_AMOUNT.translate(EnergyDisplay.of(multiblock.getPassiveGeneration(false, true))));
}));
addButton(new GuiGasGauge(() -> tile.getMultiblock().deuteriumTank, () -> tile.getMultiblock().getGasTanks(null), GaugeType.SMALL, this, 25, 64));
addButton(new GuiGasGauge(() -> tile.getMultiblock().fuelTank, () -> tile.getMultiblock().getGasTanks(null), GaugeType.STANDARD, this, 79, 50));
addButton(new GuiGasGauge(() -> tile.getMultiblock().tritiumTank, () -> tile.getMultiblock().getGasTanks(null), GaugeType.SMALL, this, 133, 64));
addButton(new GuiProgress(() -> tile.getMultiblock().isBurning(), ProgressType.SMALL_RIGHT, this, 47, 76));
addButton(new GuiProgress(() -> tile.getMultiblock().isBurning(), ProgressType.SMALL_LEFT, this, 101, 76));
addButton(new GuiFusionReactorTab(this, tile, FusionReactorTab.HEAT));
addButton(new GuiFusionReactorTab(this, tile, FusionReactorTab.STAT));
injectionRateField = addButton(new GuiTextField(this, 98, 115, 26, 11));
injectionRateField.changeFocus(true);
injectionRateField.setInputValidator(InputValidator.DIGIT);
injectionRateField.setEnterHandler(this::setInjection);
injectionRateField.setMaxStringLength(2);
}
use of mekanism.client.gui.element.text.GuiTextField in project Mekanism by mekanism.
the class GuiFissionReactorStats method addGuiElements.
@Override
protected void addGuiElements() {
super.addGuiElements();
addButton(new GuiFissionReactorTab(this, tile, FissionReactorTab.MAIN));
addButton(new GuiDynamicHorizontalRateBar(this, new IBarInfoHandler() {
@Override
public ITextComponent getTooltip() {
return GeneratorsLang.GAS_BURN_RATE.translate(tile.getMultiblock().lastBurnRate);
}
@Override
public double getLevel() {
FissionReactorMultiblockData multiblock = tile.getMultiblock();
return Math.min(1, multiblock.lastBurnRate / multiblock.getMaxBurnRate());
}
}, 5, 114, imageWidth - 12));
rateLimitField = addButton(new GuiTextField(this, 77, 128, 49, 12));
rateLimitField.setEnterHandler(this::setRateLimit);
rateLimitField.setInputValidator(InputValidator.DECIMAL);
rateLimitField.setMaxStringLength(4);
rateLimitField.addCheckmarkButton(this::setRateLimit);
}
use of mekanism.client.gui.element.text.GuiTextField in project Mekanism by mekanism.
the class GuiLaserAmplifier method addGuiElements.
@Override
protected void addGuiElements() {
super.addGuiElements();
addButton(new GuiEnergyGauge(tile.getEnergyContainer(), GaugeType.STANDARD, this, 6, 10));
addButton(new GuiAmplifierTab(this, tile));
timerField = addButton(new GuiTextField(this, 96, 28, 36, 11));
timerField.setMaxStringLength(4);
timerField.setEnterHandler(this::setTime);
timerField.setInputValidator(InputValidator.DIGIT);
minField = addButton(new GuiTextField(this, 96, 43, 72, 11));
minField.setMaxStringLength(10);
minField.setEnterHandler(this::setMinThreshold);
minField.setInputValidator(InputValidator.SCI_NOTATION);
maxField = addButton(new GuiTextField(this, 96, 58, 72, 11));
maxField.setMaxStringLength(10);
maxField.setEnterHandler(this::setMaxThreshold);
maxField.setInputValidator(InputValidator.SCI_NOTATION);
}
Aggregations