- Joined
- Jul 11, 2020
- Messages
- 0
- Reaction score
- 25
- Points
- 0
I am trying to sort modules after their length, thru the deluge clickgui.
The way they store their modules are in HashMaps with String as its key. I store mine in ArrayLists.
I get a redline under "sort" where it says:
Im wondering if anyone know how I can make List a String while I get the ToggledModules? idk how I can get the name of every toggledModule thru the list.
the way deluge has it:
The way they store their modules are in HashMaps with String as its key. I store mine in ArrayLists.
Code:
if (arrayList) {
List<Module> list = Oblivion.INSTANCE.MODULE_MANAGER.getToggledModules();
switch (arrayListSort) {
case "length":
Collections.sort(list, new StringLengthComparator(StringLengthComparator.Direction.LARGETOSMALL, Wrapper.mc().fontRendererObj));
break;
case "alphabetical":
Collections.sort(list);
break;
}
I get a redline under "sort" where it says:
Im wondering if anyone know how I can make List a String while I get the ToggledModules? idk how I can get the name of every toggledModule thru the list.
the way deluge has it:
Code:
if (arrayList) {
List<String> list = Module.enabled();
switch (arrayListSort) {
case "length":
Collections.sort(list, new StringLengthComparator(StringLengthComparator.Direction.LARGETOSMALL, Helper.mc().fontRendererObj));
break;
case "alphabetical":
Collections.sort(list);
break;
}
public static List<String> enabled()
{
List<String> list = new ArrayList();
for (String s : modules.keySet())
{
Module module = get(s);
if (module.active) {
list.add(s);
}
}
return list;
}