Commit 6b7c9d2
committed
BlockCanvas: Implement drag & drop resource files from the filesystem dock
Dragging the resources from the filesystem dock shows the object's type
as "files". So, allow the "files" type in _can_drop_data() and handle it
in _drop_data(). Then, implement getting the resource's file path as a
Variable block with _drop_files() in detail.
And, because Godot allows dragging multiple files at the same time, this
implemention parses the "files"' paths, then generates the corresponding
block definition with get_resource_block_definition() and sets default
"file_path" for each file's path.
Besides, to avoid the dropped blocks overlap with each others on the
canvas, each block biases its position a little bit automatically.
https://phabricator.endlessm.com/T357121 parent c8b7692 commit 6b7c9d2
1 file changed
+23
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
90 | 94 | | |
91 | 95 | | |
92 | 96 | | |
| |||
108 | 112 | | |
109 | 113 | | |
110 | 114 | | |
| 115 | + | |
| 116 | + | |
111 | 117 | | |
112 | 118 | | |
113 | 119 | | |
| |||
148 | 154 | | |
149 | 155 | | |
150 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
151 | 174 | | |
152 | 175 | | |
153 | 176 | | |
| |||
0 commit comments