Bläddra i källkod

Merge pull request #62209 from akien-mga/3.x-fix-editor-ProjectSettings

Rémi Verschelde 3 år sedan
förälder
incheckning
faf8a7b19e

+ 5 - 2
core/project_settings.cpp

@@ -1096,14 +1096,17 @@ 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", "");
+	GLOBAL_DEF("editor/version_control_autoload_on_startup", false);
+	GLOBAL_DEF("editor/version_control_plugin_name", "");
 
 	action = Dictionary();
 	action["deadzone"] = Variant(0.5f);

+ 8 - 2
doc/classes/ProjectSettings.xml

@@ -530,16 +530,22 @@
 			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">
+		<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;">
+		<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="gui/common/default_scroll_deadzone" type="int" setter="" getter="" default="0">

+ 1 - 4
editor/editor_node.cpp

@@ -2453,7 +2453,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;
@@ -5650,9 +5650,6 @@ void EditorNode::_feature_profile_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);

+ 4 - 4
editor/plugins/version_control_editor_plugin.cpp

@@ -84,8 +84,8 @@ void VersionControlEditorPlugin::_bind_methods() {
 
 void VersionControlEditorPlugin::_notification(int p_what) {
 	if (p_what == NOTIFICATION_READY) {
-		String installed_plugin = GLOBAL_GET("editor/version_control/plugin_name");
-		bool has_autoload_enable = GLOBAL_GET("editor/version_control/autoload_on_startup");
+		String installed_plugin = GLOBAL_GET("editor/version_control_plugin_name");
+		bool has_autoload_enable = GLOBAL_GET("editor/version_control_autoload_on_startup");
 
 		if (installed_plugin != "" && has_autoload_enable) {
 			if (_load_plugin(installed_plugin)) {
@@ -139,8 +139,8 @@ void VersionControlEditorPlugin::_initialize_vcs() {
 	if (_load_plugin(selected_plugin)) {
 		_set_up();
 
-		ProjectSettings::get_singleton()->set("editor/version_control/autoload_on_startup", true);
-		ProjectSettings::get_singleton()->set("editor/version_control/plugin_name", selected_plugin);
+		ProjectSettings::get_singleton()->set("editor/version_control_autoload_on_startup", true);
+		ProjectSettings::get_singleton()->set("editor/version_control_plugin_name", selected_plugin);
 		ProjectSettings::get_singleton()->save();
 	}
 }