diff --git a/src/main/java/net/aoba/gui/tabs/ModuleSettingsTab.java b/src/main/java/net/aoba/gui/tabs/ModuleSettingsTab.java index cd5c62b2..379e2c6a 100644 --- a/src/main/java/net/aoba/gui/tabs/ModuleSettingsTab.java +++ b/src/main/java/net/aoba/gui/tabs/ModuleSettingsTab.java @@ -20,6 +20,7 @@ import org.joml.Matrix4f; import net.aoba.Aoba; +import net.aoba.event.events.LeftMouseDownEvent; import net.aoba.gui.AbstractGui; import net.aoba.gui.GuiManager; import net.aoba.gui.colors.Color; @@ -140,27 +141,27 @@ public void draw(DrawContext drawContext, float partialTicks) { } } -// @Override -// public void OnLeftMouseDown(LeftMouseDownEvent event) { -// double mouseX = mc.mouse.getX(); -// double mouseY = mc.mouse.getY(); -// Vector2 pos = position.getValue(); -// -// if (Aoba.getInstance().hudManager.isClickGuiOpen()) { -// if (mouseX >= pos.x && mouseX <= pos.x + width) { -// if (mouseY >= pos.y && mouseY <= pos.y + 24) { -// this.lastClickOffsetX = mouseX - pos.x; -// this.lastClickOffsetY = mouseY - pos.y; -// GuiManager.currentGrabbed = this; -// } -// } -// -// if (mouseX >= (pos.x + width - 24) && mouseX <= (pos.x + width - 2)) { -// if (mouseY >= (pos.y + 4) && mouseY <= (pos.y + 20)) { -// GuiManager.currentGrabbed = null; -// Aoba.getInstance().hudManager.RemoveHud(this, "Modules"); -// } -// } -// } -// } + @Override + public void OnLeftMouseDown(LeftMouseDownEvent event) { + double mouseX = mc.mouse.getX(); + double mouseY = mc.mouse.getY(); + Vector2 pos = position.getValue(); + + if (Aoba.getInstance().hudManager.isClickGuiOpen()) { + if (mouseX >= pos.x && mouseX <= pos.x + width) { + if (mouseY >= pos.y && mouseY <= pos.y + 24) { + this.lastClickOffsetX = mouseX - pos.x; + this.lastClickOffsetY = mouseY - pos.y; + GuiManager.currentGrabbed = this; + } + } + + if (mouseX >= (pos.x + width - 24) && mouseX <= (pos.x + width - 2)) { + if (mouseY >= (pos.y + 4) && mouseY <= (pos.y + 20)) { + GuiManager.currentGrabbed = null; + Aoba.getInstance().hudManager.RemoveHud(this, "Modules"); + } + } + } + } }