diff options
author | Max Hilbrunner <mhilbrunner@users.noreply.github.com> | 2018-07-04 22:37:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-04 22:37:27 +0200 |
commit | dacd9c51b139d1dce66405d3357669862d6250ff (patch) | |
tree | c2baf6a19086be40c183e14decca9ba366e777bb /editor/create_dialog.cpp | |
parent | 02372bfdf7e81bb3e1a154f824665fc9ddbcd566 (diff) | |
parent | 2a6c591957b456961db192908ce62d997d34acac (diff) |
Merge pull request #19849 from willnationsdev/expose-script-create-dialog
Expose ScriptCreateDialog to EditorPlugin
Diffstat (limited to 'editor/create_dialog.cpp')
-rw-r--r-- | editor/create_dialog.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 36978e37a5..a8cbf52cd2 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -262,13 +262,17 @@ void CreateDialog::_update_search() { if (base_type == "Node" && type.begins_with("Editor")) continue; // do not show editor nodes - if (base_type == "Resource" && ClassDB::is_parent_class(type, "PluginScript")) - // PluginScript must be initialized before use, which is not possible here - continue; - if (!ClassDB::can_instance(type)) continue; // can't create what can't be instanced + bool skip = false; + for (Set<StringName>::Element *E = type_blacklist.front(); E && !skip; E = E->next()) { + if (ClassDB::is_parent_class(type, E->get())) + skip = true; + } + if (skip) + continue; + if (search_box->get_text() == "") { add_type(type, types, root, &to_select); } else { @@ -706,4 +710,7 @@ CreateDialog::CreateDialog() { help_bit = memnew(EditorHelpBit); vbc->add_margin_child(TTR("Description:"), help_bit); help_bit->connect("request_hide", this, "_closed"); + + type_blacklist.insert("PluginScript"); // PluginScript must be initialized before use, which is not possible here + type_blacklist.insert("ScriptCreateDialog"); // This is an exposed editor Node that doesn't have an Editor prefix. } |