Skip to content

Commit

Permalink
Sort binds by name
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryhon0 committed May 16, 2024
1 parent e483ec5 commit cd12116
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/xyz/ryhon/tmb/SearchScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Comparator;

import org.lwjgl.glfw.GLFW;

Expand Down Expand Up @@ -267,6 +268,8 @@ List<BindingEntry> getEntries() {
list.add(be);
}

list.sort(Comparator.comparing(BindingEntry::getName));

return list;
}

Expand All @@ -289,6 +292,10 @@ public BindingEntry(KeyBinding bind, String id, String name, String categoryId,
public String categoryId;
public String categoryName;

public String getName() {
return name;
}

public boolean matches(String query) {
String[] split = query.toLowerCase().split("\\ ");

Expand Down

0 comments on commit cd12116

Please sign in to comment.