Merge pull request #69924 from aaronfranke/ed-cd-class-virtual
Check if class exists before checking if it's virtual in Create New Node dialog
This commit is contained in:
commit
5e227bfc98
1 changed files with 2 additions and 1 deletions
|
@ -284,8 +284,9 @@ 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)) ||
|
bool can_instantiate = (p_type_category == TypeCategory::CPP_TYPE && ClassDB::can_instantiate(p_type)) ||
|
||||||
p_type_category == TypeCategory::OTHER_TYPE;
|
p_type_category == TypeCategory::OTHER_TYPE;
|
||||||
|
bool is_virtual = ClassDB::class_exists(p_type) && ClassDB::is_virtual(p_type);
|
||||||
|
|
||||||
if (can_instantiate && !ClassDB::is_virtual(p_type)) {
|
if (can_instantiate && !is_virtual) {
|
||||||
r_item->set_icon(0, EditorNode::get_singleton()->get_class_icon(p_type, icon_fallback));
|
r_item->set_icon(0, EditorNode::get_singleton()->get_class_icon(p_type, icon_fallback));
|
||||||
} else {
|
} else {
|
||||||
r_item->set_icon(0, EditorNode::get_singleton()->get_class_icon(p_type, "NodeDisabled"));
|
r_item->set_icon(0, EditorNode::get_singleton()->get_class_icon(p_type, "NodeDisabled"));
|
||||||
|
|
Loading…
Reference in a new issue