mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-18 19:39:06 +00:00
Compare commits
12
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
11d5d8ecf7 | ||
|
|
80e382a5b1 | ||
|
|
1c9c89a6a5 | ||
|
|
1b82963160 | ||
|
|
9e7b279e37 | ||
|
|
f6cd66be3b | ||
|
|
f532b87880 | ||
|
|
71cca7a0bb | ||
|
|
68fcc34d18 | ||
|
|
3ff3bb5c11 | ||
|
|
903271b279 | ||
|
|
204c37fa36 |
No files matched your search
+2
-2
@@ -1,8 +1,8 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:CodeChickenCore:1.4.2:dev')
|
||||
implementation('com.github.GTNewHorizons:GTNHLib:0.6.21:dev')
|
||||
api('com.github.GTNewHorizons:CodeChickenCore:1.4.1:dev')
|
||||
implementation('com.github.GTNewHorizons:GTNHLib:0.6.18:dev')
|
||||
|
||||
shadowImplementation('org.apache.commons:commons-csv:1.10.0')
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package codechicken.nei;
|
||||
|
||||
import static codechicken.nei.NEIClientUtils.translate;
|
||||
|
||||
import java.awt.Point;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
@@ -146,7 +148,7 @@ public class BookmarkPanel extends PanelWidget<BookmarkGrid> {
|
||||
|
||||
@Override
|
||||
public String getButtonTip() {
|
||||
return NEIClientUtils.translate("bookmark.pullBookmarkedItems.tip");
|
||||
return translate("bookmark.pullBookmarkedItems.tip");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -672,7 +674,7 @@ public class BookmarkPanel extends PanelWidget<BookmarkGrid> {
|
||||
if (overRowIndex != -1) {
|
||||
final int groupId = this.grid.getRowGroupId(overRowIndex);
|
||||
|
||||
currenttip.add(NEIClientUtils.translate("bookmark.group"));
|
||||
currenttip.add(translate("bookmark.group"));
|
||||
|
||||
if (groupId != BookmarkGrid.DEFAULT_GROUP_ID) {
|
||||
currenttip = recipeChainTooltip(groupId, currenttip);
|
||||
@@ -682,7 +684,7 @@ public class BookmarkPanel extends PanelWidget<BookmarkGrid> {
|
||||
} else
|
||||
if (new Rectangle4i(pagePrev.x + pagePrev.w, pagePrev.y, pageNext.x - (pagePrev.x + pagePrev.w), pagePrev.h)
|
||||
.contains(mousex, mousey)) {
|
||||
currenttip.add(NEIClientUtils.translate("bookmark.group"));
|
||||
currenttip.add(translate("bookmark.group"));
|
||||
currenttip = recipeChainTooltip(BookmarkGrid.DEFAULT_GROUP_ID, currenttip);
|
||||
} else {
|
||||
this.recipeChainTooltipLineHandler = null;
|
||||
@@ -729,36 +731,32 @@ public class BookmarkPanel extends PanelWidget<BookmarkGrid> {
|
||||
NEIClientUtils.getKeyName(
|
||||
NEIClientUtils.CTRL_HASH,
|
||||
NEIMouseUtils.MOUSE_BTN_NONE + NEIMouseUtils.MOUSE_SCROLL),
|
||||
NEIClientUtils.translate("bookmark.change_quantity"));
|
||||
NEIClientUtils.translate("bookmark.group.change_quantity"));
|
||||
|
||||
hotkeys.put(
|
||||
NEIClientUtils.getKeyName(
|
||||
NEIClientUtils.CTRL_HASH + NEIClientUtils.ALT_HASH,
|
||||
NEIMouseUtils.MOUSE_BTN_NONE + NEIMouseUtils.MOUSE_SCROLL),
|
||||
NEIClientUtils.translate("bookmark.change_quantity_step"));
|
||||
NEIClientUtils.translate("bookmark.group.change_quantity_step"));
|
||||
|
||||
hotkeys.put(
|
||||
NEIMouseUtils.getKeyName(NEIMouseUtils.MOUSE_BTN_LMB),
|
||||
NEIClientUtils.translate("bookmark.group.toggle_mode"));
|
||||
hotkeys.put(NEIMouseUtils.getKeyName(NEIMouseUtils.MOUSE_BTN_LMB), translate("bookmark.group.toggle_mode"));
|
||||
hotkeys.put(
|
||||
NEIMouseUtils.getKeyName(NEIMouseUtils.MOUSE_BTN_RMB),
|
||||
NEIClientUtils.translate("bookmark.group.toggle_crafting_chain"));
|
||||
hotkeys.put(
|
||||
NEIClientConfig.getKeyName("gui.remove_recipe"),
|
||||
NEIClientUtils.translate("bookmark.group.remove_recipe"));
|
||||
translate("bookmark.group.toggle_crafting_chain"));
|
||||
hotkeys.put(NEIClientConfig.getKeyName("gui.remove_recipe"), translate("bookmark.group.remove_recipe"));
|
||||
|
||||
if (BookmarkContainerInfo.getBookmarkContainerHandler(gui) != null) {
|
||||
hotkeys.put(
|
||||
NEIClientConfig.getKeyName("gui.bookmark_pull_items"),
|
||||
NEIClientUtils.translate("bookmark.group.pull_items"));
|
||||
translate("bookmark.group.pull_items"));
|
||||
hotkeys.put(
|
||||
NEIClientConfig.getKeyName("gui.bookmark_pull_items", NEIClientUtils.SHIFT_HASH),
|
||||
NEIClientUtils.translate("bookmark.group.pull_items_shift"));
|
||||
translate("bookmark.group.pull_items_shift"));
|
||||
}
|
||||
|
||||
hotkeys.put(
|
||||
NEIClientUtils.getKeyName(NEIClientUtils.ALT_HASH, NEIMouseUtils.MOUSE_BTN_LMB),
|
||||
NEIClientUtils.translate("bookmark.group.toggle_collapse"));
|
||||
translate("bookmark.group.toggle_collapse"));
|
||||
}
|
||||
|
||||
if (overRowIndex != -1) {
|
||||
@@ -766,7 +764,7 @@ public class BookmarkPanel extends PanelWidget<BookmarkGrid> {
|
||||
|
||||
hotkeys.put(
|
||||
NEIMouseUtils.getKeyName(NEIMouseUtils.MOUSE_BTN_LMB + NEIMouseUtils.MOUSE_DRAG),
|
||||
NEIClientUtils.translate("bookmark.group.include_group"));
|
||||
translate("bookmark.group.include_group"));
|
||||
|
||||
if (groupId != BookmarkGrid.DEFAULT_GROUP_ID) {
|
||||
|
||||
@@ -774,33 +772,33 @@ public class BookmarkPanel extends PanelWidget<BookmarkGrid> {
|
||||
NEIClientUtils.getKeyName(
|
||||
NEIClientUtils.CTRL_HASH,
|
||||
NEIMouseUtils.MOUSE_BTN_NONE + NEIMouseUtils.MOUSE_SCROLL),
|
||||
NEIClientUtils.translate("bookmark.change_quantity"));
|
||||
NEIClientUtils.translate("bookmark.group.change_quantity"));
|
||||
|
||||
hotkeys.put(
|
||||
NEIClientUtils.getKeyName(
|
||||
NEIClientUtils.CTRL_HASH + NEIClientUtils.ALT_HASH,
|
||||
NEIMouseUtils.MOUSE_BTN_NONE + NEIMouseUtils.MOUSE_SCROLL),
|
||||
NEIClientUtils.translate("bookmark.change_quantity_step"));
|
||||
NEIClientUtils.translate("bookmark.group.change_quantity_step"));
|
||||
|
||||
hotkeys.put(
|
||||
NEIMouseUtils.getKeyName(NEIMouseUtils.MOUSE_BTN_RMB + NEIMouseUtils.MOUSE_DRAG),
|
||||
NEIClientUtils.translate("bookmark.group.exclude_group"));
|
||||
translate("bookmark.group.exclude_group"));
|
||||
hotkeys.put(
|
||||
NEIMouseUtils.getKeyName(NEIMouseUtils.MOUSE_BTN_LMB),
|
||||
NEIClientUtils.translate("bookmark.group.toggle_mode"));
|
||||
translate("bookmark.group.toggle_mode"));
|
||||
hotkeys.put(
|
||||
NEIMouseUtils.getKeyName(NEIMouseUtils.MOUSE_BTN_RMB),
|
||||
NEIClientUtils.translate("bookmark.group.toggle_crafting_chain"));
|
||||
translate("bookmark.group.toggle_crafting_chain"));
|
||||
|
||||
hotkeys.put(
|
||||
NEIClientUtils.getKeyName(
|
||||
NEIClientUtils.SHIFT_HASH,
|
||||
NEIMouseUtils.MOUSE_BTN_LMB + NEIMouseUtils.MOUSE_DRAG),
|
||||
NEIClientUtils.translate("bookmark.group.sorting"));
|
||||
translate("bookmark.group.sorting"));
|
||||
|
||||
hotkeys.put(
|
||||
NEIClientUtils.getKeyName(NEIClientUtils.ALT_HASH, NEIMouseUtils.MOUSE_BTN_LMB),
|
||||
NEIClientUtils.translate("bookmark.group.toggle_collapse"));
|
||||
translate("bookmark.group.toggle_collapse"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -811,28 +809,22 @@ public class BookmarkPanel extends PanelWidget<BookmarkGrid> {
|
||||
NEIClientUtils.getKeyName(
|
||||
NEIClientUtils.CTRL_HASH,
|
||||
NEIMouseUtils.MOUSE_BTN_NONE + NEIMouseUtils.MOUSE_SCROLL),
|
||||
NEIClientUtils.translate("bookmark.change_quantity"));
|
||||
NEIClientUtils.translate("itempanel.change_quantity"));
|
||||
|
||||
hotkeys.put(
|
||||
NEIClientUtils.getKeyName(
|
||||
NEIClientUtils.CTRL_HASH + NEIClientUtils.ALT_HASH,
|
||||
NEIMouseUtils.MOUSE_BTN_NONE + NEIMouseUtils.MOUSE_SCROLL),
|
||||
NEIClientUtils.translate("bookmark.change_quantity_step"));
|
||||
|
||||
hotkeys.put(
|
||||
NEIClientUtils.getKeyName(
|
||||
NEIClientUtils.SHIFT_HASH,
|
||||
NEIMouseUtils.MOUSE_BTN_LMB + NEIMouseUtils.MOUSE_DRAG),
|
||||
NEIClientUtils.translate("bookmark.item.sorting"));
|
||||
NEIClientUtils.translate("itempanel.change_quantity_step"));
|
||||
|
||||
if (group.collapsed) {
|
||||
hotkeys.put(
|
||||
NEIClientUtils.getKeyName(NEIClientUtils.ALT_HASH, NEIMouseUtils.MOUSE_BTN_LMB),
|
||||
NEIClientUtils.translate("bookmark.group.toggle_collapse"));
|
||||
translate("bookmark.group.toggle_collapse"));
|
||||
} else if (group.crafting != null) {
|
||||
hotkeys.put(
|
||||
NEIClientUtils.getKeyName(NEIClientUtils.ALT_HASH, NEIMouseUtils.MOUSE_BTN_LMB),
|
||||
NEIClientUtils.translate("bookmark.recipe.toggle_collapse"));
|
||||
translate("bookmark.recipe.toggle_collapse"));
|
||||
}
|
||||
|
||||
if (this.acceptsFollowingTooltipLineHandler != null) {
|
||||
|
||||
@@ -21,7 +21,6 @@ public class FormattedTextField extends GuiTextField {
|
||||
protected FontRenderer fontRenderer;
|
||||
protected String rawText = "";
|
||||
protected String formattedText = "";
|
||||
protected String placeholder = "";
|
||||
protected boolean editable = true;
|
||||
protected int editableColor = 14737632;
|
||||
protected int notEditableColor = 7368816;
|
||||
@@ -38,10 +37,6 @@ public class FormattedTextField extends GuiTextField {
|
||||
this.formatter = formatter;
|
||||
}
|
||||
|
||||
public void setPlaceholder(String placeholder) {
|
||||
this.placeholder = placeholder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCursorCounter() {
|
||||
super.updateCursorCounter();
|
||||
@@ -108,14 +103,10 @@ public class FormattedTextField extends GuiTextField {
|
||||
this.editable = p_146184_1_;
|
||||
}
|
||||
|
||||
protected boolean beforeWrite(String text) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeText(String textPart) {
|
||||
public void writeText(String p_146191_1_) {
|
||||
String newText = "";
|
||||
String substr = ChatAllowedCharacters.filerAllowedCharacters(textPart);
|
||||
String substr = ChatAllowedCharacters.filerAllowedCharacters(p_146191_1_);
|
||||
int cursorPosition = getCursorPosition();
|
||||
int maxStringLength = getMaxStringLength();
|
||||
String text = getText();
|
||||
@@ -136,10 +127,8 @@ public class FormattedTextField extends GuiTextField {
|
||||
cursorPosition = Math.min(textStart.length() + substr.length(), newText.length());
|
||||
}
|
||||
|
||||
if (beforeWrite(newText)) {
|
||||
setText(newText);
|
||||
setCursorPosition(cursorPosition);
|
||||
}
|
||||
setText(newText);
|
||||
setCursorPosition(cursorPosition);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -149,99 +138,87 @@ public class FormattedTextField extends GuiTextField {
|
||||
|
||||
@Override
|
||||
public void drawTextBox() {
|
||||
|
||||
if (!this.getVisible()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.getEnableBackgroundDrawing()) {
|
||||
drawRect(
|
||||
this.xPosition - 1,
|
||||
this.yPosition - 1,
|
||||
this.xPosition + this.width + 1,
|
||||
this.yPosition + this.height + 1,
|
||||
-6250336);
|
||||
drawRect(
|
||||
this.xPosition,
|
||||
this.yPosition,
|
||||
this.xPosition + this.width,
|
||||
this.yPosition + this.height,
|
||||
-16777216);
|
||||
}
|
||||
|
||||
if (!this.rawText.equals(getText())) {
|
||||
this.rawText = getText();
|
||||
this.formattedText = this.formatter.format(this.rawText);
|
||||
if (!EnumChatFormatting.getTextWithoutFormattingCodes(this.formattedText).toLowerCase()
|
||||
.equals(this.rawText.toLowerCase())) {
|
||||
this.formattedText = this.rawText;
|
||||
if (this.getVisible()) {
|
||||
if (this.getEnableBackgroundDrawing()) {
|
||||
drawRect(
|
||||
this.xPosition - 1,
|
||||
this.yPosition - 1,
|
||||
this.xPosition + this.width + 1,
|
||||
this.yPosition + this.height + 1,
|
||||
-6250336);
|
||||
drawRect(
|
||||
this.xPosition,
|
||||
this.yPosition,
|
||||
this.xPosition + this.width,
|
||||
this.yPosition + this.height,
|
||||
-16777216);
|
||||
}
|
||||
}
|
||||
|
||||
if (!isFocused() && this.formattedText.isEmpty()) {
|
||||
int x = getEnableBackgroundDrawing() ? this.xPosition + 4 : this.xPosition;
|
||||
int y = getEnableBackgroundDrawing() ? this.yPosition + (this.height - 8) / 2 : this.yPosition;
|
||||
this.fontRenderer.drawStringWithShadow(
|
||||
this.fontRenderer.trimStringToWidth(this.placeholder, this.getWidth()),
|
||||
x,
|
||||
y,
|
||||
this.notEditableColor);
|
||||
return;
|
||||
}
|
||||
|
||||
int firstCharacterIndex = getFormattedTextShift(this.lineScrollOffset);
|
||||
String rawTextClipped = this.fontRenderer
|
||||
.trimStringToWidth(this.rawText.substring(this.lineScrollOffset), this.getWidth());
|
||||
String textClipped = this.formattedText
|
||||
.substring(firstCharacterIndex, getFormattedTextShift(this.lineScrollOffset + rawTextClipped.length()));
|
||||
int cursorPosition = getFormattedTextShift(getCursorPosition());
|
||||
int selectionEnd = getFormattedTextShift(getSelectionEnd());
|
||||
|
||||
int color = this.editable ? this.editableColor : this.notEditableColor;
|
||||
int cursorA = cursorPosition - firstCharacterIndex;
|
||||
int cursorB = selectionEnd - firstCharacterIndex;
|
||||
boolean flag = cursorA >= 0 && cursorA <= textClipped.length();
|
||||
boolean flag1 = isFocused() && this.frame / 6 % 2 == 0 && flag;
|
||||
boolean flag2 = getCursorPosition() < this.rawText.length() || this.rawText.length() >= getMaxStringLength();
|
||||
int x = getEnableBackgroundDrawing() ? this.xPosition + 4 : this.xPosition;
|
||||
int y = getEnableBackgroundDrawing() ? this.yPosition + (this.height - 8) / 2 : this.yPosition;
|
||||
int x2 = x;
|
||||
|
||||
if (cursorB > textClipped.length()) {
|
||||
cursorB = textClipped.length();
|
||||
}
|
||||
|
||||
if (textClipped.length() > 0) {
|
||||
String s1 = flag ? textClipped.substring(0, cursorA) : textClipped;
|
||||
String colorA = getPreviousColor(firstCharacterIndex);
|
||||
x2 = this.fontRenderer.drawStringWithShadow(colorA + s1, x, y, color);
|
||||
}
|
||||
|
||||
int k1 = x2;
|
||||
|
||||
if (!flag) {
|
||||
k1 = cursorA > 0 ? x + this.width : x;
|
||||
} else if (flag2) {
|
||||
k1 = x2 - 1;
|
||||
--x2;
|
||||
}
|
||||
|
||||
if (textClipped.length() > 0 && flag && cursorA < textClipped.length()) {
|
||||
String colorB = getPreviousColor(firstCharacterIndex + cursorA);
|
||||
this.fontRenderer.drawStringWithShadow(colorB + textClipped.substring(cursorA), x2, y, color);
|
||||
}
|
||||
|
||||
if (flag1) {
|
||||
if (flag2) {
|
||||
Gui.drawRect(k1, y - 1, k1 + 1, y + 1 + this.fontRenderer.FONT_HEIGHT, -3092272);
|
||||
} else {
|
||||
this.fontRenderer.drawStringWithShadow("_", k1, y, color);
|
||||
if (!this.rawText.equals(getText())) {
|
||||
this.rawText = getText();
|
||||
this.formattedText = this.formatter.format(this.rawText);
|
||||
if (!EnumChatFormatting.getTextWithoutFormattingCodes(this.formattedText).toLowerCase()
|
||||
.equals(this.rawText.toLowerCase())) {
|
||||
this.formattedText = this.rawText;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (cursorB != cursorA) {
|
||||
int l1 = x + this.fontRenderer.getStringWidth(textClipped.substring(0, cursorB));
|
||||
drawCursorVertical(k1, y - 1, l1 - 1, y + 1 + this.fontRenderer.FONT_HEIGHT);
|
||||
int firstCharacterIndex = getFormattedTextShift(this.lineScrollOffset);
|
||||
String rawTextClipped = this.fontRenderer
|
||||
.trimStringToWidth(this.rawText.substring(this.lineScrollOffset), this.getWidth());
|
||||
String textClipped = this.formattedText.substring(
|
||||
firstCharacterIndex,
|
||||
getFormattedTextShift(this.lineScrollOffset + rawTextClipped.length()));
|
||||
int cursorPosition = getFormattedTextShift(this.getCursorPosition());
|
||||
int selectionEnd = getFormattedTextShift(this.getSelectionEnd());
|
||||
|
||||
int color = this.editable ? this.editableColor : this.notEditableColor;
|
||||
int cursorA = cursorPosition - firstCharacterIndex;
|
||||
int cursorB = selectionEnd - firstCharacterIndex;
|
||||
boolean flag = cursorA >= 0 && cursorA <= textClipped.length();
|
||||
boolean flag1 = this.isFocused() && this.frame / 6 % 2 == 0 && flag;
|
||||
boolean flag2 = this.getCursorPosition() < this.rawText.length()
|
||||
|| this.rawText.length() >= this.getMaxStringLength();
|
||||
int x = this.getEnableBackgroundDrawing() ? this.xPosition + 4 : this.xPosition;
|
||||
int y = this.getEnableBackgroundDrawing() ? this.yPosition + (this.height - 8) / 2 : this.yPosition;
|
||||
int x2 = x;
|
||||
|
||||
if (cursorB > textClipped.length()) {
|
||||
cursorB = textClipped.length();
|
||||
}
|
||||
|
||||
if (textClipped.length() > 0) {
|
||||
String s1 = flag ? textClipped.substring(0, cursorA) : textClipped;
|
||||
String colorA = getPreviousColor(firstCharacterIndex);
|
||||
x2 = this.fontRenderer.drawStringWithShadow(colorA + s1, x, y, color);
|
||||
}
|
||||
|
||||
int k1 = x2;
|
||||
|
||||
if (!flag) {
|
||||
k1 = cursorA > 0 ? x + this.width : x;
|
||||
} else if (flag2) {
|
||||
k1 = x2 - 1;
|
||||
--x2;
|
||||
}
|
||||
|
||||
if (textClipped.length() > 0 && flag && cursorA < textClipped.length()) {
|
||||
String colorB = getPreviousColor(firstCharacterIndex + cursorA);
|
||||
this.fontRenderer.drawStringWithShadow(colorB + textClipped.substring(cursorA), x2, y, color);
|
||||
}
|
||||
|
||||
if (flag1) {
|
||||
if (flag2) {
|
||||
Gui.drawRect(k1, y - 1, k1 + 1, y + 1 + this.fontRenderer.FONT_HEIGHT, -3092272);
|
||||
} else {
|
||||
this.fontRenderer.drawStringWithShadow("_", k1, y, color);
|
||||
}
|
||||
}
|
||||
|
||||
if (cursorB != cursorA) {
|
||||
int l1 = x + this.fontRenderer.getStringWidth(textClipped.substring(0, cursorB));
|
||||
drawCursorVertical(k1, y - 1, l1 - 1, y + 1 + this.fontRenderer.FONT_HEIGHT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
package codechicken.nei;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import static codechicken.nei.NEIClientUtils.translate;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import codechicken.nei.recipe.StackInfo;
|
||||
|
||||
@@ -15,63 +14,13 @@ public class ItemQuantityField extends TextField {
|
||||
field.setDisabledTextColour(0xFF303030);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initInternalTextField() {
|
||||
field = new FormattedTextField(Minecraft.getMinecraft().fontRenderer, 0, 0, 0, 0) {
|
||||
|
||||
{
|
||||
setPlaceholder(NEIClientUtils.translate("itempanel.quantity.default"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText() {
|
||||
String text = super.getText();
|
||||
return !isFocused() && "0".equals(text) ? "" : text;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean beforeWrite(String text) {
|
||||
if (text == null || text.isEmpty()) return true;
|
||||
try {
|
||||
return Integer.parseInt(text) >= 0;
|
||||
} catch (NumberFormatException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean textboxKeyTyped(char keyChar, int keyID) {
|
||||
if (!isFocused()) return false;
|
||||
|
||||
if (super.textboxKeyTyped(keyChar, keyID)) {
|
||||
return true;
|
||||
} else if (keyID == Keyboard.KEY_DOWN) {
|
||||
setText(Integer.toString(Math.max(0, getInteger() - 1)));
|
||||
return true;
|
||||
} else if (keyID == Keyboard.KEY_UP) {
|
||||
setText(Integer.toString(getInteger() + 1));
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private int getInteger() {
|
||||
try {
|
||||
return Math.max(0, Integer.parseInt(text()));
|
||||
} catch (NumberFormatException nfe) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
field.setMaxStringLength(maxSearchLength);
|
||||
field.setCursorPositionZero();
|
||||
public int intValue() {
|
||||
return intValue(text());
|
||||
}
|
||||
|
||||
private int getInteger() {
|
||||
public int intValue(String s) {
|
||||
try {
|
||||
return Math.max(0, Integer.parseInt(text()));
|
||||
return Math.max(0, Integer.parseInt(s));
|
||||
} catch (NumberFormatException nfe) {
|
||||
return 0;
|
||||
}
|
||||
@@ -107,21 +56,36 @@ public class ItemQuantityField extends TextField {
|
||||
|
||||
@Override
|
||||
public void onTextChange(String oldText) {
|
||||
NEIClientUtils.setItemQuantity(getInteger());
|
||||
NEIClientUtils.setItemQuantity(intValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(int mousex, int mousey) {
|
||||
|
||||
if (!focused() && intValue() == 0) {
|
||||
field.setText(translate("itempanel.quantity.default"));
|
||||
field.setCursorPositionZero();
|
||||
field.setEnabled(false);
|
||||
super.draw(mousex, mousey);
|
||||
field.setEnabled(true);
|
||||
field.setText("0");
|
||||
} else {
|
||||
super.draw(mousex, mousey);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onMouseWheel(int i, int mx, int my) {
|
||||
if (!contains(mx, my)) return false;
|
||||
int multiplier = 1;
|
||||
|
||||
if (NEIClientUtils.shiftKey()) {
|
||||
multiplier = 10;
|
||||
} else if (NEIClientUtils.controlKey()) {
|
||||
multiplier = 64;
|
||||
}
|
||||
|
||||
setText(Integer.toString(Math.max(0, getInteger() + i * multiplier)));
|
||||
int quantity = intValue() + i * multiplier;
|
||||
setText(Integer.toString(quantity));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -100,8 +100,6 @@ public class SearchField extends TextField implements ItemFilterProvider {
|
||||
super(Minecraft.getMinecraft().fontRenderer, 0, 0, 0, 0);
|
||||
this.searchParser = searchParser;
|
||||
setFormatter(new SearchTextFormatter(searchParser));
|
||||
setDisabledTextColour(0xFF303030);
|
||||
setPlaceholder(NEIClientUtils.translate("inventory.search.placeholder"));
|
||||
}
|
||||
|
||||
public ItemFilter getFilter() {
|
||||
|
||||
@@ -347,12 +347,13 @@ public abstract class ShortcutInputHandler {
|
||||
if (slot != null) {
|
||||
hotkeys.put(
|
||||
NEIClientConfig.getKeyName("gui.bookmark"),
|
||||
NEIClientUtils.translate(slot.isIngredient() ? "bookmark.remove_item" : "bookmark.remove_recipe"));
|
||||
NEIClientUtils
|
||||
.translate(slot.isIngredient() ? "itempanel.remove_item" : "itempanel.remove_recipe"));
|
||||
|
||||
if (slot.isIngredient()) {
|
||||
hotkeys.put(
|
||||
NEIClientConfig.getKeyName("gui.bookmark", NEIClientUtils.SHIFT_HASH),
|
||||
NEIClientUtils.translate("bookmark.remove_recipe"));
|
||||
NEIClientUtils.translate("itempanel.remove_recipe"));
|
||||
}
|
||||
|
||||
if (BookmarkContainerInfo.getBookmarkContainerHandler(gui) != null) {
|
||||
@@ -365,18 +366,18 @@ public abstract class ShortcutInputHandler {
|
||||
}
|
||||
|
||||
} else {
|
||||
hotkeys.put(NEIClientConfig.getKeyName("gui.bookmark"), NEIClientUtils.translate("bookmark.add_item"));
|
||||
hotkeys.put(NEIClientConfig.getKeyName("gui.bookmark"), NEIClientUtils.translate("itempanel.add_item"));
|
||||
|
||||
if (StackInfo.getAmount(stack) > 0) {
|
||||
hotkeys.put(
|
||||
NEIClientConfig.getKeyName("gui.bookmark", NEIClientUtils.CTRL_HASH),
|
||||
NEIClientUtils.translate("bookmark.add_item_with_count"));
|
||||
NEIClientUtils.translate("itempanel.add_item_with_count"));
|
||||
}
|
||||
|
||||
if (recipeId != null) {
|
||||
hotkeys.put(
|
||||
NEIClientConfig.getKeyName("gui.bookmark", NEIClientUtils.SHIFT_HASH),
|
||||
NEIClientUtils.translate("bookmark.add_item_with_recipe"));
|
||||
NEIClientUtils.translate("itempanel.add_item_with_recipe"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -882,19 +882,14 @@ public abstract class GuiRecipe<H extends IRecipeHandler> extends GuiContainer i
|
||||
if (NEIClientConfig.showCycledIngredientsTooltip() && itemstack != null) {
|
||||
PositionedStack hovered = null;
|
||||
|
||||
outer: for (int refIndex = 0; refIndex < indices.size(); refIndex++) {
|
||||
for (int refIndex = 0; refIndex < indices.size() && hovered == null; refIndex++) {
|
||||
final int recipeIndex = indices.get(refIndex);
|
||||
final List<PositionedStack> stacks = handler.original.getIngredientStacks(recipeIndex);
|
||||
|
||||
List<List<PositionedStack>> stackGroups = Arrays.asList(
|
||||
handler.original.getIngredientStacks(recipeIndex),
|
||||
handler.original.getOtherStacks(recipeIndex));
|
||||
|
||||
for (List<PositionedStack> group : stackGroups) {
|
||||
for (PositionedStack pStack : group) {
|
||||
if (isMouseOver(pStack, refIndex)) {
|
||||
hovered = pStack;
|
||||
break outer;
|
||||
}
|
||||
for (PositionedStack pStack : stacks) {
|
||||
if (isMouseOver(pStack, refIndex)) {
|
||||
hovered = pStack;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,19 +26,13 @@ nei.bookmark.group.toggle_mode=Toggle Group Mode
|
||||
nei.bookmark.group.toggle_collapse=Toggle Collapse/Expand
|
||||
nei.bookmark.group.toggle_crafting_chain=Toggle Crafting Chain
|
||||
nei.bookmark.group.overlay_use=Fill Crafting Grid
|
||||
nei.bookmark.group.sorting=Move Position
|
||||
nei.bookmark.group.sorting=Sorting
|
||||
nei.bookmark.group.remove_recipe=Remove Group
|
||||
nei.bookmark.group.pull_items=Pull all Items
|
||||
nei.bookmark.group.pull_items_shift=Pull missing Items
|
||||
nei.bookmark.group.craft=Craft Group
|
||||
nei.bookmark.item.sorting=Move Position
|
||||
nei.bookmark.remove_recipe=Remove Recipe
|
||||
nei.bookmark.remove_item=Remove Item
|
||||
nei.bookmark.add_item=Add Bookmark
|
||||
nei.bookmark.add_item_with_recipe=Add Bookmark with Recipe
|
||||
nei.bookmark.add_item_with_count=Add Bookmark with Count
|
||||
nei.bookmark.change_quantity=Change Quantity
|
||||
nei.bookmark.change_quantity_step=Change Quantity with Multiplier
|
||||
nei.bookmark.group.change_quantity=Change Quantity
|
||||
nei.bookmark.group.change_quantity_step=Change Quantity with Multiplier
|
||||
nei.bookmark.recipe.toggle_collapse=Toggle Collapse/Expand
|
||||
nei.bookmark.crafting_chain=Crafting Chain
|
||||
nei.bookmark.crafting_chain.input=Ingredients
|
||||
@@ -46,19 +40,29 @@ nei.bookmark.crafting_chain.missing=Missing Items
|
||||
nei.bookmark.crafting_chain.output=Results
|
||||
nei.bookmark.crafting_chain.remainder=Remainders
|
||||
nei.bookmark.crafting_chain.available=Available Items
|
||||
nei.inventory.search.placeholder=Search...
|
||||
|
||||
nei.itempanel.quantity.default=One stack
|
||||
nei.itempanel.loading=Loading Item List...
|
||||
nei.itempanel.deleteItem=Delete Item
|
||||
nei.itempanel.collapsed.button.tip=Collapse/Expand All Collapsible Items
|
||||
nei.itempanel.collapsed.hint.expand=Expand Group (%d items)
|
||||
nei.itempanel.collapsed.hint.collapse=Collapse Group (%d items)
|
||||
|
||||
nei.itempanel.remove_recipe=Remove Recipe
|
||||
nei.itempanel.remove_item=Remove Item
|
||||
nei.itempanel.add_item=Add Bookmark
|
||||
nei.itempanel.add_item_with_recipe=Add Bookmark with Recipe
|
||||
nei.itempanel.add_item_with_count=Add Bookmark with Count
|
||||
nei.itempanel.change_quantity=Change Quantity
|
||||
nei.itempanel.change_quantity_step=Change Quantity with Multiplier
|
||||
nei.itempanel.overlay_recipe=Overlay Recipe
|
||||
nei.itempanel.craft=Craft Recipe
|
||||
nei.itempanel.fill_crafting_grid=Fill Crafting Grid
|
||||
nei.itempanel.fill_crafting_grid_quantity=Fill Crafting Grid With Quantity
|
||||
nei.itempanel.open_crafting=Recipe to make this item
|
||||
nei.itempanel.open_usage=Recipes that use this item
|
||||
nei.itempanel.sort_item=Sorting
|
||||
nei.itempanel.sort_recipe=Sorting
|
||||
nei.itempanel.copy_name=Copy Item Name
|
||||
nei.itempanel.copy_oredict=Copy Item OreDictionary
|
||||
|
||||
@@ -431,9 +435,6 @@ nei.options.tools.handler_load_from_config.false=JAR
|
||||
nei.options.tools.catalyst_load_from_config=Load catalysts from Config
|
||||
nei.options.tools.catalyst_load_from_config.true=Config
|
||||
nei.options.tools.catalyst_load_from_config.false=JAR
|
||||
nei.options.tools.handler_info=Handler Info Widget
|
||||
nei.options.tools.handler_info.true=Enabled
|
||||
nei.options.tools.handler_info.false=Disabled
|
||||
nei.options.tools.dump=Data Dumps
|
||||
nei.options.tools.dump.dump=Dump
|
||||
nei.options.tools.dump.dumped=%s IDs dumped to %s
|
||||
|
||||
Reference in new issue
Block a user