use of mekanism.client.gui.element.tab.window.GuiCraftingWindowTab 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));
}
Aggregations