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.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp
index 0f9c9bde7b..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 */
@@ -57,10 +57,10 @@ void CreateDialog::popup_create(bool p_dont_clear, bool p_replace_mode, const St
if (p_replace_mode) {
set_title(vformat(TTR("Change %s Type"), base_type));
- get_ok()->set_text(TTR("Change"));
+ get_ok_button()->set_text(TTR("Change"));
} else {
set_title(vformat(TTR("Create New %s"), base_type));
- get_ok()->set_text(TTR("Create"));
+ get_ok_button()->set_text(TTR("Create"));
}
_load_favorites_and_history();
@@ -195,7 +195,7 @@ void CreateDialog::_update_search() {
} else {
favorite->set_disabled(true);
help_bit->set_text("");
- get_ok()->set_disabled(true);
+ get_ok_button()->set_disabled(true);
search_options->deselect_all();
}
}
@@ -396,7 +396,7 @@ void CreateDialog::select_type(const String &p_type) {
favorite->set_disabled(false);
favorite->set_pressed(favorite_list.find(p_type) != -1);
- get_ok()->set_disabled(false);
+ get_ok_button()->set_disabled(false);
}
String CreateDialog::get_selected_type() {
@@ -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();
}