diff options
Diffstat (limited to 'editor/editor_feature_profile.cpp')
-rw-r--r-- | editor/editor_feature_profile.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/editor/editor_feature_profile.cpp b/editor/editor_feature_profile.cpp index 94262c2289..976c9043d2 100644 --- a/editor/editor_feature_profile.cpp +++ b/editor/editor_feature_profile.cpp @@ -32,9 +32,10 @@ #include "core/io/dir_access.h" #include "core/io/json.h" +#include "editor/editor_file_dialog.h" +#include "editor/editor_node.h" +#include "editor/editor_scale.h" #include "editor/editor_settings.h" -#include "editor_node.h" -#include "editor_scale.h" const char *EditorFeatureProfile::feature_names[FEATURE_MAX] = { TTRC("3D Editor"), @@ -462,7 +463,7 @@ void EditorFeatureProfileManager::_erase_selected_profile() { void EditorFeatureProfileManager::_create_new_profile() { String name = new_profile_name->get_text().strip_edges(); - if (!name.is_valid_filename() || name.find(".") != -1) { + if (!name.is_valid_filename() || name.contains(".")) { EditorNode::get_singleton()->show_warning(TTR("Profile must be a valid filename and must not contain '.'")); return; } @@ -592,7 +593,15 @@ void EditorFeatureProfileManager::_class_list_item_selected() { List<PropertyInfo> props; ClassDB::get_property_list(class_name, &props, true); - if (props.size() > 0) { + bool has_editor_props = false; + for (const PropertyInfo &E : props) { + if (E.usage & PROPERTY_USAGE_EDITOR) { + has_editor_props = true; + break; + } + } + + if (has_editor_props) { TreeItem *properties = property_list->create_item(root); properties->set_text(0, TTR("Class Properties:")); |