Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/main/kotlin/com/lambda/gui/MenuBar.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import com.lambda.imgui.ImGui
import com.lambda.imgui.ImGui.closeCurrentPopup
import com.lambda.imgui.flag.ImGuiCol
import com.lambda.imgui.flag.ImGuiStyleVar
import com.lambda.imgui.type.ImBoolean
import com.lambda.imgui.flag.ImGuiWindowFlags
import com.lambda.interaction.BaritoneHandler
import com.lambda.module.ModuleRegistry
Expand Down Expand Up @@ -264,22 +265,19 @@ object MenuBar {
private fun ImGuiBuilder.buildModulesMenu() {
menu("Module Tag") {
ModuleTag.defaults.forEach { tag ->
menuItem(tag.name, selected = ModuleTag.isTagShown(tag)) {
checkbox(tag.name, ImBoolean(ModuleTag.isTagShown(tag))) {
ModuleTag.toggleTag(tag)
}
}
}
separator()
// By Tag → quick enable/disable per module
// By Tag → toggle whether each module is shown in the ClickGui layout
ModuleTag.defaults.forEach { tag ->
menu(tag.name) {
ModuleRegistry.modules
.filter { it.tag == tag }
.forEach { module ->
menuItem(module.name, selected = module.isEnabled) {
module.toggle()
}
// Optionally, offer a "Settings..." item to focus this module’s details UI.
checkbox(module.name, module::showInClickGui)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ object ClickGuiLayout : Loadable, Config(
}

ModuleRegistry.modules
.filter { it.tag == tag }
.filter { it.tag == tag && it.showInClickGui }
.forEach { with(ModuleEntry(it)) { buildLayout() } }

val vis = snapOverlays[tag.name]
Expand Down
2 changes: 2 additions & 0 deletions src/main/kotlin/com/lambda/module/Module.kt
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ abstract class Module(
.onRelease { if (disableOnRelease) disable() }
val disableOnReleaseSetting = setting("Disable On Release", false) { false }
val drawSetting = setting("Draw", true, "Draws the module in the module list hud element") { false }
val showInClickGuiSetting = setting("Show In ClickGui", true, "Shows the module in the ClickGui layout") { false }

var isEnabled by isEnabledSetting
private set
Expand All @@ -154,6 +155,7 @@ abstract class Module(
val keybind by keybindSetting
val disableOnRelease by disableOnReleaseSetting
val draw by drawSetting
var showInClickGui by showInClickGuiSetting

override val isMuted: Boolean
get() = !isEnabled && !alwaysListening
Expand Down