diff options
author | Ninni Pipping <over999ships@gmail.com> | 2023-03-10 15:09:56 +0100 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2023-03-30 19:26:05 +0200 |
commit | 1e948814845864ca5796d5ebddb985f509a33c8c (patch) | |
tree | 51b6addfeb15916c7ff8016c6731688bafbb8580 | |
parent | d6b36e800dfa8970c6bdeab2ed9a0e027e30068b (diff) |
Exposing more project settings for documentation
(cherry picked from commit bd30847e5916f4ca8a855774cb32a160e690e71d)
-rw-r--r-- | core/config/project_settings.cpp | 15 | ||||
-rw-r--r-- | doc/classes/ProjectSettings.xml | 40 | ||||
-rw-r--r-- | doc/classes/SceneTree.xml | 4 | ||||
-rw-r--r-- | editor/editor_file_system.cpp | 3 | ||||
-rw-r--r-- | editor/export/editor_export.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/version_control_editor_plugin.cpp | 4 | ||||
-rw-r--r-- | editor/register_editor_types.cpp | 8 | ||||
-rw-r--r-- | main/main.cpp | 16 |
8 files changed, 72 insertions, 20 deletions
diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index 123e01860e..ac5499d709 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -1270,6 +1270,10 @@ ProjectSettings::ProjectSettings() { GLOBAL_DEF("application/config/custom_user_dir_name", ""); GLOBAL_DEF("application/config/project_settings_override", ""); + GLOBAL_DEF("application/run/main_loop_type", "SceneTree"); + GLOBAL_DEF("application/config/auto_accept_quit", true); + GLOBAL_DEF("application/config/quit_on_go_back", true); + // The default window size is tuned to: // - Have a 16:9 aspect ratio, // - Have both dimensions divisible by 8 to better play along with video recording, @@ -1314,12 +1318,17 @@ ProjectSettings::ProjectSettings() { // Keep the enum values in sync with the `DisplayServer::ScreenOrientation` enum. custom_prop_info["display/window/handheld/orientation"] = PropertyInfo(Variant::INT, "display/window/handheld/orientation", PROPERTY_HINT_ENUM, "Landscape,Portrait,Reverse Landscape,Reverse Portrait,Sensor Landscape,Sensor Portrait,Sensor"); + GLOBAL_DEF("display/window/subwindows/embed_subwindows", true); // Keep the enum values in sync with the `DisplayServer::VSyncMode` enum. custom_prop_info["display/window/vsync/vsync_mode"] = PropertyInfo(Variant::INT, "display/window/vsync/vsync_mode", PROPERTY_HINT_ENUM, "Disabled,Enabled,Adaptive,Mailbox"); custom_prop_info["rendering/driver/threads/thread_model"] = PropertyInfo(Variant::INT, "rendering/driver/threads/thread_model", PROPERTY_HINT_ENUM, "Single-Unsafe,Single-Safe,Multi-Threaded"); GLOBAL_DEF("physics/2d/run_on_separate_thread", false); GLOBAL_DEF("physics/3d/run_on_separate_thread", false); + GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "display/window/stretch/mode", PROPERTY_HINT_ENUM, "disabled,canvas_items,viewport"), "disabled"); + GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "display/window/stretch/aspect", PROPERTY_HINT_ENUM, "ignore,keep,keep_width,keep_height,expand"), "keep"); + GLOBAL_DEF_BASIC(PropertyInfo(Variant::FLOAT, "display/window/stretch/scale", PROPERTY_HINT_RANGE, "0.5,8.0,0.01"), 1.0); + GLOBAL_DEF(PropertyInfo(Variant::INT, "debug/settings/profiler/max_functions", PROPERTY_HINT_RANGE, "128,65535,1"), 16384); GLOBAL_DEF(PropertyInfo(Variant::BOOL, "compression/formats/zstd/long_distance_matching"), Compression::zstd_long_distance_matching); @@ -1339,11 +1348,17 @@ ProjectSettings::ProjectSettings() { GLOBAL_DEF(PropertyInfo(Variant::INT, "gui/timers/incremental_search_max_interval_msec", PROPERTY_HINT_RANGE, "0,10000,1,or_greater"), 2000); + GLOBAL_DEF_BASIC("gui/common/snap_controls_to_pixels", true); + GLOBAL_DEF_BASIC("gui/fonts/dynamic_fonts/use_oversampling", true); + GLOBAL_DEF("rendering/rendering_device/staging_buffer/block_size_kb", 256); GLOBAL_DEF("rendering/rendering_device/staging_buffer/max_size_mb", 128); GLOBAL_DEF("rendering/rendering_device/staging_buffer/texture_upload_region_size_px", 64); GLOBAL_DEF("rendering/rendering_device/vulkan/max_descriptors_per_pool", 64); + GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "rendering/textures/canvas_textures/default_texture_filter", PROPERTY_HINT_ENUM, "Nearest,Linear,Linear Mipmap,Nearest Mipmap"), 1); + GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "rendering/textures/canvas_textures/default_texture_repeat", PROPERTY_HINT_ENUM, "Disable,Enable,Mirror"), 0); + // These properties will not show up in the dialog nor in the documentation. If you want to exclude whole groups, see _get_property_list() method. GLOBAL_DEF_INTERNAL("application/config/features", PackedStringArray()); GLOBAL_DEF_INTERNAL("internationalization/locale/translation_remaps", PackedStringArray()); diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 4ea113e7b1..da5f02aebb 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -241,6 +241,9 @@ <member name="application/boot_splash/use_filter" type="bool" setter="" getter="" default="true"> If [code]true[/code], applies linear filtering when scaling the image (recommended for high-resolution artwork). If [code]false[/code], uses nearest-neighbor interpolation (recommended for pixel art). </member> + <member name="application/config/auto_accept_quit" type="bool" setter="" getter="" default="true"> + If [code]true[/code], the application automatically accepts quitting requests. + </member> <member name="application/config/custom_user_dir_name" type="String" setter="" getter="" default=""""> This user directory is used for storing persistent data ([code]user://[/code] filesystem). If a custom directory name is defined, this name will be appended to the system-specific user data directory (same parent folder as the Godot configuration folder documented in [method OS.get_user_data_dir]). The [member application/config/use_custom_user_dir] setting must be enabled for this to take effect. @@ -265,6 +268,9 @@ Specifies a file to override project settings. For example: [code]user://custom_settings.cfg[/code]. See "Overriding" in the [ProjectSettings] class description at the top for more information. [b]Note:[/b] Regardless of this setting's value, [code]res://override.cfg[/code] will still be read to override the project settings. </member> + <member name="application/config/quit_on_go_back" type="bool" setter="" getter="" default="true"> + If [code]true[/code], the application quits automatically when navigating back (e.g. using the system "Back" button on Android). + </member> <member name="application/config/use_custom_user_dir" type="bool" setter="" getter="" default="false"> If [code]true[/code], the project will save user data to its own user directory. If [member application/config/custom_user_dir_name] is empty, [code]<OS user data directory>/<project name>[/code] directory will be used. If [code]false[/code], the project will save user data to [code]<OS user data directory>/Godot/app_userdata/<project name>[/code]. See also [url=$DOCS_URL/tutorials/io/data_paths.html#accessing-persistent-user-data-user]File paths in Godot projects[/url]. This setting is only effective on desktop platforms. @@ -305,6 +311,9 @@ <member name="application/run/low_processor_mode_sleep_usec" type="int" setter="" getter="" default="6900"> Amount of sleeping between frames when the low-processor usage mode is enabled (in microseconds). Higher values will result in lower CPU usage. </member> + <member name="application/run/main_loop_type" type="String" setter="" getter="" default=""SceneTree""> + The name of the type implementing the engine's main loop. + </member> <member name="application/run/main_scene" type="String" setter="" getter="" default=""""> Path to the main scene file that will be loaded when the project runs. </member> @@ -698,6 +707,15 @@ On desktop platforms, overrides the game's initial window width. See also [member display/window/size/window_height_override], [member display/window/size/viewport_width] and [member display/window/size/viewport_height]. [b]Note:[/b] By default, or when set to [code]0[/code], the initial window width is the viewport [member display/window/size/viewport_width]. This setting is ignored on iOS, Android, and Web. </member> + <member name="display/window/stretch/aspect" type="String" setter="" getter="" default=""keep""> + </member> + <member name="display/window/stretch/mode" type="String" setter="" getter="" default=""disabled""> + </member> + <member name="display/window/stretch/scale" type="float" setter="" getter="" default="1.0"> + </member> + <member name="display/window/subwindows/embed_subwindows" type="bool" setter="" getter="" default="true"> + If [code]true[/code] subwindows are embedded in the main window. + </member> <member name="display/window/vsync/vsync_mode" type="int" setter="" getter="" default="1"> Sets the V-Sync mode for the main game window. See [enum DisplayServer.VSyncMode] for possible values and how they affect the behavior of your application. @@ -712,6 +730,14 @@ Directory that contains the [code].sln[/code] file. By default, the [code].sln[/code] files is in the root of the project directory, next to the [code]project.godot[/code] and [code].csproj[/code] files. Changing this value allows setting up a multi-project scenario where there are multiple [code].csproj[/code]. Keep in mind that the Godot project is considered one of the C# projects in the workspace and it's root directory should contain the [code]project.godot[/code] and [code].csproj[/code] next to each other. </member> + <member name="editor/export/convert_text_resources_to_binary" type="bool" setter="" getter="" default="true"> + If [code]true[/code] text resources are converted to binary format on export. + </member> + <member name="editor/import/reimport_missing_imported_files" type="bool" setter="" getter="" default="true"> + </member> + <member name="editor/import/use_multiple_threads" type="bool" setter="" getter="" default="true"> + If [code]true[/code] importing of resources is run on multiple threads. + </member> <member name="editor/movie_writer/disable_vsync" type="bool" setter="" getter="" default="false"> If [code]true[/code], requests V-Sync to be disabled when writing a movie (similar to setting [member display/window/vsync/vsync_mode] to [b]Disabled[/b]). This can speed up video writing if the hardware is fast enough to render, encode and save the video at a framerate higher than the monitor's refresh rate. [b]Note:[/b] [member editor/movie_writer/disable_vsync] has no effect if the operating system or graphics driver forces V-Sync with no way for applications to disable it. @@ -767,6 +793,10 @@ <member name="editor/script/templates_search_path" type="String" setter="" getter="" default=""res://script_templates""> 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/version_control/autoload_on_startup" type="bool" setter="" getter="" default="false"> + </member> + <member name="editor/version_control/plugin_name" type="String" setter="" getter="" default=""""> + </member> <member name="filesystem/import/blender/enabled" type="bool" setter="" getter="" default="true"> If [code]true[/code], Blender 3D scene files with the [code].blend[/code] extension will be imported by converting them to glTF 2.0. This requires configuring a path to a Blender executable in the editor settings at [code]filesystem/import/blender/blender3_path[/code]. Blender 3.0 or later is required. @@ -790,6 +820,8 @@ <member name="gui/common/default_scroll_deadzone" type="int" setter="" getter="" default="0"> Default value for [member ScrollContainer.scroll_deadzone], which will be used for all [ScrollContainer]s unless overridden. </member> + <member name="gui/common/snap_controls_to_pixels" type="bool" setter="" getter="" default="true"> + </member> <member name="gui/common/swap_cancel_ok" type="bool" setter="" getter=""> If [code]true[/code], swaps [b]Cancel[/b] and [b]OK[/b] buttons in dialogs on Windows and UWP to follow interface conventions. [method DisplayServer.get_swap_cancel_ok] can be used to query whether buttons are swapped at run-time. [b]Note:[/b] This doesn't affect native dialogs such as the ones spawned by [method DisplayServer.dialog_show]. @@ -797,6 +829,8 @@ <member name="gui/common/text_edit_undo_stack_max_size" type="int" setter="" getter="" default="1024"> Maximum undo/redo history size for [TextEdit] fields. </member> + <member name="gui/fonts/dynamic_fonts/use_oversampling" type="bool" setter="" getter="" default="true"> + </member> <member name="gui/theme/custom" type="String" setter="" getter="" default=""""> Path to a custom [Theme] resource file to use for the project ([code].theme[/code] or generic [code].tres[/code]/[code].res[/code] extension). </member> @@ -2312,6 +2346,12 @@ Lower-end override for [member rendering/shading/overrides/force_vertex_shading] on mobile devices, due to performance concerns or driver support. [b]Note:[/b] This setting currently has no effect, as vertex shading is not implemented yet. </member> + <member name="rendering/textures/canvas_textures/default_texture_filter" type="int" setter="" getter="" default="1"> + The default texture filtering mode to use on [CanvasItem]s. + </member> + <member name="rendering/textures/canvas_textures/default_texture_repeat" type="int" setter="" getter="" default="0"> + The default texture repeating mode to use on [CanvasItem]s. + </member> <member name="rendering/textures/decals/filter" type="int" setter="" getter="" default="3"> The filtering quality to use for [Decal] nodes. When using one of the anisotropic filtering modes, the anisotropic filtering level is controlled by [member rendering/textures/default_filters/anisotropic_filtering_level]. </member> diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml index 0466d6f281..2e72be5558 100644 --- a/doc/classes/SceneTree.xml +++ b/doc/classes/SceneTree.xml @@ -218,7 +218,7 @@ </methods> <members> <member name="auto_accept_quit" type="bool" setter="set_auto_accept_quit" getter="is_auto_accept_quit" default="true"> - If [code]true[/code], the application automatically accepts quitting. + If [code]true[/code], the application automatically accepts quitting requests. For mobile platforms, see [member quit_on_go_back]. </member> <member name="current_scene" type="Node" setter="set_current_scene" getter="get_current_scene"> @@ -249,7 +249,7 @@ - [method Node._process], [method Node._physics_process] and [method Node._input] will not be called anymore in nodes. </member> <member name="quit_on_go_back" type="bool" setter="set_quit_on_go_back" getter="is_quit_on_go_back" default="true"> - If [code]true[/code], the application quits automatically on going back (e.g. on Android). + If [code]true[/code], the application quits automatically when navigating back (e.g. using the system "Back" button on Android). To handle 'Go Back' button when this option is disabled, use [constant DisplayServer.WINDOW_EVENT_GO_BACK_REQUEST]. </member> <member name="root" type="Window" setter="" getter="get_root"> diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index b37d12e5ee..58080c08ae 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -2568,8 +2568,7 @@ void EditorFileSystem::remove_import_format_support_query(Ref<EditorFileSystemIm EditorFileSystem::EditorFileSystem() { ResourceLoader::import = _resource_import; - reimport_on_missing_imported_files = GLOBAL_DEF("editor/import/reimport_missing_imported_files", true); - GLOBAL_DEF("editor/import/use_multiple_threads", true); + reimport_on_missing_imported_files = GLOBAL_GET("editor/import/reimport_missing_imported_files"); singleton = this; filesystem = memnew(EditorFileSystemDirectory); //like, empty filesystem->parent = nullptr; diff --git a/editor/export/editor_export.cpp b/editor/export/editor_export.cpp index bc429e1111..299523b368 100644 --- a/editor/export/editor_export.cpp +++ b/editor/export/editor_export.cpp @@ -374,8 +374,6 @@ EditorExport::EditorExport() { singleton = this; set_process(true); - - GLOBAL_DEF("editor/export/convert_text_resources_to_binary", true); } EditorExport::~EditorExport() { diff --git a/editor/plugins/version_control_editor_plugin.cpp b/editor/plugins/version_control_editor_plugin.cpp index c404e12d39..1964835e24 100644 --- a/editor/plugins/version_control_editor_plugin.cpp +++ b/editor/plugins/version_control_editor_plugin.cpp @@ -57,8 +57,8 @@ void VersionControlEditorPlugin::_create_vcs_metadata_files() { void VersionControlEditorPlugin::_notification(int p_what) { if (p_what == NOTIFICATION_READY) { - String installed_plugin = GLOBAL_DEF("editor/version_control/plugin_name", ""); - bool has_autoload_enable = GLOBAL_DEF("editor/version_control/autoload_on_startup", false); + 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)) { diff --git a/editor/register_editor_types.cpp b/editor/register_editor_types.cpp index d9138128cd..44624d201b 100644 --- a/editor/register_editor_types.cpp +++ b/editor/register_editor_types.cpp @@ -221,6 +221,14 @@ void register_editor_types() { GLOBAL_DEF("editor/naming/default_signal_callback_name", "_on_{node_name}_{signal_name}"); GLOBAL_DEF("editor/naming/default_signal_callback_to_self_name", "_on_{signal_name}"); GLOBAL_DEF(PropertyInfo(Variant::INT, "editor/naming/scene_name_casing", PROPERTY_HINT_ENUM, "Auto,PascalCase,snake_case"), EditorNode::SCENE_NAME_CASING_SNAKE_CASE); + + GLOBAL_DEF("editor/import/reimport_missing_imported_files", true); + GLOBAL_DEF("editor/import/use_multiple_threads", true); + + GLOBAL_DEF("editor/export/convert_text_resources_to_binary", true); + + GLOBAL_DEF("editor/version_control/plugin_name", ""); + GLOBAL_DEF("editor/version_control/autoload_on_startup", false); } void unregister_editor_types() { diff --git a/main/main.cpp b/main/main.cpp index f4d2dbef52..4ff83527e1 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -2630,7 +2630,7 @@ bool Main::start() { if (editor) { main_loop = memnew(SceneTree); } - String main_loop_type = GLOBAL_DEF("application/run/main_loop_type", "SceneTree"); + String main_loop_type = GLOBAL_GET("application/run/main_loop_type"); if (!script.is_empty()) { Ref<Script> script_res = ResourceLoader::load(script); @@ -2721,7 +2721,7 @@ bool Main::start() { } #endif - bool embed_subwindows = GLOBAL_DEF("display/window/subwindows/embed_subwindows", true); + bool embed_subwindows = GLOBAL_GET("display/window/subwindows/embed_subwindows"); if (single_window || (!project_manager && !editor && embed_subwindows) || !DisplayServer::get_singleton()->has_feature(DisplayServer::Feature::FEATURE_SUBWINDOWS)) { sml->get_root()->set_embedding_subwindows(true); @@ -2823,16 +2823,8 @@ bool Main::start() { startup_benchmark_file = String(); } #endif - GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "display/window/stretch/mode", PROPERTY_HINT_ENUM, "disabled,canvas_items,viewport"), "disabled"); - GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "display/window/stretch/aspect", PROPERTY_HINT_ENUM, "ignore,keep,keep_width,keep_height,expand"), "keep"); - GLOBAL_DEF_BASIC(PropertyInfo(Variant::FLOAT, "display/window/stretch/scale", PROPERTY_HINT_RANGE, "0.5,8.0,0.01"), 1.0); - sml->set_auto_accept_quit(GLOBAL_DEF("application/config/auto_accept_quit", true)); - sml->set_quit_on_go_back(GLOBAL_DEF("application/config/quit_on_go_back", true)); - GLOBAL_DEF_BASIC("gui/common/snap_controls_to_pixels", true); - GLOBAL_DEF_BASIC("gui/fonts/dynamic_fonts/use_oversampling", true); - - GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "rendering/textures/canvas_textures/default_texture_filter", PROPERTY_HINT_ENUM, "Nearest,Linear,Linear Mipmap,Nearest Mipmap"), 1); - GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "rendering/textures/canvas_textures/default_texture_repeat", PROPERTY_HINT_ENUM, "Disable,Enable,Mirror"), 0); + sml->set_auto_accept_quit(GLOBAL_GET("application/config/auto_accept_quit")); + sml->set_quit_on_go_back(GLOBAL_GET("application/config/quit_on_go_back")); if (!editor && !project_manager) { //standard helpers that can be changed from main config |