From 2948a38f06c13a97e33f483840c5220eb1321e61 Mon Sep 17 00:00:00 2001 From: Ic3Tank <61137113+IceTank@users.noreply.github.com> Date: Sun, 28 Sep 2025 17:25:51 +0200 Subject: [PATCH 1/2] Sort Modules in lambda click ui by name --- src/main/kotlin/com/lambda/gui/components/ClickGuiLayout.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/kotlin/com/lambda/gui/components/ClickGuiLayout.kt b/src/main/kotlin/com/lambda/gui/components/ClickGuiLayout.kt index 5383bce4f..73a67c740 100644 --- a/src/main/kotlin/com/lambda/gui/components/ClickGuiLayout.kt +++ b/src/main/kotlin/com/lambda/gui/components/ClickGuiLayout.kt @@ -202,6 +202,7 @@ object ClickGuiLayout : Loadable, Configurable(GuiConfig) { window(tag.name, flags = AlwaysAutoResize) { ModuleRegistry.modules .filter { it.tag == tag } + .sortedBy { it.name } .forEach { with(ModuleEntry(it)) { buildLayout() } } } } From c88dc0ee603d4c893e3b7c1df3df0ded2127ac56 Mon Sep 17 00:00:00 2001 From: Ic3Tank <61137113+IceTank@users.noreply.github.com> Date: Sun, 28 Sep 2025 17:37:13 +0200 Subject: [PATCH 2/2] Change sort operation from on render to on load --- src/main/kotlin/com/lambda/gui/components/ClickGuiLayout.kt | 1 - src/main/kotlin/com/lambda/module/ModuleRegistry.kt | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/kotlin/com/lambda/gui/components/ClickGuiLayout.kt b/src/main/kotlin/com/lambda/gui/components/ClickGuiLayout.kt index 73a67c740..5383bce4f 100644 --- a/src/main/kotlin/com/lambda/gui/components/ClickGuiLayout.kt +++ b/src/main/kotlin/com/lambda/gui/components/ClickGuiLayout.kt @@ -202,7 +202,6 @@ object ClickGuiLayout : Loadable, Configurable(GuiConfig) { window(tag.name, flags = AlwaysAutoResize) { ModuleRegistry.modules .filter { it.tag == tag } - .sortedBy { it.name } .forEach { with(ModuleEntry(it)) { buildLayout() } } } } diff --git a/src/main/kotlin/com/lambda/module/ModuleRegistry.kt b/src/main/kotlin/com/lambda/module/ModuleRegistry.kt index e6f2bc9ca..2986f8c9a 100644 --- a/src/main/kotlin/com/lambda/module/ModuleRegistry.kt +++ b/src/main/kotlin/com/lambda/module/ModuleRegistry.kt @@ -25,7 +25,7 @@ import com.lambda.util.reflections.getInstances */ object ModuleRegistry : Loadable { override val priority = 1 - val modules = getInstances().toMutableList() + val modules = getInstances().toMutableList().sortedBy { it.name } val moduleNames: Set get() = modules.map { it.name }.toSet()