summaryrefslogtreecommitdiff
path: root/editor/create_dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/create_dialog.cpp')
-rw-r--r--editor/create_dialog.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp
index 75d57b040f..3a63100012 100644
--- a/editor/create_dialog.cpp
+++ b/editor/create_dialog.cpp
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
+/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -408,15 +408,15 @@ String CreateDialog::get_selected_type() {
return selected->get_text(0);
}
-Object *CreateDialog::instance_selected() {
+Variant CreateDialog::instance_selected() {
TreeItem *selected = search_options->get_selected();
if (!selected) {
- return nullptr;
+ return Variant();
}
Variant md = selected->get_metadata(0);
- Object *obj = nullptr;
+ Variant obj;
if (md.get_type() != Variant::NIL) {
String custom = md;
if (ScriptServer::is_global_class(custom)) {
@@ -434,13 +434,13 @@ Object *CreateDialog::instance_selected() {
// Check if any Object-type property should be instantiated.
List<PropertyInfo> pinfo;
- obj->get_property_list(&pinfo);
+ ((Object *)obj)->get_property_list(&pinfo);
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
PropertyInfo pi = E->get();
if (pi.type == Variant::OBJECT && pi.usage & PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT) {
Object *prop = ClassDB::instance(pi.class_name);
- obj->set(pi.name, prop);
+ ((Object *)obj)->set(pi.name, prop);
}
}
@@ -492,7 +492,7 @@ void CreateDialog::_favorite_selected() {
}
search_box->set_text(item->get_text(0).get_slicec(' ', 0));
- recent->unselect_all();
+ recent->deselect_all();
_update_search();
}