Skip to content

Commit

Permalink
Merge pull request #42 from coltonk9043/1.20.5
Browse files Browse the repository at this point in the history
Added back Module Options Close functionality.
  • Loading branch information
coltonk9043 committed May 5, 2024
2 parents e4354c4 + ff6fcef commit f49394c
Showing 1 changed file with 24 additions and 23 deletions.
47 changes: 24 additions & 23 deletions src/main/java/net/aoba/gui/tabs/ModuleSettingsTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
}
}
}
}
}

0 comments on commit f49394c

Please sign in to comment.