summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-06-26 11:08:21 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-06-26 11:08:21 +0200
commit2d22dfab4a1a67d222173e673f4d52d9adb91c41 (patch)
treea842d55624b30ae5f89df44ef7a4eb111e07534c
parent2cd46de180dc59ef2cefa870f3f1ac3cb5df4bc9 (diff)
parent5f695f0ab4390dd571833ea8d551e95da9d8a1a0 (diff)
downloadredot-engine-2d22dfab4a1a67d222173e673f4d52d9adb91c41.tar.gz
Merge pull request #91337 from KoBeWi/unhack_addons
Rework global class hiding in addons
-rw-r--r--editor/create_dialog.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp
index 56500c71e2..204636e128 100644
--- a/editor/create_dialog.cpp
+++ b/editor/create_dialog.cpp
@@ -160,8 +160,13 @@ bool CreateDialog::_should_hide_type(const StringName &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.
+ int i = script_path.find("/", 13); // 13 is length of "res://addons/".
+ while (i > -1) {
+ const String plugin_path = script_path.substr(0, i).path_join("plugin.cfg");
+ if (FileAccess::exists(plugin_path)) {
+ return !EditorNode::get_singleton()->is_addon_plugin_enabled(plugin_path);
+ }
+ i = script_path.find("/", i + 1);
}
}
}