Ported: ProjectSettings: Ensure 'editor/' settings aren't nested

Having a mix of settings with and without subcategory makes the 'Editor'
section stand out with a weird UX, as instead of simply being a foldable
section like the others, it also holds its own top-level settings and is
therefore selectable.
This wasn't the case in 3.4, and is fixed in 4.0 by refactoring, so for
3.5 we should preserve the 3.4 UX, even if it's not the best.
- akien-mga
acd4a01b8c
This commit is contained in:
Relintai 2022-07-29 10:45:12 +02:00
parent 36afe803a9
commit 8ca3043a28
3 changed files with 10 additions and 18 deletions

View File

@ -1066,15 +1066,15 @@ ProjectSettings::ProjectSettings() {
GLOBAL_DEF("editor/main_run_args", "");
GLOBAL_DEF("editor/scene_naming", 0); // Sync enum values with EditorNode.
ProjectSettings::get_singleton()->set_custom_property_info("editor/scene_naming", PropertyInfo(Variant::INT, "editor/scene_naming", PROPERTY_HINT_ENUM, "Auto,PascalCase,snake_case"));
GLOBAL_DEF("editor/search_in_file_extensions", extensions);
custom_prop_info["editor/search_in_file_extensions"] = PropertyInfo(Variant::POOL_STRING_ARRAY, "editor/search_in_file_extensions");
GLOBAL_DEF("editor/script_templates_search_path", "res://script_templates");
custom_prop_info["editor/script_templates_search_path"] = PropertyInfo(Variant::STRING, "editor/script_templates_search_path", PROPERTY_HINT_DIR);
GLOBAL_DEF("editor/version_control/autoload_on_startup", false);
GLOBAL_DEF("editor/version_control/plugin_name", "");
action = Dictionary();
action["deadzone"] = Variant(0.5f);
events = Array();

View File

@ -527,18 +527,18 @@
prime-run %command%
[/codeblock]
</member>
<member name="editor/scene_naming" type="int" setter="" getter="" default="0">
Default naming style for scene files to infer from their root nodes. Possible options are:
- [code]0[/code] (Auto): Uses the scene root name as is without changing its casing.
- [code]1[/code] (PascalCase): Converts the scene root name to PascalCase casing.
- [code]2[/code] (snake_case): Converts the scene root name to snake_case casing.
</member>
<member name="editor/script_templates_search_path" type="String" setter="" getter="" default="&quot;res://script_templates&quot;">
Search path for project-specific script templates. Godot will search for script templates both in the editor-specific path and in this project-specific path.
</member>
<member name="editor/search_in_file_extensions" type="PoolStringArray" setter="" getter="" default="PoolStringArray( &quot;gd&quot;, &quot;gdshader&quot;, &quot;shader&quot; )">
Text-based file extensions to include in the script editor's "Find in Files" feature. You can add e.g. [code]tscn[/code] if you wish to also parse your scene files, especially if you use built-in scripts which are serialized in the scene files.
</member>
<member name="editor/version_control/autoload_on_startup" type="bool" setter="" getter="" default="false">
Load the previously opened VCS plugin when the editor starts up. This is set to [code]true[/code] whenever a new VCS plugin is initialized.
</member>
<member name="editor/version_control/plugin_name" type="String" setter="" getter="" default="&quot;&quot;">
Last loaded VCS plugin name. Used to autoload the plugin when the editor starts up.
</member>
<member name="ess/data/automatic_load" type="bool" setter="" getter="" default="false">
</member>
<member name="ess/data/ess_resource_db_path" type="String" setter="" getter="" default="&quot;&quot;">

View File

@ -2376,7 +2376,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
} else if (extensions.size()) {
String root_name = scene->get_name();
// Very similar to node naming logic.
switch (ProjectSettings::get_singleton()->get("editor/scene/scene_naming").operator int()) {
switch (ProjectSettings::get_singleton()->get("editor/scene_naming").operator int()) {
case SCENE_NAME_CASING_AUTO:
// Use casing of the root node.
break;
@ -5483,9 +5483,6 @@ void EditorNode::_project_settings_changed() {
}
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"));
ClassDB::bind_method("_menu_option", &EditorNode::_menu_option);
ClassDB::bind_method("_tool_menu_option", &EditorNode::_tool_menu_option);
ClassDB::bind_method("_menu_confirm_current", &EditorNode::_menu_confirm_current);
@ -5853,11 +5850,6 @@ EditorNode::EditorNode() {
EDITOR_DEF("interface/inspector/default_color_picker_mode", 0);
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT, "interface/inspector/default_color_picker_mode", PROPERTY_HINT_ENUM, "RGB,HSV,RAW", PROPERTY_USAGE_DEFAULT));
EDITOR_DEF("run/auto_save/save_before_running", true);
EDITOR_DEF("version_control/username", "");
EDITOR_DEF("version_control/ssh_public_key_path", "");
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "version_control/ssh_public_key_path", PROPERTY_HINT_GLOBAL_FILE));
EDITOR_DEF("version_control/ssh_private_key_path", "");
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "version_control/ssh_private_key_path", PROPERTY_HINT_GLOBAL_FILE));
theme_base = memnew(Control);
add_child(theme_base);