Skip to content

Commit 294248b

Browse files
committed
Lock HUD elements in GUIs not being ClickGUI
1 parent 7128a20 commit 294248b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/kotlin/com/lambda/gui/components/HudGuiLayout.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ object HudGuiLayout : Loadable {
7171
val mousePressedThisFrame = mouseDown && !mouseWasDown
7272
val mouseReleasedThisFrame = !mouseDown && mouseWasDown
7373
mouseWasDown = mouseDown
74-
if (mouseReleasedThisFrame) {
74+
if (mouseReleasedThisFrame || !ClickGui.isEnabled) {
7575
activeDragHudName = null
7676
}
7777

@@ -97,7 +97,12 @@ object HudGuiLayout : Loadable {
9797
if (override != null) {
9898
ImGui.setNextWindowPos(override.first, override.second)
9999
}
100-
window("##${hud.name}", flags = DEFAULT_HUD_FLAGS) {
100+
101+
val hudFlags = if (ClickGui.isEnabled) DEFAULT_HUD_FLAGS else {
102+
DEFAULT_HUD_FLAGS or ImGuiWindowFlags.NoMove
103+
}
104+
105+
window("##${hud.name}", flags = hudFlags) {
101106
val vis = snapOverlays[hud.name]
102107
if (vis != null) {
103108
SnapManager.drawSnapLines(

0 commit comments

Comments
 (0)