0
0
mirror of https://github.com/Wurst-Imperium/Wurst7.git synced 2024-09-19 17:02:13 +02:00

Fix zoom in screens bug and turn it into an optional feature

This commit is contained in:
Alexander01998 2024-07-30 11:30:19 +02:00
parent 2f400b5598
commit 90092c1097

View File

@ -32,6 +32,11 @@ public final class ZoomOtf extends OtherFeature implements MouseScrollListener
+ " zooming to zoom in even further.", + " zooming to zoom in even further.",
true); 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", private final TextFieldSetting keybind = new TextFieldSetting("Keybind",
"Determines the zoom keybind.\n\n" "Determines the zoom keybind.\n\n"
+ "Instead of editing this value manually, you should go to Wurst" + "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."); + "Go to Wurst Options -> Zoom to change this keybind.");
addSetting(level); addSetting(level);
addSetting(scroll); addSetting(scroll);
addSetting(zoomInScreens);
addSetting(keybind); addSetting(keybind);
EVENTS.add(MouseScrollListener.class, this); EVENTS.add(MouseScrollListener.class, this);
} }
@ -121,6 +127,9 @@ public final class ZoomOtf extends OtherFeature implements MouseScrollListener
private boolean isZoomKeyPressed() private boolean isZoomKeyPressed()
{ {
if(MC.currentScreen != null && !zoomInScreens.isChecked())
return false;
return InputUtil.isKeyPressed(MC.getWindow().getHandle(), return InputUtil.isKeyPressed(MC.getWindow().getHandle(),
InputUtil.fromTranslationKey(keybind.getValue()).getCode()); InputUtil.fromTranslationKey(keybind.getValue()).getCode());
} }