mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 10:01:15 +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:
parent
9ab17b664d
commit
a20235aeb0
24 changed files with 1586 additions and 67 deletions
|
|
@ -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"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue