@tool extends TextureButton signal save_callback var held_data : PlantResource = null @export var preview : TextureRect func _can_drop_data(at_position: Vector2, data: Variant) -> bool: if typeof(data) == TYPE_DICTIONARY: if data.type == "files": return load(data.files[0]) is PlantResource return false func _drop_data(at_position: Vector2, data: Variant) -> void: held_data = load(data.files[0]) as PlantResource update() func update(): if held_data: preview.texture = held_data.Preview else: preview.texture = null save_callback.emit() func _pressed() -> void: held_data = null update()