aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com>2022-09-23 01:56:53 +1000
committerGitHub <noreply@github.com>2022-09-22 17:56:53 +0200
commit5b3d6154a53599d37aa9c98e89b942f70fbce2cb (patch)
tree0e69608186bfc1b3956c304b7f169b0e72980222
parent6520c42697fe929316e93e42e8b070e6241cff0e (diff)
downloadNotEnoughUpdates-5b3d6154a53599d37aa9c98e89b942f70fbce2cb.tar.gz
NotEnoughUpdates-5b3d6154a53599d37aa9c98e89b942f70fbce2cb.tar.bz2
NotEnoughUpdates-5b3d6154a53599d37aa9c98e89b942f70fbce2cb.zip
fix pet middle clicking (#287)
-rw-r--r--Update Notes/2.1.md2
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java4
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java3
3 files changed, 6 insertions, 3 deletions
diff --git a/Update Notes/2.1.md b/Update Notes/2.1.md
index e6b2b472..99b2eef0 100644
--- a/Update Notes/2.1.md
+++ b/Update Notes/2.1.md
@@ -155,6 +155,8 @@
- Fixed storage gui when having locked backpack slots - nopo
- Fixed hyphens in /peek being the wrong color - whalker
- Fixed skill average calculation to include carpentry in /peek - whalker
+- Fixed middle clicking on pets not registering pet swap - nopo
+- Fixed middle clicking on an item with no id searching for it - nopo
### **Other:**
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java
index 308bd63e..dbff2be2 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java
@@ -753,7 +753,9 @@ public class NEUOverlay extends Gui {
if (slot != null) {
ItemStack hover = slot.getStack();
if (hover != null) {
- textField.setText("id:" + manager.getInternalNameForItem(hover));
+ if (manager.getInternalNameForItem(hover) != null) {
+ textField.setText("id:" + manager.getInternalNameForItem(hover));
+ }
itemPaneOpen = true;
updateSearch();
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java
index 761c0695..14a136a2 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java
@@ -859,8 +859,7 @@ public class PetInfoOverlay extends TextOverlay {
);
public static void onStackClick(ItemStack stack, int windowId, int slotId, int mouseButtonClicked, int mode) {
- if (mode != 0) return;
- if (mouseButtonClicked != 0 && mouseButtonClicked != 1) return;
+ if (mouseButtonClicked != 0 && mouseButtonClicked != 1 && mouseButtonClicked != 2) return;
int slotIdMod = (slotId - 10) % 9;
if (slotId >= 10 && slotId <= 43 && slotIdMod >= 0 && slotIdMod <= 6 &&