Fix - Check for popup menu overlaps and block builds through them.

pull/18/head
Preetb71 2025-05-08 13:22:21 +07:00
parent 3b47a9f435
commit a54e32ba5e
1 changed files with 9 additions and 0 deletions

@ -286,6 +286,15 @@ func _check_visible_controls(node: Node, mouse_pos: Vector2) -> bool:
if node is Control and node.is_visible_in_tree():
if node.get_global_rect().has_point(mouse_pos):
return true
# check for popups
if "get_popup" in node and node.has_method("get_popup"):
var popup = node.get_popup()
if popup and popup is PopupMenu and popup.visible:
var popup_pos = popup.position
var popup_rect = Rect2(popup_pos, popup.size)
if popup_rect.has_point(mouse_pos):
return true
for child in node.get_children():
if _check_visible_controls(child, mouse_pos):