From bafc6372b2fee1d633f1ab85a34dc41cb8af3b27 Mon Sep 17 00:00:00 2001 From: fabriceci Date: Tue, 21 Feb 2023 22:34:44 +0100 Subject: [PATCH 01/17] Exposes the apply_floor_snap function to allow a snap to be made regardless of velocity. (cherry picked from commit 1381e6da4f695323853b24cf8d3632604b629133) --- doc/classes/CharacterBody2D.xml | 8 +++++++- doc/classes/CharacterBody3D.xml | 8 +++++++- scene/2d/physics_body_2d.cpp | 17 +++++++++++++++-- scene/2d/physics_body_2d.h | 2 ++ scene/3d/physics_body_3d.cpp | 13 +++++++++++-- scene/3d/physics_body_3d.h | 1 + 6 files changed, 43 insertions(+), 6 deletions(-) diff --git a/doc/classes/CharacterBody2D.xml b/doc/classes/CharacterBody2D.xml index ce7d1e18d7f..c0cfc31407a 100644 --- a/doc/classes/CharacterBody2D.xml +++ b/doc/classes/CharacterBody2D.xml @@ -15,6 +15,12 @@ https://godotengine.org/asset-library/asset/120 + + + + 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]. + + @@ -152,7 +158,7 @@ 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]. 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 2ff207acb70..8b511e5a729 100644 --- a/doc/classes/CharacterBody3D.xml +++ b/doc/classes/CharacterBody3D.xml @@ -17,6 +17,12 @@ https://godotengine.org/asset-library/asset/678 + + + + 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]. + + @@ -144,7 +150,7 @@ 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]. 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/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index 1721bcde3b8..ba361c2656f 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 53bc5b7cd30..c4eb77d8613 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/physics_body_3d.cpp b/scene/3d/physics_body_3d.cpp index c8cfcf7d7a0..ab5b054bb38 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 92d4726bb5a..d141c1aaa20 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); From ff15e2384ab65d5f408cee4c9b62639ddfaf5272 Mon Sep 17 00:00:00 2001 From: Fredia Huya-Kouadio Date: Sun, 5 Mar 2023 22:26:19 -0800 Subject: [PATCH 02/17] Configure maven central snapshot versions for the Godot Android library A snapshot version is a version that has not yet been released which allows us to deploy the same transient version incrementally, without requiring projects to upgrade the artifact version they're consuming. Those projects can use the same version to get an updated snapshot version. (cherry picked from commit a5fdc955158502d99fca4865aa2dffa4d832312d) --- platform/android/java/app/config.gradle | 3 +++ platform/android/java/build.gradle | 7 +++++++ platform/android/java/lib/build.gradle | 1 - 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/platform/android/java/app/config.gradle b/platform/android/java/app/config.gradle index f1b4bfd5340..95f46bbb7b4 100644 --- a/platform/android/java/app/config.gradle +++ b/platform/android/java/app/config.gradle @@ -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 cffe0a33d99..10c28a00b2e 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/lib/build.gradle b/platform/android/java/lib/build.gradle index 841656a240b..38133ddd515 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' } From 5f9990e25d2569ef1577e25a9b320abbe1d4192c Mon Sep 17 00:00:00 2001 From: lewiji Date: Thu, 9 Mar 2023 17:04:13 +0000 Subject: [PATCH 03/17] Add "filesRoot" path to Android provider paths xml (cherry picked from commit ac04ff7becfa31388c8bcfe725d71f0c7ec65c94) --- platform/android/java/lib/res/xml/godot_provider_paths.xml | 4 ++++ 1 file changed, 4 insertions(+) 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 1255f576bf1..8ad16da879f 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 @@ + + From dc100cbebb5ebe557fc23e1902a4288d509dda97 Mon Sep 17 00:00:00 2001 From: Fredia Huya-Kouadio Date: Tue, 21 Mar 2023 18:54:04 -0700 Subject: [PATCH 04/17] Bump the target SDK version to 33 (Android 13) (cherry picked from commit 845ca33c7608a8df7e7aaf87f38c1dfaf724fad2) --- platform/android/export/export_plugin.cpp | 2 +- platform/android/java/app/config.gradle | 10 +++++----- .../java/gradle/wrapper/gradle-wrapper.properties | 2 +- .../org/godotengine/godot/input/GodotGestureHandler.kt | 10 +++++----- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp index 641258a26ce..888c202f9bf 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 95f46bbb7b4..a6fa2271ee5 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', diff --git a/platform/android/java/gradle/wrapper/gradle-wrapper.properties b/platform/android/java/gradle/wrapper/gradle-wrapper.properties index 41dfb87909a..aa991fceae6 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/src/org/godotengine/godot/input/GodotGestureHandler.kt b/platform/android/java/lib/src/org/godotengine/godot/input/GodotGestureHandler.kt index 1be009b6dc3..af1f38f89cf 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 } } From 838a82f8858c859a9ceda4049904bf263604cbd4 Mon Sep 17 00:00:00 2001 From: Brian Long Date: Mon, 27 Mar 2023 09:15:59 -0700 Subject: [PATCH 05/17] Update GPUParticles2D/3D speed scale on ENTER_TREE Fix for https://github.com/godotengine/godot/issues/75218 Pause notifications are not sent when a node is added as a child. So GPUParticles2D should also obey its can_process status on ENTER_TREE, not just PAUSED/UNPAUSED. (cherry picked from commit 4652fbd09e81741a146c7dd1dcc89bf4235bdb75) --- scene/2d/gpu_particles_2d.cpp | 5 +++++ scene/3d/gpu_particles_3d.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/scene/2d/gpu_particles_2d.cpp b/scene/2d/gpu_particles_2d.cpp index 3f887ae9f3a..08c7b8e131a 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/3d/gpu_particles_3d.cpp b/scene/3d/gpu_particles_3d.cpp index 8eb1820cf81..b4131ff4b27 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: { From 47c4044d0306a2eecfe03309c30965695151797a Mon Sep 17 00:00:00 2001 From: kleonc <9283098+kleonc@users.noreply.github.com> Date: Sun, 26 Mar 2023 16:59:35 +0200 Subject: [PATCH 06/17] TileSet editor AtlasMergingDialog crash fix (cherry picked from commit c72b09639ad5a8644a1fd3bb61c5e2cca8483808) --- editor/plugins/tiles/atlas_merging_dialog.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/editor/plugins/tiles/atlas_merging_dialog.cpp b/editor/plugins/tiles/atlas_merging_dialog.cpp index 8404ea09691..ce5da811c1e 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> 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> p_atla } } } - - merged->set_name(p_atlas_sources[0]->get_name()); - merged->set_texture_region_size(new_texture_region_size); } } From 07beae98f04308ebcbaa5f4efc2d5e982b2eda22 Mon Sep 17 00:00:00 2001 From: Danil Alexeev Date: Wed, 15 Mar 2023 22:11:02 +0300 Subject: [PATCH 07/17] GDScript: Fix false positive `REDUNDANT_AWAIT` warning (cherry picked from commit c0eeb32e38fbd4f582f7a2726e6535614e507205) --- modules/gdscript/gdscript_analyzer.cpp | 2 +- .../features/warning_ignore_annotation.gd | 2 +- .../analyzer/warnings/redundant_await.gd | 53 +++++++++++++++++++ .../analyzer/warnings/redundant_await.out | 37 +++++++++++++ .../features/await_without_coroutine.gd | 2 +- 5 files changed, 93 insertions(+), 3 deletions(-) create mode 100644 modules/gdscript/tests/scripts/analyzer/warnings/redundant_await.gd create mode 100644 modules/gdscript/tests/scripts/analyzer/warnings/redundant_await.out diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index 38d5ae6b77c..c233d518012 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 4c02fd4b0da..292db30bcd4 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 00000000000..f8844d66a77 --- /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 00000000000..3d251c29062 --- /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 9da61ab1845..1c39073be98 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" From b39cbe71b4abd053f2ea86948f3cb6ff6c1c8b9c Mon Sep 17 00:00:00 2001 From: Bastiaan Olij Date: Wed, 15 Mar 2023 13:40:44 +1100 Subject: [PATCH 08/17] Fix typo in OpenXR pose orientation check (cherry picked from commit cdd9de28a80079bd3f81a8b004e02e8511a03869) --- modules/openxr/scene/openxr_hand.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openxr/scene/openxr_hand.cpp b/modules/openxr/scene/openxr_hand.cpp index e4bd2dab52e..e341d2b1d4c 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(); From 74a35c9ca2c8084608a2caf36ee912d202c936b5 Mon Sep 17 00:00:00 2001 From: kobewi Date: Thu, 30 Mar 2023 15:56:05 +0200 Subject: [PATCH 09/17] Don't allow selecting nodes without owner (cherry picked from commit 2fcfef15daed68e2bcb83a706223dd8d3107290b) --- editor/plugins/canvas_item_editor_plugin.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index fd44e9221ed..06cb3bc9b13 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(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 &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 selitems; @@ -2386,14 +2390,14 @@ bool CanvasItemEditor::_gui_input_select(const Ref &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; From 105699620067a280cccd13a9c0e3ab84a5cbc3c6 Mon Sep 17 00:00:00 2001 From: Sabrehull <124904810+Sabrehull@users.noreply.github.com> Date: Wed, 29 Mar 2023 15:18:31 +0200 Subject: [PATCH 10/17] [X11] Fix layout bug in `keyboard_get_keycode_from_physical` (cherry picked from commit d4b746626659d6e29c54da57b822735d15ab14c0) --- platform/linuxbsd/x11/display_server_x11.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/linuxbsd/x11/display_server_x11.cpp b/platform/linuxbsd/x11/display_server_x11.cpp index 5be1bd236b5..3f57a95dea6 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'); } From 9f20659c62796184ede59a1ea930e9bf492f0195 Mon Sep 17 00:00:00 2001 From: Mai Lavelle Date: Tue, 7 Mar 2023 09:38:29 -0500 Subject: [PATCH 11/17] Fixups to list handling in SceneReplicationConfig Wrong paths were being inserted leading to duplicates / missed properties. (cherry picked from commit 74edbdd4bce8f7a8a6c01ecb6ba5ae74ad6bac10) --- modules/multiplayer/scene_replication_config.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/modules/multiplayer/scene_replication_config.cpp b/modules/multiplayer/scene_replication_config.cpp index f8006228de9..b91c755c627 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); } } } From fe71d33033d178f7c437938313a213746f3662c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 29 Mar 2023 07:32:33 +0200 Subject: [PATCH 12/17] Project converter: Remove Tween properties/signals from renames The Tween class in Godot 3 is fully incompatible with Godot 4, there's no point doing these renames. It also makes it harder to use Threen, my (currently WIP) forward-port of the Godot 3 Tween to Godot 4. (cherry picked from commit 0171037e0a32b860f60859a0da9d08c6681e690f) --- editor/renames_map_3_to_4.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/editor/renames_map_3_to_4.cpp b/editor/renames_map_3_to_4.cpp index a8c438b25a7..cb885b45e4d 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 }, }; From 493e39860dd5648fc0886b3e59772938158eedab Mon Sep 17 00:00:00 2001 From: Redwarx008 <50837890+Redwarx008@users.noreply.github.com> Date: Sun, 26 Mar 2023 21:14:08 +0800 Subject: [PATCH 13/17] C#: Fix Array.AddRange index out of bounds Fix Array.AddRange index out of bounds (cherry picked from commit eb1fb254a649efe128a3d993b7bd31486e9356e1) --- modules/mono/glue/GodotSharp/GodotSharp/Core/Array.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Array.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Array.cs index 8598c32760e..5163ea51139 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; From ae0a98ef9b7772998f475bb169c435c7d4f22dab Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Thu, 2 Mar 2023 16:54:15 +0800 Subject: [PATCH 14/17] Hide internal settings from the classref Default actions are no longer internal since we want to document them. They are still hidden from the Project Setting dialog because we hid the whole `input/` group manually. (cherry picked from commit 1e0b8d6240314f1904df560cdab840771ef3e002) --- core/config/project_settings.cpp | 6 +++++- doc/classes/@GlobalScope.xml | 1 + doc/classes/ProjectSettings.xml | 9 --------- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index f3c0bc21539..ac51380c304 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -401,6 +401,10 @@ void ProjectSettings::_get_property_list(List *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); } } diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 8db668af0a2..12b5493589a 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -2773,6 +2773,7 @@ The property is shown in the [EditorInspector] (default). + The property is excluded from the class reference. The property can be checked in the [EditorInspector]. diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index ed227047e5d..4ea113e7b1c 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -248,9 +248,6 @@ The project's description, displayed as a tooltip in the Project Manager when hovering the project. - - List of internal features associated with the project, like [code]Double Precision[/code] or [code]C#[/code]. Not to be confused with feature tags. - Icon used for the project, set when project loads. Exporters will also use this icon when possible. @@ -1164,12 +1161,6 @@ If non-empty, this locale will be used when running the project from the editor. - - Locale-dependent resource remaps. Edit them in the "Localization" tab of Project Settings editor. - - - List of translation files available in the project. Edit them in the "Localization" tab of Project Settings editor. - Double vowels in strings during pseudolocalization to simulate the lengthening of text due to localization. From d6b36e800dfa8970c6bdeab2ed9a0e027e30068b Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Thu, 2 Mar 2023 14:38:59 +0800 Subject: [PATCH 15/17] Improve POT Generation dialog * Avoid "property not found" warnings when adding a file for the first time. * When no file is added, disable the Generate POT button instead of printing a warning. (cherry picked from commit 584136271cf92b7731f82dce22c4e99075b9b5d7) --- core/config/project_settings.cpp | 1 + editor/localization_editor.cpp | 26 +++++++++++++------------- editor/localization_editor.h | 1 + editor/pot_generator.cpp | 6 +++--- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index ac51380c304..123e01860e8 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -1348,6 +1348,7 @@ ProjectSettings::ProjectSettings() { 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/editor/localization_editor.cpp b/editor/localization_editor.cpp index 55036459309..fac1ec3523b 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 670ac5793b1..b9a78a3c823 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/pot_generator.cpp b/editor/pot_generator.cpp index f70a795683f..9428d290880 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 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 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 msgids; From 1e948814845864ca5796d5ebddb985f509a33c8c Mon Sep 17 00:00:00 2001 From: Ninni Pipping Date: Fri, 10 Mar 2023 15:09:56 +0100 Subject: [PATCH 16/17] Exposing more project settings for documentation (cherry picked from commit bd30847e5916f4ca8a855774cb32a160e690e71d) --- core/config/project_settings.cpp | 15 +++++++ doc/classes/ProjectSettings.xml | 40 +++++++++++++++++++ doc/classes/SceneTree.xml | 4 +- editor/editor_file_system.cpp | 3 +- editor/export/editor_export.cpp | 2 - .../plugins/version_control_editor_plugin.cpp | 4 +- editor/register_editor_types.cpp | 8 ++++ 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 123e01860e8..ac5499d7095 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 4ea113e7b1c..da5f02aebb4 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -241,6 +241,9 @@ 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). + + If [code]true[/code], the application automatically accepts quitting requests. + 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. + + If [code]true[/code], the application quits automatically when navigating back (e.g. using the system "Back" button on Android). + 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 @@ Amount of sleeping between frames when the low-processor usage mode is enabled (in microseconds). Higher values will result in lower CPU usage. + + The name of the type implementing the engine's main loop. + Path to the main scene file that will be loaded when the project runs. @@ -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. + + + + + + + + If [code]true[/code] subwindows are embedded in the main window. + 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. + + If [code]true[/code] text resources are converted to binary format on export. + + + + + If [code]true[/code] importing of resources is run on multiple threads. + 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 @@ 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. + + + + 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 @@ Default value for [member ScrollContainer.scroll_deadzone], which will be used for all [ScrollContainer]s unless overridden. + + 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 @@ Maximum undo/redo history size for [TextEdit] fields. + + Path to a custom [Theme] resource file to use for the project ([code].theme[/code] or generic [code].tres[/code]/[code].res[/code] extension). @@ -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. + + The default texture filtering mode to use on [CanvasItem]s. + + + The default texture repeating mode to use on [CanvasItem]s. + 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]. diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml index 0466d6f2819..2e72be55583 100644 --- a/doc/classes/SceneTree.xml +++ b/doc/classes/SceneTree.xml @@ -218,7 +218,7 @@ - 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]. @@ -249,7 +249,7 @@ - [method Node._process], [method Node._physics_process] and [method Node._input] will not be called anymore in nodes. - 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]. diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index b37d12e5eee..58080c08ae8 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -2568,8 +2568,7 @@ void EditorFileSystem::remove_import_format_support_query(Refparent = nullptr; diff --git a/editor/export/editor_export.cpp b/editor/export/editor_export.cpp index bc429e1111d..299523b3685 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 c404e12d394..1964835e24c 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 d9138128cde..44624d201bf 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 f4d2dbef52b..4ff83527e13 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