gmtk-2024/addons/AsepriteWizard/interface/shared/source_drop_button.gd
2024-08-17 15:22:33 +01:00

15 lines
325 B
GDScript

@tool
extends Button
signal aseprite_file_dropped(path)
func _can_drop_data(_pos, data):
if data.type == "files":
var extension = data.files[0].get_extension()
return extension == "ase" or extension == "aseprite"
return false
func _drop_data(_pos, data):
var path = data.files[0]
aseprite_file_dropped.emit(path)