Search in sources :

Example 1 with TextFieldWidget

use of gregtech.api.gui.widgets.TextFieldWidget in project GregTech by GregTechCE.

the class OreDictionaryItemFilter method initUI.

@Override
public void initUI(Consumer<Widget> widgetGroup) {
    widgetGroup.accept(new LabelWidget(10, 0, "cover.ore_dictionary_filter.title1"));
    widgetGroup.accept(new LabelWidget(10, 10, "cover.ore_dictionary_filter.title2"));
    widgetGroup.accept(new TextFieldWidget(10, 25, 100, 12, true, () -> oreDictionaryFilter, this::setOreDictionaryFilter).setMaxStringLength(64).setValidator(str -> ORE_DICTIONARY_FILTER.matcher(str).matches()));
}
Also used : NBTTagCompound(net.minecraft.nbt.NBTTagCompound) Consumer(java.util.function.Consumer) ItemStack(net.minecraft.item.ItemStack) OreDictUnifier(gregtech.api.unification.OreDictUnifier) Widget(gregtech.api.gui.Widget) Set(java.util.Set) Pattern(java.util.regex.Pattern) LabelWidget(gregtech.api.gui.widgets.LabelWidget) TextFieldWidget(gregtech.api.gui.widgets.TextFieldWidget) ItemStackKey(gregtech.api.util.ItemStackKey) LabelWidget(gregtech.api.gui.widgets.LabelWidget) TextFieldWidget(gregtech.api.gui.widgets.TextFieldWidget)

Aggregations

Widget (gregtech.api.gui.Widget)1 LabelWidget (gregtech.api.gui.widgets.LabelWidget)1 TextFieldWidget (gregtech.api.gui.widgets.TextFieldWidget)1 OreDictUnifier (gregtech.api.unification.OreDictUnifier)1 ItemStackKey (gregtech.api.util.ItemStackKey)1 Set (java.util.Set)1 Consumer (java.util.function.Consumer)1 Pattern (java.util.regex.Pattern)1 ItemStack (net.minecraft.item.ItemStack)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1