16 lines
469 B
GDScript
16 lines
469 B
GDScript
class_name DropReiter
|
|
extends Button
|
|
## Partei-Reiter als Tauschziel: ein gezogener Gegenstand wechselt die Figur.
|
|
|
|
signal figur_bekommen(index: int, id: String)
|
|
|
|
var index := 0
|
|
|
|
|
|
func _can_drop_data(_at: Vector2, data: Variant) -> bool:
|
|
return typeof(data) == TYPE_DICTIONARY and data.get("art") == "inventar" \
|
|
and not str(data.get("id", "")).is_empty()
|
|
|
|
|
|
func _drop_data(_at: Vector2, data: Variant) -> void:
|
|
figur_bekommen.emit(index, str(data.get("id", "")))
|