diff --git a/behaviours/draggable.gd b/behaviours/draggable.gd index 26ad854..5587747 100644 --- a/behaviours/draggable.gd +++ b/behaviours/draggable.gd @@ -3,17 +3,17 @@ extends Area2D class_name Draggable -signal dragged -signal dropped +signal dragged(cursor: Cursor) +signal dropped(cursor: Cursor) var being_dragged: bool = false -func drag(): +func drag(cursor: Cursor): being_dragged = true - dragged.emit() + dragged.emit(cursor) -func drop(): +func drop(cursor: Cursor): being_dragged = false - dropped.emit() + dropped.emit(cursor) diff --git a/scenes/game/cursor.gd b/scenes/game/cursor.gd index 2bb2622..7f9a360 100644 --- a/scenes/game/cursor.gd +++ b/scenes/game/cursor.gd @@ -36,14 +36,14 @@ func drag(): var target = find_closest_target() if target and not dragging: dragging = target - target.drag() + target.drag(self) dragged.emit(target) func drop(): if dragging: var target = dragging dragging = null - target.drop() + target.drop(self) dropped.emit(target) func log_dragging() -> void: