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

Use EditorResourcePicker in the Inspector #48854

Merged

Conversation

YuriSizov
Copy link
Contributor

@YuriSizov YuriSizov commented May 19, 2021

Closes #48797, follow-up to #47260. This also exposes additional properties and methods on EditorResourcePicker as well as introduces a derivative class EditorScriptPicker (available in the scripting API) that's different from the parent class in that it replaces "New ..." options with special "New Script"/"Extend Script" actions. They open the "Attach Script" dialog, as before.

Special behavior for ViewportTextures was left in the EditorProperty wrapper as it's too specific to the Inspector. I also have concerns about warnings that try to prevent the creation of invalid ViewportTextures (when no scene or node is involved and therefore it's impossible to attach it anywhere). These warnings and checks are pretty much superficial and can be easily side-stepped by users by accident or by misunderstanding them. Therefore I think those need to be removed from here and rethought, reimplemented in a more encompassing way. But, alas, I have no idea on what that way may be, so I've tried to keep them as close to the old behavior as possible.

@YuriSizov YuriSizov added enhancement topic:editor cherrypick:3.x Considered for cherry-picking into a future 3.x release topic:gui labels May 19, 2021
@YuriSizov YuriSizov added this to the 4.0 milestone May 19, 2021
@YuriSizov YuriSizov requested review from a team May 19, 2021 18:48
@YuriSizov YuriSizov requested a review from a team as a code owner May 19, 2021 18:48
@YuriSizov YuriSizov requested a review from reduz May 20, 2021 12:48
@akien-mga akien-mga merged commit d3ba922 into godotengine:master May 21, 2021
@akien-mga
Copy link
Member

Thanks!

@YuriSizov
Copy link
Contributor Author

Oh no, I see a typo in my docs 😱

@YuriSizov YuriSizov deleted the editor-reuse-resource-picker branch May 21, 2021 11:37
@YuriSizov YuriSizov removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Jun 10, 2021
YuriSizov added a commit to YuriSizov/godot that referenced this pull request Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reuse EditorResourcePicker in EditorPropertyResource
2 participants