diff --git a/src/logic-scenes/board/card-board.gd b/src/logic-scenes/board/card-board.gd index a0771b2..d6b7a24 100644 --- a/src/logic-scenes/board/card-board.gd +++ b/src/logic-scenes/board/card-board.gd @@ -89,9 +89,10 @@ func handle_mouse_button(to_handle: Area2D, input: InputEvent): var overlaps = to_handle.get_overlapping_areas() for area in overlaps: if area.get_meta("type") == "card": - to_handle.reparent(area) - to_handle.set_owner(self) - to_handle.position = area.get_child(3).position + if !area.has_postit_attached(): + to_handle.reparent(area) + to_handle.set_owner(self) + to_handle.position = area.get_child(3).position else: to_handle.rotation = to_handle.base_rotation to_handle.scale = to_handle.base_scale @@ -127,5 +128,5 @@ func reorder_areas(reorder: String): i += 1 new_order.insert(i, obj) - print_debug(new_order) + #print_debug(new_order) diff --git a/src/logic-scenes/board/card.gd b/src/logic-scenes/board/card.gd index 15fbef4..ee4e6ca 100644 --- a/src/logic-scenes/board/card.gd +++ b/src/logic-scenes/board/card.gd @@ -118,3 +118,11 @@ func _on_input_event(viewport, event, shape_idx): func _move_card(): if is_dragged: position += get_viewport().get_mouse_position() - position + +func has_postit_attached() -> bool: + var all_children = get_children() + print_debug(all_children) + for child in all_children: + if child.get_meta("type") == "post-it": + return true + return false