1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +00:00

Expose ScriptCreateDialog to EditorPlugin

This commit is contained in:
willnationsdev
2018-06-29 22:08:28 -05:00
committed by Will Nations
parent 0ffec7daf7
commit 2a6c591957
11 changed files with 91 additions and 4 deletions

View File

@@ -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.
}