Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support dragging resources to the resource-picker #148

Merged
merged 2 commits into from Oct 11, 2023

Conversation

russmatney
Copy link
Contributor

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.

russmatney and others added 2 commits October 10, 2023 15:30
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.
@bitbrain
Copy link
Owner

Amazing! Thank you.

@bitbrain bitbrain merged commit 8f39604 into bitbrain:godot-4.x Oct 11, 2023
3 checks passed
@russmatney russmatney deleted the rm/drag-drop-resource-picker branch October 11, 2023 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants