diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-12-11 22:35:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-11 22:35:21 +0100 |
commit | 5e227bfc98d5a4dfe3f91fe0cc0dab7689e4331d (patch) | |
tree | 0545b010d3a5ff888e6011a609954bad2f508d50 | |
parent | 71eccdff8b119b4213c1078954dc2fdf9685eb7e (diff) | |
parent | 137508dfc868a7944eb1c342a6a4af98e0597410 (diff) |
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
-rw-r--r-- | editor/create_dialog.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 2adab089e4..5292b51032 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -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)) || 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)); } else { r_item->set_icon(0, EditorNode::get_singleton()->get_class_icon(p_type, "NodeDisabled")); |