feat: support dragging resources to the resource-picker #148
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This extends the resource-picker to support a simple drag-and-drop from
the FileSystem tab.
The resource_picker's line_edit's MouseFilter was set to 'pass' so the
drag/drop input could live on the resource_picker itself, which was a
bit simpler than extending a custom LineEdit component.
I'm happy to implement some other way if there's a preference, just let me know!
In some cases I'm using strings for filepaths as well, when setting a script
path on an entity... maybe we want to support drag-n-drop to set a filepath on
strings too?
I looked into the EditorFileDialog and EditorResourcePicker as well -
these both need to be subclassed and cannot run in-game (only at
editor/tool-time), but if we're ok with that, they might provide more UX
improvements.
The EditorFileDialog supports a few extra file-dialog features, like
'recent' and 'starred' files.
The EditorResourcePicker would be a larger refactor because it expects a class
rather than an extension, but it can be used for filtering/searching via the
Load/Quick Load option - really this option is best if we know what kind of
resource we're loading, which would require more user input, and might not be
worth it.