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

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions editor/create_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,14 @@ bool CreateDialog::_should_hide_type(const String &p_type) const {

String script_path = ScriptServer::get_global_class_path(p_type);
if (script_path.begins_with("res://addons/")) {
if (!EditorNode::get_singleton()->is_addon_plugin_enabled(script_path.get_slicec('/', 3))) {
return true; // Plugin is not enabled.
String base_path = "res://addons/";
Vector<String> folders = script_path.split("/");
for (int i = 3; i < folders.size() - 1; i++) {
base_path += folders[i] + "/";
String plugin = base_path + "plugin.cfg";
if (FileAccess::exists(plugin) && !EditorNode::get_singleton()->is_addon_plugin_enabled(plugin)) {
return true; // Plugin is not enabled.
}
}
}
}
Expand Down
Loading