diff options
40 files changed, 313 insertions, 94 deletions
diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index f3c0bc2153..ac5499d709 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -401,6 +401,10 @@ void ProjectSettings::_get_property_list(List<PropertyInfo> *p_list) const { vc.flags = PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_STORAGE; } + if (v->internal) { + vc.flags |= PROPERTY_USAGE_INTERNAL; + } + if (v->basic) { vc.flags |= PROPERTY_USAGE_EDITOR_BASIC_SETTING; } @@ -1242,7 +1246,7 @@ void ProjectSettings::_add_builtin_input_map() { action["events"] = events; String action_name = "input/" + E.key; - GLOBAL_DEF_INTERNAL(action_name, action); + GLOBAL_DEF(action_name, action); input_presets.push_back(action_name); } } @@ -1266,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, @@ -1310,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); @@ -1335,15 +1348,22 @@ 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()); GLOBAL_DEF_INTERNAL("internationalization/locale/translations", PackedStringArray()); + GLOBAL_DEF_INTERNAL("internationalization/locale/translations_pot_files", PackedStringArray()); } ProjectSettings::~ProjectSettings() { diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 8db668af0a..12b5493589 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -2773,6 +2773,7 @@ The property is shown in the [EditorInspector] (default). </constant> <constant name="PROPERTY_USAGE_INTERNAL" value="8" enum="PropertyUsageFlags" is_bitfield="true"> + The property is excluded from the class reference. </constant> <constant name="PROPERTY_USAGE_CHECKABLE" value="16" enum="PropertyUsageFlags" is_bitfield="true"> The property can be checked in the [EditorInspector]. diff --git a/doc/classes/CharacterBody2D.xml b/doc/classes/CharacterBody2D.xml index ce7d1e18d7..c0cfc31407 100644 --- a/doc/classes/CharacterBody2D.xml +++ b/doc/classes/CharacterBody2D.xml @@ -15,6 +15,12 @@ <link title="2D Platformer Demo">https://godotengine.org/asset-library/asset/120</link> </tutorials> <methods> + <method name="apply_floor_snap"> + <return type="void" /> + <description> + Allows to manually apply a snap to the floor regardless of the body's velocity. This function does nothing when [method is_on_floor] returns [code]true[/code]. + </description> + </method> <method name="get_floor_angle" qualifiers="const"> <return type="float" /> <param index="0" name="up_direction" type="Vector2" default="Vector2(0, -1)" /> @@ -152,7 +158,7 @@ </member> <member name="floor_snap_length" type="float" setter="set_floor_snap_length" getter="get_floor_snap_length" default="1.0"> Sets a snapping distance. When set to a value different from [code]0.0[/code], the body is kept attached to slopes when calling [method move_and_slide]. The snapping vector is determined by the given distance along the opposite direction of the [member up_direction]. - As long as the snapping vector is in contact with the ground and the body moves against [member up_direction], the body will remain attached to the surface. Snapping is not applied if the body moves along [member up_direction], so it will be able to detach from the ground when jumping. + As long as the snapping vector is in contact with the ground and the body moves against [member up_direction], the body will remain attached to the surface. Snapping is not applied if the body moves along [member up_direction], meaning it contains vertical rising velocity, so it will be able to detach from the ground when jumping or when the body is pushed up by something. If you want to apply a snap without taking into account the velocity, use [method apply_floor_snap]. </member> <member name="floor_stop_on_slope" type="bool" setter="set_floor_stop_on_slope_enabled" getter="is_floor_stop_on_slope_enabled" default="true"> If [code]true[/code], the body will not slide on slopes when calling [method move_and_slide] when the body is standing still. diff --git a/doc/classes/CharacterBody3D.xml b/doc/classes/CharacterBody3D.xml index 2ff207acb7..8b511e5a72 100644 --- a/doc/classes/CharacterBody3D.xml +++ b/doc/classes/CharacterBody3D.xml @@ -17,6 +17,12 @@ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> </tutorials> <methods> + <method name="apply_floor_snap"> + <return type="void" /> + <description> + Allows to manually apply a snap to the floor regardless of the body's velocity. This function does nothing when [method is_on_floor] returns [code]true[/code]. + </description> + </method> <method name="get_floor_angle" qualifiers="const"> <return type="float" /> <param index="0" name="up_direction" type="Vector3" default="Vector3(0, 1, 0)" /> @@ -144,7 +150,7 @@ </member> <member name="floor_snap_length" type="float" setter="set_floor_snap_length" getter="get_floor_snap_length" default="0.1"> Sets a snapping distance. When set to a value different from [code]0.0[/code], the body is kept attached to slopes when calling [method move_and_slide]. The snapping vector is determined by the given distance along the opposite direction of the [member up_direction]. - As long as the snapping vector is in contact with the ground and the body moves against [member up_direction], the body will remain attached to the surface. Snapping is not applied if the body moves along [member up_direction], so it will be able to detach from the ground when jumping. + As long as the snapping vector is in contact with the ground and the body moves against [member up_direction], the body will remain attached to the surface. Snapping is not applied if the body moves along [member up_direction], meaning it contains vertical rising velocity, so it will be able to detach from the ground when jumping or when the body is pushed up by something. If you want to apply a snap without taking into account the velocity, use [method apply_floor_snap]. </member> <member name="floor_stop_on_slope" type="bool" setter="set_floor_stop_on_slope_enabled" getter="is_floor_stop_on_slope_enabled" default="true"> If [code]true[/code], the body will not slide on slopes when calling [method move_and_slide] when the body is standing still. diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index ed227047e5..120dda92c4 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. @@ -248,9 +251,6 @@ <member name="application/config/description" type="String" setter="" getter="" default=""""> The project's description, displayed as a tooltip in the Project Manager when hovering the project. </member> - <member name="application/config/features" type="PackedStringArray" setter="" getter=""> - List of internal features associated with the project, like [code]Double Precision[/code] or [code]C#[/code]. Not to be confused with feature tags. - </member> <member name="application/config/icon" type="String" setter="" getter="" default=""""> Icon used for the project, set when project loads. Exporters will also use this icon when possible. </member> @@ -268,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. @@ -308,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> @@ -701,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. @@ -715,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. @@ -770,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. @@ -793,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]. @@ -800,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> @@ -1164,12 +1195,6 @@ <member name="internationalization/locale/test" type="String" setter="" getter="" default=""""> If non-empty, this locale will be used when running the project from the editor. </member> - <member name="internationalization/locale/translation_remaps" type="PackedStringArray" setter="" getter=""> - Locale-dependent resource remaps. Edit them in the "Localization" tab of Project Settings editor. - </member> - <member name="internationalization/locale/translations" type="PackedStringArray" setter="" getter=""> - List of translation files available in the project. Edit them in the "Localization" tab of Project Settings editor. - </member> <member name="internationalization/pseudolocalization/double_vowels" type="bool" setter="" getter="" default="false"> Double vowels in strings during pseudolocalization to simulate the lengthening of text due to localization. </member> @@ -2321,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> @@ -2400,6 +2431,9 @@ <member name="xr/openxr/reference_space" type="int" setter="" getter="" default=""1""> Specify the default reference space. </member> + <member name="xr/openxr/startup_alert" type="bool" setter="" getter="" default="true"> + If [code]true[/code], Godot will display an alert modal when OpenXR initialization fails on startup. + </member> <member name="xr/openxr/submit_depth_buffer" type="bool" setter="" getter="" default="false"> If [code]true[/code], OpenXR will manage the depth buffer and use the depth buffer for advanced reprojection provided this is supported by the XR runtime. Note that some rendering features in Godot can't be used with this feature. </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/localization_editor.cpp b/editor/localization_editor.cpp index 5503645930..fac1ec3523 100644 --- a/editor/localization_editor.cpp +++ b/editor/localization_editor.cpp @@ -576,21 +576,21 @@ void LocalizationEditor::update_translations() { translation_pot_list->clear(); root = translation_pot_list->create_item(nullptr); translation_pot_list->set_hide_root(true); - if (ProjectSettings::get_singleton()->has_setting("internationalization/locale/translations_pot_files")) { - PackedStringArray pot_translations = GLOBAL_GET("internationalization/locale/translations_pot_files"); - for (int i = 0; i < pot_translations.size(); i++) { - TreeItem *t = translation_pot_list->create_item(root); - t->set_editable(0, false); - t->set_text(0, pot_translations[i].replace_first("res://", "")); - t->set_tooltip_text(0, pot_translations[i]); - t->set_metadata(0, i); - t->add_button(0, get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), 0, false, TTR("Remove")); - } + PackedStringArray pot_translations = GLOBAL_GET("internationalization/locale/translations_pot_files"); + for (int i = 0; i < pot_translations.size(); i++) { + TreeItem *t = translation_pot_list->create_item(root); + t->set_editable(0, false); + t->set_text(0, pot_translations[i].replace_first("res://", "")); + t->set_tooltip_text(0, pot_translations[i]); + t->set_metadata(0, i); + t->add_button(0, get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), 0, false, TTR("Remove")); } // New translation parser plugin might extend possible file extensions in POT generation. _update_pot_file_extensions(); + pot_generate_button->set_disabled(pot_translations.is_empty()); + updating_translations = false; } @@ -726,9 +726,9 @@ LocalizationEditor::LocalizationEditor() { addtr->connect("pressed", callable_mp(this, &LocalizationEditor::_pot_file_open)); thb->add_child(addtr); - Button *generate = memnew(Button(TTR("Generate POT"))); - generate->connect("pressed", callable_mp(this, &LocalizationEditor::_pot_generate_open)); - thb->add_child(generate); + pot_generate_button = memnew(Button(TTR("Generate POT"))); + pot_generate_button->connect("pressed", callable_mp(this, &LocalizationEditor::_pot_generate_open)); + thb->add_child(pot_generate_button); VBoxContainer *tmc = memnew(VBoxContainer); tmc->set_v_size_flags(Control::SIZE_EXPAND_FILL); diff --git a/editor/localization_editor.h b/editor/localization_editor.h index 670ac5793b..b9a78a3c82 100644 --- a/editor/localization_editor.h +++ b/editor/localization_editor.h @@ -54,6 +54,7 @@ class LocalizationEditor : public VBoxContainer { Tree *translation_pot_list = nullptr; EditorFileDialog *pot_file_open_dialog = nullptr; EditorFileDialog *pot_generate_dialog = nullptr; + Button *pot_generate_button = nullptr; bool updating_translations = false; String localization_changed; diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index fd44e9221e..06cb3bc9b1 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -697,6 +697,10 @@ void CanvasItemEditor::_find_canvas_items_in_rect(const Rect2 &p_rect, Node *p_n CanvasItem *ci = Object::cast_to<CanvasItem>(p_node); Node *scene = EditorNode::get_singleton()->get_edited_scene(); + if (p_node != scene && !p_node->get_owner()) { + return; + } + bool editable = p_node == scene || p_node->get_owner() == scene || p_node == scene->get_deepest_editable_node(p_node); bool lock_children = p_node->get_meta("_edit_group_", false); bool locked = _is_node_locked(p_node); @@ -2357,7 +2361,7 @@ bool CanvasItemEditor::_gui_input_select(const Ref<InputEvent> &p_event) { if (drag_type == DRAG_BOX_SELECTION) { if (b.is_valid() && !b->is_pressed() && b->get_button_index() == MouseButton::LEFT) { - // Confirms box selection + // Confirms box selection. Node *scene = EditorNode::get_singleton()->get_edited_scene(); if (scene) { List<CanvasItem *> selitems; @@ -2386,14 +2390,14 @@ bool CanvasItemEditor::_gui_input_select(const Ref<InputEvent> &p_event) { } if (b.is_valid() && b->is_pressed() && b->get_button_index() == MouseButton::RIGHT) { - // Cancel box selection + // Cancel box selection. _reset_drag(); viewport->queue_redraw(); return true; } if (m.is_valid()) { - // Update box selection + // Update box selection. box_selecting_to = transform.affine_inverse().xform(m->get_position()); viewport->queue_redraw(); return true; diff --git a/editor/plugins/tiles/atlas_merging_dialog.cpp b/editor/plugins/tiles/atlas_merging_dialog.cpp index 8404ea0969..ce5da811c1 100644 --- a/editor/plugins/tiles/atlas_merging_dialog.cpp +++ b/editor/plugins/tiles/atlas_merging_dialog.cpp @@ -95,7 +95,9 @@ void AtlasMergingDialog::_generate_merged(Vector<Ref<TileSetAtlasSource>> p_atla } } + merged->set_name(p_atlas_sources[0]->get_name()); merged->set_texture(ImageTexture::create_from_image(output_image)); + merged->set_texture_region_size(new_texture_region_size); // Copy the tiles to the merged TileSetAtlasSource. for (int source_index = 0; source_index < p_atlas_sources.size(); source_index++) { @@ -130,9 +132,6 @@ void AtlasMergingDialog::_generate_merged(Vector<Ref<TileSetAtlasSource>> p_atla } } } - - merged->set_name(p_atlas_sources[0]->get_name()); - merged->set_texture_region_size(new_texture_region_size); } } 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/pot_generator.cpp b/editor/pot_generator.cpp index f70a795683..9428d29088 100644 --- a/editor/pot_generator.cpp +++ b/editor/pot_generator.cpp @@ -55,7 +55,9 @@ void POTGenerator::_print_all_translation_strings() { #endif void POTGenerator::generate_pot(const String &p_file) { - if (!ProjectSettings::get_singleton()->has_setting("internationalization/locale/translations_pot_files")) { + Vector<String> files = GLOBAL_GET("internationalization/locale/translations_pot_files"); + + if (files.is_empty()) { WARN_PRINT("No files selected for POT generation."); return; } @@ -63,8 +65,6 @@ void POTGenerator::generate_pot(const String &p_file) { // Clear all_translation_strings of the previous round. all_translation_strings.clear(); - Vector<String> files = GLOBAL_GET("internationalization/locale/translations_pot_files"); - // Collect all translatable strings according to files order in "POT Generation" setting. for (int i = 0; i < files.size(); i++) { Vector<String> msgids; 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/editor/renames_map_3_to_4.cpp b/editor/renames_map_3_to_4.cpp index a8c438b25a..cb885b45e4 100644 --- a/editor/renames_map_3_to_4.cpp +++ b/editor/renames_map_3_to_4.cpp @@ -569,8 +569,6 @@ const char *RenamesMap3To4::gdscript_function_renames[][2] = { { "shortcut_match", "is_match" }, // InputEvent { "skeleton_allocate", "skeleton_allocate_data" }, // RenderingServer { "surface_update_region", "surface_update_attribute_region" }, // ArrayMesh - { "targeting_method", "tween_method" }, // Tween - { "targeting_property", "tween_property" }, // Tween { "track_remove_key_at_position", "track_remove_key_at_time" }, // Animation { "triangulate_delaunay_2d", "triangulate_delaunay" }, // Geometry2D { "unselect", "deselect" }, // ItemList @@ -968,8 +966,6 @@ const char *RenamesMap3To4::csharp_function_renames[][2] = { { "ShortcutMatch", "IsMatch" }, // InputEvent { "SkeletonAllocate", "SkeletonAllocateData" }, // RenderingServer { "SurfaceUpdateRegion", "SurfaceUpdateAttributeRegion" }, // ArrayMesh - { "TargetingMethod", "TweenMethod" }, // Tween - { "TargetingProperty", "TweenProperty" }, // Tween { "TrackRemoveKeyAtPosition", "TrackRemoveKeyAtTime" }, // Animation { "TriangulateDelaunay2d", "TriangulateDelaunay" }, // Geometry2D { "UnbindChildNodeFromBone", "RemoveBoneChild" }, // Skeleton3D @@ -1265,8 +1261,6 @@ const char *RenamesMap3To4::gdscript_signals_renames[][2] = { { "tab_close", "tab_closed" }, // TextEdit { "tab_hover", "tab_hovered" }, // TextEdit { "text_entered", "text_submitted" }, // LineEdit - { "tween_completed", "finished" }, // Tween - { "tween_step", "step_finished" }, // Tween { nullptr, nullptr }, }; @@ -1286,8 +1280,6 @@ const char *RenamesMap3To4::csharp_signals_renames[][2] = { { "TabClose", "TabClosed" }, // TextEdit { "TabHover", "TabHovered" }, // TextEdit { "TextEntered", "TextSubmitted" }, // LineEdit - { "TweenCompleted", "Finished" }, // Tween - { "TweenStep", "StepFinished" }, // Tween { nullptr, nullptr }, }; diff --git a/main/main.cpp b/main/main.cpp index f4d2dbef52..fbd0b75e58 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1859,6 +1859,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "xr/openxr/reference_space", PROPERTY_HINT_ENUM, "Local,Stage"), "1"); GLOBAL_DEF_BASIC("xr/openxr/submit_depth_buffer", false); + GLOBAL_DEF_BASIC("xr/openxr/startup_alert", true); #ifdef TOOLS_ENABLED // Disabled for now, using XR inside of the editor we'll be working on during the coming months. @@ -2630,7 +2631,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 +2722,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 +2824,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 diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index 38d5ae6b77..c233d51801 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -2548,7 +2548,7 @@ void GDScriptAnalyzer::reduce_await(GDScriptParser::AwaitNode *p_await) { #ifdef DEBUG_ENABLED GDScriptParser::DataType to_await_type = p_await->to_await->get_datatype(); - if (!(to_await_type.has_no_type() || to_await_type.is_coroutine || to_await_type.builtin_type == Variant::SIGNAL)) { + if (!to_await_type.is_coroutine && !to_await_type.is_variant() && to_await_type.builtin_type != Variant::SIGNAL) { parser->push_warning(p_await, GDScriptWarning::REDUNDANT_AWAIT); } #endif diff --git a/modules/gdscript/tests/scripts/analyzer/features/warning_ignore_annotation.gd b/modules/gdscript/tests/scripts/analyzer/features/warning_ignore_annotation.gd index 4c02fd4b0d..292db30bcd 100644 --- a/modules/gdscript/tests/scripts/analyzer/features/warning_ignore_annotation.gd +++ b/modules/gdscript/tests/scripts/analyzer/features/warning_ignore_annotation.gd @@ -11,5 +11,5 @@ func test(): print("done") -func regular_func(): +func regular_func() -> int: return 0 diff --git a/modules/gdscript/tests/scripts/analyzer/warnings/redundant_await.gd b/modules/gdscript/tests/scripts/analyzer/warnings/redundant_await.gd new file mode 100644 index 0000000000..f8844d66a7 --- /dev/null +++ b/modules/gdscript/tests/scripts/analyzer/warnings/redundant_await.gd @@ -0,0 +1,53 @@ +signal my_signal() + +# CI cannot test async things. +func test_signals(): + await my_signal + var t: Signal = my_signal + await t + +func coroutine() -> void: + @warning_ignore("redundant_await") + await 0 + +func not_coroutine_variant(): + pass + +func not_coroutine_void() -> void: + pass + +func test(): + const CONST_NULL = null + var var_null = null + var var_int: int = 1 + var var_variant: Variant = 1 + var var_array: Array = [1] + + await CONST_NULL + await var_null + await var_int + await var_variant + await var_array[0] + + await coroutine + await coroutine() + await coroutine.call() + await self.coroutine() + await call(&"coroutine") + + await not_coroutine_variant + await not_coroutine_variant() + await self.not_coroutine_variant() + await not_coroutine_variant.call() + await call(&"not_coroutine_variant") + + await not_coroutine_void + await not_coroutine_void() + await self.not_coroutine_void() + await not_coroutine_void.call() + await call(&"not_coroutine_void") + + var callable: Callable = coroutine + await callable + await callable.call() + await callable.get_method() diff --git a/modules/gdscript/tests/scripts/analyzer/warnings/redundant_await.out b/modules/gdscript/tests/scripts/analyzer/warnings/redundant_await.out new file mode 100644 index 0000000000..3d251c2906 --- /dev/null +++ b/modules/gdscript/tests/scripts/analyzer/warnings/redundant_await.out @@ -0,0 +1,37 @@ +GDTEST_OK +>> WARNING +>> Line: 26 +>> REDUNDANT_AWAIT +>> "await" keyword not needed in this case, because the expression isn't a coroutine nor a signal. +>> WARNING +>> Line: 28 +>> REDUNDANT_AWAIT +>> "await" keyword not needed in this case, because the expression isn't a coroutine nor a signal. +>> WARNING +>> Line: 32 +>> REDUNDANT_AWAIT +>> "await" keyword not needed in this case, because the expression isn't a coroutine nor a signal. +>> WARNING +>> Line: 38 +>> REDUNDANT_AWAIT +>> "await" keyword not needed in this case, because the expression isn't a coroutine nor a signal. +>> WARNING +>> Line: 44 +>> REDUNDANT_AWAIT +>> "await" keyword not needed in this case, because the expression isn't a coroutine nor a signal. +>> WARNING +>> Line: 45 +>> REDUNDANT_AWAIT +>> "await" keyword not needed in this case, because the expression isn't a coroutine nor a signal. +>> WARNING +>> Line: 46 +>> REDUNDANT_AWAIT +>> "await" keyword not needed in this case, because the expression isn't a coroutine nor a signal. +>> WARNING +>> Line: 51 +>> REDUNDANT_AWAIT +>> "await" keyword not needed in this case, because the expression isn't a coroutine nor a signal. +>> WARNING +>> Line: 53 +>> REDUNDANT_AWAIT +>> "await" keyword not needed in this case, because the expression isn't a coroutine nor a signal. diff --git a/modules/gdscript/tests/scripts/runtime/features/await_without_coroutine.gd b/modules/gdscript/tests/scripts/runtime/features/await_without_coroutine.gd index 9da61ab184..1c39073be9 100644 --- a/modules/gdscript/tests/scripts/runtime/features/await_without_coroutine.gd +++ b/modules/gdscript/tests/scripts/runtime/features/await_without_coroutine.gd @@ -4,5 +4,5 @@ func test(): print(await not_coroutine()) -func not_coroutine(): +func not_coroutine() -> String: return "awaited" diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Array.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Array.cs index 8598c32760..5163ea5113 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Array.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Array.cs @@ -554,6 +554,7 @@ namespace Godot.Collections // instead of growing it as we add items. if (collection.TryGetNonEnumeratedCount(out int count)) { + int oldCount = Count; Resize(Count + count); using var enumerator = collection.GetEnumerator(); @@ -561,7 +562,7 @@ namespace Godot.Collections for (int i = 0; i < count; i++) { enumerator.MoveNext(); - this[count + i] = Variant.From(enumerator.Current); + this[oldCount + i] = Variant.From(enumerator.Current); } return; @@ -1578,6 +1579,7 @@ namespace Godot.Collections // instead of growing it as we add items. if (collection.TryGetNonEnumeratedCount(out int count)) { + int oldCount = Count; Resize(Count + count); using var enumerator = collection.GetEnumerator(); @@ -1585,7 +1587,7 @@ namespace Godot.Collections for (int i = 0; i < count; i++) { enumerator.MoveNext(); - this[count + i] = enumerator.Current; + this[oldCount + i] = enumerator.Current; } return; diff --git a/modules/multiplayer/scene_replication_config.cpp b/modules/multiplayer/scene_replication_config.cpp index f8006228de..b91c755c62 100644 --- a/modules/multiplayer/scene_replication_config.cpp +++ b/modules/multiplayer/scene_replication_config.cpp @@ -51,6 +51,9 @@ bool SceneReplicationConfig::_set(const StringName &p_name, const Variant &p_val ERR_FAIL_INDEX_V(idx, properties.size(), false); ReplicationProperty &prop = properties[idx]; if (what == "sync") { + if ((bool)p_value == prop.sync) { + return true; + } prop.sync = p_value; if (prop.sync) { sync_props.push_back(prop.name); @@ -59,6 +62,9 @@ bool SceneReplicationConfig::_set(const StringName &p_name, const Variant &p_val } return true; } else if (what == "spawn") { + if ((bool)p_value == prop.spawn) { + return true; + } prop.spawn = p_value; if (prop.spawn) { spawn_props.push_back(prop.name); @@ -132,16 +138,18 @@ void SceneReplicationConfig::add_property(const NodePath &p_path, int p_index) { spawn_props.clear(); for (const ReplicationProperty &prop : properties) { if (prop.sync) { - sync_props.push_back(p_path); + sync_props.push_back(prop.name); } if (prop.spawn) { - spawn_props.push_back(p_path); + spawn_props.push_back(prop.name); } } } void SceneReplicationConfig::remove_property(const NodePath &p_path) { properties.erase(p_path); + sync_props.erase(p_path); + spawn_props.erase(p_path); } bool SceneReplicationConfig::has_property(const NodePath &p_path) const { @@ -178,7 +186,7 @@ void SceneReplicationConfig::property_set_spawn(const NodePath &p_path, bool p_e spawn_props.clear(); for (const ReplicationProperty &prop : properties) { if (prop.spawn) { - spawn_props.push_back(p_path); + spawn_props.push_back(prop.name); } } } @@ -199,7 +207,7 @@ void SceneReplicationConfig::property_set_sync(const NodePath &p_path, bool p_en sync_props.clear(); for (const ReplicationProperty &prop : properties) { if (prop.sync) { - sync_props.push_back(p_path); + sync_props.push_back(prop.name); } } } diff --git a/modules/openxr/register_types.cpp b/modules/openxr/register_types.cpp index c39e49387a..b7d239fc73 100644 --- a/modules/openxr/register_types.cpp +++ b/modules/openxr/register_types.cpp @@ -29,6 +29,7 @@ /**************************************************************************/ #include "register_types.h" +#include "core/config/project_settings.h" #include "main/main.h" #include "openxr_interface.h" @@ -113,10 +114,19 @@ void initialize_openxr_module(ModuleInitializationLevel p_level) { ERR_FAIL_NULL(openxr_api); if (!openxr_api->initialize(Main::get_rendering_driver_name())) { - OS::get_singleton()->alert("OpenXR was requested but failed to start.\n" - "Please check if your HMD is connected.\n" - "When using Windows MR please note that WMR only has DirectX support, make sure SteamVR is your default OpenXR runtime.\n" - "Godot will start in normal mode.\n"); + const char *init_error_message = + "OpenXR was requested but failed to start.\n" + "Please check if your HMD is connected.\n" + "When using Windows MR please note that WMR only has DirectX support, make sure SteamVR is your default OpenXR runtime.\n" + "Godot will start in normal mode.\n"; + + WARN_PRINT(init_error_message); + + bool init_show_startup_alert = GLOBAL_GET("xr/openxr/startup_alert"); + if (init_show_startup_alert) { + OS::get_singleton()->alert(init_error_message); + } + memdelete(openxr_api); openxr_api = nullptr; return; diff --git a/modules/openxr/scene/openxr_hand.cpp b/modules/openxr/scene/openxr_hand.cpp index e4bd2dab52..e341d2b1d4 100644 --- a/modules/openxr/scene/openxr_hand.cpp +++ b/modules/openxr/scene/openxr_hand.cpp @@ -216,7 +216,7 @@ void OpenXRHand::_update_skeleton() { const auto &pose = location.pose; if (location.locationFlags & XR_SPACE_LOCATION_ORIENTATION_VALID_BIT) { - if (pose.orientation.x != 0 || pose.orientation.y != 0 || pose.orientation.y != 0 || pose.orientation.w != 0) { + if (pose.orientation.x != 0 || pose.orientation.y != 0 || pose.orientation.z != 0 || pose.orientation.w != 0) { quaternions[i] = Quaternion(pose.orientation.x, pose.orientation.y, pose.orientation.z, pose.orientation.w); inv_quaternions[i] = quaternions[i].inverse(); diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp index 641258a26c..888c202f9b 100644 --- a/platform/android/export/export_plugin.cpp +++ b/platform/android/export/export_plugin.cpp @@ -253,7 +253,7 @@ static const char *AAB_ASSETS_DIRECTORY = "res://android/build/assetPacks/instal static const int OPENGL_MIN_SDK_VERSION = 21; // Should match the value in 'platform/android/java/app/config.gradle#minSdk' static const int VULKAN_MIN_SDK_VERSION = 24; -static const int DEFAULT_TARGET_SDK_VERSION = 32; // Should match the value in 'platform/android/java/app/config.gradle#targetSdk' +static const int DEFAULT_TARGET_SDK_VERSION = 33; // Should match the value in 'platform/android/java/app/config.gradle#targetSdk' #ifndef ANDROID_ENABLED void EditorExportPlatformAndroid::_check_for_changes_poll_thread(void *ud) { diff --git a/platform/android/java/app/config.gradle b/platform/android/java/app/config.gradle index f1b4bfd534..a6fa2271ee 100644 --- a/platform/android/java/app/config.gradle +++ b/platform/android/java/app/config.gradle @@ -1,11 +1,11 @@ ext.versions = [ - androidGradlePlugin: '7.2.1', - compileSdk : 32, - // Also update 'platform/android/export/export_plugin.cpp#DEFAULT_MIN_SDK_VERSION' + androidGradlePlugin: '7.3.0', + compileSdk : 33, + // Also update 'platform/android/export/export_plugin.cpp#OPENGL_MIN_SDK_VERSION' minSdk : 21, // Also update 'platform/android/export/export_plugin.cpp#DEFAULT_TARGET_SDK_VERSION' - targetSdk : 32, - buildTools : '32.0.0', + targetSdk : 33, + buildTools : '33.0.2', kotlinVersion : '1.7.0', fragmentVersion : '1.3.6', nexusPublishVersion: '1.1.0', @@ -189,6 +189,9 @@ ext.getGodotPublishVersion = { -> String versionName = "" int versionCode = 1 (versionName, versionCode) = generateGodotLibraryVersion(requiredKeys) + if (!versionName.endsWith("stable")) { + versionName += "-SNAPSHOT" + } return versionName } diff --git a/platform/android/java/build.gradle b/platform/android/java/build.gradle index cffe0a33d9..10c28a00b2 100644 --- a/platform/android/java/build.gradle +++ b/platform/android/java/build.gradle @@ -20,6 +20,13 @@ plugins { apply from: 'app/config.gradle' apply from: 'scripts/publish-root.gradle' +ext { + PUBLISH_VERSION = getGodotPublishVersion() +} + +group = ossrhGroupId +version = PUBLISH_VERSION + allprojects { repositories { google() diff --git a/platform/android/java/gradle/wrapper/gradle-wrapper.properties b/platform/android/java/gradle/wrapper/gradle-wrapper.properties index 41dfb87909..aa991fceae 100644 --- a/platform/android/java/gradle/wrapper/gradle-wrapper.properties +++ b/platform/android/java/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/platform/android/java/lib/build.gradle b/platform/android/java/lib/build.gradle index 841656a240..38133ddd51 100644 --- a/platform/android/java/lib/build.gradle +++ b/platform/android/java/lib/build.gradle @@ -4,7 +4,6 @@ plugins { } ext { - PUBLISH_VERSION = getGodotPublishVersion() PUBLISH_ARTIFACT_ID = 'godot' } diff --git a/platform/android/java/lib/res/xml/godot_provider_paths.xml b/platform/android/java/lib/res/xml/godot_provider_paths.xml index 1255f576bf..8ad16da879 100644 --- a/platform/android/java/lib/res/xml/godot_provider_paths.xml +++ b/platform/android/java/lib/res/xml/godot_provider_paths.xml @@ -1,6 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> <paths xmlns:android="http://schemas.android.com/apk/res/android"> + <files-path + name="filesRoot" + path="/" /> + <external-path name="public" path="." /> diff --git a/platform/android/java/lib/src/org/godotengine/godot/input/GodotGestureHandler.kt b/platform/android/java/lib/src/org/godotengine/godot/input/GodotGestureHandler.kt index 1be009b6dc..af1f38f89c 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/input/GodotGestureHandler.kt +++ b/platform/android/java/lib/src/org/godotengine/godot/input/GodotGestureHandler.kt @@ -239,8 +239,8 @@ internal class GodotGestureHandler : SimpleOnGestureListener(), OnScaleGestureLi return true } - override fun onScale(detector: ScaleGestureDetector?): Boolean { - if (detector == null || !panningAndScalingEnabled || pointerCaptureInProgress) { + override fun onScale(detector: ScaleGestureDetector): Boolean { + if (!panningAndScalingEnabled || pointerCaptureInProgress) { return false } GodotLib.magnify( @@ -251,15 +251,15 @@ internal class GodotGestureHandler : SimpleOnGestureListener(), OnScaleGestureLi return true } - override fun onScaleBegin(detector: ScaleGestureDetector?): Boolean { - if (detector == null || !panningAndScalingEnabled || pointerCaptureInProgress) { + override fun onScaleBegin(detector: ScaleGestureDetector): Boolean { + if (!panningAndScalingEnabled || pointerCaptureInProgress) { return false } scaleInProgress = true return true } - override fun onScaleEnd(detector: ScaleGestureDetector?) { + override fun onScaleEnd(detector: ScaleGestureDetector) { scaleInProgress = false } } diff --git a/platform/linuxbsd/x11/display_server_x11.cpp b/platform/linuxbsd/x11/display_server_x11.cpp index 5be1bd236b..3f57a95dea 100644 --- a/platform/linuxbsd/x11/display_server_x11.cpp +++ b/platform/linuxbsd/x11/display_server_x11.cpp @@ -2824,7 +2824,7 @@ Key DisplayServerX11::keyboard_get_keycode_from_physical(Key p_keycode) const { Key modifiers = p_keycode & KeyModifierMask::MODIFIER_MASK; Key keycode_no_mod = p_keycode & KeyModifierMask::CODE_MASK; unsigned int xkeycode = KeyMappingX11::get_xlibcode(keycode_no_mod); - KeySym xkeysym = XkbKeycodeToKeysym(x11_display, xkeycode, 0, 0); + KeySym xkeysym = XkbKeycodeToKeysym(x11_display, xkeycode, keyboard_get_current_layout(), 0); if (is_ascii_lower_case(xkeysym)) { xkeysym -= ('a' - 'A'); } diff --git a/scene/2d/gpu_particles_2d.cpp b/scene/2d/gpu_particles_2d.cpp index 3f887ae9f3..08c7b8e131 100644 --- a/scene/2d/gpu_particles_2d.cpp +++ b/scene/2d/gpu_particles_2d.cpp @@ -538,6 +538,11 @@ void GPUParticles2D::_notification(int p_what) { if (sub_emitter != NodePath()) { _attach_sub_emitter(); } + if (can_process()) { + RS::get_singleton()->particles_set_speed_scale(particles, speed_scale); + } else { + RS::get_singleton()->particles_set_speed_scale(particles, 0); + } } break; case NOTIFICATION_EXIT_TREE: { diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index 1721bcde3b..ba361c2656 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -1391,9 +1391,13 @@ void CharacterBody2D::_move_and_slide_floating(double p_delta) { first_slide = false; } } +void CharacterBody2D::apply_floor_snap() { + _apply_floor_snap(); +} -void CharacterBody2D::_snap_on_floor(bool p_was_on_floor, bool p_vel_dir_facing_up, bool p_wall_as_floor) { - if (on_floor || !p_was_on_floor || p_vel_dir_facing_up) { +// Method that avoids the p_wall_as_floor parameter for the public method. +void CharacterBody2D::_apply_floor_snap(bool p_wall_as_floor) { + if (on_floor) { return; } @@ -1428,6 +1432,14 @@ void CharacterBody2D::_snap_on_floor(bool p_was_on_floor, bool p_vel_dir_facing_ } } +void CharacterBody2D::_snap_on_floor(bool p_was_on_floor, bool p_vel_dir_facing_up, bool p_wall_as_floor) { + if (on_floor || !p_was_on_floor || p_vel_dir_facing_up) { + return; + } + + _apply_floor_snap(p_wall_as_floor); +} + bool CharacterBody2D::_on_floor_if_snapped(bool p_was_on_floor, bool p_vel_dir_facing_up) { if (up_direction == Vector2() || on_floor || !p_was_on_floor || p_vel_dir_facing_up) { return false; @@ -1699,6 +1711,7 @@ void CharacterBody2D::_notification(int p_what) { void CharacterBody2D::_bind_methods() { ClassDB::bind_method(D_METHOD("move_and_slide"), &CharacterBody2D::move_and_slide); + ClassDB::bind_method(D_METHOD("apply_floor_snap"), &CharacterBody2D::apply_floor_snap); ClassDB::bind_method(D_METHOD("set_velocity", "velocity"), &CharacterBody2D::set_velocity); ClassDB::bind_method(D_METHOD("get_velocity"), &CharacterBody2D::get_velocity); diff --git a/scene/2d/physics_body_2d.h b/scene/2d/physics_body_2d.h index 53bc5b7cd3..c4eb77d861 100644 --- a/scene/2d/physics_body_2d.h +++ b/scene/2d/physics_body_2d.h @@ -337,6 +337,7 @@ public: PLATFORM_ON_LEAVE_DO_NOTHING, }; bool move_and_slide(); + void apply_floor_snap(); const Vector2 &get_velocity() const; void set_velocity(const Vector2 &p_velocity); @@ -446,6 +447,7 @@ private: void set_up_direction(const Vector2 &p_up_direction); void _set_collision_direction(const PhysicsServer2D::MotionResult &p_result); void _set_platform_data(const PhysicsServer2D::MotionResult &p_result); + void _apply_floor_snap(bool p_wall_as_floor = false); void _snap_on_floor(bool p_was_on_floor, bool p_vel_dir_facing_up, bool p_wall_as_floor = false); protected: diff --git a/scene/3d/gpu_particles_3d.cpp b/scene/3d/gpu_particles_3d.cpp index 8eb1820cf8..b4131ff4b2 100644 --- a/scene/3d/gpu_particles_3d.cpp +++ b/scene/3d/gpu_particles_3d.cpp @@ -439,6 +439,11 @@ void GPUParticles3D::_notification(int p_what) { if (sub_emitter != NodePath()) { _attach_sub_emitter(); } + if (can_process()) { + RS::get_singleton()->particles_set_speed_scale(particles, speed_scale); + } else { + RS::get_singleton()->particles_set_speed_scale(particles, 0); + } } break; case NOTIFICATION_EXIT_TREE: { diff --git a/scene/3d/physics_body_3d.cpp b/scene/3d/physics_body_3d.cpp index c8cfcf7d7a..ab5b054bb3 100644 --- a/scene/3d/physics_body_3d.cpp +++ b/scene/3d/physics_body_3d.cpp @@ -1565,8 +1565,8 @@ void CharacterBody3D::_move_and_slide_floating(double p_delta) { } } -void CharacterBody3D::_snap_on_floor(bool p_was_on_floor, bool p_vel_dir_facing_up) { - if (collision_state.floor || !p_was_on_floor || p_vel_dir_facing_up) { +void CharacterBody3D::apply_floor_snap() { + if (collision_state.floor) { return; } @@ -1601,6 +1601,14 @@ void CharacterBody3D::_snap_on_floor(bool p_was_on_floor, bool p_vel_dir_facing_ } } +void CharacterBody3D::_snap_on_floor(bool p_was_on_floor, bool p_vel_dir_facing_up) { + if (collision_state.floor || !p_was_on_floor || p_vel_dir_facing_up) { + return; + } + + apply_floor_snap(); +} + bool CharacterBody3D::_on_floor_if_snapped(bool p_was_on_floor, bool p_vel_dir_facing_up) { if (up_direction == Vector3() || collision_state.floor || !p_was_on_floor || p_vel_dir_facing_up) { return false; @@ -1954,6 +1962,7 @@ void CharacterBody3D::_notification(int p_what) { void CharacterBody3D::_bind_methods() { ClassDB::bind_method(D_METHOD("move_and_slide"), &CharacterBody3D::move_and_slide); + ClassDB::bind_method(D_METHOD("apply_floor_snap"), &CharacterBody3D::apply_floor_snap); ClassDB::bind_method(D_METHOD("set_velocity", "velocity"), &CharacterBody3D::set_velocity); ClassDB::bind_method(D_METHOD("get_velocity"), &CharacterBody3D::get_velocity); diff --git a/scene/3d/physics_body_3d.h b/scene/3d/physics_body_3d.h index 92d4726bb5..d141c1aaa2 100644 --- a/scene/3d/physics_body_3d.h +++ b/scene/3d/physics_body_3d.h @@ -354,6 +354,7 @@ public: PLATFORM_ON_LEAVE_DO_NOTHING, }; bool move_and_slide(); + void apply_floor_snap(); const Vector3 &get_velocity() const; void set_velocity(const Vector3 &p_velocity); |