diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/render/Zoom.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/render/Zoom.java index ab96938886..40f5a98efe 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/render/Zoom.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/render/Zoom.java @@ -6,6 +6,7 @@ package meteordevelopment.meteorclient.systems.modules.render; import meteordevelopment.meteorclient.MeteorClient; +import meteordevelopment.meteorclient.events.meteor.KeyEvent; import meteordevelopment.meteorclient.events.meteor.MouseScrollEvent; import meteordevelopment.meteorclient.events.render.GetFovEvent; import meteordevelopment.meteorclient.events.render.Render3DEvent; @@ -18,6 +19,7 @@ import meteordevelopment.meteorclient.systems.modules.Module; import meteordevelopment.orbit.EventHandler; import net.minecraft.util.math.MathHelper; +import org.lwjgl.glfw.GLFW; public class Zoom extends Module { private final SettingGroup sgGeneral = settings.getDefaultGroup(); @@ -52,10 +54,18 @@ public class Zoom extends Module { .build() ); + private final Setting hideHud = sgGeneral.add(new BoolSetting.Builder() + .name("hide-HUD") + .description("Whether or not to hide the Minecraft HUD.") + .defaultValue(false) + .build() + ); + private final Setting renderHands = sgGeneral.add(new BoolSetting.Builder() .name("show-hands") .description("Whether or not to render your hands.") .defaultValue(false) + .visible(() -> !hideHud.get()) .build() ); @@ -66,6 +76,8 @@ public class Zoom extends Module { private double lastFov; private double time; + private boolean hudManualToggled; + public Zoom() { super(Categories.Render, "zoom", "Zooms your view."); autoSubscribe = false; @@ -83,6 +95,24 @@ public void onActivate() { MeteorClient.EVENT_BUS.subscribe(this); enabled = true; } + + if (hideHud.get() && !mc.options.hudHidden) { + hudManualToggled = false; + mc.options.hudHidden = true; + } + } + + @Override + public void onDeactivate() { + if (hideHud.get() && !hudManualToggled) { + mc.options.hudHidden = false; + } + } + + @EventHandler + public void onKeyPressed(KeyEvent event) { + if (event.key != GLFW.GLFW_KEY_F1) return; + hudManualToggled = true; } public void onStop() { @@ -133,7 +163,7 @@ private void onRender3D(Render3DEvent event) { @EventHandler private void onGetFov(GetFovEvent event) { - event.fov /= getScaling(); + event.fov /= (float) getScaling(); if (lastFov != event.fov) mc.worldRenderer.scheduleTerrainUpdate(); lastFov = event.fov;