1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

Add ability to edit editor feature profiles

Allows enabling/disabling parts of the editor and storing/loading profiles for that.
This commit is contained in:
Juan Linietsky
2019-04-08 19:18:03 -03:00
parent 9ab17b664d
commit a20235aeb0
24 changed files with 1586 additions and 67 deletions

View File

@@ -238,6 +238,26 @@ void CreateDialog::add_type(const String &p_type, HashMap<String, TreeItem *> &p
p_types[p_type] = item;
}
bool CreateDialog::_is_class_disabled_by_feature_profile(const StringName &p_class) {
Ref<EditorFeatureProfile> profile = EditorFeatureProfileManager::get_singleton()->get_current_profile();
if (profile.is_null()) {
return false;
}
StringName class_name = p_class;
while (class_name != StringName()) {
if (profile->is_class_disabled(class_name)) {
return true;
}
class_name = ClassDB::get_parent_class(class_name);
}
return false;
}
void CreateDialog::_update_search() {
search_options->clear();
@@ -264,6 +284,10 @@ void CreateDialog::_update_search() {
for (List<StringName>::Element *I = type_list.front(); I; I = I->next()) {
String type = I->get();
if (_is_class_disabled_by_feature_profile(type)) {
continue;
}
bool cpp_type = ClassDB::class_exists(type);
if (base_type == "Node" && type.begins_with("Editor"))