mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-25 14:34:54 +00:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f7927fe21 | ||
|
|
3e1baa4ded |
No files matched your search
+1
-1
@@ -41,7 +41,7 @@ developmentEnvironmentUserName = Developer
|
||||
|
||||
# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8.
|
||||
# See https://github.com/bsideup/jabel for details on how this works.
|
||||
enableModernJavaSyntax = true
|
||||
enableModernJavaSyntax = false
|
||||
|
||||
# Enables injecting missing generics into the decompiled source code for a better coding experience.
|
||||
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package codechicken.nei;
|
||||
|
||||
import static codechicken.lib.gui.GuiDraw.drawString;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
@@ -18,6 +15,7 @@ import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.storage.SaveFormatComparator;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
@@ -181,311 +179,59 @@ public class NEIClientConfig {
|
||||
tag.getTag("inventory.search.quoteDropItemName").setComment("Quote Drop Item Name").getBooleanValue(true);
|
||||
API.addOption(new OptionToggleButton("inventory.search.quoteDropItemName", true));
|
||||
|
||||
tag.getTag("inventory.search.modNameSearchMode").setComment("Search mode for Mod Names").getIntValue(1);
|
||||
API.addOption(new OptionCycled("inventory.search.modNameSearchMode", 3, true));
|
||||
|
||||
String preModName = tag.getTag("inventory.search.modNameSearchPrefix").setComment(
|
||||
"Search prefix for Mod Names (leave empty to always search for Mod Names, enter anything longer than one character to disable)")
|
||||
.getValue("@");
|
||||
if (preModName.length() != 1) {
|
||||
logger.warn("Search prefix inventory.search.modNameSearchPrefix has invalid length! Resetting to default.");
|
||||
preModName = "@";
|
||||
tag.getTag("inventory.search.modNameSearchPrefix").setValue(preModName);
|
||||
}
|
||||
API.addOption(new OptionTextField("inventory.search.modNameSearchPrefix") {
|
||||
tag.getTag("inventory.search.modNameSearchMode").setComment("Search mode for Mod Names (prefix: @)")
|
||||
.getIntValue(1);
|
||||
API.addOption(new OptionCycled("inventory.search.modNameSearchMode", 3, true) {
|
||||
|
||||
@Override
|
||||
public void draw(int mousex, int mousey, float frame) {
|
||||
drawString(getPrefix(), 10, 6, -1);
|
||||
textField.w = 60;
|
||||
textField.x = slot.slotWidth() - textField.w;
|
||||
textField.draw(mousex, mousey);
|
||||
public String getButtonText() {
|
||||
return translateN(name + "." + value(), EnumChatFormatting.LIGHT_PURPLE + "@");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidValue(String s) {
|
||||
if (s.length() == 1) {
|
||||
return !Arrays.asList(
|
||||
getTag("inventory.search.tooltipSearchPrefix").getValue(),
|
||||
getTag("inventory.search.identifierSearchPrefix").getValue(),
|
||||
getTag("inventory.search.oreDictSearchPrefix").getValue(),
|
||||
getTag("inventory.search.subsetsSearchPrefix").getValue()).contains(s);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TextField createTextField() {
|
||||
return new DefaultOptionTextField() {
|
||||
|
||||
@Override
|
||||
public int getTextColour() {
|
||||
return isValidValue(text()) ? 0xFF55FF : 0xAA0000;
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
tag.getTag("inventory.search.tooltipSearchMode").setComment("Search mode for Tooltips").getIntValue(0);
|
||||
API.addOption(new OptionCycled("inventory.search.tooltipSearchMode", 3, true));
|
||||
|
||||
String preTooltip = tag.getTag("inventory.search.tooltipSearchPrefix").setComment(
|
||||
"Search mode for Tooltips (leave empty to always search for Tooltips, enter anything longer than one character to disable)")
|
||||
.getValue("#");
|
||||
if (preTooltip.length() == 1) {
|
||||
if (preTooltip.equals(preModName)) {
|
||||
// conflicting prefix char
|
||||
logger.warn(
|
||||
"Search prefix inventory.search.tooltipSearchPrefix conflicts with inventory.search.modNameSearchPrefix ({})! Resetting to default.",
|
||||
preTooltip);
|
||||
preTooltip = "#";
|
||||
tag.getTag("inventory.search.tooltipSearchPrefix").setValue(preTooltip);
|
||||
}
|
||||
} else {
|
||||
logger.warn("Search prefix inventory.search.tooltipSearchPrefix has invalid length! Resetting to default.");
|
||||
preModName = "#";
|
||||
tag.getTag("inventory.search.tooltipSearchPrefix").setValue(preModName);
|
||||
}
|
||||
API.addOption(new OptionTextField("inventory.search.tooltipSearchPrefix") {
|
||||
tag.getTag("inventory.search.tooltipSearchMode").setComment("Search mode for Tooltips (prefix: #)")
|
||||
.getIntValue(0);
|
||||
API.addOption(new OptionCycled("inventory.search.tooltipSearchMode", 3, true) {
|
||||
|
||||
@Override
|
||||
public void draw(int mousex, int mousey, float frame) {
|
||||
drawString(getPrefix(), 10, 6, -1);
|
||||
textField.w = 60;
|
||||
textField.x = slot.slotWidth() - textField.w;
|
||||
textField.draw(mousex, mousey);
|
||||
public String getButtonText() {
|
||||
return translateN(name + "." + value(), EnumChatFormatting.YELLOW + "#");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidValue(String s) {
|
||||
if (s.length() == 1) {
|
||||
return !Arrays.asList(
|
||||
getTag("inventory.search.modNameSearchPrefix").getValue(),
|
||||
getTag("inventory.search.identifierSearchPrefix").getValue(),
|
||||
getTag("inventory.search.oreDictSearchPrefix").getValue(),
|
||||
getTag("inventory.search.subsetsSearchPrefix").getValue()).contains(s);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TextField createTextField() {
|
||||
return new DefaultOptionTextField() {
|
||||
|
||||
@Override
|
||||
public int getTextColour() {
|
||||
return isValidValue(text()) ? 0xFFFF55 : 0xAA0000;
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
tag.getTag("inventory.search.identifierSearchMode").setComment("Search mode for identifier (prefix: &)")
|
||||
.getIntValue(0);
|
||||
API.addOption(new OptionCycled("inventory.search.identifierSearchMode", 3, true));
|
||||
|
||||
String preIdentifier = tag.getTag("inventory.search.identifierSearchPrefix").setComment(
|
||||
"Search mode for identifier (leave empty to always search for identifier, enter anything longer than one character to disable)")
|
||||
.getValue("&");
|
||||
if (preIdentifier.length() == 1) {
|
||||
if (preIdentifier.equals(preModName)) {
|
||||
// conflicting prefix char
|
||||
logger.warn(
|
||||
"Search prefix inventory.search.identifierSearchPrefix conflicts with inventory.search.modNameSearchPrefix ({})! Resetting to default.",
|
||||
preIdentifier);
|
||||
preIdentifier = "&";
|
||||
tag.getTag("inventory.search.identifierSearchPrefix").setValue(preIdentifier);
|
||||
} else if (preIdentifier.equals(preTooltip)) {
|
||||
// conflicting prefix char
|
||||
logger.warn(
|
||||
"Search prefix inventory.search.identifierSearchPrefix conflicts with inventory.search.tooltipSearchPrefix ({})! Resetting to default.",
|
||||
preIdentifier);
|
||||
preIdentifier = "&";
|
||||
tag.getTag("inventory.search.identifierSearchPrefix").setValue(preIdentifier);
|
||||
}
|
||||
} else {
|
||||
logger.warn(
|
||||
"Search prefix inventory.search.identifierSearchPrefix has invalid length! Resetting to default.");
|
||||
preModName = "&";
|
||||
tag.getTag("inventory.search.identifierSearchPrefix").setValue(preModName);
|
||||
}
|
||||
API.addOption(new OptionTextField("inventory.search.identifierSearchPrefix") {
|
||||
API.addOption(new OptionCycled("inventory.search.identifierSearchMode", 3, true) {
|
||||
|
||||
@Override
|
||||
public void draw(int mousex, int mousey, float frame) {
|
||||
drawString(getPrefix(), 10, 6, -1);
|
||||
textField.w = 60;
|
||||
textField.x = slot.slotWidth() - textField.w;
|
||||
textField.draw(mousex, mousey);
|
||||
public String getButtonText() {
|
||||
return translateN(name + "." + value(), EnumChatFormatting.GOLD + "&");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidValue(String s) {
|
||||
if (s.length() == 1) {
|
||||
return !Arrays.asList(
|
||||
getTag("inventory.search.modNameSearchPrefix").getValue(),
|
||||
getTag("inventory.search.tooltipSearchPrefix").getValue(),
|
||||
getTag("inventory.search.oreDictSearchPrefix").getValue(),
|
||||
getTag("inventory.search.subsetsSearchPrefix").getValue()).contains(s);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TextField createTextField() {
|
||||
return new DefaultOptionTextField() {
|
||||
|
||||
@Override
|
||||
public int getTextColour() {
|
||||
return isValidValue(text()) ? 0xFFAA00 : 0xAA0000;
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
tag.getTag("inventory.search.oreDictSearchMode").setComment("Search mode for Tag Names (prefix: $)")
|
||||
.getIntValue(0);
|
||||
API.addOption(new OptionCycled("inventory.search.oreDictSearchMode", 3, true));
|
||||
|
||||
String preODName = tag.getTag("inventory.search.oreDictSearchPrefix").setComment(
|
||||
"Search mode for Ore Dictionary Tags (leave empty to always search for Ore Dictionary Tags, enter anything longer than one character to disable)")
|
||||
.getValue("$");
|
||||
if (preODName.length() == 1) {
|
||||
if (preODName.equals(preModName)) {
|
||||
// conflicting prefix char
|
||||
logger.warn(
|
||||
"Search prefix inventory.search.oreDictSearchPrefix conflicts with inventory.search.modNameSearchPrefix ({})! Resetting to default.",
|
||||
preIdentifier);
|
||||
preODName = "$";
|
||||
tag.getTag("inventory.search.oreDictSearchPrefix").setValue(preODName);
|
||||
} else if (preODName.equals(preTooltip)) {
|
||||
// conflicting prefix char
|
||||
logger.warn(
|
||||
"Search prefix inventory.search.oreDictSearchPrefix conflicts with inventory.search.tooltipSearchPrefix ({})! Resetting to default.",
|
||||
preIdentifier);
|
||||
preODName = "$";
|
||||
tag.getTag("inventory.search.oreDictSearchPrefix").setValue(preODName);
|
||||
} else if (preODName.equals(preIdentifier)) {
|
||||
// conflicting prefix char
|
||||
logger.warn(
|
||||
"Search prefix inventory.search.oreDictSearchPrefix conflicts with inventory.search.identifierSearchPrefix ({})! Resetting to default.",
|
||||
preIdentifier);
|
||||
preODName = "$";
|
||||
tag.getTag("inventory.search.oreDictSearchPrefix").setValue(preODName);
|
||||
}
|
||||
} else {
|
||||
logger.warn("Search prefix inventory.search.oreDictSearchPrefix has invalid length! Resetting to default.");
|
||||
preModName = "$";
|
||||
tag.getTag("inventory.search.oreDictSearchPrefix").setValue(preModName);
|
||||
}
|
||||
API.addOption(new OptionTextField("inventory.search.oreDictSearchPrefix") {
|
||||
API.addOption(new OptionCycled("inventory.search.oreDictSearchMode", 3, true) {
|
||||
|
||||
@Override
|
||||
public void draw(int mousex, int mousey, float frame) {
|
||||
drawString(getPrefix(), 10, 6, -1);
|
||||
textField.w = 60;
|
||||
textField.x = slot.slotWidth() - textField.w;
|
||||
textField.draw(mousex, mousey);
|
||||
public String getButtonText() {
|
||||
return translateN(name + "." + value(), EnumChatFormatting.AQUA + "$");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidValue(String s) {
|
||||
if (s.length() == 1) {
|
||||
return !Arrays.asList(
|
||||
getTag("inventory.search.modNameSearchPrefix").getValue(),
|
||||
getTag("inventory.search.tooltipSearchPrefix").getValue(),
|
||||
getTag("inventory.search.identifierSearchPrefix").getValue(),
|
||||
getTag("inventory.search.subsetsSearchPrefix").getValue()).contains(s);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TextField createTextField() {
|
||||
return new DefaultOptionTextField() {
|
||||
|
||||
@Override
|
||||
public int getTextColour() {
|
||||
return isValidValue(text()) ? 0x55FFFF : 0xAA0000;
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
tag.getTag("inventory.search.subsetsSearchMode").setComment("Search mode for Item Subsets (prefix: %)")
|
||||
.getIntValue(2);
|
||||
API.addOption(new OptionCycled("inventory.search.subsetsSearchMode", 3, true));
|
||||
|
||||
String preSubset = tag.getTag("inventory.search.subsetsSearchPrefix").setComment(
|
||||
"Search mode for Item Subsets (leave empty to always search for Item Subsets, enter anything longer than one character to disable)")
|
||||
.getValue("%");
|
||||
if (preSubset.length() == 1) {
|
||||
if (preSubset.equals(preModName)) {
|
||||
// conflicting prefix char
|
||||
logger.warn(
|
||||
"Search prefix inventory.search.subsetsSearchPrefix conflicts with inventory.search.modNameSearchPrefix ({})! Resetting to default.",
|
||||
preIdentifier);
|
||||
preSubset = "%";
|
||||
tag.getTag("inventory.search.subsetsSearchPrefix").setValue(preSubset);
|
||||
} else if (preSubset.equals(preTooltip)) {
|
||||
// conflicting prefix char
|
||||
logger.warn(
|
||||
"Search prefix inventory.search.subsetsSearchPrefix conflicts with inventory.search.tooltipSearchPrefix ({})! Resetting to default.",
|
||||
preIdentifier);
|
||||
preSubset = "%";
|
||||
tag.getTag("inventory.search.subsetsSearchPrefix").setValue(preSubset);
|
||||
} else if (preSubset.equals(preIdentifier)) {
|
||||
// conflicting prefix char
|
||||
logger.warn(
|
||||
"Search prefix inventory.search.subsetsSearchPrefix conflicts with inventory.search.identifierSearchPrefix ({})! Resetting to default.",
|
||||
preIdentifier);
|
||||
preSubset = "%";
|
||||
tag.getTag("inventory.search.subsetsSearchPrefix").setValue(preSubset);
|
||||
} else if (preSubset.equals(preODName)) {
|
||||
// conflicting prefix char
|
||||
logger.warn(
|
||||
"Search prefix inventory.search.subsetsSearchPrefix conflicts with inventory.search.oreDictSearchPrefix ({})! Resetting to default.",
|
||||
preIdentifier);
|
||||
preSubset = "%";
|
||||
tag.getTag("inventory.search.subsetsSearchPrefix").setValue(preSubset);
|
||||
}
|
||||
} else {
|
||||
logger.warn("Search prefix inventory.search.subsetsSearchPrefix has invalid length! Resetting to default.");
|
||||
preModName = "%";
|
||||
tag.getTag("inventory.search.subsetsSearchPrefix").setValue(preModName);
|
||||
}
|
||||
API.addOption(new OptionTextField("inventory.search.subsetsSearchPrefix") {
|
||||
API.addOption(new OptionCycled("inventory.search.subsetsSearchMode", 3, true) {
|
||||
|
||||
@Override
|
||||
public void draw(int mousex, int mousey, float frame) {
|
||||
drawString(getPrefix(), 10, 6, -1);
|
||||
textField.w = 60;
|
||||
textField.x = slot.slotWidth() - textField.w;
|
||||
textField.draw(mousex, mousey);
|
||||
public String getButtonText() {
|
||||
return translateN(name + "." + value(), EnumChatFormatting.DARK_PURPLE + "%");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidValue(String s) {
|
||||
if (s.length() == 1) {
|
||||
return !Arrays.asList(
|
||||
getTag("inventory.search.modNameSearchPrefix").getValue(),
|
||||
getTag("inventory.search.tooltipSearchPrefix").getValue(),
|
||||
getTag("inventory.search.identifierSearchPrefix").getValue(),
|
||||
getTag("inventory.search.oreDictSearchPrefix").getValue()).contains(s);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TextField createTextField() {
|
||||
return new DefaultOptionTextField() {
|
||||
|
||||
@Override
|
||||
public int getTextColour() {
|
||||
return isValidValue(text()) ? 0xAA00AA : 0xAA0000;
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
tag.getTag("inventory.bookmarks.enabled").setComment("Enable/Disable Bookmark Panel").getBooleanValue(true);
|
||||
|
||||
@@ -44,12 +44,12 @@ public class SearchField extends TextField implements ItemFilterProvider {
|
||||
|
||||
protected final Function<Pattern, ItemFilter> createFilter;
|
||||
protected final String name;
|
||||
protected final char defaultPrefix;
|
||||
protected final char prefix;
|
||||
protected final EnumChatFormatting highlightedColor;
|
||||
|
||||
public SearchParserProvider(char defaultPrefix, String name, EnumChatFormatting highlightedColor,
|
||||
public SearchParserProvider(char prefix, String name, EnumChatFormatting highlightedColor,
|
||||
Function<Pattern, ItemFilter> createFilter) {
|
||||
this.defaultPrefix = defaultPrefix;
|
||||
this.prefix = prefix;
|
||||
this.name = name;
|
||||
this.highlightedColor = highlightedColor;
|
||||
this.createFilter = createFilter;
|
||||
@@ -74,8 +74,7 @@ public class SearchField extends TextField implements ItemFilterProvider {
|
||||
|
||||
@Override
|
||||
public char getPrefix() {
|
||||
String prefix = NEIClientConfig.getStringSetting("inventory.search." + this.name + "SearchPrefix");
|
||||
return prefix.length() == 0 ? this.defaultPrefix : prefix.charAt(0);
|
||||
return this.prefix;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -30,11 +30,16 @@ public class SearchTokenParser {
|
||||
NEVER;
|
||||
|
||||
public static SearchMode fromInt(int value) {
|
||||
return switch (value) {
|
||||
case 0 -> ALWAYS;
|
||||
case 1 -> PREFIX;
|
||||
default -> NEVER;
|
||||
};
|
||||
switch (value) {
|
||||
case 0:
|
||||
return ALWAYS;
|
||||
case 1:
|
||||
return PREFIX;
|
||||
case 2:
|
||||
return NEVER;
|
||||
default:
|
||||
return ALWAYS;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ public class SubsetWidget extends Button implements ItemFilterProvider, ItemsLoa
|
||||
Rectangle4i r = new Rectangle4i(x, y, w, getSlotHeight(slot));
|
||||
if (slot < sorted.size()) {
|
||||
SubsetTag tag = sorted.get(slot);
|
||||
LayoutManager.getLayoutStyle()
|
||||
codechicken.nei.LayoutManager.getLayoutStyle()
|
||||
.drawSubsetTag(tag.displayName(), x, y, r.w, r.h, tag.state.state, r.contains(mx, my));
|
||||
} else {
|
||||
ItemStack stack = state.items.get(slot - sorted.size());
|
||||
@@ -103,7 +103,8 @@ public class SubsetWidget extends Button implements ItemFilterProvider, ItemsLoa
|
||||
int itemx = w / 2 - 8;
|
||||
int itemy = 1;
|
||||
|
||||
LayoutManager.getLayoutStyle().drawSubsetTag(null, x, y, r.w, r.h, hidden ? 0 : 2, false);
|
||||
codechicken.nei.LayoutManager.getLayoutStyle()
|
||||
.drawSubsetTag(null, x, y, r.w, r.h, hidden ? 0 : 2, false);
|
||||
|
||||
GuiContainerManager.drawItem(x + itemx, y + itemy, stack);
|
||||
if (new Rectangle4i(itemx, itemy, 16, 16).contains(mx, my)) SubsetWidget.hoverStack = stack;
|
||||
@@ -380,8 +381,7 @@ public class SubsetWidget extends Button implements ItemFilterProvider, ItemsLoa
|
||||
}
|
||||
|
||||
public char getPrefix() {
|
||||
String prefix = NEIClientConfig.getStringSetting("inventory.search.subsetsSearchPrefix");
|
||||
return prefix.length() == 0 ? '%' : prefix.charAt(0);
|
||||
return '%';
|
||||
}
|
||||
|
||||
public EnumChatFormatting getHighlightedColor() {
|
||||
|
||||
@@ -142,12 +142,11 @@ public class ItemInfo {
|
||||
|
||||
private static void addSearchProviders() {
|
||||
API.addSearchProvider(
|
||||
new SearchParserProvider('\0', "default", EnumChatFormatting.RESET, PatternItemFilter::new) {
|
||||
|
||||
@Override
|
||||
public char getPrefix() {
|
||||
return defaultPrefix;
|
||||
}
|
||||
new SearchParserProvider(
|
||||
'\0',
|
||||
"default",
|
||||
EnumChatFormatting.RESET,
|
||||
(pattern) -> new PatternItemFilter(pattern)) {
|
||||
|
||||
@Override
|
||||
public SearchMode getSearchMode() {
|
||||
@@ -156,12 +155,29 @@ public class ItemInfo {
|
||||
|
||||
});
|
||||
API.addSearchProvider(
|
||||
new SearchParserProvider('@', "modName", EnumChatFormatting.LIGHT_PURPLE, ModNameFilter::new));
|
||||
new SearchParserProvider(
|
||||
'@',
|
||||
"modName",
|
||||
EnumChatFormatting.LIGHT_PURPLE,
|
||||
(pattern) -> new ModNameFilter(pattern)));
|
||||
API.addSearchProvider(
|
||||
new SearchParserProvider('$', "oreDict", EnumChatFormatting.AQUA, OreDictionaryFilter::new));
|
||||
API.addSearchProvider(new SearchParserProvider('#', "tooltip", EnumChatFormatting.YELLOW, TooltipFilter::new));
|
||||
new SearchParserProvider(
|
||||
'$',
|
||||
"oreDict",
|
||||
EnumChatFormatting.AQUA,
|
||||
(pattern) -> new OreDictionaryFilter(pattern)));
|
||||
API.addSearchProvider(
|
||||
new SearchParserProvider('&', "identifier", EnumChatFormatting.GOLD, IdentifierFilter::new));
|
||||
new SearchParserProvider(
|
||||
'#',
|
||||
"tooltip",
|
||||
EnumChatFormatting.YELLOW,
|
||||
(pattern) -> new TooltipFilter(pattern)));
|
||||
API.addSearchProvider(
|
||||
new SearchParserProvider(
|
||||
'&',
|
||||
"identifier",
|
||||
EnumChatFormatting.GOLD,
|
||||
(pattern) -> new IdentifierFilter(pattern)));
|
||||
}
|
||||
|
||||
private static void addIDDumps() {
|
||||
|
||||
@@ -11,10 +11,30 @@ import codechicken.nei.config.GuiOptionList.OptionScrollSlot;
|
||||
|
||||
public class OptionTextField extends Option {
|
||||
|
||||
protected final TextField textField = createTextField();
|
||||
private TextField textField = new TextField("test") {
|
||||
|
||||
@Override
|
||||
public void onTextChange(String oldText) {
|
||||
if (focused() && isValidValue(text())) if (!defaulting() || !text().equals(getTag().getValue())) // don't
|
||||
// override
|
||||
// global
|
||||
// if text
|
||||
// hasn't
|
||||
// changed
|
||||
getTag().setValue(text());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFocus(boolean focus) {
|
||||
if (!focus && !isValidValue(text())) setText(renderTag().getValue());
|
||||
|
||||
super.setFocus(focus);
|
||||
}
|
||||
};
|
||||
|
||||
public OptionTextField(String name) {
|
||||
super(name);
|
||||
textField.h = 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -72,30 +92,4 @@ public class OptionTextField extends Option {
|
||||
public boolean isValidValue(String s) {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected TextField createTextField() {
|
||||
return new DefaultOptionTextField();
|
||||
}
|
||||
|
||||
protected class DefaultOptionTextField extends TextField {
|
||||
|
||||
public DefaultOptionTextField() {
|
||||
super("test");
|
||||
this.h = 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChange(String oldText) {
|
||||
// don't override global if text hasn't changed
|
||||
if (focused() && isValidValue(text()) && (!defaulting() || !text().equals(getTag().getValue()))) {
|
||||
getTag().setValue(text());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFocus(boolean focus) {
|
||||
if (!focus && !isValidValue(text())) setText(renderTag().getValue());
|
||||
super.setFocus(focus);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -104,31 +104,6 @@ nei.options.inventory.search.patternMode=Suchmodus
|
||||
nei.options.inventory.search.patternMode.0=Gewöhnlich
|
||||
nei.options.inventory.search.patternMode.1=Erweitert
|
||||
nei.options.inventory.search.patternMode.2=Regex
|
||||
nei.options.inventory.search.modNameSearchMode=Modname Suchmodus
|
||||
nei.options.inventory.search.modNameSearchMode.0=Immer
|
||||
nei.options.inventory.search.modNameSearchMode.1=Präfix
|
||||
nei.options.inventory.search.modNameSearchMode.2=Nie
|
||||
nei.options.inventory.search.modNameSearchPrefix=Modname Suchpräfix
|
||||
nei.options.inventory.search.tooltipSearchMode=Tooltip Suchmodus
|
||||
nei.options.inventory.search.tooltipSearchMode.0=Immer
|
||||
nei.options.inventory.search.tooltipSearchMode.1=Präfix
|
||||
nei.options.inventory.search.tooltipSearchMode.2=Nie
|
||||
nei.options.inventory.search.tooltipSearchPrefix=Tooltip Suchpräfix
|
||||
nei.options.inventory.search.identifierSearchMode=Identifikator Suchmodus
|
||||
nei.options.inventory.search.identifierSearchMode.0=Immer
|
||||
nei.options.inventory.search.identifierSearchMode.1=Präfix
|
||||
nei.options.inventory.search.identifierSearchMode.2=Nie
|
||||
nei.options.inventory.search.identifierSearchPrefix=Identifier Suchpräfix
|
||||
nei.options.inventory.search.oreDictSearchMode=OreDict Suchmodus
|
||||
nei.options.inventory.search.oreDictSearchMode.0=Immer
|
||||
nei.options.inventory.search.oreDictSearchMode.1=Präfix
|
||||
nei.options.inventory.search.oreDictSearchMode.2=Nie
|
||||
nei.options.inventory.search.oreDictSearchPrefix=OreDict Suchpräfix
|
||||
nei.options.inventory.search.subsetsSearchMode=Item-SubSet Suchmodus
|
||||
nei.options.inventory.search.subsetsSearchMode.0=Immer
|
||||
nei.options.inventory.search.subsetsSearchMode.1=Präfix
|
||||
nei.options.inventory.search.subsetsSearchMode.2=Nie
|
||||
nei.options.inventory.search.subsetsSearchPrefix=Item-SubSet Suchpräfix
|
||||
nei.options.inventory.utilities=Nützliches
|
||||
nei.options.inventory.utilities.tip=Wähle Inhalte für den Mehrzweckmodus
|
||||
nei.options.inventory.utilities.time=Zeit
|
||||
|
||||
@@ -225,31 +225,26 @@ nei.options.inventory.search.patternMode.2=Regex
|
||||
nei.options.inventory.search.quoteDropItemName=Quote Drop Item Name
|
||||
nei.options.inventory.search.quoteDropItemName.true=Yes
|
||||
nei.options.inventory.search.quoteDropItemName.false=No
|
||||
nei.options.inventory.search.modNameSearchMode=Mod Name Search Mode
|
||||
nei.options.inventory.search.modNameSearchMode=Mod Name Search
|
||||
nei.options.inventory.search.modNameSearchMode.0=Always
|
||||
nei.options.inventory.search.modNameSearchMode.1=Prefix
|
||||
nei.options.inventory.search.modNameSearchMode.1=Prefix: %s
|
||||
nei.options.inventory.search.modNameSearchMode.2=Never
|
||||
nei.options.inventory.search.modNameSearchPrefix=Mod Name Search Prefix
|
||||
nei.options.inventory.search.tooltipSearchMode=Tooltip Search Mode
|
||||
nei.options.inventory.search.tooltipSearchMode=Tooltip Search
|
||||
nei.options.inventory.search.tooltipSearchMode.0=Always
|
||||
nei.options.inventory.search.tooltipSearchMode.1=Prefix
|
||||
nei.options.inventory.search.tooltipSearchMode.1=Prefix: %s
|
||||
nei.options.inventory.search.tooltipSearchMode.2=Never
|
||||
nei.options.inventory.search.tooltipSearchPrefix=Tooltip Search Prefix
|
||||
nei.options.inventory.search.identifierSearchMode=Identifier Search Mode
|
||||
nei.options.inventory.search.identifierSearchMode=Resource ID Search
|
||||
nei.options.inventory.search.identifierSearchMode.0=Always
|
||||
nei.options.inventory.search.identifierSearchMode.1=Prefix
|
||||
nei.options.inventory.search.identifierSearchMode.1=Prefix: %s
|
||||
nei.options.inventory.search.identifierSearchMode.2=Never
|
||||
nei.options.inventory.search.identifierSearchPrefix=Identifier Search Prefix
|
||||
nei.options.inventory.search.oreDictSearchMode=OreDict Search Mode
|
||||
nei.options.inventory.search.oreDictSearchMode=OreDict Search
|
||||
nei.options.inventory.search.oreDictSearchMode.0=Always
|
||||
nei.options.inventory.search.oreDictSearchMode.1=Prefix
|
||||
nei.options.inventory.search.oreDictSearchMode.1=Prefix: %s
|
||||
nei.options.inventory.search.oreDictSearchMode.2=Never
|
||||
nei.options.inventory.search.oreDictSearchPrefix=OreDict Search Prefix
|
||||
nei.options.inventory.search.subsetsSearchMode=Item Subset Search Mode
|
||||
nei.options.inventory.search.subsetsSearchMode=Item Subsets Search
|
||||
nei.options.inventory.search.subsetsSearchMode.0=Always
|
||||
nei.options.inventory.search.subsetsSearchMode.1=Prefix
|
||||
nei.options.inventory.search.subsetsSearchMode.1=Prefix: %s
|
||||
nei.options.inventory.search.subsetsSearchMode.2=Never
|
||||
nei.options.inventory.search.subsetsSearchPrefix=Item Subset Search Prefix
|
||||
nei.options.inventory.guirecipe.creativeTabStyle=Creative or JEI tab style
|
||||
nei.options.inventory.guirecipe.creativeTabStyle.true=Creative
|
||||
nei.options.inventory.guirecipe.creativeTabStyle.false=JEI
|
||||
|
||||
Reference in new issue
Block a user