TinyAdventure/ui/item_drag.gd

17 lines
380 B
GDScript
Raw Permalink Normal View History

class_name ItemDrag
signal drag_completed(data:ItemDrag)
var source:Control = null
var destination:Control = null
var preview:Control
func _init(source_control: Control, preview_control:Control):
self.source = source_control
self.preview = preview_control
self.preview.tree_exiting.connect(self._on_tree_exiting)
func _on_tree_exiting()->void:
drag_completed.emit(self)