Skip to content
Open
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
14 changes: 14 additions & 0 deletions src/main/kotlin/com/lambda/gui/components/ClickGuiLayout.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import com.lambda.imgui.extension.implot.ImPlot
import com.lambda.imgui.flag.ImGuiCol
import com.lambda.imgui.flag.ImGuiCond
import com.lambda.imgui.flag.ImGuiHoveredFlags
import com.lambda.imgui.flag.ImGuiPopupFlags
import com.lambda.imgui.flag.ImGuiWindowFlags
import com.lambda.module.ModuleRegistry
import com.lambda.module.modules.client.Client
Expand Down Expand Up @@ -303,6 +304,19 @@ object ClickGuiLayout : Loadable, Config(
}
}

// A left click on empty space — not over any window and with no popup
// open — closes the GUI (click-outside-to-dismiss). When a popup/menu is
// open, the same click only dismisses that popup, so the GUI stays open.
if (
activeDragWindowName == null &&
mousePressedThisFrameGlobal &&
!ImGui.isWindowHovered(ImGuiHoveredFlags.AnyWindow) &&
!ImGui.isPopupOpen("", ImGuiPopupFlags.AnyPopup)
) {
toggle()
return@buildLayout
}

val tags = if (developerMode) shownTags + ModuleTag.DEBUG else shownTags
if (tags.isEmpty()) return@buildLayout

Expand Down