aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com>2023-01-05 23:42:35 +1100
committerGitHub <noreply@github.com>2023-01-05 13:42:35 +0100
commitc6e0f61c412adc1927ccff21d3e58f83808de215 (patch)
tree3ebe38cc2c858e8002c2411adae4e229609e8146
parentd96c0ec4ffc434382abb40441cd83ac3879933a9 (diff)
downloadNotEnoughUpdates-c6e0f61c412adc1927ccff21d3e58f83808de215.tar.gz
NotEnoughUpdates-c6e0f61c412adc1927ccff21d3e58f83808de215.tar.bz2
NotEnoughUpdates-c6e0f61c412adc1927ccff21d3e58f83808de215.zip
Replace help button with button to toggle inventory searching (#539)
* add button to toggle search mode * Its a bit better Co-authored-by: jani270 <jani270@gmx.de>
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java18
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Toolbar.java6
-rw-r--r--src/main/resources/assets/notenoughupdates/search_mode_button.pngbin0 -> 644 bytes
3 files changed, 11 insertions, 13 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java
index 686f6a27..7159ef89 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java
@@ -88,7 +88,6 @@ import java.awt.*;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
@@ -113,6 +112,7 @@ public class NEUOverlay extends Gui {
"notenoughupdates:supersecretassets/lunar.png");
private static final ResourceLocation SEARCH_BAR = new ResourceLocation("notenoughupdates:search_bar.png");
private static final ResourceLocation SEARCH_BAR_GOLD = new ResourceLocation("notenoughupdates:search_bar_gold.png");
+ private static final ResourceLocation SEARCH_MODE_BUTTON = new ResourceLocation("notenoughupdates:search_mode_button.png");
private final NEUManager manager;
@@ -429,7 +429,7 @@ public class NEUOverlay extends Gui {
};
}
- private MBGuiElement createHelpButton(NEUOverlay overlay) {
+ private MBGuiElement createSearchModeButton() {
return new MBGuiElement() {
@Override
public int getWidth() {
@@ -446,14 +446,12 @@ public class NEUOverlay extends Gui {
@Override
public void mouseClick(float x, float y, int mouseX, int mouseY) {
- if (!NotEnoughUpdates.INSTANCE.config.toolbar.enableHelpButton) {
+ if (!NotEnoughUpdates.INSTANCE.config.toolbar.enableSearchModeButton) {
return;
}
if (Mouse.getEventButtonState()) {
- //displayInformationPane(HTMLInfoPane.createFromWikiUrl(overlay, manager, "Help",
- // "https://moulberry.github.io/files/neu_help.html"));
- //Minecraft.getMinecraft().displayGuiScreen(new HelpGUI());
- ClientCommandHandler.instance.executeCommand(Minecraft.getMinecraft().thePlayer, "/neuhelp");
+ searchMode = !searchMode;
+ lastSearchMode = System.currentTimeMillis();
Utils.playPressSound();
}
}
@@ -466,7 +464,7 @@ public class NEUOverlay extends Gui {
int paddingUnscaled = getPaddingUnscaled();
int searchYSize = getSearchBarYSize();
- if (!NotEnoughUpdates.INSTANCE.config.toolbar.enableHelpButton) {
+ if (!NotEnoughUpdates.INSTANCE.config.toolbar.enableSearchModeButton) {
return;
}
@@ -476,7 +474,7 @@ public class NEUOverlay extends Gui {
searchYSize + paddingUnscaled * 2, searchYSize + paddingUnscaled * 2, GL11.GL_NEAREST
);
- Minecraft.getMinecraft().getTextureManager().bindTexture(GuiTextures.help);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(SEARCH_MODE_BUTTON);
GlStateManager.color(1f, 1f, 1f, 1f);
Utils.drawTexturedRect((int) x + paddingUnscaled, (int) y + paddingUnscaled,
getSearchBarYSize(), getSearchBarYSize()
@@ -621,7 +619,7 @@ public class NEUOverlay extends Gui {
List<MBGuiElement> children = Lists.newArrayList(
createSettingsButton(this),
createSearchBar(),
- createHelpButton(this)
+ createSearchModeButton()
);
return new MBGuiGroupAligned(children, false) {
public int getPadding() {
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Toolbar.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Toolbar.java
index 2d88544e..d8fe91d5 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Toolbar.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Toolbar.java
@@ -64,12 +64,12 @@ public class Toolbar {
@Expose
@ConfigOption(
- name = "Show a help settings button",
- desc = "Show quick settings button in the NEU toolbar"
+ name = "Show an inventory search button",
+ desc = "Show button to enable inventory searching in the NEU toolbar"
)
@ConfigEditorBoolean
@ConfigAccordionId(id = 0)
- public boolean enableHelpButton = true;
+ public boolean enableSearchModeButton = true;
@Expose
@ConfigOption(
diff --git a/src/main/resources/assets/notenoughupdates/search_mode_button.png b/src/main/resources/assets/notenoughupdates/search_mode_button.png
new file mode 100644
index 00000000..416d26f7
--- /dev/null
+++ b/src/main/resources/assets/notenoughupdates/search_mode_button.png
Binary files differ