You've already forked godot
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:
@@ -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"))
|
||||
|
||||
Reference in New Issue
Block a user