From 90092c1097df7e2925bcac37f09157e8e9808b80 Mon Sep 17 00:00:00 2001 From: Alexander01998 Date: Tue, 30 Jul 2024 11:30:19 +0200 Subject: [PATCH] Fix zoom in screens bug and turn it into an optional feature --- .../java/net/wurstclient/other_features/ZoomOtf.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/net/wurstclient/other_features/ZoomOtf.java b/src/main/java/net/wurstclient/other_features/ZoomOtf.java index 7e6571e2..a168091d 100644 --- a/src/main/java/net/wurstclient/other_features/ZoomOtf.java +++ b/src/main/java/net/wurstclient/other_features/ZoomOtf.java @@ -32,6 +32,11 @@ public final class ZoomOtf extends OtherFeature implements MouseScrollListener + " zooming to zoom in even further.", true); + private final CheckboxSetting zoomInScreens = new CheckboxSetting( + "Zoom in screens", "If enabled, you can also zoom while a screen (chat," + + " inventory, etc.) is open.", + false); + private final TextFieldSetting keybind = new TextFieldSetting("Keybind", "Determines the zoom keybind.\n\n" + "Instead of editing this value manually, you should go to Wurst" @@ -48,6 +53,7 @@ public final class ZoomOtf extends OtherFeature implements MouseScrollListener + "Go to Wurst Options -> Zoom to change this keybind."); addSetting(level); addSetting(scroll); + addSetting(zoomInScreens); addSetting(keybind); EVENTS.add(MouseScrollListener.class, this); } @@ -121,6 +127,9 @@ public final class ZoomOtf extends OtherFeature implements MouseScrollListener private boolean isZoomKeyPressed() { + if(MC.currentScreen != null && !zoomInScreens.isChecked()) + return false; + return InputUtil.isKeyPressed(MC.getWindow().getHandle(), InputUtil.fromTranslationKey(keybind.getValue()).getCode()); }