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

Enable global classes in subfolders of res://addons/ #86325

Conversation

emklasson
Copy link
Contributor

This PR lets GlobalClass classes get added to the "Create New Node" dialog no matter where they are under addons/ as long as it's not in a disabled plugin (or any subfolder of such as those are assumed to belong to the disabled plugin).

This also then lets you keep non-plugin files under addons/ and have their GlobalClasses work, as seems encouraged by https://docs.godotengine.org/en/stable/tutorials/best_practices/project_organization.html saying "In general, keep third-party resources in a top-level addons/ folder, even if they aren't editor plugins. This makes it easier to track which files are third-party."

Fixes #78400.

The code could presumably be optimised some e.g. by not using String::split, but I'm guessing code clarity and brevity takes preference over squeezing out performance here?

Copy link
Member

@ajreckof ajreckof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
I don't see how to do it better then with split and based on what is done in EditorPluginSettings::_get_plugins it should be good as it is.

@akien-mga
Copy link
Member

Superseded by #91337. Thanks for the contribution!

@akien-mga akien-mga closed this Jun 26, 2024
@akien-mga akien-mga removed this from the 4.3 milestone Jun 26, 2024
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.

Create dialog does not show global classes from addons inside subfolders
4 participants