diff options
Diffstat (limited to 'editor/create_dialog.cpp')
-rw-r--r-- | editor/create_dialog.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 8ccfda1145..3e72c6211d 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -38,7 +38,7 @@ #include "editor/editor_scale.h" #include "editor/editor_settings.h" -void CreateDialog::popup_create(bool p_dont_clear, bool p_replace_mode, const String &p_select_type, const String &p_select_name) { +void CreateDialog::popup_create(bool p_dont_clear, bool p_replace_mode, const String &p_current_type, const String &p_current_name) { _fill_type_list(); icon_fallback = search_options->has_theme_icon(base_type, SNAME("EditorIcons")) ? base_type : "Object"; @@ -50,18 +50,14 @@ void CreateDialog::popup_create(bool p_dont_clear, bool p_replace_mode, const St } if (p_replace_mode) { - search_box->set_text(p_select_type); + search_box->set_text(p_current_type); } search_box->grab_focus(); _update_search(); if (p_replace_mode) { - if (!p_select_name.is_empty()) { - set_title(vformat(TTR("Convert %s from %s"), p_select_name, p_select_type)); - } else { - set_title(vformat(TTR("Convert %s"), p_select_type)); - } + set_title(vformat(TTR("Change Type of \"%s\""), p_current_name)); set_ok_button_text(TTR("Change")); } else { set_title(vformat(TTR("Create New %s"), base_type)); @@ -300,6 +296,15 @@ void CreateDialog::_configure_search_option_item(TreeItem *r_item, const String r_item->set_icon(0, EditorNode::get_singleton()->get_class_icon(p_type, icon_fallback)); } + bool is_deprecated = EditorHelp::get_doc_data()->class_list[p_type].is_deprecated; + bool is_experimental = EditorHelp::get_doc_data()->class_list[p_type].is_experimental; + + if (is_deprecated) { + r_item->add_button(0, get_theme_icon("StatusError", SNAME("EditorIcons")), 0, false, TTR("This class is marked as deprecated.")); + } else if (is_experimental) { + r_item->add_button(0, get_theme_icon("NodeWarning", SNAME("EditorIcons")), 0, false, TTR("This class is marked as experimental.")); + } + if (!search_box->get_text().is_empty()) { r_item->set_collapsed(false); } else { @@ -665,7 +670,7 @@ void CreateDialog::_save_and_update_favorite_list() { for (int i = 0; i < favorite_list.size(); i++) { String l = favorite_list[i]; String name = l.get_slicec(' ', 0); - if (!(ClassDB::class_exists(name) || ScriptServer::is_global_class(name))) { + if (!EditorNode::get_editor_data().is_type_recognized(name)) { continue; } f->store_line(l); @@ -692,7 +697,7 @@ void CreateDialog::_load_favorites_and_history() { String l = f->get_line().strip_edges(); String name = l.get_slicec(' ', 0); - if ((ClassDB::class_exists(name) || ScriptServer::is_global_class(name)) && !_is_class_disabled_by_feature_profile(name)) { + if (EditorNode::get_editor_data().is_type_recognized(name) && !_is_class_disabled_by_feature_profile(name)) { recent->add_item(l, EditorNode::get_singleton()->get_class_icon(name, icon_fallback)); } } |