summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2022-10-19 01:58:13 -0500
committerAaron Franke <arnfranke@yahoo.com>2022-11-05 14:45:16 -0500
commitba542444e3f81498eb3a9851a1b17cbf828abe61 (patch)
tree36ad1dacef6e0e2d4cd43c1fb01a89f70668f233 /editor
parent6882890a34528e056f13020798f4a473046990bb (diff)
Don't allow instancing virtual node types in the Create New Node dialog
Diffstat (limited to 'editor')
-rw-r--r--editor/create_dialog.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp
index 6142856f75..545b0895b0 100644
--- a/editor/create_dialog.cpp
+++ b/editor/create_dialog.cpp
@@ -284,12 +284,12 @@ void CreateDialog::_configure_search_option_item(TreeItem *r_item, const String
bool can_instantiate = (p_type_category == TypeCategory::CPP_TYPE && ClassDB::can_instantiate(p_type)) ||
p_type_category == TypeCategory::OTHER_TYPE;
- if (!can_instantiate) {
- r_item->set_custom_color(0, search_options->get_theme_color(SNAME("disabled_font_color"), SNAME("Editor")));
+ if (can_instantiate && !ClassDB::is_virtual(p_type)) {
+ r_item->set_icon(0, EditorNode::get_singleton()->get_class_icon(p_type, icon_fallback));
+ } else {
r_item->set_icon(0, EditorNode::get_singleton()->get_class_icon(p_type, "NodeDisabled"));
+ r_item->set_custom_color(0, search_options->get_theme_color(SNAME("disabled_font_color"), SNAME("Editor")));
r_item->set_selectable(0, false);
- } else {
- r_item->set_icon(0, EditorNode::get_singleton()->get_class_icon(p_type, icon_fallback));
}
bool is_deprecated = EditorHelp::get_doc_data()->class_list[p_type].is_deprecated;