Skip to content

Commit

Permalink
feat: support dragging resources to the resource-picker (#148)
Browse files Browse the repository at this point in the history
Co-authored-by: miguel <[email protected]>
  • Loading branch information
russmatney and bitbrain authored Oct 11, 2023
1 parent a2e6a33 commit 8f39604
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions addons/pandora/ui/components/resource_picker/resource_picker.gd
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,13 @@ func _path_changed(new_path:String) -> void:
resource_changed.emit(new_path)
else:
line_edit.text = resource_path

func _can_drop_data(_pos, data):
if data.type == "files":
return true
return false

func _drop_data(_pos, data):
if data.type == "files":
var path = data.files[0]
_path_changed(path)
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ script = ExtResource("1_hjkiw")
[node name="LineEdit" type="LineEdit" parent="."]
layout_mode = 2
size_flags_horizontal = 3
mouse_filter = 1

[node name="LoadFileButton" type="Button" parent="."]
layout_mode = 2
Expand Down

0 comments on commit 8f39604

Please sign in to comment.