aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/overlays/TextTabOverlay.java
diff options
context:
space:
mode:
authorheyngra <heyngra.wspolpraca@gmail.com>2022-12-09 12:45:03 +0100
committerGitHub <noreply@github.com>2022-12-09 22:45:03 +1100
commit1797440fcdc21c816c3d3a472f261c4e6da6f024 (patch)
tree9efdaf81d44cbf0bdaf781180a34ccd81d832ccc /src/main/java/io/github/moulberry/notenoughupdates/overlays/TextTabOverlay.java
parent77734f25f1e0b3d093e3506c059a97536b0f3972 (diff)
downloadnotenoughupdates-1797440fcdc21c816c3d3a472f261c4e6da6f024.tar.gz
notenoughupdates-1797440fcdc21c816c3d3a472f261c4e6da6f024.tar.bz2
notenoughupdates-1797440fcdc21c816c3d3a472f261c4e6da6f024.zip
Fix mining overlay not update while chat is opened (and more) (#481)
Fixes undefined
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/overlays/TextTabOverlay.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/overlays/TextTabOverlay.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/TextTabOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/TextTabOverlay.java
index fa263db7..c64fe21e 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/TextTabOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/TextTabOverlay.java
@@ -36,7 +36,7 @@ public abstract class TextTabOverlay extends TextOverlay {
super(position, dummyStrings, styleSupplier);
}
- private boolean lastTabState = false;
+ protected boolean lastTabState = false;
private boolean shouldUpdateOverlay = true;
@Override
@@ -48,7 +48,7 @@ public abstract class TextTabOverlay extends TextOverlay {
public void realTick() {
shouldUpdateOverlay = shouldUpdate();
- if (shouldUpdateOverlay) {
+ if (!(Minecraft.getMinecraft().currentScreen instanceof GuiChat)) {
int keycode = Minecraft.getMinecraft().gameSettings.keyBindPlayerList.getKeyCode();
boolean currentTabState;
if (keycode > 0) {
@@ -58,17 +58,14 @@ public abstract class TextTabOverlay extends TextOverlay {
}
if (lastTabState != currentTabState) {
lastTabState = currentTabState;
- update();
}
+ } else lastTabState = false; // disallow showing overlays that use tab while having chat open
+ if (shouldUpdateOverlay) {
+ update();
}
}
private boolean shouldUpdate() {
- //prevent rendering when tab completing a command
- if (Minecraft.getMinecraft().currentScreen instanceof GuiChat) {
- return false;
- }
-
//prevent rendering when tab completing in ah search overlay
if (AuctionSearchOverlay.shouldReplace()) {
return false;