Skip to content

Commit

Permalink
Search fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tanishisherewithhh committed Jun 9, 2024
1 parent 4647c1e commit a553a0b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/main/java/dev/heliosclient/ui/clickgui/CategoryPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ public static int getWidth() {

public void addModule(List<Module_> moduleS) {

int prevSize = moduleButtons.size();
for (Module_ module : moduleS) {
boolean exists = false;
for (ModuleButton button : moduleButtons) {
Expand All @@ -104,7 +103,6 @@ public void addModule(List<Module_> moduleS) {
moduleButtons.add(moduleButton);
}
}
if(moduleButtons.size() != prevSize) {
height = 4;
for (ModuleButton button : moduleButtons) {
maxWidth = Math.max(maxWidth, button.width);
Expand All @@ -113,7 +111,6 @@ public void addModule(List<Module_> moduleS) {
maxWidth = getWidth();
}
}
}
}

public void update(float delta) {
Expand Down Expand Up @@ -238,6 +235,7 @@ else if (hovered(mouseX, mouseY) && button == 0) {
}
for (ModuleButton moduleButton : moduleButtons) {
moduleButton.collapsed = collapsed;
moduleButton.mouseClicked(event);
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/dev/heliosclient/ui/clickgui/ModuleButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ public int renderSettings(DrawContext drawContext, int x, int y, int mouseX, int
return buttonYOffset > 2 ? finalHeight : 0;
}

@SubscribeEvent
/**
* Method is called in {@link CategoryPane#mouseClicked(MouseClickEvent)}
*/
public boolean mouseClicked(MouseClickEvent event) {
//Do not accept any clicks if the mouse is over the search bar
if (ClickGUIScreen.INSTANCE.searchBar.isMouseOverInputBox(event.getMouseX(), event.getMouseY())) return false;
Expand Down

0 comments on commit a553a0b

Please sign in to comment.