fix: connect Background gui_input to close overlay on outside click

This commit is contained in:
2026-04-26 22:04:43 -07:00
parent efc2b2249c
commit 81feaa4f4f
3 changed files with 44 additions and 25 deletions

View File

@@ -176,16 +176,25 @@ func _update_hover_label() -> void:
else:
hover_label.text = ""
func _on_background_gui_input(event: InputEvent) -> void:
if event is InputEventMouseButton and event.button_index == 1 and event.pressed:
hide_overlay()
close_requested.emit()
func _gui_input(event: InputEvent) -> void:
print("HI")
if not _is_visible:
return
if event is InputEventMouseButton:
if event is InputEventMouseButton:
print("CLOSE")
if event.button_index == 1 and event.pressed:
_clear_selection()
hide_overlay()
close_requested.emit()
if not _is_dragging:
hide_overlay()
close_requested.emit()
return
pass
elif event.button_index == 1 and not event.pressed:
if _is_dragging:
if _hovered_slot == null: