diff options
Diffstat (limited to 'editor/create_dialog.cpp')
-rw-r--r-- | editor/create_dialog.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 119e81c150..33e5100cb4 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -503,17 +503,7 @@ Variant CreateDialog::instance_selected() { } else { obj = ClassDB::instantiate(selected->get_text(0)); } - - // Check if any Object-type property should be instantiated. - List<PropertyInfo> pinfo; - ((Object *)obj)->get_property_list(&pinfo); - - for (const PropertyInfo &pi : pinfo) { - if (pi.type == Variant::OBJECT && pi.usage & PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT) { - Object *prop = ClassDB::instantiate(pi.class_name); - ((Object *)obj)->set(pi.name, prop); - } - } + EditorNode::get_editor_data().instantiate_object_properties(obj); return obj; } @@ -743,7 +733,7 @@ CreateDialog::CreateDialog() { favorites->set_allow_reselect(true); favorites->connect("cell_selected", callable_mp(this, &CreateDialog::_favorite_selected)); favorites->connect("item_activated", callable_mp(this, &CreateDialog::_favorite_activated)); - favorites->add_theme_constant_override(SNAME("draw_guides"), 1); + favorites->add_theme_constant_override("draw_guides", 1); #ifndef _MSC_VER #warning cannot forward drag data to a non control, must be fixed #endif @@ -760,7 +750,7 @@ CreateDialog::CreateDialog() { recent->set_allow_reselect(true); recent->connect("item_selected", callable_mp(this, &CreateDialog::_history_selected)); recent->connect("item_activated", callable_mp(this, &CreateDialog::_history_activated)); - recent->add_theme_constant_override(SNAME("draw_guides"), 1); + recent->add_theme_constant_override("draw_guides", 1); VBoxContainer *vbc = memnew(VBoxContainer); vbc->set_custom_minimum_size(Size2(300, 0) * EDSCALE); |