Removed editor feature profiles.

This commit is contained in:
Relintai 2022-03-16 01:17:27 +01:00
parent 84bd8ad20a
commit 5767e12b56
17 changed files with 46 additions and 1519 deletions

View File

@ -196,26 +196,6 @@ bool ProjectSettings::_set(const StringName &p_name, const Variant &p_value) {
return true;
}
if (!disable_feature_overrides) {
int dot = p_name.operator String().find(".");
if (dot != -1) {
Vector<String> s = p_name.operator String().split(".");
bool override_valid = false;
for (int i = 1; i < s.size(); i++) {
String feature = s[i].strip_edges();
if (OS::get_singleton()->has_feature(feature) || custom_features.has(feature)) {
override_valid = true;
break;
}
}
if (override_valid) {
feature_overrides[s[0]] = p_name;
}
}
}
if (props.has(p_name)) {
if (!props[p_name].overridden) {
props[p_name].variant = p_value;
@ -232,9 +212,7 @@ bool ProjectSettings::_get(const StringName &p_name, Variant &r_ret) const {
_THREAD_SAFE_METHOD_
StringName name = p_name;
if (!disable_feature_overrides && feature_overrides.has(name)) {
name = feature_overrides[name];
}
if (!props.has(name)) {
WARN_PRINT("Property not found: " + String(name));
return false;
@ -986,10 +964,6 @@ const Map<StringName, PropertyInfo> &ProjectSettings::get_custom_property_info()
return custom_prop_info;
}
void ProjectSettings::set_disable_feature_overrides(bool p_disable) {
disable_feature_overrides = p_disable;
}
bool ProjectSettings::is_using_datapack() const {
return using_datapack;
}
@ -1050,7 +1024,6 @@ ProjectSettings::ProjectSettings() {
singleton = this;
last_order = NO_BUILTIN_ORDER_BASE;
last_builtin_order = 0;
disable_feature_overrides = false;
registering_order = true;
Array events;

View File

@ -112,12 +112,10 @@ protected:
Map<StringName, VariantContainer> props;
String resource_path;
Map<StringName, PropertyInfo> custom_prop_info;
bool disable_feature_overrides;
bool using_datapack;
List<String> input_presets;
Set<String> custom_features;
Map<StringName, StringName> feature_overrides;
String project_data_dir_name;
@ -187,8 +185,6 @@ public:
List<String> get_input_presets() const { return input_presets; }
void set_disable_feature_overrides(bool p_disable);
bool is_using_datapack() const;
void set_registering_order(bool p_enable);

View File

@ -33,7 +33,6 @@
#include "core/class_db.h"
#include "core/os/keyboard.h"
#include "core/print_string.h"
#include "editor_feature_profile.h"
#include "editor_help.h"
#include "editor_node.h"
#include "editor_scale.h"
@ -58,7 +57,7 @@ void CreateDialog::popup_create(bool p_dont_clear, bool p_replace_mode, const St
while (!f->eof_reached()) {
String l = f->get_line().strip_edges();
String name = l.split(" ")[0];
if ((ClassDB::class_exists(name) || ScriptServer::is_global_class(name)) && !_is_class_disabled_by_feature_profile(name)) {
if ((ClassDB::class_exists(name) || ScriptServer::is_global_class(name))) {
TreeItem *ti = recent->create_item(root);
ti->set_text(0, l);
ti->set_icon(0, EditorNode::get_singleton()->get_class_icon(name, icon_fallback));
@ -263,15 +262,6 @@ bool CreateDialog::_is_type_prefered(const String &type) {
return ed.script_class_is_parent(type, preferred_search_result_type);
}
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;
}
return profile->is_class_disabled(p_class);
}
void CreateDialog::select_type(const String &p_type) {
TreeItem *to_select;
if (search_options_types.has(p_type)) {
@ -314,9 +304,6 @@ 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")) {
@ -612,7 +599,7 @@ void CreateDialog::_update_favorite_list() {
for (int i = 0; i < favorite_list.size(); i++) {
String l = favorite_list[i];
String name = l.split(" ")[0];
if (!((ClassDB::class_exists(name) || ScriptServer::is_global_class(name)) && !_is_class_disabled_by_feature_profile(name))) {
if (!((ClassDB::class_exists(name) || ScriptServer::is_global_class(name)))) {
continue;
}

View File

@ -84,7 +84,6 @@ class CreateDialog : public ConfirmationDialog {
bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const;
void drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from);
bool _is_class_disabled_by_feature_profile(const StringName &p_class);
bool _is_type_prefered(const String &type);
protected:

File diff suppressed because it is too large Load Diff

View File

@ -1,184 +0,0 @@
/*************************************************************************/
/* editor_feature_profile.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef EDITOR_FEATURE_PROFILE_H
#define EDITOR_FEATURE_PROFILE_H
#include "core/os/file_access.h"
#include "core/reference.h"
#include "editor/editor_file_dialog.h"
#include "editor_help.h"
#include "scene/gui/dialogs.h"
#include "scene/gui/option_button.h"
#include "scene/gui/separator.h"
#include "scene/gui/split_container.h"
#include "scene/gui/tree.h"
class EditorFeatureProfile : public Reference {
GDCLASS(EditorFeatureProfile, Reference);
public:
enum Feature {
FEATURE_3D,
FEATURE_SCRIPT,
FEATURE_ASSET_LIB,
FEATURE_SCENE_TREE,
FEATURE_NODE_DOCK,
FEATURE_FILESYSTEM_DOCK,
FEATURE_IMPORT_DOCK,
FEATURE_MAX
};
private:
Set<StringName> disabled_classes;
Set<StringName> disabled_editors;
Map<StringName, Set<StringName>> disabled_properties;
Set<StringName> collapsed_classes;
bool features_disabled[FEATURE_MAX];
static const char *feature_names[FEATURE_MAX];
static const char *feature_descriptions[FEATURE_MAX];
static const char *feature_identifiers[FEATURE_MAX];
String _get_feature_name(Feature p_feature) { return get_feature_name(p_feature); }
protected:
static void _bind_methods();
public:
void set_disable_class(const StringName &p_class, bool p_disabled);
bool is_class_disabled(const StringName &p_class) const;
void set_disable_class_editor(const StringName &p_class, bool p_disabled);
bool is_class_editor_disabled(const StringName &p_class) const;
void set_disable_class_property(const StringName &p_class, const StringName &p_property, bool p_disabled);
bool is_class_property_disabled(const StringName &p_class, const StringName &p_property) const;
bool has_class_properties_disabled(const StringName &p_class) const;
void set_item_collapsed(const StringName &p_class, bool p_collapsed);
bool is_item_collapsed(const StringName &p_class) const;
void set_disable_feature(Feature p_feature, bool p_disable);
bool is_feature_disabled(Feature p_feature) const;
Error save_to_file(const String &p_path);
Error load_from_file(const String &p_path);
static String get_feature_name(Feature p_feature);
static String get_feature_description(Feature p_feature);
EditorFeatureProfile();
};
VARIANT_ENUM_CAST(EditorFeatureProfile::Feature)
class EditorFeatureProfileManager : public AcceptDialog {
GDCLASS(EditorFeatureProfileManager, AcceptDialog);
enum Action {
PROFILE_CLEAR,
PROFILE_SET,
PROFILE_IMPORT,
PROFILE_EXPORT,
PROFILE_NEW,
PROFILE_ERASE,
PROFILE_MAX
};
enum ClassOptions {
CLASS_OPTION_DISABLE_EDITOR
};
ConfirmationDialog *erase_profile_dialog;
ConfirmationDialog *new_profile_dialog;
LineEdit *new_profile_name;
LineEdit *current_profile_name;
OptionButton *profile_list;
Button *profile_actions[PROFILE_MAX];
HSplitContainer *h_split;
VBoxContainer *class_list_vbc;
Tree *class_list;
VBoxContainer *property_list_vbc;
Tree *property_list;
EditorHelpBit *description_bit;
Label *no_profile_selected_help;
EditorFileDialog *import_profiles;
EditorFileDialog *export_profile;
void _profile_action(int p_action);
void _profile_selected(int p_what);
String current_profile;
void _update_profile_list(const String &p_select_profile = String());
void _update_selected_profile();
void _fill_classes_from(TreeItem *p_parent, const String &p_class, const String &p_selected);
Ref<EditorFeatureProfile> current;
Ref<EditorFeatureProfile> edited;
void _erase_selected_profile();
void _create_new_profile();
String _get_selected_profile();
void _import_profiles(const Vector<String> &p_paths);
void _export_profile(const String &p_path);
bool updating_features;
void _class_list_item_selected();
void _class_list_item_edited();
void _class_list_item_collapsed(Object *p_item);
void _property_item_edited();
void _save_and_update();
Timer *update_timer;
void _emit_current_profile_changed();
static EditorFeatureProfileManager *singleton;
protected:
static void _bind_methods();
void _notification(int p_what);
public:
Ref<EditorFeatureProfile> get_current_profile();
void notify_changed();
static EditorFeatureProfileManager *get_singleton() { return singleton; }
EditorFeatureProfileManager();
};
#endif // EDITOR_FEATURE_PROFILE_H

View File

@ -31,7 +31,6 @@
#include "editor_help_search.h"
#include "core/os/keyboard.h"
#include "editor_feature_profile.h"
#include "editor_node.h"
#include "editor_scale.h"
@ -248,27 +247,6 @@ EditorHelpSearch::EditorHelpSearch() {
vbox->add_child(results_tree, true);
}
bool EditorHelpSearch::Runner::_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 (!ClassDB::class_exists(class_name)) {
return false;
}
if (profile->is_class_disabled(class_name)) {
return true;
}
class_name = ClassDB::get_parent_class(class_name);
}
return false;
}
bool EditorHelpSearch::Runner::_slice() {
bool phase_done = false;
switch (phase) {
@ -317,56 +295,55 @@ bool EditorHelpSearch::Runner::_phase_match_classes_init() {
bool EditorHelpSearch::Runner::_phase_match_classes() {
DocData::ClassDoc &class_doc = iterator_doc->value();
if (!_is_class_disabled_by_feature_profile(class_doc.name)) {
matches[class_doc.name] = ClassMatch();
ClassMatch &match = matches[class_doc.name];
match.doc = &class_doc;
matches[class_doc.name] = ClassMatch();
ClassMatch &match = matches[class_doc.name];
// Match class name.
if (search_flags & SEARCH_CLASSES) {
match.name = term == "" || _match_string(term, class_doc.name);
match.doc = &class_doc;
// Match class name.
if (search_flags & SEARCH_CLASSES) {
match.name = term == "" || _match_string(term, class_doc.name);
}
// Match members if the term is long enough.
if (term.length() > 1) {
if (search_flags & SEARCH_METHODS) {
for (int i = 0; i < class_doc.methods.size(); i++) {
String method_name = (search_flags & SEARCH_CASE_SENSITIVE) ? class_doc.methods[i].name : class_doc.methods[i].name.to_lower();
if (method_name.find(term) > -1 ||
(term.begins_with(".") && method_name.begins_with(term.right(1))) ||
(term.ends_with("(") && method_name.ends_with(term.left(term.length() - 1).strip_edges())) ||
(term.begins_with(".") && term.ends_with("(") && method_name == term.substr(1, term.length() - 2).strip_edges())) {
match.methods.push_back(const_cast<DocData::MethodDoc *>(&class_doc.methods[i]));
}
}
}
// Match members if the term is long enough.
if (term.length() > 1) {
if (search_flags & SEARCH_METHODS) {
for (int i = 0; i < class_doc.methods.size(); i++) {
String method_name = (search_flags & SEARCH_CASE_SENSITIVE) ? class_doc.methods[i].name : class_doc.methods[i].name.to_lower();
if (method_name.find(term) > -1 ||
(term.begins_with(".") && method_name.begins_with(term.right(1))) ||
(term.ends_with("(") && method_name.ends_with(term.left(term.length() - 1).strip_edges())) ||
(term.begins_with(".") && term.ends_with("(") && method_name == term.substr(1, term.length() - 2).strip_edges())) {
match.methods.push_back(const_cast<DocData::MethodDoc *>(&class_doc.methods[i]));
}
if (search_flags & SEARCH_SIGNALS) {
for (int i = 0; i < class_doc.signals.size(); i++) {
if (_match_string(term, class_doc.signals[i].name)) {
match.signals.push_back(const_cast<DocData::MethodDoc *>(&class_doc.signals[i]));
}
}
if (search_flags & SEARCH_SIGNALS) {
for (int i = 0; i < class_doc.signals.size(); i++) {
if (_match_string(term, class_doc.signals[i].name)) {
match.signals.push_back(const_cast<DocData::MethodDoc *>(&class_doc.signals[i]));
}
}
if (search_flags & SEARCH_CONSTANTS) {
for (int i = 0; i < class_doc.constants.size(); i++) {
if (_match_string(term, class_doc.constants[i].name)) {
match.constants.push_back(const_cast<DocData::ConstantDoc *>(&class_doc.constants[i]));
}
}
if (search_flags & SEARCH_CONSTANTS) {
for (int i = 0; i < class_doc.constants.size(); i++) {
if (_match_string(term, class_doc.constants[i].name)) {
match.constants.push_back(const_cast<DocData::ConstantDoc *>(&class_doc.constants[i]));
}
}
if (search_flags & SEARCH_PROPERTIES) {
for (int i = 0; i < class_doc.properties.size(); i++) {
if (_match_string(term, class_doc.properties[i].name) || _match_string(term, class_doc.properties[i].getter) || _match_string(term, class_doc.properties[i].setter)) {
match.properties.push_back(const_cast<DocData::PropertyDoc *>(&class_doc.properties[i]));
}
}
if (search_flags & SEARCH_PROPERTIES) {
for (int i = 0; i < class_doc.properties.size(); i++) {
if (_match_string(term, class_doc.properties[i].name) || _match_string(term, class_doc.properties[i].getter) || _match_string(term, class_doc.properties[i].setter)) {
match.properties.push_back(const_cast<DocData::PropertyDoc *>(&class_doc.properties[i]));
}
}
}
if (search_flags & SEARCH_THEME_ITEMS) {
for (int i = 0; i < class_doc.theme_properties.size(); i++) {
if (_match_string(term, class_doc.theme_properties[i].name)) {
match.theme_properties.push_back(const_cast<DocData::ThemeItemDoc *>(&class_doc.theme_properties[i]));
}
}
if (search_flags & SEARCH_THEME_ITEMS) {
for (int i = 0; i < class_doc.theme_properties.size(); i++) {
if (_match_string(term, class_doc.theme_properties[i].name)) {
match.theme_properties.push_back(const_cast<DocData::ThemeItemDoc *>(&class_doc.theme_properties[i]));
}
}
}

View File

@ -126,8 +126,6 @@ class EditorHelpSearch::Runner : public Reference {
TreeItem *matched_item;
float match_highest_score = 0;
bool _is_class_disabled_by_feature_profile(const StringName &p_class);
bool _slice();
bool _phase_match_classes_init();
bool _phase_match_classes();

View File

@ -34,7 +34,6 @@
#include "core/os/input.h"
#include "core/os/keyboard.h"
#include "dictionary_property_edit.h"
#include "editor_feature_profile.h"
#include "editor_node.h"
#include "editor_property_name_processor.h"
#include "editor_scale.h"
@ -1352,28 +1351,6 @@ void EditorInspector::_parse_added_editors(VBoxContainer *current_vbox, Ref<Edit
ped->added_editors.clear();
}
bool EditorInspector::_is_property_disabled_by_feature_profile(const StringName &p_property) {
Ref<EditorFeatureProfile> profile = EditorFeatureProfileManager::get_singleton()->get_current_profile();
if (profile.is_null()) {
return false;
}
StringName class_name = object->get_class();
while (class_name != StringName()) {
if (profile->is_class_property_disabled(class_name, p_property)) {
return true;
}
if (profile->is_class_disabled(class_name)) {
//won't see properties of a disabled class
return true;
}
class_name = ClassDB::get_parent_class(class_name);
}
return false;
}
void EditorInspector::update_tree() {
//to update properly if all is refreshed
StringName current_selected = property_selected;
@ -1517,7 +1494,7 @@ void EditorInspector::update_tree() {
continue;
} else if (!(p.usage & PROPERTY_USAGE_EDITOR) || _is_property_disabled_by_feature_profile(p.name)) {
} else if (!(p.usage & PROPERTY_USAGE_EDITOR)) {
continue;
}
@ -2196,7 +2173,6 @@ void EditorInspector::_node_removed(Node *p_node) {
void EditorInspector::_notification(int p_what) {
if (p_what == NOTIFICATION_READY) {
EditorFeatureProfileManager::get_singleton()->connect("current_feature_profile_changed", this, "_feature_profile_changed");
_update_inspector_bg();
}
@ -2293,10 +2269,6 @@ String EditorInspector::get_object_class() const {
return object_class;
}
void EditorInspector::_feature_profile_changed() {
update_tree();
}
void EditorInspector::_bind_methods() {
ClassDB::bind_method("_property_changed", &EditorInspector::_property_changed, DEFVAL(""), DEFVAL(false));
ClassDB::bind_method("_multiple_properties_changed", &EditorInspector::_multiple_properties_changed);
@ -2313,7 +2285,6 @@ void EditorInspector::_bind_methods() {
ClassDB::bind_method("_resource_selected", &EditorInspector::_resource_selected);
ClassDB::bind_method("_object_id_selected", &EditorInspector::_object_id_selected);
ClassDB::bind_method("_vscroll_changed", &EditorInspector::_vscroll_changed);
ClassDB::bind_method("_feature_profile_changed", &EditorInspector::_feature_profile_changed);
ClassDB::bind_method("refresh", &EditorInspector::refresh);

View File

@ -339,10 +339,6 @@ class EditorInspector : public ScrollContainer {
void _vscroll_changed(double);
void _feature_profile_changed();
bool _is_property_disabled_by_feature_profile(const StringName &p_property);
void _update_inspector_bg();
protected:

View File

@ -72,7 +72,6 @@
#include "editor/editor_about.h"
#include "editor/editor_audio_buses.h"
#include "editor/editor_export.h"
#include "editor/editor_feature_profile.h"
#include "editor/editor_file_system.h"
#include "editor/editor_help.h"
#include "editor/editor_inspector.h"
@ -493,8 +492,6 @@ void EditorNode::_notification(int p_what) {
VisualServer::get_singleton()->viewport_set_hide_canvas(get_scene_root()->get_viewport_rid(), true);
VisualServer::get_singleton()->viewport_set_disable_environment(get_viewport()->get_viewport_rid(), true);
feature_profile_manager->notify_changed();
if (!main_editor_buttons[EDITOR_3D]->is_visible()) { //may be hidden due to feature profile
_editor_select(EDITOR_2D);
} else {
@ -1350,10 +1347,7 @@ void EditorNode::_save_scene_with_preview(String p_file, int p_idx) {
// The 3D editor may be disabled as a feature, but scenes can still be opened.
// This check prevents the preview from regenerating in case those scenes are then saved.
// The preview will be generated if no feature profile is set (as the 3D editor is enabled by default).
Ref<EditorFeatureProfile> profile = feature_profile_manager->get_current_profile();
if (!profile.is_valid() || !profile->is_feature_disabled(EditorFeatureProfile::FEATURE_3D)) {
img = SpatialEditor::get_singleton()->get_editor_viewport(0)->get_viewport_node()->get_texture()->get_data();
}
img = SpatialEditor::get_singleton()->get_editor_viewport(0)->get_viewport_node()->get_texture()->get_data();
}
if (img.is_valid() && img->get_width() > 0 && img->get_height() > 0) {
@ -1853,10 +1847,6 @@ void EditorNode::_dialog_action(String p_file) {
}
bool EditorNode::item_has_editor(Object *p_object) {
if (_is_class_editor_disabled_by_feature_profile(p_object->get_class())) {
return false;
}
return editor_data.get_subeditors(p_object).size() > 0;
}
@ -1864,34 +1854,10 @@ void EditorNode::edit_item_resource(RES p_resource) {
edit_item(p_resource.ptr());
}
bool EditorNode::_is_class_editor_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;
}
if (profile->is_class_editor_disabled(class_name)) {
return true;
}
class_name = ClassDB::get_parent_class(class_name);
}
return false;
}
void EditorNode::edit_item(Object *p_object) {
Vector<EditorPlugin *> sub_plugins;
if (p_object) {
if (_is_class_editor_disabled_by_feature_profile(p_object->get_class())) {
return;
}
sub_plugins = editor_data.get_subeditors(p_object);
}
@ -2140,9 +2106,7 @@ void EditorNode::_edit_current(bool p_skip_foreign) {
Vector<EditorPlugin *> sub_plugins;
if (!_is_class_editor_disabled_by_feature_profile(current_obj->get_class())) {
sub_plugins = editor_data.get_subeditors(current_obj);
}
sub_plugins = editor_data.get_subeditors(current_obj);
if (!sub_plugins.empty()) {
_display_top_editors(false);
@ -2822,9 +2786,6 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
custom_build_manage_templates->hide();
file_android_build_source->popup_centered_ratio();
} break;
case SETTINGS_MANAGE_FEATURE_PROFILES: {
feature_profile_manager->popup_centered_clamped(Size2(900, 800) * EDSCALE, 0.8);
} break;
case SETTINGS_TOGGLE_FULLSCREEN: {
OS::get_singleton()->set_window_fullscreen(!OS::get_singleton()->is_window_fullscreen());
@ -3859,7 +3820,6 @@ void EditorNode::register_editor_types() {
ClassDB::register_class<EditorProperty>();
ClassDB::register_class<AnimationTrackEditPlugin>();
ClassDB::register_class<ScriptCreateDialog>();
ClassDB::register_class<EditorFeatureProfile>();
ClassDB::register_class<EditorSpinSlider>();
ClassDB::register_class<EditorResourcePicker>();
ClassDB::register_class<EditorScriptPicker>();
@ -5551,39 +5511,6 @@ void EditorNode::_resource_loaded(RES p_resource, const String &p_path) {
singleton->editor_folding.load_resource_folding(p_resource, p_path);
}
void EditorNode::_feature_profile_changed() {
Ref<EditorFeatureProfile> profile = feature_profile_manager->get_current_profile();
TabContainer *import_tabs = cast_to<TabContainer>(import_dock->get_parent());
TabContainer *node_tabs = cast_to<TabContainer>(node_dock->get_parent());
TabContainer *fs_tabs = cast_to<TabContainer>(filesystem_dock->get_parent());
if (profile.is_valid()) {
node_tabs->set_tab_hidden(node_dock->get_index(), profile->is_feature_disabled(EditorFeatureProfile::FEATURE_NODE_DOCK));
// The Import dock is useless without the FileSystem dock. Ensure the configuration is valid.
bool fs_dock_disabled = profile->is_feature_disabled(EditorFeatureProfile::FEATURE_FILESYSTEM_DOCK);
fs_tabs->set_tab_hidden(filesystem_dock->get_index(), fs_dock_disabled);
import_tabs->set_tab_hidden(import_dock->get_index(), fs_dock_disabled || profile->is_feature_disabled(EditorFeatureProfile::FEATURE_IMPORT_DOCK));
main_editor_buttons[EDITOR_3D]->set_visible(!profile->is_feature_disabled(EditorFeatureProfile::FEATURE_3D));
main_editor_buttons[EDITOR_SCRIPT]->set_visible(!profile->is_feature_disabled(EditorFeatureProfile::FEATURE_SCRIPT));
if ((profile->is_feature_disabled(EditorFeatureProfile::FEATURE_3D) && singleton->main_editor_buttons[EDITOR_3D]->is_pressed()) ||
(profile->is_feature_disabled(EditorFeatureProfile::FEATURE_SCRIPT) && singleton->main_editor_buttons[EDITOR_SCRIPT]->is_pressed())) {
_editor_select(EDITOR_2D);
}
} else {
import_tabs->set_tab_hidden(import_dock->get_index(), false);
node_tabs->set_tab_hidden(node_dock->get_index(), false);
fs_tabs->set_tab_hidden(filesystem_dock->get_index(), false);
import_dock->set_visible(true);
node_dock->set_visible(true);
filesystem_dock->set_visible(true);
main_editor_buttons[EDITOR_3D]->set_visible(true);
main_editor_buttons[EDITOR_SCRIPT]->set_visible(true);
}
_update_dock_slots_visibility();
}
void EditorNode::_bind_methods() {
GLOBAL_DEF("editor/scene/scene_naming", SCENE_NAME_CASING_AUTO);
ProjectSettings::get_singleton()->set_custom_property_info("editor/scene/scene_naming", PropertyInfo(Variant::INT, "editor/scene/scene_naming", PROPERTY_HINT_ENUM, "Auto,PascalCase,snake_case"));
@ -5676,7 +5603,6 @@ void EditorNode::_bind_methods() {
ClassDB::bind_method(D_METHOD("_reload_modified_scenes"), &EditorNode::_reload_modified_scenes);
ClassDB::bind_method(D_METHOD("_reload_project_settings"), &EditorNode::_reload_project_settings);
ClassDB::bind_method(D_METHOD("_resave_scenes"), &EditorNode::_resave_scenes);
ClassDB::bind_method(D_METHOD("_feature_profile_changed"), &EditorNode::_feature_profile_changed);
ClassDB::bind_method("_screenshot", &EditorNode::_screenshot);
ClassDB::bind_method("_request_screenshot", &EditorNode::_request_screenshot);
@ -6249,12 +6175,6 @@ EditorNode::EditorNode() {
export_template_manager = memnew(ExportTemplateManager);
gui_base->add_child(export_template_manager);
feature_profile_manager = memnew(EditorFeatureProfileManager);
gui_base->add_child(feature_profile_manager);
about = memnew(EditorAbout);
gui_base->add_child(about);
feature_profile_manager->connect("current_feature_profile_changed", this, "_feature_profile_changed");
warning = memnew(AcceptDialog);
warning->add_button(TTR("Copy Text"), true, "copy");
gui_base->add_child(warning);
@ -6464,7 +6384,6 @@ EditorNode::EditorNode() {
}
p->add_separator();
p->add_item(TTR("Manage Editor Features..."), SETTINGS_MANAGE_FEATURE_PROFILES);
p->add_item(TTR("Manage Export Templates..."), SETTINGS_MANAGE_EXPORT_TEMPLATES);
// Help Menu

View File

@ -54,7 +54,6 @@ class DependencyEditor;
class DependencyErrorDialog;
class EditorAbout;
class EditorExport;
class EditorFeatureProfileManager;
class EditorFileServer;
class EditorInspector;
class EditorLayoutsDialog;
@ -188,7 +187,6 @@ private:
SETTINGS_EDITOR_DATA_FOLDER,
SETTINGS_EDITOR_CONFIG_FOLDER,
SETTINGS_MANAGE_EXPORT_TEMPLATES,
SETTINGS_MANAGE_FEATURE_PROFILES,
SETTINGS_INSTALL_ANDROID_BUILD_TEMPLATE,
SETTINGS_PICK_MAIN_SCENE,
SETTINGS_TOGGLE_FULLSCREEN,
@ -337,7 +335,6 @@ private:
PopupMenu *vcs_actions_menu;
EditorFileDialog *file;
ExportTemplateManager *export_template_manager;
EditorFeatureProfileManager *feature_profile_manager;
EditorFileDialog *file_templates;
EditorFileDialog *file_export_lib;
EditorFileDialog *file_script;
@ -663,8 +660,6 @@ private:
void _reload_project_settings();
void _resave_scenes(String p_str);
void _feature_profile_changed();
bool _is_class_editor_disabled_by_feature_profile(const StringName &p_class);
Ref<ImageTexture> _load_custom_class_icon(const String &p_path) const;
static String _to_absolute_plugin_path(const String &p_path);

View File

@ -37,7 +37,6 @@
#include "core/os/keyboard.h"
#include "core/os/os.h"
#include "core/project_settings.h"
#include "editor_feature_profile.h"
#include "editor_node.h"
#include "editor_resource_preview.h"
#include "editor_scale.h"
@ -105,11 +104,6 @@ bool FileSystemDock::_create_tree(TreeItem *p_parent, EditorFileSystemDirectory
for (int i = 0; i < p_dir->get_file_count(); i++) {
String file_type = p_dir->get_file_type(i);
if (_is_file_type_disabled_by_feature_profile(file_type)) {
// If type is disabled, file won't be displayed.
continue;
}
String file_name = p_dir->get_file(i);
if (searched_string.length() > 0) {
if (file_name.to_lower().find(searched_string) < 0) {
@ -324,7 +318,6 @@ void FileSystemDock::_notification(int p_what) {
return;
}
initialized = true;
EditorFeatureProfileManager::get_singleton()->connect("current_feature_profile_changed", this, "_feature_profile_changed");
EditorFileSystem::get_singleton()->connect("filesystem_changed", this, "_fs_changed");
EditorResourcePreview::get_singleton()->connect("preview_invalidated", this, "_preview_invalidated");
@ -578,24 +571,6 @@ void FileSystemDock::_set_file_display(bool p_active) {
_update_file_list(true);
}
bool FileSystemDock::_is_file_type_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 FileSystemDock::_search(EditorFileSystemDirectory *p_path, List<FileInfo> *matches, int p_max_items) {
if (matches->size() > p_max_items) {
return;
@ -615,11 +590,6 @@ void FileSystemDock::_search(EditorFileSystemDirectory *p_path, List<FileInfo> *
fi.path = p_path->get_file_path(i);
fi.import_broken = !p_path->get_file_import_is_valid(i);
if (_is_file_type_disabled_by_feature_profile(fi.type)) {
// This type is disabled, will not appear here.
continue;
}
matches->push_back(fi);
if (matches->size() > p_max_items) {
return;
@ -2689,10 +2659,6 @@ void FileSystemDock::_update_import_dock() {
import_dock_needs_update = false;
}
void FileSystemDock::_feature_profile_changed() {
_update_display_mode(true);
}
void FileSystemDock::set_file_sort(FileSortOption p_file_sort) {
for (int i = 0; i != FILE_SORT_MAX; i++) {
tree_button_sort->get_popup()->set_item_checked(i, (i == (int)p_file_sort));
@ -2779,8 +2745,6 @@ void FileSystemDock::_bind_methods() {
ClassDB::bind_method(D_METHOD("_file_multi_selected"), &FileSystemDock::_file_multi_selected);
ClassDB::bind_method(D_METHOD("_update_import_dock"), &FileSystemDock::_update_import_dock);
ClassDB::bind_method(D_METHOD("_feature_profile_changed"), &FileSystemDock::_feature_profile_changed);
ADD_SIGNAL(MethodInfo("inherit", PropertyInfo(Variant::STRING, "file")));
ADD_SIGNAL(MethodInfo("instance", PropertyInfo(Variant::POOL_STRING_ARRAY, "files")));

View File

@ -299,9 +299,6 @@ private:
Vector<String> _tree_get_selected(bool remove_self_inclusion = true);
bool _is_file_type_disabled_by_feature_profile(const StringName &p_class);
void _feature_profile_changed();
Vector<String> _remove_self_included_paths(Vector<String> selected_strings);
protected:

View File

@ -34,7 +34,6 @@
#include "core/os/input.h"
#include "core/os/keyboard.h"
#include "core/project_settings.h"
#include "editor/editor_feature_profile.h"
#include "editor/editor_node.h"
#include "editor/editor_scale.h"
#include "editor/editor_settings.h"
@ -1223,8 +1222,6 @@ void SceneTreeDock::_notification(int p_what) {
}
first_enter = false;
EditorFeatureProfileManager::get_singleton()->connect("current_feature_profile_changed", this, "_feature_profile_changed");
CanvasItemEditorPlugin *canvas_item_plugin = Object::cast_to<CanvasItemEditorPlugin>(editor_data->get_editor("2D"));
if (canvas_item_plugin) {
canvas_item_plugin->get_canvas_item_editor()->connect("item_lock_status_changed", scene_tree, "_update_tree");
@ -3077,31 +3074,6 @@ void SceneTreeDock::_favorite_root_selected(const String &p_class) {
_tool_selected(TOOL_CREATE_FAVORITE, false);
}
void SceneTreeDock::_feature_profile_changed() {
Ref<EditorFeatureProfile> profile = EditorFeatureProfileManager::get_singleton()->get_current_profile();
if (profile.is_valid()) {
profile_allow_editing = !profile->is_feature_disabled(EditorFeatureProfile::FEATURE_SCENE_TREE);
profile_allow_script_editing = !profile->is_feature_disabled(EditorFeatureProfile::FEATURE_SCRIPT);
bool profile_allow_3d = !profile->is_feature_disabled(EditorFeatureProfile::FEATURE_3D);
button_3d->set_visible(profile_allow_3d);
button_add->set_visible(profile_allow_editing);
button_instance->set_visible(profile_allow_editing);
scene_tree->set_can_rename(profile_allow_editing);
} else {
button_3d->set_visible(true);
button_add->set_visible(true);
button_instance->set_visible(true);
scene_tree->set_can_rename(true);
profile_allow_editing = true;
profile_allow_script_editing = true;
}
_update_script_button();
}
void SceneTreeDock::_clear_clipboard() {
for (List<Node *>::Element *E = node_clipboard.front(); E; E = E->next()) {
memdelete(E->get());
@ -3207,7 +3179,6 @@ void SceneTreeDock::_bind_methods() {
ClassDB::bind_method(D_METHOD("_update_script_button"), &SceneTreeDock::_update_script_button);
ClassDB::bind_method(D_METHOD("_favorite_root_selected"), &SceneTreeDock::_favorite_root_selected);
ClassDB::bind_method(D_METHOD("_update_create_root_dialog"), &SceneTreeDock::_update_create_root_dialog);
ClassDB::bind_method(D_METHOD("_feature_profile_changed"), &SceneTreeDock::_feature_profile_changed);
ClassDB::bind_method(D_METHOD("instance"), &SceneTreeDock::instance);
ClassDB::bind_method(D_METHOD("get_tree_editor"), &SceneTreeDock::get_tree_editor);

View File

@ -249,8 +249,6 @@ class SceneTreeDock : public VBoxContainer {
void _update_create_root_dialog();
void _favorite_root_selected(const String &p_class);
void _feature_profile_changed();
void _clear_clipboard();
void _create_remap_for_node(Node *p_node, Map<RES, RES> &r_remap);
void _create_remap_for_resource(RES p_resource, Map<RES, RES> &r_remap);

View File

@ -976,7 +976,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
#ifdef TOOLS_ENABLED
if (editor) {
packed_data->set_disabled(true);
globals->set_disable_feature_overrides(true);
}
#endif