summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/linux_builds.yml3
-rw-r--r--.gitignore9
-rw-r--r--SConstruct7
-rw-r--r--core/input/godotcontrollerdb.txt2
-rw-r--r--core/input/input_map.cpp2
-rw-r--r--core/io/file_access.cpp2
-rw-r--r--core/io/file_access.h2
-rw-r--r--core/io/file_access_compressed.cpp4
-rw-r--r--core/io/file_access_compressed.h2
-rw-r--r--core/io/file_access_encrypted.cpp4
-rw-r--r--core/io/file_access_encrypted.h2
-rw-r--r--core/io/file_access_memory.h2
-rw-r--r--core/io/file_access_network.cpp9
-rw-r--r--core/io/file_access_network.h2
-rw-r--r--core/io/file_access_pack.cpp4
-rw-r--r--core/io/file_access_pack.h2
-rw-r--r--core/io/file_access_zip.cpp4
-rw-r--r--core/io/file_access_zip.h2
-rw-r--r--core/object/script_language_extension.cpp1
-rw-r--r--core/templates/paged_array.h20
-rw-r--r--doc/classes/@GlobalScope.xml2
-rw-r--r--doc/classes/AStar2D.xml2
-rw-r--r--doc/classes/AnimatedTexture.xml5
-rw-r--r--doc/classes/Animation.xml2
-rw-r--r--doc/classes/BaseMaterial3D.xml2
-rw-r--r--doc/classes/Bone2D.xml13
-rw-r--r--doc/classes/BoneAttachment3D.xml4
-rw-r--r--doc/classes/BoxMesh.xml2
-rw-r--r--doc/classes/Decal.xml2
-rw-r--r--doc/classes/DisplayServer.xml9
-rw-r--r--doc/classes/EditorInspectorPlugin.xml2
-rw-r--r--doc/classes/EditorNode3DGizmoPlugin.xml4
-rw-r--r--doc/classes/EditorPlugin.xml4
-rw-r--r--doc/classes/FileAccess.xml9
-rw-r--r--doc/classes/GeometryInstance3D.xml4
-rw-r--r--doc/classes/InputEvent.xml2
-rw-r--r--doc/classes/NavigationAgent2D.xml2
-rw-r--r--doc/classes/NavigationAgent3D.xml8
-rw-r--r--doc/classes/NavigationLink2D.xml28
-rw-r--r--doc/classes/NavigationLink3D.xml28
-rw-r--r--doc/classes/NavigationPathQueryResult2D.xml2
-rw-r--r--doc/classes/NavigationPathQueryResult3D.xml2
-rw-r--r--doc/classes/NavigationServer2D.xml13
-rw-r--r--doc/classes/NavigationServer3D.xml13
-rw-r--r--doc/classes/Node3D.xml2
-rw-r--r--doc/classes/OmniLight3D.xml3
-rw-r--r--doc/classes/PopupMenu.xml16
-rw-r--r--doc/classes/ProjectSettings.xml9
-rw-r--r--doc/classes/ScriptExtension.xml5
-rw-r--r--doc/classes/SpotLight3D.xml5
-rw-r--r--doc/classes/String.xml2
-rw-r--r--doc/classes/StringName.xml2
-rw-r--r--doc/classes/TextureRect.xml3
-rw-r--r--doc/classes/VisibleOnScreenEnabler2D.xml2
-rw-r--r--doc/classes/XRInterface.xml2
-rw-r--r--drivers/alsa/SCsub3
-rw-r--r--drivers/alsa/audio_driver_alsa.cpp5
-rw-r--r--drivers/alsa/audio_driver_alsa.h4
-rw-r--r--drivers/alsamidi/midi_driver_alsamidi.h5
-rw-r--r--drivers/gles3/rasterizer_canvas_gles3.cpp3
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.cpp7
-rw-r--r--drivers/pulseaudio/SCsub3
-rw-r--r--drivers/pulseaudio/audio_driver_pulseaudio.cpp7
-rw-r--r--drivers/pulseaudio/audio_driver_pulseaudio.h4
-rw-r--r--drivers/unix/file_access_unix.cpp4
-rw-r--r--drivers/unix/file_access_unix.h2
-rw-r--r--drivers/windows/file_access_windows.cpp5
-rw-r--r--drivers/windows/file_access_windows.h2
-rw-r--r--editor/animation_track_editor.cpp12
-rw-r--r--editor/code_editor.cpp5
-rw-r--r--editor/debugger/editor_profiler.cpp2
-rw-r--r--editor/editor_audio_buses.cpp2
-rw-r--r--editor/editor_build_profile.cpp5
-rw-r--r--editor/editor_file_dialog.cpp30
-rw-r--r--editor/editor_file_dialog.h2
-rw-r--r--editor/editor_file_system.cpp2
-rw-r--r--editor/editor_inspector.cpp27
-rw-r--r--editor/editor_inspector.h6
-rw-r--r--editor/editor_node.cpp1
-rw-r--r--editor/editor_plugin.cpp6
-rw-r--r--editor/editor_plugin.h4
-rw-r--r--editor/editor_properties.cpp22
-rw-r--r--editor/editor_settings.cpp4
-rw-r--r--editor/editor_themes.cpp40
-rw-r--r--editor/export/editor_export_platform.cpp3
-rw-r--r--editor/icons/GodotFile.svg1
-rw-r--r--editor/icons/GodotMonochrome.svg1
-rw-r--r--editor/icons/editor_icons_builders.py2
-rw-r--r--editor/import/resource_importer_scene.cpp1
-rw-r--r--editor/import/scene_import_settings.cpp16
-rw-r--r--editor/import/scene_import_settings.h2
-rw-r--r--editor/input_event_configuration_dialog.cpp3
-rw-r--r--editor/plugins/animation_player_editor_plugin.cpp1
-rw-r--r--editor/plugins/cast_2d_editor_plugin.cpp2
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp2
-rw-r--r--editor/plugins/script_editor_plugin.cpp2
-rw-r--r--editor/plugins/sprite_frames_editor_plugin.cpp6
-rw-r--r--editor/plugins/theme_editor_plugin.cpp7
-rw-r--r--editor/plugins/tiles/tile_map_editor.cpp31
-rw-r--r--editor/plugins/tiles/tile_set_atlas_source_editor.cpp71
-rw-r--r--editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp11
-rw-r--r--editor/project_manager.cpp18
-rw-r--r--editor/project_manager.h1
-rw-r--r--editor/project_settings_editor.cpp2
-rw-r--r--editor/renames_map_3_to_4.cpp568
-rw-r--r--main/main.cpp5
-rw-r--r--methods.py4
-rw-r--r--misc/dist/ios_xcode/godot_ios/vulkan/icd.d/MoltenVK_icd.json7
-rw-r--r--modules/basis_universal/SCsub3
-rw-r--r--modules/gdscript/gdscript.cpp2
-rw-r--r--modules/gdscript/gdscript_analyzer.cpp25
-rw-r--r--modules/gdscript/gdscript_byte_codegen.cpp103
-rw-r--r--modules/gdscript/gdscript_byte_codegen.h29
-rw-r--r--modules/gdscript/gdscript_compiler.cpp2
-rw-r--r--modules/gdscript/gdscript_function.h2
-rw-r--r--modules/gdscript/gdscript_vm.cpp67
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/native_freed_instance.gd7
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/native_freed_instance.out6
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/script_freed_instance.gd10
-rw-r--r--modules/gdscript/tests/scripts/analyzer/errors/script_freed_instance.out6
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/getter_return_type.gd9
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/getter_return_type.out2
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/native_typed_assign_null.gd15
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/native_typed_assign_null.out7
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/typed_array_usage.gd4
-rw-r--r--modules/gridmap/editor/grid_map_editor_plugin.cpp1
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Build/BuildManager.cs2
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs5
-rw-r--r--modules/mono/glue/GodotSharp/Godot.SourceGenerators.Internal/UnmanagedCallbacksGenerator.cs4
-rw-r--r--modules/navigation/SCsub2
-rw-r--r--modules/ogg/ogg_packet_sequence.h5
-rw-r--r--modules/text_server_adv/SCsub5
-rw-r--r--modules/vorbis/audio_stream_ogg_vorbis.cpp3
-rw-r--r--modules/vorbis/audio_stream_ogg_vorbis.h3
-rw-r--r--modules/vorbis/resource_importer_ogg_vorbis.cpp5
-rw-r--r--platform/android/display_server_android.cpp2
-rw-r--r--platform/android/export/export_plugin.cpp12
-rw-r--r--platform/android/file_access_android.cpp4
-rw-r--r--platform/android/file_access_android.h2
-rw-r--r--platform/android/file_access_filesystem_jandroid.cpp6
-rw-r--r--platform/android/file_access_filesystem_jandroid.h2
-rw-r--r--platform/ios/SCsub1
-rw-r--r--platform/ios/godot_view.h5
-rw-r--r--platform/ios/godot_view.mm82
-rw-r--r--platform/ios/godot_view_gesture_recognizer.h46
-rw-r--r--platform/ios/godot_view_gesture_recognizer.mm186
-rw-r--r--platform/ios/joypad_ios.mm19
-rw-r--r--platform/linuxbsd/SCsub17
-rw-r--r--platform/linuxbsd/detect.py143
-rw-r--r--platform/linuxbsd/freedesktop_portal_desktop.cpp8
-rw-r--r--platform/linuxbsd/freedesktop_screensaver.cpp8
-rw-r--r--platform/linuxbsd/joypad_linux.cpp6
-rw-r--r--platform/linuxbsd/os_linuxbsd.cpp4
-rw-r--r--platform/linuxbsd/os_linuxbsd.h4
-rw-r--r--platform/linuxbsd/tts_linux.cpp10
-rw-r--r--platform/linuxbsd/tts_linux.h4
-rw-r--r--platform/linuxbsd/x11/SCsub20
-rw-r--r--platform/linuxbsd/x11/detect_prime_x11.cpp6
-rw-r--r--platform/linuxbsd/x11/display_server_x11.cpp44
-rw-r--r--platform/linuxbsd/x11/display_server_x11.h26
-rw-r--r--platform/linuxbsd/x11/gl_manager_x11.h15
-rw-r--r--platform/macos/display_server_macos.mm2
-rw-r--r--platform/macos/export/export_plugin.cpp2
-rw-r--r--platform/web/display_server_web.cpp1
-rw-r--r--platform/windows/display_server_windows.cpp2
-rw-r--r--scene/2d/audio_stream_player_2d.cpp2
-rw-r--r--scene/2d/cpu_particles_2d.cpp4
-rw-r--r--scene/2d/navigation_agent_2d.cpp32
-rw-r--r--scene/2d/navigation_link_2d.cpp38
-rw-r--r--scene/2d/navigation_link_2d.h6
-rw-r--r--scene/2d/skeleton_2d.cpp13
-rw-r--r--scene/2d/skeleton_2d.h3
-rw-r--r--scene/2d/touch_screen_button.cpp4
-rw-r--r--scene/3d/audio_stream_player_3d.cpp2
-rw-r--r--scene/3d/cpu_particles_3d.cpp4
-rw-r--r--scene/3d/navigation_agent_3d.cpp34
-rw-r--r--scene/3d/navigation_agent_3d.h6
-rw-r--r--scene/3d/navigation_link_3d.cpp38
-rw-r--r--scene/3d/navigation_link_3d.h6
-rw-r--r--scene/3d/voxelizer.cpp32
-rw-r--r--scene/audio/audio_stream_player.cpp2
-rw-r--r--scene/gui/aspect_ratio_container.cpp12
-rw-r--r--scene/gui/code_edit.cpp2
-rw-r--r--scene/gui/color_picker.cpp113
-rw-r--r--scene/gui/color_picker.h12
-rw-r--r--scene/gui/file_dialog.cpp10
-rw-r--r--scene/gui/file_dialog.h1
-rw-r--r--scene/gui/item_list.cpp14
-rw-r--r--scene/gui/label.cpp16
-rw-r--r--scene/gui/popup_menu.cpp6
-rw-r--r--scene/gui/rich_text_label.cpp6
-rw-r--r--scene/gui/text_edit.cpp5
-rw-r--r--scene/main/canvas_item.cpp6
-rw-r--r--scene/main/viewport.cpp4
-rw-r--r--scene/main/window.cpp28
-rw-r--r--scene/main/window.h2
-rw-r--r--scene/resources/material.cpp15
-rw-r--r--scene/resources/texture.cpp68
-rw-r--r--scene/resources/texture.h23
-rw-r--r--scene/resources/tile_set.cpp48
-rw-r--r--scene/resources/visual_shader_nodes.cpp7
-rw-r--r--servers/audio/effects/audio_effect_pitch_shift.cpp2
-rw-r--r--servers/navigation_server_2d.cpp6
-rw-r--r--servers/navigation_server_2d.h2
-rw-r--r--servers/navigation_server_3d.cpp37
-rw-r--r--servers/navigation_server_3d.h9
-rw-r--r--servers/navigation_server_3d_dummy.h2
-rw-r--r--servers/physics_3d/godot_shape_3d.cpp2
-rw-r--r--servers/rendering/renderer_rd/effects/ss_effects.cpp32
-rw-r--r--servers/rendering/renderer_rd/shaders/effects/ss_effects_downsample.glsl15
-rw-r--r--servers/rendering/shader_language.cpp2
-rw-r--r--servers/rendering_server.cpp4
-rw-r--r--tests/core/templates/test_paged_array.h51
-rw-r--r--tests/scene/test_text_edit.h44
-rw-r--r--thirdparty/basis_universal/encoder/basisu_comp.cpp2
-rw-r--r--thirdparty/basis_universal/transcoder/basisu_transcoder.cpp2
216 files changed, 1940 insertions, 1210 deletions
diff --git a/.github/workflows/linux_builds.yml b/.github/workflows/linux_builds.yml
index 0000a061d7..2c2ab9b6fb 100644
--- a/.github/workflows/linux_builds.yml
+++ b/.github/workflows/linux_builds.yml
@@ -36,7 +36,8 @@ jobs:
cache-name: linux-editor-double-sanitizers
target: editor
tests: true
- sconsflags: dev_build=yes precision=double use_asan=yes use_ubsan=yes linker=gold
+ # Debug symbols disabled as they're huge on this build and we hit the 14 GB limit for runners.
+ sconsflags: dev_build=yes debug_symbols=no precision=double use_asan=yes use_ubsan=yes linker=gold
proj-test: true
# Can be turned off for PRs that intentionally break compat with godot-cpp,
# until both the upstream PR and the matching godot-cpp changes are merged.
diff --git a/.gitignore b/.gitignore
index e9beb26e7e..17c9a6c95a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -243,9 +243,6 @@ xcuserdata/
x64/
x86/
-# Do not ignore x86 folders anywhere under thirdparty libraries
-!thirdparty/**/x86/
-
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
@@ -255,6 +252,12 @@ bld/
[Ll]og/
[Ll]ogs/
+# Do not ignore arch-specific folders anywhere under thirdparty libraries
+!thirdparty/**/x64/
+!thirdparty/**/x86/
+!thirdparty/**/arm/
+!thirdparty/**/arm64/
+
# Visual Studio 2015/2017 cache/options directory
.vs/
diff --git a/SConstruct b/SConstruct
index 845b9be4a6..2763f3f578 100644
--- a/SConstruct
+++ b/SConstruct
@@ -200,6 +200,7 @@ opts.Add(EnumVariable("warnings", "Level of compilation warnings", "all", ("extr
opts.Add(BoolVariable("werror", "Treat compiler warnings as errors", False))
opts.Add("extra_suffix", "Custom extra suffix added to the base filename of all generated binary files", "")
opts.Add(BoolVariable("vsproj", "Generate a Visual Studio solution", False))
+opts.Add("vsproj_name", "Name of the Visual Studio solution", "godot")
opts.Add(BoolVariable("disable_3d", "Disable 3D nodes for a smaller executable", False))
opts.Add(BoolVariable("disable_advanced_gui", "Disable advanced GUI nodes and behaviors", False))
opts.Add("build_profile", "Path to a file containing a feature build profile", "")
@@ -217,7 +218,7 @@ opts.Add(BoolVariable("builtin_msdfgen", "Use the built-in MSDFgen library", Tru
opts.Add(BoolVariable("builtin_glslang", "Use the built-in glslang library", True))
opts.Add(BoolVariable("builtin_graphite", "Use the built-in Graphite library", True))
opts.Add(BoolVariable("builtin_harfbuzz", "Use the built-in HarfBuzz library", True))
-opts.Add(BoolVariable("builtin_icu", "Use the built-in ICU library", True))
+opts.Add(BoolVariable("builtin_icu4c", "Use the built-in ICU library", True))
opts.Add(BoolVariable("builtin_libogg", "Use the built-in libogg library", True))
opts.Add(BoolVariable("builtin_libpng", "Use the built-in libpng library", True))
opts.Add(BoolVariable("builtin_libtheora", "Use the built-in libtheora library", True))
@@ -228,7 +229,7 @@ opts.Add(BoolVariable("builtin_mbedtls", "Use the built-in mbedTLS library", Tru
opts.Add(BoolVariable("builtin_miniupnpc", "Use the built-in miniupnpc library", True))
opts.Add(BoolVariable("builtin_pcre2", "Use the built-in PCRE2 library", True))
opts.Add(BoolVariable("builtin_pcre2_with_jit", "Use JIT compiler for the built-in PCRE2 library", True))
-opts.Add(BoolVariable("builtin_recast", "Use the built-in Recast library", True))
+opts.Add(BoolVariable("builtin_recastnavigation", "Use the built-in Recast navigation library", True))
opts.Add(BoolVariable("builtin_rvo2", "Use the built-in RVO2 library", True))
opts.Add(BoolVariable("builtin_squish", "Use the built-in squish library", True))
opts.Add(BoolVariable("builtin_xatlas", "Use the built-in xatlas library", True))
@@ -923,7 +924,7 @@ if selected_platform in platform_list:
print("Error: The `vsproj` option is only usable on Windows with Visual Studio.")
Exit(255)
env["CPPPATH"] = [Dir(path) for path in env["CPPPATH"]]
- methods.generate_vs_project(env, GetOption("num_jobs"))
+ methods.generate_vs_project(env, GetOption("num_jobs"), env["vsproj_name"])
methods.generate_cpp_hint_file("cpp.hint")
# Check for the existence of headers
diff --git a/core/input/godotcontrollerdb.txt b/core/input/godotcontrollerdb.txt
index eb4a1a1578..6ead872149 100644
--- a/core/input/godotcontrollerdb.txt
+++ b/core/input/godotcontrollerdb.txt
@@ -8,7 +8,7 @@ __XINPUT_DEVICE__,XInput Gamepad,a:b12,b:b13,x:b14,y:b15,start:b4,back:b5,leftst
Default Android Gamepad,Default Controller,leftx:a0,lefty:a1,dpdown:h0.4,rightstick:b8,rightshoulder:b10,rightx:a2,start:b6,righty:a3,dpleft:h0.8,lefttrigger:a4,x:b2,dpup:h0.1,back:b4,leftstick:b7,leftshoulder:b9,y:b3,a:b0,dpright:h0.2,righttrigger:a5,b:b1,platform:Android,
# Web
-standard,Standard Gamepad Mapping,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a6,righttrigger:a7,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b8,start:b9,leftstick:b10,rightstick:b11,dpup:b12,dpdown:b13,dpleft:b14,dpright:b15,guide:b16,leftstick:b10,rightstick:b11,platform:Web,
+standard,Standard Gamepad Mapping,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b8,start:b9,leftstick:b10,rightstick:b11,dpup:b12,dpdown:b13,dpleft:b14,dpright:b15,guide:b16,leftstick:b10,rightstick:b11,platform:Web,
Linux24c6581a,PowerA Xbox One Cabled,a:b0,b:b1,y:b3,x:b2,start:b7,guide:b8,back:b6,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:-a7,dpleft:-a6,dpdown:+a7,dpright:+a6,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,platform:Web,
Linux0e6f0301,Logic 3 Controller (xbox compatible),a:b0,b:b1,y:b3,x:b2,start:b7,guide:b8,back:b6,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:-a7,dpleft:-a6,dpdown:+a7,dpright:+a6,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,platform:Web,
Linux045e028e,Microsoft X-Box 360 pad,a:b0,b:b1,y:b3,x:b2,start:b7,guide:b8,back:b6,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:-a7,dpleft:-a6,dpdown:+a7,dpright:+a6,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,platform:Web,
diff --git a/core/input/input_map.cpp b/core/input/input_map.cpp
index 5a07d44197..b2e6b57eb6 100644
--- a/core/input/input_map.cpp
+++ b/core/input/input_map.cpp
@@ -344,7 +344,7 @@ static const _BuiltinActionDisplayName _builtin_action_display_names[] = {
{ "ui_text_add_selection_for_next_occurrence", TTRC("Add Selection for Next Occurrence") },
{ "ui_text_clear_carets_and_selection", TTRC("Clear Carets and Selection") },
{ "ui_text_toggle_insert_mode", TTRC("Toggle Insert Mode") },
- { "ui_text_submit", TTRC("Text Submitted") },
+ { "ui_text_submit", TTRC("Submit Text") },
{ "ui_graph_duplicate", TTRC("Duplicate Nodes") },
{ "ui_graph_delete", TTRC("Delete Nodes") },
{ "ui_filedialog_up_one_level", TTRC("Go Up One Level") },
diff --git a/core/io/file_access.cpp b/core/io/file_access.cpp
index cacbcb28a4..0e9084de84 100644
--- a/core/io/file_access.cpp
+++ b/core/io/file_access.cpp
@@ -856,6 +856,8 @@ void FileAccess::_bind_methods() {
ClassDB::bind_method(D_METHOD("store_pascal_string", "string"), &FileAccess::store_pascal_string);
ClassDB::bind_method(D_METHOD("get_pascal_string"), &FileAccess::get_pascal_string);
+ ClassDB::bind_method(D_METHOD("close"), &FileAccess::close);
+
ClassDB::bind_static_method("FileAccess", D_METHOD("file_exists", "path"), &FileAccess::exists);
ClassDB::bind_static_method("FileAccess", D_METHOD("get_modified_time", "file"), &FileAccess::get_modified_time);
diff --git a/core/io/file_access.h b/core/io/file_access.h
index 3e51ba11ed..47770cad87 100644
--- a/core/io/file_access.h
+++ b/core/io/file_access.h
@@ -166,6 +166,8 @@ public:
void store_var(const Variant &p_var, bool p_full_objects = false);
+ virtual void close() = 0;
+
virtual bool file_exists(const String &p_name) = 0; ///< return true if a file exists
virtual Error reopen(const String &p_path, int p_mode_flags); ///< does not change the AccessType
diff --git a/core/io/file_access_compressed.cpp b/core/io/file_access_compressed.cpp
index c256668af0..da59ae8c59 100644
--- a/core/io/file_access_compressed.cpp
+++ b/core/io/file_access_compressed.cpp
@@ -385,6 +385,10 @@ Error FileAccessCompressed::_set_unix_permissions(const String &p_file, uint32_t
return FAILED;
}
+void FileAccessCompressed::close() {
+ _close();
+}
+
FileAccessCompressed::~FileAccessCompressed() {
_close();
}
diff --git a/core/io/file_access_compressed.h b/core/io/file_access_compressed.h
index 136fcede06..601b74a9c1 100644
--- a/core/io/file_access_compressed.h
+++ b/core/io/file_access_compressed.h
@@ -97,6 +97,8 @@ public:
virtual uint32_t _get_unix_permissions(const String &p_file) override;
virtual Error _set_unix_permissions(const String &p_file, uint32_t p_permissions) override;
+ virtual void close() override;
+
FileAccessCompressed() {}
virtual ~FileAccessCompressed();
};
diff --git a/core/io/file_access_encrypted.cpp b/core/io/file_access_encrypted.cpp
index 8282f2515c..c39d19d52b 100644
--- a/core/io/file_access_encrypted.cpp
+++ b/core/io/file_access_encrypted.cpp
@@ -294,6 +294,10 @@ Error FileAccessEncrypted::_set_unix_permissions(const String &p_file, uint32_t
return ERR_UNAVAILABLE;
}
+void FileAccessEncrypted::close() {
+ _close();
+}
+
FileAccessEncrypted::~FileAccessEncrypted() {
_close();
}
diff --git a/core/io/file_access_encrypted.h b/core/io/file_access_encrypted.h
index d8cd0df6d1..9702b5a517 100644
--- a/core/io/file_access_encrypted.h
+++ b/core/io/file_access_encrypted.h
@@ -88,6 +88,8 @@ public:
virtual uint32_t _get_unix_permissions(const String &p_file) override;
virtual Error _set_unix_permissions(const String &p_file, uint32_t p_permissions) override;
+ virtual void close() override;
+
FileAccessEncrypted() {}
~FileAccessEncrypted();
};
diff --git a/core/io/file_access_memory.h b/core/io/file_access_memory.h
index adc29f74be..43fe6ab658 100644
--- a/core/io/file_access_memory.h
+++ b/core/io/file_access_memory.h
@@ -71,6 +71,8 @@ public:
virtual uint32_t _get_unix_permissions(const String &p_file) override { return 0; }
virtual Error _set_unix_permissions(const String &p_file, uint32_t p_permissions) override { return FAILED; }
+ virtual void close() override {}
+
FileAccessMemory() {}
};
diff --git a/core/io/file_access_network.cpp b/core/io/file_access_network.cpp
index e765eb2d42..7fabff26ac 100644
--- a/core/io/file_access_network.cpp
+++ b/core/io/file_access_network.cpp
@@ -469,6 +469,15 @@ void FileAccessNetwork::configure() {
GLOBAL_DEF(PropertyInfo(Variant::INT, "network/remote_fs/page_read_ahead", PROPERTY_HINT_RANGE, "0,8,1,or_greater"), 4);
}
+void FileAccessNetwork::close() {
+ _close();
+
+ FileAccessNetworkClient *nc = FileAccessNetworkClient::singleton;
+ nc->lock_mutex();
+ nc->accesses.erase(id);
+ nc->unlock_mutex();
+}
+
FileAccessNetwork::FileAccessNetwork() {
FileAccessNetworkClient *nc = FileAccessNetworkClient::singleton;
nc->lock_mutex();
diff --git a/core/io/file_access_network.h b/core/io/file_access_network.h
index 16e8920114..78c19347ce 100644
--- a/core/io/file_access_network.h
+++ b/core/io/file_access_network.h
@@ -156,6 +156,8 @@ public:
virtual uint32_t _get_unix_permissions(const String &p_file) override;
virtual Error _set_unix_permissions(const String &p_file, uint32_t p_permissions) override;
+ virtual void close() override;
+
static void configure();
FileAccessNetwork();
diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp
index 7c392c005a..9553f35b19 100644
--- a/core/io/file_access_pack.cpp
+++ b/core/io/file_access_pack.cpp
@@ -366,6 +366,10 @@ bool FileAccessPack::file_exists(const String &p_name) {
return false;
}
+void FileAccessPack::close() {
+ f = Ref<FileAccess>();
+}
+
FileAccessPack::FileAccessPack(const String &p_path, const PackedData::PackedFile &p_file) :
pf(p_file),
f(FileAccess::open(pf.pack, FileAccess::READ)) {
diff --git a/core/io/file_access_pack.h b/core/io/file_access_pack.h
index baa62e4516..8bfabc9529 100644
--- a/core/io/file_access_pack.h
+++ b/core/io/file_access_pack.h
@@ -178,6 +178,8 @@ public:
virtual bool file_exists(const String &p_name) override;
+ virtual void close() override;
+
FileAccessPack(const String &p_path, const PackedData::PackedFile &p_file);
};
diff --git a/core/io/file_access_zip.cpp b/core/io/file_access_zip.cpp
index b71dd5e9bd..064353476f 100644
--- a/core/io/file_access_zip.cpp
+++ b/core/io/file_access_zip.cpp
@@ -336,6 +336,10 @@ bool FileAccessZip::file_exists(const String &p_name) {
return false;
}
+void FileAccessZip::close() {
+ _close();
+}
+
FileAccessZip::FileAccessZip(const String &p_path, const PackedData::PackedFile &p_file) {
open_internal(p_path, FileAccess::READ);
}
diff --git a/core/io/file_access_zip.h b/core/io/file_access_zip.h
index 63f1012f99..f8b640946c 100644
--- a/core/io/file_access_zip.h
+++ b/core/io/file_access_zip.h
@@ -109,6 +109,8 @@ public:
virtual uint32_t _get_unix_permissions(const String &p_file) override { return 0; }
virtual Error _set_unix_permissions(const String &p_file, uint32_t p_permissions) override { return FAILED; }
+ virtual void close() override;
+
FileAccessZip(const String &p_path, const PackedData::PackedFile &p_file);
~FileAccessZip();
};
diff --git a/core/object/script_language_extension.cpp b/core/object/script_language_extension.cpp
index 19c6fc3383..c7eb32c020 100644
--- a/core/object/script_language_extension.cpp
+++ b/core/object/script_language_extension.cpp
@@ -36,6 +36,7 @@ void ScriptExtension::_bind_methods() {
GDVIRTUAL_BIND(_can_instantiate);
GDVIRTUAL_BIND(_get_base_script);
+ GDVIRTUAL_BIND(_get_global_name);
GDVIRTUAL_BIND(_inherits_script, "script");
GDVIRTUAL_BIND(_get_instance_base_type);
diff --git a/core/templates/paged_array.h b/core/templates/paged_array.h
index c447b5af64..45b90869b9 100644
--- a/core/templates/paged_array.h
+++ b/core/templates/paged_array.h
@@ -278,10 +278,10 @@ public:
count -= remainder;
- uint32_t src_pages = p_array._get_pages_in_use();
+ uint32_t src_page_index = 0;
uint32_t page_size = page_size_mask + 1;
- for (uint32_t i = 0; i < src_pages; i++) {
+ while (p_array.count > 0) {
uint32_t page_count = _get_pages_in_use();
uint32_t new_page_count = page_count + 1;
@@ -289,16 +289,14 @@ public:
_grow_page_array(); //keep out of inline
}
- page_data[page_count] = p_array.page_data[i];
- page_ids[page_count] = p_array.page_ids[i];
- if (i == src_pages - 1) {
- //last page, only increment with remainder
- count += p_array.count & page_size_mask;
- } else {
- count += page_size;
- }
+ page_data[page_count] = p_array.page_data[src_page_index];
+ page_ids[page_count] = p_array.page_ids[src_page_index];
+
+ uint32_t take = MIN(p_array.count, page_size); //pages to take away
+ p_array.count -= take;
+ count += take;
+ src_page_index++;
}
- p_array.count = 0; //take away the other array pages
//handle the remainder page if exists
if (remainder_page) {
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml
index d5280cb548..ed7bdc07fc 100644
--- a/doc/classes/@GlobalScope.xml
+++ b/doc/classes/@GlobalScope.xml
@@ -1140,7 +1140,7 @@
<return type="float" />
<param index="0" name="x" type="float" />
<description>
- Returns [code]-1.0[/code] if [param x] is negative, [code]1.0[/code] if [param x] is positive, and [code]0.0[/code] if if [param x] is zero.
+ Returns [code]-1.0[/code] if [param x] is negative, [code]1.0[/code] if [param x] is positive, and [code]0.0[/code] if [param x] is zero.
[codeblock]
sign(-6.5) # Returns -1.0
sign(0.0) # Returns 0.0
diff --git a/doc/classes/AStar2D.xml b/doc/classes/AStar2D.xml
index 2414b068e6..d80d784366 100644
--- a/doc/classes/AStar2D.xml
+++ b/doc/classes/AStar2D.xml
@@ -175,7 +175,7 @@
<method name="get_point_capacity" qualifiers="const">
<return type="int" />
<description>
- Returns the capacity of the structure backing the points, useful in conjunction with [code]reserve_space[/code].
+ Returns the capacity of the structure backing the points, useful in conjunction with [method reserve_space].
</description>
</method>
<method name="get_point_connections">
diff --git a/doc/classes/AnimatedTexture.xml b/doc/classes/AnimatedTexture.xml
index 57a7f86901..052c55dfb6 100644
--- a/doc/classes/AnimatedTexture.xml
+++ b/doc/classes/AnimatedTexture.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="AnimatedTexture" inherits="Texture2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
+<class name="AnimatedTexture" inherits="Texture2D" is_deprecated="true" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Proxy texture for simple frame-based animations.
</brief_description>
@@ -8,6 +8,7 @@
The playback of the animation is controlled by the [member speed_scale] property, as well as each frame's duration (see [method set_frame_duration]). The animation loops, i.e. it will restart at frame 0 automatically after playing the last frame.
[AnimatedTexture] currently requires all frame textures to have the same size, otherwise the bigger ones will be cropped to match the smallest one.
[b]Note:[/b] AnimatedTexture doesn't support using [AtlasTexture]s. Each frame needs to be a separate [Texture2D].
+ [b]Warning:[/b] AnimatedTexture is deprecated, and might be removed in a future release. Its current implementation is not efficient for the modern renderers.
</description>
<tutorials>
</tutorials>
@@ -46,7 +47,7 @@
</methods>
<members>
<member name="current_frame" type="int" setter="set_current_frame" getter="get_current_frame">
- Sets the currently visible frame of the texture.
+ Sets the currently visible frame of the texture. Setting this frame while playing resets the current frame time, so the newly selected frame plays for its whole configured frame duration.
</member>
<member name="frames" type="int" setter="set_frames" getter="get_frames" default="1">
Number of frames to use in the animation. While you can create the frames independently with [method set_frame_texture], you need to set this value for the animation to take new frames into account. The maximum number of frames is [constant MAX_FRAMES].
diff --git a/doc/classes/Animation.xml b/doc/classes/Animation.xml
index 74ee13a3d2..9b834f2635 100644
--- a/doc/classes/Animation.xml
+++ b/doc/classes/Animation.xml
@@ -108,7 +108,7 @@
<return type="bool" />
<param index="0" name="track_idx" type="int" />
<description>
- Returns [code]true[/code] if the track at [code]idx[/code] will be blended with other animations.
+ Returns [code]true[/code] if the track at [param track_idx] will be blended with other animations.
</description>
</method>
<method name="audio_track_set_key_end_offset">
diff --git a/doc/classes/BaseMaterial3D.xml b/doc/classes/BaseMaterial3D.xml
index e72aa373f7..6cd8c44269 100644
--- a/doc/classes/BaseMaterial3D.xml
+++ b/doc/classes/BaseMaterial3D.xml
@@ -121,7 +121,7 @@
Texture used to control the backlight effect per-pixel. Added to [member backlight].
</member>
<member name="billboard_keep_scale" type="bool" setter="set_flag" getter="get_flag" default="false">
- If [code]true[/code], the shader will keep the scale set for the mesh. Otherwise, the scale is lost when billboarding. Only applies when [member billboard_mode] is [constant BILLBOARD_ENABLED].
+ If [code]true[/code], the shader will keep the scale set for the mesh. Otherwise, the scale is lost when billboarding. Only applies when [member billboard_mode] is not [constant BILLBOARD_DISABLED].
</member>
<member name="billboard_mode" type="int" setter="set_billboard_mode" getter="get_billboard_mode" enum="BaseMaterial3D.BillboardMode" default="0">
Controls how the object faces the camera. See [enum BillboardMode].
diff --git a/doc/classes/Bone2D.xml b/doc/classes/Bone2D.xml
index d452edd1aa..c421fe1543 100644
--- a/doc/classes/Bone2D.xml
+++ b/doc/classes/Bone2D.xml
@@ -31,12 +31,6 @@
[b]Note:[/b] This is different from the [code]Bone2D[/code]'s rotation. The bone angle is the rotation of the bone shown by the [code]Bone2D[/code] gizmo, and because [code]Bone2D[/code] bones are based on positions, this can vary from the actual rotation of the [code]Bone2D[/code] node.
</description>
</method>
- <method name="get_default_length" qualifiers="const">
- <return type="float" />
- <description>
- Deprecated. Please use [code]get_length[/code] instead.
- </description>
- </method>
<method name="get_index_in_skeleton" qualifiers="const">
<return type="int" />
<description>
@@ -70,13 +64,6 @@
[b]Note:[/b] This is different from the [code]Bone2D[/code]'s rotation. The bone angle is the rotation of the bone shown by the [code]Bone2D[/code] gizmo, and because [code]Bone2D[/code] bones are based on positions, this can vary from the actual rotation of the [code]Bone2D[/code] node.
</description>
</method>
- <method name="set_default_length">
- <return type="void" />
- <param index="0" name="default_length" type="float" />
- <description>
- Deprecated. Please use [code]set_length[/code] instead.
- </description>
- </method>
<method name="set_length">
<return type="void" />
<param index="0" name="length" type="float" />
diff --git a/doc/classes/BoneAttachment3D.xml b/doc/classes/BoneAttachment3D.xml
index dd01de3607..850aa4c2f2 100644
--- a/doc/classes/BoneAttachment3D.xml
+++ b/doc/classes/BoneAttachment3D.xml
@@ -33,14 +33,14 @@
<return type="void" />
<param index="0" name="external_skeleton" type="NodePath" />
<description>
- Sets the [NodePath] to the external skeleton that the BoneAttachment3D node should use. The external [Skeleton3D] node is only used when [code]use_external_skeleton[/code] is set to [code]true[/code].
+ Sets the [NodePath] to the external skeleton that the BoneAttachment3D node should use. See [method set_use_external_skeleton] to enable the external [Skeleton3D] node.
</description>
</method>
<method name="set_use_external_skeleton">
<return type="void" />
<param index="0" name="use_external_skeleton" type="bool" />
<description>
- Sets whether the BoneAttachment3D node will use an extenral [Skeleton3D] node rather than attenpting to use its parent node as the [Skeleton3D]. When set to [code]true[/code], the BoneAttachment3D node will use the external [Skeleton3D] node set in [code]set_external_skeleton[/code].
+ Sets whether the BoneAttachment3D node will use an extenral [Skeleton3D] node rather than attenpting to use its parent node as the [Skeleton3D]. When set to [code]true[/code], the BoneAttachment3D node will use the external [Skeleton3D] node set in [method set_external_skeleton].
</description>
</method>
</methods>
diff --git a/doc/classes/BoxMesh.xml b/doc/classes/BoxMesh.xml
index 84e6d6f87d..f8cae0fc72 100644
--- a/doc/classes/BoxMesh.xml
+++ b/doc/classes/BoxMesh.xml
@@ -5,7 +5,7 @@
</brief_description>
<description>
Generate an axis-aligned box [PrimitiveMesh].
- The box's UV layout is arranged in a 3×2 layout that allows texturing each face individually. To apply the same texture on all faces, change the material's UV property to [code]Vector3(3, 2, 1)[/code].
+ The box's UV layout is arranged in a 3×2 layout that allows texturing each face individually. To apply the same texture on all faces, change the material's UV property to [code]Vector3(3, 2, 1)[/code]. This is equivalent to adding [code]UV *= vec2(3.0, 2.0)[/code] in a vertex shader.
[b]Note:[/b] When using a large textured [BoxMesh] (e.g. as a floor), you may stumble upon UV jittering issues depending on the camera angle. To solve this, increase [member subdivide_depth], [member subdivide_height] and [member subdivide_width] until you no longer notice UV jittering.
</description>
<tutorials>
diff --git a/doc/classes/Decal.xml b/doc/classes/Decal.xml
index ddfa64891d..824416e4d4 100644
--- a/doc/classes/Decal.xml
+++ b/doc/classes/Decal.xml
@@ -96,7 +96,7 @@
[b]Note:[/b] Unlike [BaseMaterial3D] whose filter mode can be adjusted on a per-material basis, the filter mode for [Decal] textures is set globally with [member ProjectSettings.rendering/textures/decals/filter].
</member>
<member name="texture_emission" type="Texture2D" setter="set_texture" getter="get_texture">
- [Texture2D] with the emission [Color] of the Decal. Either this or the [member texture_emission] must be set for the Decal to be visible. Use the alpha channel like a mask to smoothly blend the edges of the decal with the underlying object.
+ [Texture2D] with the emission [Color] of the Decal. Either this or the [member texture_albedo] must be set for the Decal to be visible. Use the alpha channel like a mask to smoothly blend the edges of the decal with the underlying object.
[b]Note:[/b] Unlike [BaseMaterial3D] whose filter mode can be adjusted on a per-material basis, the filter mode for [Decal] textures is set globally with [member ProjectSettings.rendering/textures/decals/filter].
</member>
<member name="texture_normal" type="Texture2D" setter="set_texture" getter="get_texture">
diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml
index 4463abfe07..a258a8c010 100644
--- a/doc/classes/DisplayServer.xml
+++ b/doc/classes/DisplayServer.xml
@@ -190,6 +190,7 @@
<description>
Adds a new checkable item with text [param label] to the global menu with ID [param menu_root].
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
+ An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using boolean OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented on macOS.
[b]Supported system menu IDs:[/b]
@@ -212,6 +213,7 @@
<description>
Adds a new checkable item with text [param label] and icon [param icon] to the global menu with ID [param menu_root].
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
+ An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using boolean OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented on macOS.
[b]Supported system menu IDs:[/b]
@@ -234,6 +236,7 @@
<description>
Adds a new item with text [param label] and icon [param icon] to the global menu with ID [param menu_root].
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
+ An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using boolean OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented on macOS.
[b]Supported system menu IDs:[/b]
@@ -256,6 +259,7 @@
<description>
Adds a new radio-checkable item with text [param label] and icon [param icon] to the global menu with ID [param menu_root].
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
+ An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using boolean OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
[b]Note:[/b] Radio-checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method global_menu_set_item_checked] for more info on how to control it.
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented on macOS.
@@ -278,6 +282,7 @@
<description>
Adds a new item with text [param label] to the global menu with ID [param menu_root].
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
+ An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using boolean OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented on macOS.
[b]Supported system menu IDs:[/b]
@@ -302,6 +307,7 @@
Adds a new item with text [param label] to the global menu with ID [param menu_root].
Contrarily to normal binary items, multistate items can have more than two states, as defined by [param max_states]. Each press or activate of the item will increase the state by one. The default value is defined by [param default_state].
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
+ An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using boolean OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
[b]Note:[/b] By default, there's no indication of the current item state, it should be changed manually.
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented on macOS.
@@ -324,6 +330,7 @@
<description>
Adds a new radio-checkable item with text [param label] to the global menu with ID [param menu_root].
Returns index of the inserted item, it's not guaranteed to be the same as [param index] value.
+ An [param accelerator] can optionally be defined, which is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The [param accelerator] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using boolean OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
[b]Note:[/b] Radio-checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method global_menu_set_item_checked] for more info on how to control it.
[b]Note:[/b] The [param callback] and [param key_callback] Callables need to accept exactly one Variant parameter, the parameter passed to the Callables will be the value passed to [param tag].
[b]Note:[/b] This method is implemented on macOS.
@@ -558,7 +565,7 @@
<param index="1" name="idx" type="int" />
<param index="2" name="keycode" type="int" enum="Key" />
<description>
- Sets the accelerator of the item at index [param idx].
+ Sets the accelerator of the item at index [param idx]. [param keycode] can be a single [enum Key], or a combination of [enum KeyModifierMask]s and [enum Key]s using boolean OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
[b]Note:[/b] This method is implemented on macOS.
</description>
</method>
diff --git a/doc/classes/EditorInspectorPlugin.xml b/doc/classes/EditorInspectorPlugin.xml
index 7ffd7f9426..bbd383edc0 100644
--- a/doc/classes/EditorInspectorPlugin.xml
+++ b/doc/classes/EditorInspectorPlugin.xml
@@ -18,7 +18,7 @@
<methods>
<method name="_can_handle" qualifiers="virtual const">
<return type="bool" />
- <param index="0" name="object" type="Variant" />
+ <param index="0" name="object" type="Object" />
<description>
Returns [code]true[/code] if this object can be handled by this plugin.
</description>
diff --git a/doc/classes/EditorNode3DGizmoPlugin.xml b/doc/classes/EditorNode3DGizmoPlugin.xml
index 3ab13ec5c0..7c012f8ef6 100644
--- a/doc/classes/EditorNode3DGizmoPlugin.xml
+++ b/doc/classes/EditorNode3DGizmoPlugin.xml
@@ -138,7 +138,7 @@
<param index="1" name="subgizmo_id" type="int" />
<param index="2" name="transform" type="Transform3D" />
<description>
- Override this method to update the node properties during subgizmo editing (see [method _subgizmos_intersect_ray] and [method _subgizmos_intersect_frustum]). The [param transform] is given in the Node3D's local coordinate system. Called for this plugin's active gizmos.
+ Override this method to update the node properties during subgizmo editing (see [method _subgizmos_intersect_ray] and [method _subgizmos_intersect_frustum]). The [param transform] is given in the Node3D's local coordinate system. Called for this plugin's active gizmos.
</description>
</method>
<method name="_subgizmos_intersect_frustum" qualifiers="virtual const">
@@ -147,7 +147,7 @@
<param index="1" name="camera" type="Camera3D" />
<param index="2" name="frustum_planes" type="Plane[]" />
<description>
- Override this method to allow selecting subgizmos using mouse drag box selection. Given a [param camera] and [param frustum_planes], this method should return which subgizmos are contained within the frustums. The [param frustum_planes] argument consists of an [code]Array[/code] with all the [code]Plane[/code]s that make up the selection frustum. The returned value should contain a list of unique subgizmo identifiers, these identifiers can have any non-negative value and will be used in other virtual methods like [method _get_subgizmo_transform] or [method _commit_subgizmos]. Called for this plugin's active gizmos.
+ Override this method to allow selecting subgizmos using mouse drag box selection. Given a [param camera] and [param frustum_planes], this method should return which subgizmos are contained within the frustums. The [param frustum_planes] argument consists of an [code]Array[/code] with all the [code]Plane[/code]s that make up the selection frustum. The returned value should contain a list of unique subgizmo identifiers, these identifiers can have any non-negative value and will be used in other virtual methods like [method _get_subgizmo_transform] or [method _commit_subgizmos]. Called for this plugin's active gizmos.
</description>
</method>
<method name="_subgizmos_intersect_ray" qualifiers="virtual const">
diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml
index f4b912de9e..95c0f8efe1 100644
--- a/doc/classes/EditorPlugin.xml
+++ b/doc/classes/EditorPlugin.xml
@@ -38,7 +38,7 @@
</method>
<method name="_edit" qualifiers="virtual">
<return type="void" />
- <param index="0" name="object" type="Variant" />
+ <param index="0" name="object" type="Object" />
<description>
This function is used for plugins that edit specific object types (nodes or resources). It requests the editor to edit the given object.
[param object] can be [code]null[/code] if the plugin was editing an object, but there is no longer any selected object handled by this plugin. It can be used to cleanup editing state.
@@ -295,7 +295,7 @@
</method>
<method name="_handles" qualifiers="virtual const">
<return type="bool" />
- <param index="0" name="object" type="Variant" />
+ <param index="0" name="object" type="Object" />
<description>
Implement this function if your plugin edits a specific type of object (Resource or Node). If you return [code]true[/code], then you will get the functions [method _edit] and [method _make_visible] called when the editor requests them. If you have declared the methods [method _forward_canvas_gui_input] and [method _forward_3d_gui_input] these will be called too.
</description>
diff --git a/doc/classes/FileAccess.xml b/doc/classes/FileAccess.xml
index eda06d57da..526f7c22e6 100644
--- a/doc/classes/FileAccess.xml
+++ b/doc/classes/FileAccess.xml
@@ -33,7 +33,7 @@
[/csharp]
[/codeblocks]
In the example above, the file will be saved in the user data folder as specified in the [url=$DOCS_URL/tutorials/io/data_paths.html]Data paths[/url] documentation.
- There is no method to close a file in order to free it from use. Instead, [FileAccess] will close when it's freed, which happens when it goes out of scope or when it gets assigned with [code]null[/code]. In C# the reference must be disposed after we are done using it, this can be done with the [code]using[/code] statement or calling the [code]Dispose[/code] method directly.
+ [FileAccess] will close when it's freed, which happens when it goes out of scope or when it gets assigned with [code]null[/code]. In C# the reference must be disposed after we are done using it, this can be done with the [code]using[/code] statement or calling the [code]Dispose[/code] method directly.
[codeblocks]
[gdscript]
var file = FileAccess.open("res://something") # File is opened and locked for use.
@@ -52,6 +52,13 @@
<link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<methods>
+ <method name="close">
+ <return type="void" />
+ <description>
+ Closes the currently opened file and prevents subsequent read/write operations. Use flush to persist the data to disk without closing the file.
+ [b]Note:[/b] [FileAccess] will automatically close when it's freed, which happens when it goes out of scope or when it gets assigned with [code]null[/code]. In C# the reference must be disposed after we are done using it, this can be done with the [code]using[/code] statement or calling the [code]Dispose[/code] method directly.
+ </description>
+ </method>
<method name="eof_reached" qualifiers="const">
<return type="bool" />
<description>
diff --git a/doc/classes/GeometryInstance3D.xml b/doc/classes/GeometryInstance3D.xml
index 127c5daf95..2bb55a1f40 100644
--- a/doc/classes/GeometryInstance3D.xml
+++ b/doc/classes/GeometryInstance3D.xml
@@ -46,10 +46,10 @@
[b]Note:[/b] Lights' bake mode will also affect the global illumination rendering. See [member Light3D.light_bake_mode].
</member>
<member name="ignore_occlusion_culling" type="bool" setter="set_ignore_occlusion_culling" getter="is_ignoring_occlusion_culling" default="false">
- If [code]true[/code], disables occlusion culling for this instance. Useful for gizmos that must be rendered even when occlusion culling is in use.
+ If [code]true[/code], disables occlusion culling for this instance. Useful for gizmos that must be rendered even when occlusion culling is in use.
</member>
<member name="lod_bias" type="float" setter="set_lod_bias" getter="get_lod_bias" default="1.0">
- Changes how quickly the mesh transitions to a lower level of detail. A value of 0 will force the mesh to its lowest level of detail, a value of 1 will use the default settings, and larger values will keep the mesh in a higher level of detail at farther distances.
+ Changes how quickly the mesh transitions to a lower level of detail. A value of 0 will force the mesh to its lowest level of detail, a value of 1 will use the default settings, and larger values will keep the mesh in a higher level of detail at farther distances.
Useful for testing level of detail transitions in the editor.
</member>
<member name="material_overlay" type="Material" setter="set_material_overlay" getter="get_material_overlay">
diff --git a/doc/classes/InputEvent.xml b/doc/classes/InputEvent.xml
index 043ccdca36..53fb334ede 100644
--- a/doc/classes/InputEvent.xml
+++ b/doc/classes/InputEvent.xml
@@ -74,7 +74,7 @@
<method name="is_echo" qualifiers="const">
<return type="bool" />
<description>
- Returns [code]true[/code] if this input event is an echo event (only for events of type [InputEventKey]).
+ Returns [code]true[/code] if this input event is an echo event (only for events of type [InputEventKey]). Any other event type returns [code]false[/code].
</description>
</method>
<method name="is_match" qualifiers="const">
diff --git a/doc/classes/NavigationAgent2D.xml b/doc/classes/NavigationAgent2D.xml
index 92fd8bcc6a..c6d03fb6d8 100644
--- a/doc/classes/NavigationAgent2D.xml
+++ b/doc/classes/NavigationAgent2D.xml
@@ -171,6 +171,8 @@
- [code]type[/code]: Always [constant NavigationPathQueryResult2D.PATH_SEGMENT_TYPE_LINK].
- [code]rid[/code]: The [RID] of the link.
- [code]owner[/code]: The object which manages the link (usually [NavigationLink2D]).
+ - [code]link_entry_position[/code]: If [code]owner[/code] is available and the owner is a [NavigationLink2D], it will contain the global position of the link's point the agent is entering.
+ - [code]link_exit_position[/code]: If [code]owner[/code] is available and the owner is a [NavigationLink2D], it will contain the global position of the link's point which the agent is exiting.
</description>
</signal>
<signal name="navigation_finished">
diff --git a/doc/classes/NavigationAgent3D.xml b/doc/classes/NavigationAgent3D.xml
index 0ed11bc477..d2151773da 100644
--- a/doc/classes/NavigationAgent3D.xml
+++ b/doc/classes/NavigationAgent3D.xml
@@ -144,13 +144,13 @@
<member name="path_desired_distance" type="float" setter="set_path_desired_distance" getter="get_path_desired_distance" default="1.0">
The distance threshold before a path point is considered to be reached. This will allow an agent to not have to hit a path point on the path exactly, but in the area. If this value is set to high the NavigationAgent will skip points on the path which can lead to leaving the navigation mesh. If this value is set to low the NavigationAgent will be stuck in a repath loop cause it will constantly overshoot or undershoot the distance to the next point on each physics frame update.
</member>
- <member name="path_max_distance" type="float" setter="set_path_max_distance" getter="get_path_max_distance" default="3.0">
+ <member name="path_max_distance" type="float" setter="set_path_max_distance" getter="get_path_max_distance" default="5.0">
The maximum distance the agent is allowed away from the ideal path to the final position. This can happen due to trying to avoid collisions. When the maximum distance is exceeded, it recalculates the ideal path.
</member>
<member name="path_metadata_flags" type="int" setter="set_path_metadata_flags" getter="get_path_metadata_flags" enum="NavigationPathQueryParameters3D.PathMetadataFlags" default="7">
Additional information to return with the navigation path.
</member>
- <member name="radius" type="float" setter="set_radius" getter="get_radius" default="1.0">
+ <member name="radius" type="float" setter="set_radius" getter="get_radius" default="0.5">
The radius of the avoidance agent. This is the "body" of the avoidance agent and not the avoidance maneuver starting radius (which is controlled by [member neighbor_distance]).
Does not affect normal pathfinding. To change an actor's pathfinding radius bake [NavigationMesh] resources with a different [member NavigationMesh.agent_radius] property and use different navigation maps for each actor size.
</member>
@@ -160,7 +160,7 @@
<member name="target_position" type="Vector3" setter="set_target_position" getter="get_target_position" default="Vector3(0, 0, 0)">
The user-defined target position. Setting this property will clear the current navigation path.
</member>
- <member name="time_horizon" type="float" setter="set_time_horizon" getter="get_time_horizon" default="5.0">
+ <member name="time_horizon" type="float" setter="set_time_horizon" getter="get_time_horizon" default="1.0">
The minimal amount of time for which this agent's velocities, that are computed with the collision avoidance algorithm, are safe with respect to other agents. The larger the number, the sooner the agent will respond to other agents, but less freedom in choosing its velocities. Must be positive.
</member>
</members>
@@ -174,6 +174,8 @@
- [code]type[/code]: Always [constant NavigationPathQueryResult3D.PATH_SEGMENT_TYPE_LINK].
- [code]rid[/code]: The [RID] of the link.
- [code]owner[/code]: The object which manages the link (usually [NavigationLink3D]).
+ - [code]link_entry_position[/code]: If [code]owner[/code] is available and the owner is a [NavigationLink2D], it will contain the global position of the link's point the agent is entering.
+ - [code]link_exit_position[/code]: If [code]owner[/code] is available and the owner is a [NavigationLink2D], it will contain the global position of the link's point which the agent is exiting.
</description>
</signal>
<signal name="navigation_finished">
diff --git a/doc/classes/NavigationLink2D.xml b/doc/classes/NavigationLink2D.xml
index b3f4367675..b3768c357c 100644
--- a/doc/classes/NavigationLink2D.xml
+++ b/doc/classes/NavigationLink2D.xml
@@ -4,12 +4,24 @@
Creates a link between two positions that [NavigationServer2D] can route agents through.
</brief_description>
<description>
- Creates a link between two positions that [NavigationServer2D] can route agents through. Links can be used to express navigation methods that aren't just traveling along the surface of the navigation mesh, like zip-lines, teleporters, or jumping across gaps.
+ Creates a link between two positions that [NavigationServer2D] can route agents through. Links can be used to express navigation methods that aren't just traveling along the surface of the navigation mesh, like zip-lines, teleporters, or jumping across gaps.
</description>
<tutorials>
<link title="Using NavigationLinks">$DOCS_URL/tutorials/navigation/navigation_using_navigationlinks.html</link>
</tutorials>
<methods>
+ <method name="get_global_end_position" qualifiers="const">
+ <return type="Vector2" />
+ <description>
+ Returns the [member end_position] that is relative to the link as a global position.
+ </description>
+ </method>
+ <method name="get_global_start_position" qualifiers="const">
+ <return type="Vector2" />
+ <description>
+ Returns the [member start_position] that is relative to the link as a global position.
+ </description>
+ </method>
<method name="get_navigation_layer_value" qualifiers="const">
<return type="bool" />
<param index="0" name="layer_number" type="int" />
@@ -17,6 +29,20 @@
Returns whether or not the specified layer of the [member navigation_layers] bitmask is enabled, given a [code]layer_number[/code] between 1 and 32.
</description>
</method>
+ <method name="set_global_end_position">
+ <return type="void" />
+ <param index="0" name="position" type="Vector2" />
+ <description>
+ Sets the [member end_position] that is relative to the link from a global [param position].
+ </description>
+ </method>
+ <method name="set_global_start_position">
+ <return type="void" />
+ <param index="0" name="position" type="Vector2" />
+ <description>
+ Sets the [member start_position] that is relative to the link from a global [param position].
+ </description>
+ </method>
<method name="set_navigation_layer_value">
<return type="void" />
<param index="0" name="layer_number" type="int" />
diff --git a/doc/classes/NavigationLink3D.xml b/doc/classes/NavigationLink3D.xml
index 4dff226042..63abecf631 100644
--- a/doc/classes/NavigationLink3D.xml
+++ b/doc/classes/NavigationLink3D.xml
@@ -4,12 +4,24 @@
Creates a link between two positions that [NavigationServer3D] can route agents through.
</brief_description>
<description>
- Creates a link between two positions that [NavigationServer3D] can route agents through. Links can be used to express navigation methods that aren't just traveling along the surface of the navigation mesh, like zip-lines, teleporters, or jumping across gaps.
+ Creates a link between two positions that [NavigationServer3D] can route agents through. Links can be used to express navigation methods that aren't just traveling along the surface of the navigation mesh, like zip-lines, teleporters, or jumping across gaps.
</description>
<tutorials>
<link title="Using NavigationLinks">$DOCS_URL/tutorials/navigation/navigation_using_navigationlinks.html</link>
</tutorials>
<methods>
+ <method name="get_global_end_position" qualifiers="const">
+ <return type="Vector3" />
+ <description>
+ Returns the [member end_position] that is relative to the link as a global position.
+ </description>
+ </method>
+ <method name="get_global_start_position" qualifiers="const">
+ <return type="Vector3" />
+ <description>
+ Returns the [member start_position] that is relative to the link as a global position.
+ </description>
+ </method>
<method name="get_navigation_layer_value" qualifiers="const">
<return type="bool" />
<param index="0" name="layer_number" type="int" />
@@ -17,6 +29,20 @@
Returns whether or not the specified layer of the [member navigation_layers] bitmask is enabled, given a [code]layer_number[/code] between 1 and 32.
</description>
</method>
+ <method name="set_global_end_position">
+ <return type="void" />
+ <param index="0" name="position" type="Vector3" />
+ <description>
+ Sets the [member end_position] that is relative to the link from a global [param position].
+ </description>
+ </method>
+ <method name="set_global_start_position">
+ <return type="void" />
+ <param index="0" name="position" type="Vector3" />
+ <description>
+ Sets the [member start_position] that is relative to the link from a global [param position].
+ </description>
+ </method>
<method name="set_navigation_layer_value">
<return type="void" />
<param index="0" name="layer_number" type="int" />
diff --git a/doc/classes/NavigationPathQueryResult2D.xml b/doc/classes/NavigationPathQueryResult2D.xml
index 7bc588619d..2bf7961b35 100644
--- a/doc/classes/NavigationPathQueryResult2D.xml
+++ b/doc/classes/NavigationPathQueryResult2D.xml
@@ -13,7 +13,7 @@
<method name="reset">
<return type="void" />
<description>
- Reset the result object to its initial state. This is useful to reuse the object across multiple queries.
+ Reset the result object to its initial state. This is useful to reuse the object across multiple queries.
</description>
</method>
</methods>
diff --git a/doc/classes/NavigationPathQueryResult3D.xml b/doc/classes/NavigationPathQueryResult3D.xml
index 118a597b6c..a49eb14b67 100644
--- a/doc/classes/NavigationPathQueryResult3D.xml
+++ b/doc/classes/NavigationPathQueryResult3D.xml
@@ -13,7 +13,7 @@
<method name="reset">
<return type="void" />
<description>
- Reset the result object to its initial state. This is useful to reuse the object across multiple queries.
+ Reset the result object to its initial state. This is useful to reuse the object across multiple queries.
</description>
</method>
</methods>
diff --git a/doc/classes/NavigationServer2D.xml b/doc/classes/NavigationServer2D.xml
index e7a2b99172..103de8eddb 100644
--- a/doc/classes/NavigationServer2D.xml
+++ b/doc/classes/NavigationServer2D.xml
@@ -126,6 +126,12 @@
Destroys the given RID.
</description>
</method>
+ <method name="get_debug_enabled" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] when the NavigationServer has debug enabled.
+ </description>
+ </method>
<method name="get_maps" qualifiers="const">
<return type="RID[]" />
<description>
@@ -520,6 +526,13 @@
Sets the [param travel_cost] for this [param region].
</description>
</method>
+ <method name="set_debug_enabled">
+ <return type="void" />
+ <param index="0" name="enabled" type="bool" />
+ <description>
+ If [code]true[/code] enables debug mode on the NavigationServer.
+ </description>
+ </method>
</methods>
<signals>
<signal name="map_changed">
diff --git a/doc/classes/NavigationServer3D.xml b/doc/classes/NavigationServer3D.xml
index 1feb363999..0d8cb78ff9 100644
--- a/doc/classes/NavigationServer3D.xml
+++ b/doc/classes/NavigationServer3D.xml
@@ -126,6 +126,12 @@
Destroys the given RID.
</description>
</method>
+ <method name="get_debug_enabled" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] when the NavigationServer has debug enabled.
+ </description>
+ </method>
<method name="get_maps" qualifiers="const">
<return type="RID[]" />
<description>
@@ -575,6 +581,13 @@
Control activation of this server.
</description>
</method>
+ <method name="set_debug_enabled">
+ <return type="void" />
+ <param index="0" name="enabled" type="bool" />
+ <description>
+ If [code]true[/code] enables debug mode on the NavigationServer.
+ </description>
+ </method>
</methods>
<signals>
<signal name="map_changed">
diff --git a/doc/classes/Node3D.xml b/doc/classes/Node3D.xml
index 1aa71113e9..c199c1aae6 100644
--- a/doc/classes/Node3D.xml
+++ b/doc/classes/Node3D.xml
@@ -4,7 +4,7 @@
Most basic 3D game object, parent of all 3D-related nodes.
</brief_description>
<description>
- Most basic 3D game object, with a 3D [Transform3D] and visibility settings. All other 3D game objects inherit from Node3D. Use [Node3D] as a parent node to move, scale, rotate and show/hide children in a 3D project.
+ Most basic 3D game object, with a [Transform3D] and visibility settings. All other 3D game objects inherit from Node3D. Use [Node3D] as a parent node to move, scale, rotate and show/hide children in a 3D project.
Affine operations (rotate, scale, translate) happen in parent's local coordinate system, unless the [Node3D] object is set as top-level. Affine operations in this coordinate system correspond to direct affine operations on the [Node3D]'s transform. The word local below refers to this coordinate system. The coordinate system that is attached to the [Node3D] object itself is referred to as object-local coordinate system.
[b]Note:[/b] Unless otherwise specified, all methods that have angle parameters must have angles specified as [i]radians[/i]. To convert degrees to radians, use [method @GlobalScope.deg_to_rad].
</description>
diff --git a/doc/classes/OmniLight3D.xml b/doc/classes/OmniLight3D.xml
index 1df8c255dd..7c5b9aff46 100644
--- a/doc/classes/OmniLight3D.xml
+++ b/doc/classes/OmniLight3D.xml
@@ -13,7 +13,8 @@
</tutorials>
<members>
<member name="omni_attenuation" type="float" setter="set_param" getter="get_param" default="1.0">
- The light's attenuation (drop-off) curve. A number of presets are available in the [b]Inspector[/b] by right-clicking the curve.
+ The light's attenuation (drop-off) curve. A number of presets are available in the [b]Inspector[/b] by right-clicking the curve. Zero and negative values are allowed but can produce unusual effects.
+ [b]Note:[/b] Very high [member omni_attenuation] values (typically above 10) can impact performance negatively if the light is made to use a larger [member omni_range] to compensate. This is because culling opportunities will become less common and shading costs will be increased (as the light will cover more pixels on screen while resulting in the same amount of brightness). To improve performance, use the lowest [member omni_attenuation] value possible for the visuals you're trying to achieve.
</member>
<member name="omni_range" type="float" setter="set_param" getter="get_param" default="5.0">
The light's radius. Note that the effectively lit area may appear to be smaller depending on the [member omni_attenuation] in use. No matter the [member omni_attenuation] in use, the light will never reach anything outside this radius.
diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml
index 8dec4eaf86..97cc05d1a1 100644
--- a/doc/classes/PopupMenu.xml
+++ b/doc/classes/PopupMenu.xml
@@ -20,7 +20,7 @@
<param index="2" name="accel" type="int" enum="Key" default="0" />
<description>
Adds a new checkable item with text [param label].
- An [param id] can optionally be provided, as well as an accelerator ([param accel]). If no [param id] is provided, one will be created from the index. If no [param accel] is provided then the default [code]0[/code] will be assigned to it. See [method get_item_accelerator] for more info on accelerators.
+ An [param id] can optionally be provided, as well as an accelerator ([param accel]). If no [param id] is provided, one will be created from the index. If no [param accel] is provided, then the default value of 0 (corresponding to [constant @GlobalScope.KEY_NONE]) will be assigned to the item (which means it won't have any accelerator). See [method get_item_accelerator] for more info on accelerators.
[b]Note:[/b] Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method set_item_checked] for more info on how to control it.
</description>
</method>
@@ -43,7 +43,7 @@
<param index="3" name="accel" type="int" enum="Key" default="0" />
<description>
Adds a new checkable item with text [param label] and icon [param texture].
- An [param id] can optionally be provided, as well as an accelerator ([param accel]). If no [param id] is provided, one will be created from the index. If no [param accel] is provided then the default [code]0[/code] will be assigned to it. See [method get_item_accelerator] for more info on accelerators.
+ An [param id] can optionally be provided, as well as an accelerator ([param accel]). If no [param id] is provided, one will be created from the index. If no [param accel] is provided, then the default value of 0 (corresponding to [constant @GlobalScope.KEY_NONE]) will be assigned to the item (which means it won't have any accelerator). See [method get_item_accelerator] for more info on accelerators.
[b]Note:[/b] Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method set_item_checked] for more info on how to control it.
</description>
</method>
@@ -67,7 +67,7 @@
<param index="3" name="accel" type="int" enum="Key" default="0" />
<description>
Adds a new item with text [param label] and icon [param texture].
- An [param id] can optionally be provided, as well as an accelerator ([param accel]). If no [param id] is provided, one will be created from the index. If no [param accel] is provided then the default [code]0[/code] will be assigned to it. See [method get_item_accelerator] for more info on accelerators.
+ An [param id] can optionally be provided, as well as an accelerator ([param accel]). If no [param id] is provided, one will be created from the index. If no [param accel] is provided, then the default value of 0 (corresponding to [constant @GlobalScope.KEY_NONE]) will be assigned to the item (which means it won't have any accelerator). See [method get_item_accelerator] for more info on accelerators.
</description>
</method>
<method name="add_icon_radio_check_item">
@@ -108,7 +108,7 @@
<param index="2" name="accel" type="int" enum="Key" default="0" />
<description>
Adds a new item with text [param label].
- An [param id] can optionally be provided, as well as an accelerator ([param accel]). If no [param id] is provided, one will be created from the index. If no [param accel] is provided then the default [code]0[/code] will be assigned to it. See [method get_item_accelerator] for more info on accelerators.
+ An [param id] can optionally be provided, as well as an accelerator ([param accel]). If no [param id] is provided, one will be created from the index. If no [param accel] is provided, then the default value of 0 (corresponding to [constant @GlobalScope.KEY_NONE]) will be assigned to the item (which means it won't have any accelerator). See [method get_item_accelerator] for more info on accelerators.
[b]Note:[/b] The provided [param id] is used only in [signal id_pressed] and [signal id_focused] signals. It's not related to the [code]index[/code] arguments in e.g. [method set_item_checked].
</description>
</method>
@@ -122,7 +122,7 @@
<description>
Adds a new multistate item with text [param label].
Contrarily to normal binary items, multistate items can have more than two states, as defined by [param max_states]. Each press or activate of the item will increase the state by one. The default value is defined by [param default_state].
- An [param id] can optionally be provided, as well as an accelerator ([param accel]). If no [param id] is provided, one will be created from the index. If no [param accel] is provided then the default [code]0[/code] will be assigned to it. See [method get_item_accelerator] for more info on accelerators.
+ An [param id] can optionally be provided, as well as an accelerator ([param accel]). If no [param id] is provided, one will be created from the index. If no [param accel] is provided, then the default value of 0 (corresponding to [constant @GlobalScope.KEY_NONE]) will be assigned to the item (which means it won't have any accelerator). See [method get_item_accelerator] for more info on accelerators.
</description>
</method>
<method name="add_radio_check_item">
@@ -132,7 +132,7 @@
<param index="2" name="accel" type="int" enum="Key" default="0" />
<description>
Adds a new radio check button with text [param label].
- An [param id] can optionally be provided, as well as an accelerator ([param accel]). If no [param id] is provided, one will be created from the index. If no [param accel] is provided then the default [code]0[/code] will be assigned to it. See [method get_item_accelerator] for more info on accelerators.
+ An [param id] can optionally be provided, as well as an accelerator ([param accel]). If no [param id] is provided, one will be created from the index. If no [param accel] is provided, then the default value of 0 (corresponding to [constant @GlobalScope.KEY_NONE]) will be assigned to the item (which means it won't have any accelerator). See [method get_item_accelerator] for more info on accelerators.
[b]Note:[/b] Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method set_item_checked] for more info on how to control it.
</description>
</method>
@@ -192,7 +192,7 @@
<return type="int" enum="Key" />
<param index="0" name="index" type="int" />
<description>
- Returns the accelerator of the item at the given [param index]. Accelerators are special combinations of keys that activate the item, no matter which control is focused.
+ Returns the accelerator of the item at the given [param index]. An accelerator is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The return value is an integer which is generally a combination of [enum KeyModifierMask]s and [enum Key]s using boolean OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]). If no accelerator is defined for the specified [param index], [method get_item_accelerator] returns [code]0[/code] (corresponding to [constant @GlobalScope.KEY_NONE]).
</description>
</method>
<method name="get_item_icon" qualifiers="const">
@@ -345,7 +345,7 @@
<param index="0" name="index" type="int" />
<param index="1" name="accel" type="int" enum="Key" />
<description>
- Sets the accelerator of the item at the given [param index]. Accelerators are special combinations of keys that activate the item, no matter which control is focused.
+ Sets the accelerator of the item at the given [param index]. An accelerator is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. [param accel] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using boolean OR such as [code]KEY_MASK_CTRL | KEY_A[/code] ([kbd]Ctrl + A[/kbd]).
</description>
</method>
<method name="set_item_as_checkable">
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index 986810edf2..3177780a26 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -667,7 +667,7 @@
Main window initial position.
[code]0[/code] - "Absolute", [member display/window/size/initial_position] is used to set window position.
[code]1[/code] - "Primary Screen Center".
- [code]2[/code] - "Other Screen Center", [member display/window/size/initial_screen] is used to set window position.
+ [code]2[/code] - "Other Screen Center", [member display/window/size/initial_screen] is used to set the screen.
</member>
<member name="display/window/size/initial_screen" type="int" setter="" getter="" default="0">
Main window initial screen, this settings is used only if [member display/window/size/initial_position_type] is set to "Other Screen Center" ([code]2[/code]).
@@ -1147,9 +1147,6 @@
<member name="input_devices/pointing/emulate_touch_from_mouse" type="bool" setter="" getter="" default="false">
If [code]true[/code], sends touch input events when clicking or dragging the mouse.
</member>
- <member name="input_devices/pointing/ios/touch_delay" type="float" setter="" getter="" default="0.15">
- Default delay for touch events. This only affects iOS devices.
- </member>
<member name="internationalization/locale/fallback" type="String" setter="" getter="" default="&quot;en&quot;">
The locale to fall back to if a translation isn't available in a given language. If left empty, [code]en[/code] (English) will be used.
</member>
@@ -2337,11 +2334,11 @@
<member name="rendering/textures/lossless_compression/force_png" type="bool" setter="" getter="" default="false">
If [code]true[/code], the texture importer will import lossless textures using the PNG format. Otherwise, it will default to using WebP.
</member>
- <member name="rendering/textures/vram_compression/import_etc2_astc" type="bool" setter="" getter="" default="false">
+ <member name="rendering/textures/vram_compression/import_etc2_astc" type="bool" setter="" getter="">
If [code]true[/code], the texture importer will import VRAM-compressed textures using the Ericsson Texture Compression 2 algorithm for lower quality textures and normalmaps and Adaptable Scalable Texture Compression algorithm for high quality textures (in 4x4 block size).
[b]Note:[/b] Changing this setting does [i]not[/i] impact textures that were already imported before. To make this setting apply to textures that were already imported, exit the editor, remove the [code].godot/imported/[/code] folder located inside the project folder then restart the editor (see [member application/config/use_hidden_project_data_directory]).
</member>
- <member name="rendering/textures/vram_compression/import_s3tc_bptc" type="bool" setter="" getter="" default="true">
+ <member name="rendering/textures/vram_compression/import_s3tc_bptc" type="bool" setter="" getter="">
If [code]true[/code], the texture importer will import VRAM-compressed textures using the S3 Texture Compression algorithm (DXT1-5) for lower quality textures and the the BPTC algorithm (BC6H and BC7) for high quality textures. This algorithm is only supported on PC desktop platforms and consoles.
[b]Note:[/b] Changing this setting does [i]not[/i] impact textures that were already imported before. To make this setting apply to textures that were already imported, exit the editor, remove the [code].godot/imported/[/code] folder located inside the project folder then restart the editor (see [member application/config/use_hidden_project_data_directory]).
</member>
diff --git a/doc/classes/ScriptExtension.xml b/doc/classes/ScriptExtension.xml
index 045eadda41..61034f8e4a 100644
--- a/doc/classes/ScriptExtension.xml
+++ b/doc/classes/ScriptExtension.xml
@@ -32,6 +32,11 @@
<description>
</description>
</method>
+ <method name="_get_global_name" qualifiers="virtual const">
+ <return type="StringName" />
+ <description>
+ </description>
+ </method>
<method name="_get_instance_base_type" qualifiers="virtual const">
<return type="StringName" />
<description>
diff --git a/doc/classes/SpotLight3D.xml b/doc/classes/SpotLight3D.xml
index 6bb4ae548c..3b32923872 100644
--- a/doc/classes/SpotLight3D.xml
+++ b/doc/classes/SpotLight3D.xml
@@ -20,10 +20,11 @@
[b]Note:[/b] [member spot_angle] is not affected by [member Node3D.scale] (the light's scale or its parent's scale).
</member>
<member name="spot_angle_attenuation" type="float" setter="set_param" getter="get_param" default="1.0">
- The spotlight's angular attenuation curve.
+ The spotlight's [i]angular[/i] attenuation curve. See also [member spot_attenuation].
</member>
<member name="spot_attenuation" type="float" setter="set_param" getter="get_param" default="1.0">
- The spotlight's light energy attenuation curve.
+ The spotlight's light energy (drop-off) attenuation curve. A number of presets are available in the [b]Inspector[/b] by right-clicking the curve. Zero and negative values are allowed but can produce unusual effects. See also [member spot_angle_attenuation].
+ [b]Note:[/b] Very high [member spot_attenuation] values (typically above 10) can impact performance negatively if the light is made to use a larger [member spot_range] to compensate. This is because culling opportunities will become less common and shading costs will be increased (as the light will cover more pixels on screen while resulting in the same amount of brightness). To improve performance, use the lowest [member spot_attenuation] value possible for the visuals you're trying to achieve.
</member>
<member name="spot_range" type="float" setter="set_param" getter="get_param" default="5.0">
The maximal range that can be reached by the spotlight. Note that the effectively lit area may appear to be smaller depending on the [member spot_attenuation] in use. No matter the [member spot_attenuation] in use, the light will never reach anything outside this range.
diff --git a/doc/classes/String.xml b/doc/classes/String.xml
index 8535dacda7..53b34332d7 100644
--- a/doc/classes/String.xml
+++ b/doc/classes/String.xml
@@ -1052,7 +1052,7 @@
[codeblock]
print("I caught %d fishes!" % 2) # Prints "I caught 2 fishes!"
- var my_message = "Travelling to %s, at %2.2f per second."
+ var my_message = "Travelling to %s, at %2.2f km/h."
var location = "Deep Valley"
var speed = 40.3485
print(my_message % [location, speed]) # Prints "Travelling to Deep Valley, at 40.35 km/h."
diff --git a/doc/classes/StringName.xml b/doc/classes/StringName.xml
index 96b958a5b9..4ccb93dab3 100644
--- a/doc/classes/StringName.xml
+++ b/doc/classes/StringName.xml
@@ -505,7 +505,7 @@
<return type="bool" />
<param index="0" name="expr" type="String" />
<description>
- Does a simple expression match, where [code]*[/code] matches zero or more arbitrary characters and [code]?[/code] matches any single character except a period ([code].[/code]). An empty string or empty expression always evaluates to [code]false[/code].
+ Does a simple expression match (also called "glob" or "globbing"), where [code]*[/code] matches zero or more arbitrary characters and [code]?[/code] matches any single character except a period ([code].[/code]). An empty string or empty expression always evaluates to [code]false[/code].
</description>
</method>
<method name="matchn" qualifiers="const">
diff --git a/doc/classes/TextureRect.xml b/doc/classes/TextureRect.xml
index 460ffbbb80..3500a0ddf5 100644
--- a/doc/classes/TextureRect.xml
+++ b/doc/classes/TextureRect.xml
@@ -10,8 +10,9 @@
<link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link>
</tutorials>
<members>
- <member name="expand_mode" type="int" setter="set_expand_mode" getter="get_expand_mode" enum="TextureRect.ExpandMode" default="0">
+ <member name="expand_mode" type="int" setter="set_expand_mode" getter="get_expand_mode" enum="TextureRect.ExpandMode" default="0" is_experimental="true">
Defines how minimum size is determined based on the texture's size. See [enum ExpandMode] for options.
+ [b]Note:[/b] Using [constant EXPAND_FIT_WIDTH], [constant EXPAND_FIT_WIDTH_PROPORTIONAL], [constant EXPAND_FIT_HEIGHT] or [constant EXPAND_FIT_HEIGHT_PROPORTIONAL] may result in unstable behavior in some containers. This functionality is being re-evaluated and will change in the future.
</member>
<member name="flip_h" type="bool" setter="set_flip_h" getter="is_flipped_h" default="false">
If [code]true[/code], texture is flipped horizontally.
diff --git a/doc/classes/VisibleOnScreenEnabler2D.xml b/doc/classes/VisibleOnScreenEnabler2D.xml
index 8590e9cc9f..68e510a6dc 100644
--- a/doc/classes/VisibleOnScreenEnabler2D.xml
+++ b/doc/classes/VisibleOnScreenEnabler2D.xml
@@ -24,7 +24,7 @@
Corresponds to [constant Node.PROCESS_MODE_ALWAYS].
</constant>
<constant name="ENABLE_MODE_WHEN_PAUSED" value="2" enum="EnableMode">
- Corresponds to [constant Node.PROCESS_MODE_WHEN_PAUSED.
+ Corresponds to [constant Node.PROCESS_MODE_WHEN_PAUSED].
</constant>
</constants>
</class>
diff --git a/doc/classes/XRInterface.xml b/doc/classes/XRInterface.xml
index db65ce62f2..cdada35970 100644
--- a/doc/classes/XRInterface.xml
+++ b/doc/classes/XRInterface.xml
@@ -210,7 +210,7 @@
This interface supports quad rendering (not yet supported by Godot).
</constant>
<constant name="XR_VR" value="8" enum="Capabilities">
- this interface supports VR.
+ This interface supports VR.
</constant>
<constant name="XR_AR" value="16" enum="Capabilities">
This interface supports AR (video background and real world tracking).
diff --git a/drivers/alsa/SCsub b/drivers/alsa/SCsub
index 1d76bb18c4..f17acb0f91 100644
--- a/drivers/alsa/SCsub
+++ b/drivers/alsa/SCsub
@@ -3,6 +3,7 @@
Import("env")
if "alsa" in env and env["alsa"]:
- env.add_source_files(env.drivers_sources, "asound-so_wrap.c")
+ if env["use_sowrap"]:
+ env.add_source_files(env.drivers_sources, "asound-so_wrap.c")
env.add_source_files(env.drivers_sources, "*.cpp")
diff --git a/drivers/alsa/audio_driver_alsa.cpp b/drivers/alsa/audio_driver_alsa.cpp
index 20cd8dd26c..689f76389b 100644
--- a/drivers/alsa/audio_driver_alsa.cpp
+++ b/drivers/alsa/audio_driver_alsa.cpp
@@ -37,7 +37,7 @@
#include <errno.h>
-#ifdef PULSEAUDIO_ENABLED
+#if defined(PULSEAUDIO_ENABLED) && defined(SOWRAP_ENABLED)
extern "C" {
extern int initialize_pulse(int verbose);
}
@@ -153,6 +153,7 @@ Error AudioDriverALSA::init_output_device() {
}
Error AudioDriverALSA::init() {
+#ifdef SOWRAP_ENABLED
#ifdef DEBUG_ENABLED
int dylibloader_verbose = 1;
#else
@@ -167,7 +168,7 @@ Error AudioDriverALSA::init() {
if (initialize_asound(dylibloader_verbose)) {
return ERR_CANT_OPEN;
}
-
+#endif
active.clear();
exit_thread.clear();
diff --git a/drivers/alsa/audio_driver_alsa.h b/drivers/alsa/audio_driver_alsa.h
index 821ba1d145..b62d7188dd 100644
--- a/drivers/alsa/audio_driver_alsa.h
+++ b/drivers/alsa/audio_driver_alsa.h
@@ -38,7 +38,11 @@
#include "core/templates/safe_refcount.h"
#include "servers/audio_server.h"
+#ifdef SOWRAP_ENABLED
#include "asound-so_wrap.h"
+#else
+#include <alsa/asoundlib.h>
+#endif
class AudioDriverALSA : public AudioDriver {
Thread thread;
diff --git a/drivers/alsamidi/midi_driver_alsamidi.h b/drivers/alsamidi/midi_driver_alsamidi.h
index 3c6300411c..80cc96310f 100644
--- a/drivers/alsamidi/midi_driver_alsamidi.h
+++ b/drivers/alsamidi/midi_driver_alsamidi.h
@@ -39,7 +39,12 @@
#include "core/templates/safe_refcount.h"
#include "core/templates/vector.h"
+#ifdef SOWRAP_ENABLED
#include "../alsa/asound-so_wrap.h"
+#else
+#include <alsa/asoundlib.h>
+#endif
+
#include <stdio.h>
class MIDIDriverALSAMidi : public MIDIDriver {
diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp
index 2a524e8c3a..aadc71c5b8 100644
--- a/drivers/gles3/rasterizer_canvas_gles3.cpp
+++ b/drivers/gles3/rasterizer_canvas_gles3.cpp
@@ -1951,11 +1951,12 @@ void RasterizerCanvasGLES3::occluder_polygon_set_shape(RID p_occluder, const Vec
glBufferData(GL_ELEMENT_ARRAY_BUFFER, 3 * lc * sizeof(uint16_t), indices.ptr(), GL_STATIC_DRAW);
glBindVertexArray(0);
} else {
- glBindVertexArray(oc->vertex_array);
glBindBuffer(GL_ARRAY_BUFFER, oc->vertex_buffer);
glBufferData(GL_ARRAY_BUFFER, lc * 6 * sizeof(float), geometry.ptr(), GL_STATIC_DRAW);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, oc->index_buffer);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, 3 * lc * sizeof(uint16_t), indices.ptr(), GL_STATIC_DRAW);
+ glBindBuffer(GL_ARRAY_BUFFER, 0);
+ glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
}
}
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp
index 1a18f35e64..6cc6b8224c 100644
--- a/drivers/gles3/rasterizer_scene_gles3.cpp
+++ b/drivers/gles3/rasterizer_scene_gles3.cpp
@@ -1895,6 +1895,10 @@ void RasterizerSceneGLES3::render_scene(const Ref<RenderSceneBuffers> &p_render_
glBindFramebuffer(GL_FRAMEBUFFER, rt->fbo);
glViewport(0, 0, rb->width, rb->height);
+ glCullFace(GL_BACK);
+ glEnable(GL_CULL_FACE);
+ scene_state.cull_mode = GLES3::SceneShaderData::CULL_BACK;
+
// Do depth prepass if it's explicitly enabled
bool use_depth_prepass = config->use_depth_prepass;
@@ -1910,9 +1914,6 @@ void RasterizerSceneGLES3::render_scene(const Ref<RenderSceneBuffers> &p_render_
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
glDisable(GL_SCISSOR_TEST);
- glCullFace(GL_BACK);
- glEnable(GL_CULL_FACE);
- scene_state.cull_mode = GLES3::SceneShaderData::CULL_BACK;
glColorMask(0, 0, 0, 0);
glClearDepth(1.0f);
diff --git a/drivers/pulseaudio/SCsub b/drivers/pulseaudio/SCsub
index 467d1448dc..f48489d787 100644
--- a/drivers/pulseaudio/SCsub
+++ b/drivers/pulseaudio/SCsub
@@ -3,6 +3,7 @@
Import("env")
if "pulseaudio" in env and env["pulseaudio"]:
- env.add_source_files(env.drivers_sources, "pulse-so_wrap.c")
+ if env["use_sowrap"]:
+ env.add_source_files(env.drivers_sources, "pulse-so_wrap.c")
env.add_source_files(env.drivers_sources, "*.cpp")
diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.cpp b/drivers/pulseaudio/audio_driver_pulseaudio.cpp
index 0246af4fea..797ffd67fe 100644
--- a/drivers/pulseaudio/audio_driver_pulseaudio.cpp
+++ b/drivers/pulseaudio/audio_driver_pulseaudio.cpp
@@ -37,7 +37,11 @@
#include "core/version.h"
#ifdef ALSAMIDI_ENABLED
+#ifdef SOWRAP_ENABLED
#include "drivers/alsa/asound-so_wrap.h"
+#else
+#include <alsa/asoundlib.h>
+#endif
#endif
void AudioDriverPulseAudio::pa_state_cb(pa_context *c, void *userdata) {
@@ -272,6 +276,7 @@ Error AudioDriverPulseAudio::init_output_device() {
}
Error AudioDriverPulseAudio::init() {
+#ifdef SOWRAP_ENABLED
#ifdef DEBUG_ENABLED
int dylibloader_verbose = 1;
#else
@@ -284,7 +289,7 @@ Error AudioDriverPulseAudio::init() {
if (initialize_pulse(dylibloader_verbose)) {
return ERR_CANT_OPEN;
}
-
+#endif
active.clear();
exit_thread.clear();
diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.h b/drivers/pulseaudio/audio_driver_pulseaudio.h
index f4ff44d361..585e882059 100644
--- a/drivers/pulseaudio/audio_driver_pulseaudio.h
+++ b/drivers/pulseaudio/audio_driver_pulseaudio.h
@@ -38,7 +38,11 @@
#include "core/templates/safe_refcount.h"
#include "servers/audio_server.h"
+#ifdef SOWRAP_ENABLED
#include "pulse-so_wrap.h"
+#else
+#include <pulse/pulseaudio.h>
+#endif
class AudioDriverPulseAudio : public AudioDriver {
Thread thread;
diff --git a/drivers/unix/file_access_unix.cpp b/drivers/unix/file_access_unix.cpp
index 43d3f53904..ee3cb876cf 100644
--- a/drivers/unix/file_access_unix.cpp
+++ b/drivers/unix/file_access_unix.cpp
@@ -318,6 +318,10 @@ Error FileAccessUnix::_set_unix_permissions(const String &p_file, uint32_t p_per
return FAILED;
}
+void FileAccessUnix::close() {
+ _close();
+}
+
CloseNotificationFunc FileAccessUnix::close_notification_func = nullptr;
FileAccessUnix::~FileAccessUnix() {
diff --git a/drivers/unix/file_access_unix.h b/drivers/unix/file_access_unix.h
index 884fb9567f..79c4e73636 100644
--- a/drivers/unix/file_access_unix.h
+++ b/drivers/unix/file_access_unix.h
@@ -82,6 +82,8 @@ public:
virtual uint32_t _get_unix_permissions(const String &p_file) override;
virtual Error _set_unix_permissions(const String &p_file, uint32_t p_permissions) override;
+ virtual void close() override;
+
FileAccessUnix() {}
virtual ~FileAccessUnix();
};
diff --git a/drivers/windows/file_access_windows.cpp b/drivers/windows/file_access_windows.cpp
index ea40622afc..0e51586b5a 100644
--- a/drivers/windows/file_access_windows.cpp
+++ b/drivers/windows/file_access_windows.cpp
@@ -375,6 +375,10 @@ Error FileAccessWindows::_set_unix_permissions(const String &p_file, uint32_t p_
return ERR_UNAVAILABLE;
}
+void FileAccessWindows::close() {
+ _close();
+}
+
FileAccessWindows::~FileAccessWindows() {
_close();
}
@@ -391,6 +395,7 @@ void FileAccessWindows::initialize() {
reserved_file_index++;
}
}
+
void FileAccessWindows::finalize() {
invalid_files.clear();
}
diff --git a/drivers/windows/file_access_windows.h b/drivers/windows/file_access_windows.h
index 2b9960d494..453f8d3b5f 100644
--- a/drivers/windows/file_access_windows.h
+++ b/drivers/windows/file_access_windows.h
@@ -82,6 +82,8 @@ public:
virtual uint32_t _get_unix_permissions(const String &p_file) override;
virtual Error _set_unix_permissions(const String &p_file, uint32_t p_permissions) override;
+ virtual void close() override;
+
static void initialize();
static void finalize();
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index 9f3893a5db..c27417f037 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -1522,6 +1522,8 @@ void AnimationTimelineEdit::set_animation(const Ref<Animation> &p_animation, boo
animation = p_animation;
read_only = p_read_only;
+ length->set_read_only(read_only);
+
if (animation.is_valid()) {
len_hb->show();
if (read_only) {
@@ -6621,7 +6623,7 @@ AnimationTrackEditor::AnimationTrackEditor() {
optimize_dialog = memnew(ConfirmationDialog);
add_child(optimize_dialog);
- optimize_dialog->set_title(TTR("Anim. Optimizer"));
+ optimize_dialog->set_title(TTR("Animation Optimizer"));
VBoxContainer *optimize_vb = memnew(VBoxContainer);
optimize_dialog->add_child(optimize_vb);
@@ -6630,19 +6632,19 @@ AnimationTrackEditor::AnimationTrackEditor() {
optimize_velocity_error->set_min(0.001);
optimize_velocity_error->set_step(0.001);
optimize_velocity_error->set_value(0.01);
- optimize_vb->add_margin_child(TTR("Max. Velocity Error:"), optimize_velocity_error);
+ optimize_vb->add_margin_child(TTR("Max Velocity Error:"), optimize_velocity_error);
optimize_angular_error = memnew(SpinBox);
optimize_angular_error->set_max(1.0);
optimize_angular_error->set_min(0.001);
optimize_angular_error->set_step(0.001);
optimize_angular_error->set_value(0.01);
- optimize_vb->add_margin_child(TTR("Max. Angular Error:"), optimize_angular_error);
+ optimize_vb->add_margin_child(TTR("Max Angular Error:"), optimize_angular_error);
optimize_precision_error = memnew(SpinBox);
optimize_precision_error->set_max(6);
optimize_precision_error->set_min(1);
optimize_precision_error->set_step(1);
optimize_precision_error->set_value(3);
- optimize_vb->add_margin_child(TTR("Max. Precision Error:"), optimize_precision_error);
+ optimize_vb->add_margin_child(TTR("Max Precision Error:"), optimize_precision_error);
optimize_dialog->set_ok_button_text(TTR("Optimize"));
optimize_dialog->connect("confirmed", callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed).bind(EDIT_OPTIMIZE_ANIMATION_CONFIRM));
@@ -6733,7 +6735,7 @@ AnimationTrackEditor::AnimationTrackEditor() {
//
bake_dialog = memnew(ConfirmationDialog);
- bake_dialog->set_title(TTR("Anim. Baker"));
+ bake_dialog->set_title(TTR("Animation Baker"));
bake_dialog->connect("confirmed", callable_mp(this, &AnimationTrackEditor::_edit_menu_pressed).bind(EDIT_BAKE_ANIMATION_CONFIRM));
add_child(bake_dialog);
GridContainer *bake_grid = memnew(GridContainer);
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index 97a73d89e7..9a8a1097cd 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -1629,14 +1629,15 @@ void CodeTextEditor::toggle_inline_comment(const String &delimiter) {
int selection_i = 0;
int offset = (is_commented ? -1 : 1) * delimiter.length();
for (const int &c2 : caret_edit_order) {
+ bool is_line_selection = text_editor->has_selection(c2) && text_editor->get_selection_from_line(c2) < text_editor->get_selection_to_line(c2);
if (text_editor->get_caret_line(c2) >= from && text_editor->get_caret_line(c2) <= to) {
int caret_col = caret_cols[caret_i++];
- caret_col += (caret_col == 0) ? 0 : offset;
+ caret_col += (is_line_selection && caret_col == 0) ? 0 : offset;
text_editor->set_caret_column(caret_col, c2 == 0, c2);
}
if (text_editor->has_selection(c2) && text_editor->get_selection_to_line(c2) >= from && text_editor->get_selection_to_line(c2) <= to) {
int from_col = text_editor->get_selection_from_column(c2);
- from_col += (from_col == 0) ? 0 : offset;
+ from_col += (is_line_selection && from_col == 0) ? 0 : offset;
int to_col = selection_to_cols[selection_i++];
to_col += (to_col == 0) ? 0 : offset;
text_editor->select(
diff --git a/editor/debugger/editor_profiler.cpp b/editor/debugger/editor_profiler.cpp
index e4730faf38..b0d6135d52 100644
--- a/editor/debugger/editor_profiler.cpp
+++ b/editor/debugger/editor_profiler.cpp
@@ -624,7 +624,9 @@ EditorProfiler::EditorProfiler() {
hb->add_child(memnew(Label(TTR("Time:"))));
display_time = memnew(OptionButton);
+ // TRANSLATORS: This is an option in the profiler to display the time spent in a function, including the time spent in other functions called by that function.
display_time->add_item(TTR("Inclusive"));
+ // TRANSLATORS: This is an option in the profiler to display the time spent in a function, exincluding the time spent in other functions called by that function.
display_time->add_item(TTR("Self"));
display_time->set_tooltip_text(TTR("Inclusive: Includes time from other functions called by this function.\nUse this to spot bottlenecks.\n\nSelf: Only count the time spent in the function itself, not in other functions called by that function.\nUse this to find individual functions to optimize."));
display_time->connect("item_selected", callable_mp(this, &EditorProfiler::_combo_changed));
diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp
index f4cefc606b..ed7638414c 100644
--- a/editor/editor_audio_buses.cpp
+++ b/editor/editor_audio_buses.cpp
@@ -1336,6 +1336,8 @@ EditorAudioBuses::EditorAudioBuses() {
add_child(file_dialog);
file_dialog->connect("file_selected", callable_mp(this, &EditorAudioBuses::_file_dialog_callback));
+ AudioServer::get_singleton()->connect("bus_layout_changed", callable_mp(this, &EditorAudioBuses::_update_buses));
+
set_process(true);
}
diff --git a/editor/editor_build_profile.cpp b/editor/editor_build_profile.cpp
index 386284b230..b112818e83 100644
--- a/editor/editor_build_profile.cpp
+++ b/editor/editor_build_profile.cpp
@@ -35,6 +35,7 @@
#include "editor/editor_file_dialog.h"
#include "editor/editor_file_system.h"
#include "editor/editor_node.h"
+#include "editor/editor_paths.h"
#include "editor/editor_property_name_processor.h"
#include "editor/editor_scale.h"
#include "editor/editor_settings.h"
@@ -473,7 +474,7 @@ void EditorBuildProfileManager::_find_files(EditorFileSystemDirectory *p_dir, co
void EditorBuildProfileManager::_detect_classes() {
HashMap<String, DetectedFile> previous_file_cache;
- Ref<FileAccess> f = FileAccess::open("res://.godot/editor/used_class_cache", FileAccess::READ);
+ Ref<FileAccess> f = FileAccess::open(EditorPaths::get_singleton()->get_project_settings_dir().path_join("used_class_cache"), FileAccess::READ);
if (f.is_valid()) {
while (!f->eof_reached()) {
String l = f->get_line();
@@ -497,7 +498,7 @@ void EditorBuildProfileManager::_detect_classes() {
HashSet<StringName> used_classes;
// Find classes and update the disk cache in the process.
- f = FileAccess::open("res://.godot/editor/used_class_cache", FileAccess::WRITE);
+ f = FileAccess::open(EditorPaths::get_singleton()->get_project_settings_dir().path_join("used_class_cache"), FileAccess::WRITE);
for (const KeyValue<String, DetectedFile> &E : updated_file_cache) {
String l = E.key + "::" + itos(E.value.timestamp) + "::" + E.value.md5 + "::";
diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp
index 4a1f0b4c09..3de4379c5d 100644
--- a/editor/editor_file_dialog.cpp
+++ b/editor/editor_file_dialog.cpp
@@ -50,7 +50,7 @@
#include "servers/display_server.h"
EditorFileDialog::GetIconFunc EditorFileDialog::get_icon_func = nullptr;
-EditorFileDialog::GetIconFunc EditorFileDialog::get_large_icon_func = nullptr;
+EditorFileDialog::GetIconFunc EditorFileDialog::get_thumbnail_func = nullptr;
EditorFileDialog::RegisterFunc EditorFileDialog::register_func = nullptr;
EditorFileDialog::RegisterFunc EditorFileDialog::unregister_func = nullptr;
@@ -472,6 +472,14 @@ void EditorFileDialog::_action_pressed() {
}
}
+ // First check we're not having an empty name.
+ String file_name = file_text.strip_edges().get_file();
+ if (file_name.is_empty()) {
+ error_dialog->set_text(TTR("Cannot save file with an empty filename."));
+ error_dialog->popup_centered(Size2(250, 80) * EDSCALE);
+ return;
+ }
+
// Add first extension of filter if no valid extension is found.
if (!valid) {
int idx = filter->get_selected();
@@ -480,9 +488,15 @@ void EditorFileDialog::_action_pressed() {
f += "." + ext;
}
+ if (file_name.begins_with(".")) { // Could still happen if typed manually.
+ error_dialog->set_text(TTR("Cannot save file with a name starting with a dot."));
+ error_dialog->popup_centered(Size2(250, 80) * EDSCALE);
+ return;
+ }
+
if (dir_access->file_exists(f) && !disable_overwrite_warning) {
- confirm_save->set_text(TTR("File exists, overwrite?"));
- confirm_save->popup_centered(Size2(200, 80));
+ confirm_save->set_text(vformat(TTR("File \"%s\" already exists.\nDo you want to overwrite it?"), f));
+ confirm_save->popup_centered(Size2(250, 80) * EDSCALE);
} else {
_save_to_recent();
hide();
@@ -888,7 +902,15 @@ void EditorFileDialog::update_file_list() {
if (get_icon_func) {
Ref<Texture2D> icon = get_icon_func(cdir.path_join(files.front()->get()));
if (display_mode == DISPLAY_THUMBNAILS) {
- item_list->set_item_icon(-1, file_thumbnail);
+ Ref<Texture2D> thumbnail;
+ if (get_thumbnail_func) {
+ thumbnail = get_thumbnail_func(cdir.path_join(files.front()->get()));
+ }
+ if (thumbnail.is_null()) {
+ thumbnail = file_thumbnail;
+ }
+
+ item_list->set_item_icon(-1, thumbnail);
item_list->set_item_tag_icon(-1, icon);
} else {
item_list->set_item_icon(-1, icon);
diff --git a/editor/editor_file_dialog.h b/editor/editor_file_dialog.h
index 021f2e6d4c..1944cacf70 100644
--- a/editor/editor_file_dialog.h
+++ b/editor/editor_file_dialog.h
@@ -68,7 +68,7 @@ public:
typedef void (*RegisterFunc)(EditorFileDialog *);
static GetIconFunc get_icon_func;
- static GetIconFunc get_large_icon_func;
+ static GetIconFunc get_thumbnail_func;
static RegisterFunc register_func;
static RegisterFunc unregister_func;
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp
index 8a595be6e6..b37d12e5ee 100644
--- a/editor/editor_file_system.cpp
+++ b/editor/editor_file_system.cpp
@@ -1560,7 +1560,7 @@ void EditorFileSystem::_update_script_classes() {
ScriptServer::add_global_class(efd->files[index]->script_class_name, efd->files[index]->script_class_extends, lang, path);
EditorNode::get_editor_data().script_class_set_icon_path(efd->files[index]->script_class_name, efd->files[index]->script_class_icon_path);
- EditorNode::get_editor_data().script_class_set_name(efd->files[index]->file, efd->files[index]->script_class_name);
+ EditorNode::get_editor_data().script_class_set_name(path, efd->files[index]->script_class_name);
}
}
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index dd912eac42..da4c1328cd 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -414,6 +414,18 @@ StringName EditorProperty::get_edited_property() const {
return property;
}
+EditorInspector *EditorProperty::get_parent_inspector() const {
+ Node *parent = get_parent();
+ while (parent) {
+ EditorInspector *ei = Object::cast_to<EditorInspector>(parent);
+ if (ei) {
+ return ei;
+ }
+ parent = parent->get_parent();
+ }
+ ERR_FAIL_V_MSG(nullptr, "EditorProperty is outside inspector.");
+}
+
void EditorProperty::set_doc_path(const String &p_doc_path) {
doc_path = p_doc_path;
}
@@ -690,10 +702,11 @@ void EditorProperty::gui_input(const Ref<InputEvent> &p_event) {
if (revert_rect.has_point(mpos)) {
accept_event();
+ get_viewport()->gui_release_focus();
bool is_valid_revert = false;
Variant revert_value = EditorPropertyRevert::get_property_revert_value(object, property, &is_valid_revert);
ERR_FAIL_COND(!is_valid_revert);
- emit_changed(property, revert_value);
+ emit_changed(_get_revert_property(), revert_value);
update_property();
}
@@ -2484,6 +2497,10 @@ Button *EditorInspector::create_inspector_action_button(const String &p_text) {
return button;
}
+bool EditorInspector::is_main_editor_inspector() const {
+ return InspectorDock::get_singleton() && InspectorDock::get_inspector_singleton() == this;
+}
+
String EditorInspector::get_selected_path() const {
return property_selected;
}
@@ -3286,7 +3303,7 @@ void EditorInspector::update_tree() {
_parse_added_editors(main_vbox, nullptr, ped);
}
- if (_is_main_editor_inspector()) {
+ if (is_main_editor_inspector()) {
// Updating inspector might invalidate some editing owners.
EditorNode::get_singleton()->hide_unused_editors();
}
@@ -3316,7 +3333,7 @@ void EditorInspector::_clear(bool p_hide_plugins) {
pending.clear();
restart_request_props.clear();
- if (p_hide_plugins && _is_main_editor_inspector()) {
+ if (p_hide_plugins && is_main_editor_inspector()) {
EditorNode::get_singleton()->hide_unused_editors(this);
}
}
@@ -3652,10 +3669,6 @@ void EditorInspector::_edit_set(const String &p_name, const Variant &p_value, bo
}
}
-bool EditorInspector::_is_main_editor_inspector() const {
- return InspectorDock::get_singleton() && InspectorDock::get_inspector_singleton() == this;
-}
-
void EditorInspector::_property_changed(const String &p_path, const Variant &p_value, const String &p_name, bool p_changing, bool p_update_all) {
// The "changing" variable must be true for properties that trigger events as typing occurs,
// like "text_changed" signal. E.g. text property of Label, Button, RichTextLabel, etc.
diff --git a/editor/editor_inspector.h b/editor/editor_inspector.h
index 37ff2e9b52..01231108d8 100644
--- a/editor/editor_inspector.h
+++ b/editor/editor_inspector.h
@@ -38,6 +38,7 @@
class AcceptDialog;
class Button;
class ConfirmationDialog;
+class EditorInspector;
class LineEdit;
class OptionButton;
class PanelContainer;
@@ -147,6 +148,7 @@ public:
Object *get_edited_object();
StringName get_edited_property() const;
+ EditorInspector *get_parent_inspector() const;
void set_doc_path(const String &p_doc_path);
@@ -223,7 +225,7 @@ public:
protected:
static void _bind_methods();
- GDVIRTUAL1RC(bool, _can_handle, Variant)
+ GDVIRTUAL1RC(bool, _can_handle, Object *)
GDVIRTUAL1(_parse_begin, Object *)
GDVIRTUAL2(_parse_category, Object *, String)
GDVIRTUAL2(_parse_group, Object *, String)
@@ -498,7 +500,6 @@ class EditorInspector : public ScrollContainer {
bool restrict_to_basic = false;
void _edit_set(const String &p_name, const Variant &p_value, bool p_refresh_all, const String &p_changed_field);
- bool _is_main_editor_inspector() const;
void _property_changed(const String &p_path, const Variant &p_value, const String &p_name = "", bool p_changing = false, bool p_update_all = false);
void _multiple_properties_changed(Vector<String> p_paths, Array p_values, bool p_changing = false);
@@ -552,6 +553,7 @@ public:
static EditorProperty *instantiate_property_editor(Object *p_object, const Variant::Type p_type, const String &p_path, const PropertyHint p_hint, const String &p_hint_text, const uint32_t p_usage, const bool p_wide = false);
+ bool is_main_editor_inspector() const;
String get_selected_path() const;
void update_tree();
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index a0e876315c..b854da8e4f 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -8116,6 +8116,7 @@ void EditorPluginList::forward_3d_force_draw_over_viewport(Control *p_overlay) {
}
void EditorPluginList::add_plugin(EditorPlugin *p_plugin) {
+ ERR_FAIL_COND(plugins_list.has(p_plugin));
plugins_list.push_back(p_plugin);
}
diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp
index 14cdbc364e..7b01ae69bf 100644
--- a/editor/editor_plugin.cpp
+++ b/editor/editor_plugin.cpp
@@ -662,11 +662,7 @@ void EditorPlugin::make_visible(bool p_visible) {
}
void EditorPlugin::edit(Object *p_object) {
- if (Object::cast_to<Resource>(p_object)) {
- GDVIRTUAL_CALL(_edit, Ref<Resource>(Object::cast_to<Resource>(p_object)));
- } else {
- GDVIRTUAL_CALL(_edit, p_object);
- }
+ GDVIRTUAL_CALL(_edit, p_object);
}
bool EditorPlugin::handles(Object *p_object) const {
diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h
index a5a17acdf1..74f46b2d0b 100644
--- a/editor/editor_plugin.h
+++ b/editor/editor_plugin.h
@@ -164,8 +164,8 @@ protected:
GDVIRTUAL0RC(Ref<Texture2D>, _get_plugin_icon)
GDVIRTUAL0RC(bool, _has_main_screen)
GDVIRTUAL1(_make_visible, bool)
- GDVIRTUAL1(_edit, Variant)
- GDVIRTUAL1RC(bool, _handles, Variant)
+ GDVIRTUAL1(_edit, Object *)
+ GDVIRTUAL1RC(bool, _handles, Object *)
GDVIRTUAL0RC(Dictionary, _get_state)
GDVIRTUAL1(_set_state, Dictionary)
GDVIRTUAL0(_clear)
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index 33bba90c70..801f1ca5b6 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -4141,6 +4141,13 @@ void EditorPropertyResource::_notification(int p_what) {
_update_property_bg();
}
} break;
+
+ case NOTIFICATION_EXIT_TREE: {
+ const EditorInspector *ei = get_parent_inspector();
+ if (ei && !ei->is_main_editor_inspector()) {
+ fold_resource();
+ }
+ } break;
}
}
@@ -4174,9 +4181,12 @@ struct EditorPropertyRangeHint {
bool radians = false;
};
-static EditorPropertyRangeHint _parse_range_hint(PropertyHint p_hint, const String &p_hint_text, double p_default_step) {
+static EditorPropertyRangeHint _parse_range_hint(PropertyHint p_hint, const String &p_hint_text, double p_default_step, bool is_int = false) {
EditorPropertyRangeHint hint;
hint.step = p_default_step;
+ if (is_int) {
+ hint.hide_slider = false; // Always show slider for ints, unless specified in hint range.
+ }
Vector<String> slices = p_hint_text.split(",");
if (p_hint == PROPERTY_HINT_RANGE) {
ERR_FAIL_COND_V_MSG(slices.size() < 2, hint,
@@ -4294,7 +4304,7 @@ EditorProperty *EditorInspectorDefaultPlugin::get_editor_for_property(Object *p_
} else {
EditorPropertyInteger *editor = memnew(EditorPropertyInteger);
- EditorPropertyRangeHint hint = _parse_range_hint(p_hint, p_hint_text, 1);
+ EditorPropertyRangeHint hint = _parse_range_hint(p_hint, p_hint_text, 1, true);
editor->setup(hint.min, hint.max, hint.step, hint.hide_slider, hint.or_greater, hint.or_less, hint.suffix);
return editor;
@@ -4383,7 +4393,7 @@ EditorProperty *EditorInspectorDefaultPlugin::get_editor_for_property(Object *p_
} break;
case Variant::VECTOR2I: {
EditorPropertyVector2i *editor = memnew(EditorPropertyVector2i(p_wide));
- EditorPropertyRangeHint hint = _parse_range_hint(p_hint, p_hint_text, 1);
+ EditorPropertyRangeHint hint = _parse_range_hint(p_hint, p_hint_text, 1, true);
editor->setup(hint.min, hint.max, p_hint == PROPERTY_HINT_LINK, hint.suffix);
return editor;
@@ -4396,7 +4406,7 @@ EditorProperty *EditorInspectorDefaultPlugin::get_editor_for_property(Object *p_
} break;
case Variant::RECT2I: {
EditorPropertyRect2i *editor = memnew(EditorPropertyRect2i(p_wide));
- EditorPropertyRangeHint hint = _parse_range_hint(p_hint, p_hint_text, 1);
+ EditorPropertyRangeHint hint = _parse_range_hint(p_hint, p_hint_text, 1, true);
editor->setup(hint.min, hint.max, hint.suffix);
return editor;
@@ -4410,7 +4420,7 @@ EditorProperty *EditorInspectorDefaultPlugin::get_editor_for_property(Object *p_
} break;
case Variant::VECTOR3I: {
EditorPropertyVector3i *editor = memnew(EditorPropertyVector3i(p_wide));
- EditorPropertyRangeHint hint = _parse_range_hint(p_hint, p_hint_text, 1);
+ EditorPropertyRangeHint hint = _parse_range_hint(p_hint, p_hint_text, 1, true);
editor->setup(hint.min, hint.max, p_hint == PROPERTY_HINT_LINK, hint.suffix);
return editor;
@@ -4424,7 +4434,7 @@ EditorProperty *EditorInspectorDefaultPlugin::get_editor_for_property(Object *p_
} break;
case Variant::VECTOR4I: {
EditorPropertyVector4i *editor = memnew(EditorPropertyVector4i);
- EditorPropertyRangeHint hint = _parse_range_hint(p_hint, p_hint_text, 1);
+ EditorPropertyRangeHint hint = _parse_range_hint(p_hint, p_hint_text, 1, true);
editor->setup(hint.min, hint.max, hint.suffix);
return editor;
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index 23e32dcbd8..c90f8e9bf0 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -1490,11 +1490,11 @@ void ED_SHORTCUT_OVERRIDE_ARRAY(const String &p_path, const String &p_feature, c
}
// Override the existing shortcut only if it wasn't customized by the user (i.e. still "original").
+ sc->set_meta("original", events.duplicate(true));
+
if (Shortcut::is_event_array_equal(sc->get_events(), sc->get_meta("original"))) {
sc->set_events(events);
}
-
- sc->set_meta("original", events.duplicate(true));
}
Ref<Shortcut> ED_SHORTCUT(const String &p_path, const String &p_name, Key p_keycode) {
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index 6410821dcf..304a7acff1 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -509,6 +509,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
const Color font_disabled_color = Color(mono_color.r, mono_color.g, mono_color.b, 0.35);
const Color font_readonly_color = Color(mono_color.r, mono_color.g, mono_color.b, 0.65);
const Color font_placeholder_color = Color(mono_color.r, mono_color.g, mono_color.b, 0.6);
+ const Color font_outline_color = Color(0, 0, 0, 0);
const Color selection_color = accent_color * Color(1, 1, 1, 0.4);
const Color disabled_color = mono_color.inverted().lerp(base_color, 0.7);
const Color disabled_bg_color = mono_color.inverted().lerp(base_color, 0.9);
@@ -816,6 +817,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
style_write_movie_button->set_expand_margin(SIDE_RIGHT, 2 * EDSCALE);
theme->set_stylebox("MovieWriterButtonPressed", "EditorStyles", style_write_movie_button);
+ // MenuButton
theme->set_stylebox("normal", "MenuButton", style_menu);
theme->set_stylebox("hover", "MenuButton", style_widget_hover);
theme->set_stylebox("pressed", "MenuButton", style_menu);
@@ -826,6 +828,9 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_color("font_hover_color", "MenuButton", font_hover_color);
theme->set_color("font_hover_pressed_color", "MenuButton", font_hover_pressed_color);
theme->set_color("font_focus_color", "MenuButton", font_focus_color);
+ theme->set_color("font_outline_color", "MenuButton", font_outline_color);
+
+ theme->set_constant("outline_size", "MenuButton", 0 * EDSCALE);
theme->set_stylebox("MenuHover", "EditorStyles", style_widget_hover);
@@ -842,6 +847,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_color("font_focus_color", "Button", font_focus_color);
theme->set_color("font_pressed_color", "Button", accent_color);
theme->set_color("font_disabled_color", "Button", font_disabled_color);
+ theme->set_color("font_outline_color", "Button", font_outline_color);
theme->set_color("icon_normal_color", "Button", icon_normal_color);
theme->set_color("icon_hover_color", "Button", icon_hover_color);
@@ -849,6 +855,8 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_color("icon_pressed_color", "Button", icon_pressed_color);
theme->set_color("icon_disabled_color", "Button", icon_disabled_color);
+ theme->set_constant("outline_size", "Button", 0 * EDSCALE);
+
const float ACTION_BUTTON_EXTRA_MARGIN = 32 * EDSCALE;
theme->set_type_variation("InspectorActionButton", "Button");
@@ -895,6 +903,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_color("font_focus_color", "MenuBar", font_focus_color);
theme->set_color("font_pressed_color", "MenuBar", accent_color);
theme->set_color("font_disabled_color", "MenuBar", font_disabled_color);
+ theme->set_color("font_outline_color", "MenuBar", font_outline_color);
theme->set_color("icon_normal_color", "MenuBar", icon_normal_color);
theme->set_color("icon_hover_color", "MenuBar", icon_hover_color);
@@ -902,6 +911,8 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_color("icon_pressed_color", "MenuBar", icon_pressed_color);
theme->set_color("icon_disabled_color", "MenuBar", icon_disabled_color);
+ theme->set_constant("outline_size", "MenuBar", 0 * EDSCALE);
+
// OptionButton
Ref<StyleBoxFlat> style_option_button_focus = style_widget_focus->duplicate();
Ref<StyleBoxFlat> style_option_button_normal = style_widget->duplicate();
@@ -932,6 +943,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_color("font_focus_color", "OptionButton", font_focus_color);
theme->set_color("font_pressed_color", "OptionButton", accent_color);
theme->set_color("font_disabled_color", "OptionButton", font_disabled_color);
+ theme->set_color("font_outline_color", "OptionButton", font_outline_color);
theme->set_color("icon_normal_color", "OptionButton", icon_normal_color);
theme->set_color("icon_hover_color", "OptionButton", icon_hover_color);
@@ -943,6 +955,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_constant("arrow_margin", "OptionButton", widget_default_margin.x - 2 * EDSCALE);
theme->set_constant("modulate_arrow", "OptionButton", true);
theme->set_constant("h_separation", "OptionButton", 4 * EDSCALE);
+ theme->set_constant("outline_size", "OptionButton", 0 * EDSCALE);
// CheckButton
theme->set_stylebox("normal", "CheckButton", style_menu);
@@ -967,6 +980,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_color("font_focus_color", "CheckButton", font_focus_color);
theme->set_color("font_pressed_color", "CheckButton", accent_color);
theme->set_color("font_disabled_color", "CheckButton", font_disabled_color);
+ theme->set_color("font_outline_color", "CheckButton", font_outline_color);
theme->set_color("icon_normal_color", "CheckButton", icon_normal_color);
theme->set_color("icon_hover_color", "CheckButton", icon_hover_color);
@@ -976,6 +990,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_constant("h_separation", "CheckButton", 8 * EDSCALE);
theme->set_constant("check_v_offset", "CheckButton", 0 * EDSCALE);
+ theme->set_constant("outline_size", "CheckButton", 0 * EDSCALE);
// Checkbox
Ref<StyleBoxFlat> sb_checkbox = style_menu->duplicate();
@@ -1001,6 +1016,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_color("font_focus_color", "CheckBox", font_focus_color);
theme->set_color("font_pressed_color", "CheckBox", accent_color);
theme->set_color("font_disabled_color", "CheckBox", font_disabled_color);
+ theme->set_color("font_outline_color", "CheckBox", font_outline_color);
theme->set_color("icon_normal_color", "CheckBox", icon_normal_color);
theme->set_color("icon_hover_color", "CheckBox", icon_hover_color);
@@ -1010,6 +1026,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_constant("h_separation", "CheckBox", 8 * EDSCALE);
theme->set_constant("check_v_offset", "CheckBox", 0 * EDSCALE);
+ theme->set_constant("outline_size", "CheckBox", 0 * EDSCALE);
// PopupDialog
theme->set_stylebox("panel", "PopupDialog", style_popup);
@@ -1043,6 +1060,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_color("font_accelerator_color", "PopupMenu", font_disabled_color);
theme->set_color("font_disabled_color", "PopupMenu", font_disabled_color);
theme->set_color("font_separator_color", "PopupMenu", font_disabled_color);
+ theme->set_color("font_outline_color", "PopupMenu", font_outline_color);
theme->set_icon("checked", "PopupMenu", theme->get_icon(SNAME("GuiChecked"), SNAME("EditorIcons")));
theme->set_icon("unchecked", "PopupMenu", theme->get_icon(SNAME("GuiUnchecked"), SNAME("EditorIcons")));
theme->set_icon("radio_checked", "PopupMenu", theme->get_icon(SNAME("GuiRadioChecked"), SNAME("EditorIcons")));
@@ -1063,6 +1081,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
const int vsep_base = extra_spacing + default_margin_size + 6;
const int force_even_vsep = vsep_base + (vsep_base % 2);
theme->set_constant("v_separation", "PopupMenu", force_even_vsep * EDSCALE);
+ theme->set_constant("outline_size", "PopupMenu", 0 * EDSCALE);
theme->set_constant("item_start_padding", "PopupMenu", default_margin_size * 1.5 * EDSCALE);
theme->set_constant("item_end_padding", "PopupMenu", default_margin_size * 1.5 * EDSCALE);
@@ -1171,6 +1190,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_color("custom_button_font_highlight", "Tree", font_hover_color);
theme->set_color("font_color", "Tree", font_color);
theme->set_color("font_selected_color", "Tree", mono_color);
+ theme->set_color("font_outline_color", "Tree", font_outline_color);
theme->set_color("title_button_color", "Tree", font_color);
theme->set_color("drop_position_color", "Tree", accent_color);
theme->set_constant("v_separation", "Tree", widget_default_margin.y - EDSCALE);
@@ -1180,6 +1200,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_constant("button_margin", "Tree", default_margin_size * EDSCALE);
theme->set_constant("scroll_border", "Tree", 40 * EDSCALE);
theme->set_constant("scroll_speed", "Tree", 12);
+ theme->set_constant("outline_size", "Tree", 0 * EDSCALE);
const Color guide_color = mono_color * Color(1, 1, 1, 0.05);
Color relationship_line_color = mono_color * Color(1, 1, 1, relationship_line_opacity);
@@ -1269,11 +1290,13 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_stylebox("selected", "ItemList", style_tree_selected);
theme->set_color("font_color", "ItemList", font_color);
theme->set_color("font_selected_color", "ItemList", mono_color);
+ theme->set_color("font_outline_color", "ItemList", font_outline_color);
theme->set_color("guide_color", "ItemList", guide_color);
theme->set_constant("v_separation", "ItemList", force_even_vsep * 0.5 * EDSCALE);
theme->set_constant("h_separation", "ItemList", 6 * EDSCALE);
theme->set_constant("icon_margin", "ItemList", 6 * EDSCALE);
theme->set_constant("line_separation", "ItemList", 3 * EDSCALE);
+ theme->set_constant("outline_size", "ItemList", 0 * EDSCALE);
// TabBar & TabContainer
Ref<StyleBoxFlat> style_tabbar_background = make_flat_stylebox(dark_color_1, 0, 0, 0, 0, corner_radius * EDSCALE);
@@ -1291,8 +1314,10 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_stylebox("button_highlight", "TabBar", style_menu);
theme->set_color("font_selected_color", "TabContainer", font_color);
theme->set_color("font_unselected_color", "TabContainer", font_disabled_color);
+ theme->set_color("font_outline_color", "TabContainer", font_outline_color);
theme->set_color("font_selected_color", "TabBar", font_color);
theme->set_color("font_unselected_color", "TabBar", font_disabled_color);
+ theme->set_color("font_outline_color", "TabBar", font_outline_color);
theme->set_color("drop_mark_color", "TabContainer", tab_highlight);
theme->set_color("drop_mark_color", "TabBar", tab_highlight);
theme->set_icon("menu", "TabContainer", theme->get_icon(SNAME("GuiTabMenu"), SNAME("EditorIcons")));
@@ -1309,7 +1334,9 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_icon("drop_mark", "TabContainer", theme->get_icon(SNAME("GuiTabDropMark"), SNAME("EditorIcons")));
theme->set_icon("drop_mark", "TabBar", theme->get_icon(SNAME("GuiTabDropMark"), SNAME("EditorIcons")));
theme->set_constant("side_margin", "TabContainer", 0);
+ theme->set_constant("outline_size", "TabContainer", 0 * EDSCALE);
theme->set_constant("h_separation", "TabBar", 4 * EDSCALE);
+ theme->set_constant("outline_size", "TabBar", 0 * EDSCALE);
// Content of each tab.
Ref<StyleBoxFlat> style_content_panel = style_default->duplicate();
@@ -1400,10 +1427,12 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_color("font_selected_color", "LineEdit", mono_color);
theme->set_color("font_uneditable_color", "LineEdit", font_readonly_color);
theme->set_color("font_placeholder_color", "LineEdit", font_placeholder_color);
+ theme->set_color("font_outline_color", "LineEdit", font_outline_color);
theme->set_color("caret_color", "LineEdit", font_color);
theme->set_color("selection_color", "LineEdit", selection_color);
theme->set_color("clear_button_color", "LineEdit", font_color);
theme->set_color("clear_button_color_pressed", "LineEdit", accent_color);
+ theme->set_constant("outline_size", "LineEdit", 0 * EDSCALE);
// TextEdit
theme->set_stylebox("normal", "TextEdit", style_line_edit);
@@ -1414,9 +1443,11 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_color("font_color", "TextEdit", font_color);
theme->set_color("font_readonly_color", "TextEdit", font_readonly_color);
theme->set_color("font_placeholder_color", "TextEdit", font_placeholder_color);
+ theme->set_color("font_outline_color", "TextEdit", font_outline_color);
theme->set_color("caret_color", "TextEdit", font_color);
theme->set_color("selection_color", "TextEdit", selection_color);
theme->set_constant("line_spacing", "TextEdit", 4 * EDSCALE);
+ theme->set_constant("outline_size", "TextEdit", 0 * EDSCALE);
theme->set_icon("h_grabber", "SplitContainer", theme->get_icon(SNAME("GuiHsplitter"), SNAME("EditorIcons")));
theme->set_icon("v_grabber", "SplitContainer", theme->get_icon(SNAME("GuiVsplitter"), SNAME("EditorIcons")));
@@ -1549,9 +1580,11 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
// RichTextLabel
theme->set_color("default_color", "RichTextLabel", font_color);
theme->set_color("font_shadow_color", "RichTextLabel", Color(0, 0, 0, 0));
+ theme->set_color("font_outline_color", "RichTextLabel", font_outline_color);
theme->set_constant("shadow_offset_x", "RichTextLabel", 1 * EDSCALE);
theme->set_constant("shadow_offset_y", "RichTextLabel", 1 * EDSCALE);
theme->set_constant("shadow_outline_size", "RichTextLabel", 1 * EDSCALE);
+ theme->set_constant("outline_size", "RichTextLabel", 0 * EDSCALE);
theme->set_stylebox("focus", "RichTextLabel", make_empty_stylebox());
theme->set_stylebox("normal", "RichTextLabel", style_tree_bg);
@@ -1590,10 +1623,12 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_stylebox("normal", "Label", style_empty);
theme->set_color("font_color", "Label", font_color);
theme->set_color("font_shadow_color", "Label", Color(0, 0, 0, 0));
+ theme->set_color("font_outline_color", "Label", font_outline_color);
theme->set_constant("shadow_offset_x", "Label", 1 * EDSCALE);
theme->set_constant("shadow_offset_y", "Label", 1 * EDSCALE);
theme->set_constant("shadow_outline_size", "Label", 1 * EDSCALE);
theme->set_constant("line_spacing", "Label", 3 * EDSCALE);
+ theme->set_constant("outline_size", "Label", 0 * EDSCALE);
// LinkButton
theme->set_stylebox("focus", "LinkButton", style_empty);
@@ -1603,6 +1638,9 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_color("font_focus_color", "LinkButton", font_focus_color);
theme->set_color("font_pressed_color", "LinkButton", accent_color);
theme->set_color("font_disabled_color", "LinkButton", font_disabled_color);
+ theme->set_color("font_outline_color", "LinkButton", font_outline_color);
+
+ theme->set_constant("outline_size", "LinkButton", 0 * EDSCALE);
// TooltipPanel + TooltipLabel
// TooltipPanel is also used for custom tooltips, while TooltipLabel
@@ -1638,6 +1676,8 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_stylebox("background", "ProgressBar", make_stylebox(theme->get_icon(SNAME("GuiProgressBar"), SNAME("EditorIcons")), 4, 4, 4, 4, 0, 0, 0, 0));
theme->set_stylebox("fill", "ProgressBar", make_stylebox(theme->get_icon(SNAME("GuiProgressFill"), SNAME("EditorIcons")), 6, 6, 6, 6, 2, 1, 2, 1));
theme->set_color("font_color", "ProgressBar", font_color);
+ theme->set_color("font_outline_color", "ProgressBar", font_outline_color);
+ theme->set_constant("outline_size", "ProgressBar", 0 * EDSCALE);
// GraphEdit
theme->set_stylebox("bg", "GraphEdit", style_tree_bg);
diff --git a/editor/export/editor_export_platform.cpp b/editor/export/editor_export_platform.cpp
index 96a8cc8b91..fe3c2333ed 100644
--- a/editor/export/editor_export_platform.cpp
+++ b/editor/export/editor_export_platform.cpp
@@ -247,7 +247,8 @@ Error EditorExportPlatform::_save_pack_file(void *p_userdata, const String &p_pa
pd->file_ofs.push_back(sd);
- if (pd->ep->step(TTR("Storing File:") + " " + p_path, 2 + p_file * 100 / p_total, false)) {
+ // TRANSLATORS: This is an editor progress label describing the storing of a file.
+ if (pd->ep->step(vformat(TTR("Storing File: %s"), p_path), 2 + p_file * 100 / p_total, false)) {
return ERR_SKIP;
}
diff --git a/editor/icons/GodotFile.svg b/editor/icons/GodotFile.svg
new file mode 100644
index 0000000000..3989c842dc
--- /dev/null
+++ b/editor/icons/GodotFile.svg
@@ -0,0 +1 @@
+<svg height="64" viewBox="0 0 64 64" width="64" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><clipPath id="a"><path clip-rule="evenodd" d="m0 0h16v16h-16z"/></clipPath><g fill-rule="nonzero"><g clip-path="url(#a)" transform="matrix(1.68179 0 0 1.68179 18.54568 24.26388)"><path d="m0 0s-.325 1.994-.515 1.976l-36.182-3.491c-2.879-.278-5.115-2.574-5.317-5.459l-.994-14.247-27.992-1.997-1.904 12.912c-.424 2.872-2.932 5.037-5.835 5.037h-38.188c-2.902 0-5.41-2.165-5.834-5.037l-1.905-12.912-27.992 1.997-.994 14.247c-.202 2.886-2.438 5.182-5.317 5.46l-36.2 3.49c-.187.018-.324-1.978-.511-1.978l-.049-7.83 30.658-4.944 1.004-14.374c.203-2.91 2.551-5.263 5.463-5.472l38.551-2.75c.146-.01.29-.016.434-.016 2.897 0 5.401 2.166 5.825 5.038l1.959 13.286h28.005l1.959-13.286c.423-2.871 2.93-5.037 5.831-5.037.142 0 .284.005.423.015l38.556 2.75c2.911.209 5.26 2.562 5.463 5.472l1.003 14.374 30.645 4.966z" fill="#fff" transform="matrix(.0717673866 0 0 -.0717673866 15.02102684 10.60436247)"/><path d="m0 0v-59.041c.108-.001.216-.005.323-.015l36.196-3.49c1.896-.183 3.382-1.709 3.514-3.609l1.116-15.978 31.574-2.253 2.175 14.747c.282 1.912 1.922 3.329 3.856 3.329h38.188c1.933 0 3.573-1.417 3.855-3.329l2.175-14.747 31.575 2.253 1.115 15.978c.133 1.9 1.618 3.425 3.514 3.609l36.182 3.49c.107.01.214.014.322.015v4.711l.015.005v54.325h.134c4.795 6.12 9.232 12.569 13.487 19.449-5.651 9.62-12.575 18.217-19.976 26.182-6.864-3.455-13.531-7.369-19.828-11.534-3.151 3.132-6.7 5.694-10.186 8.372-3.425 2.751-7.285 4.768-10.946 7.118 1.09 8.117 1.629 16.108 1.846 24.448-9.446 4.754-19.519 7.906-29.708 10.17-4.068-6.837-7.788-14.241-11.028-21.479-3.842.642-7.702.88-11.567.926v.006c-.027 0-.052-.006-.075-.006-.024 0-.049.006-.073.006v-.006c-3.872-.046-7.729-.284-11.572-.926-3.238 7.238-6.956 14.642-11.03 21.479-10.184-2.264-20.258-5.416-29.703-10.17.216-8.34.755-16.331 1.848-24.448-3.668-2.35-7.523-4.367-10.949-7.118-3.481-2.678-7.036-5.24-10.188-8.372-6.297 4.165-12.962 8.079-19.828 11.534-7.401-7.965-14.321-16.562-19.974-26.182 4.253-6.88 8.693-13.329 13.487-19.449z" fill="#478cbf" transform="matrix(.0717673866 0 0 -.0717673866 .9775427 6.36721431)"/><path d="m0 0-1.121-16.063c-.135-1.936-1.675-3.477-3.611-3.616l-38.555-2.751c-.094-.007-.188-.01-.281-.01-1.916 0-3.569 1.406-3.852 3.33l-2.211 14.994h-31.459l-2.211-14.994c-.297-2.018-2.101-3.469-4.133-3.32l-38.555 2.751c-1.936.139-3.476 1.68-3.611 3.616l-1.121 16.063-32.547 3.138c.015-3.498.06-7.33.06-8.093 0-34.374 43.605-50.896 97.781-51.086h.133c54.176.19 97.766 16.712 97.766 51.086 0 .777.047 4.593.063 8.093z" fill="#478cbf" transform="matrix(.0717673866 0 0 -.0717673866 12.69056087 11.39003484)"/><path d="m0 0c0-12.052-9.765-21.815-21.813-21.815-12.042 0-21.81 9.763-21.81 21.815 0 12.044 9.768 21.802 21.81 21.802 12.048 0 21.813-9.758 21.813-21.802" fill="#fff" transform="matrix(.0717673866 0 0 -.0717673866 5.88277961 8.08717647)"/><path d="m0 0c0-7.994-6.479-14.473-14.479-14.473-7.996 0-14.479 6.479-14.479 14.473s6.483 14.479 14.479 14.479c8 0 14.479-6.485 14.479-14.479" fill="#414042" transform="matrix(.0717673866 0 0 -.0717673866 5.50623617 8.18010546)"/><path d="m0 0c-3.878 0-7.021 2.858-7.021 6.381v20.081c0 3.52 3.143 6.381 7.021 6.381s7.028-2.861 7.028-6.381v-20.081c0-3.523-3.15-6.381-7.028-6.381" fill="#fff" transform="matrix(.0717673866 0 0 -.0717673866 7.99962959 9.79524234)"/><path d="m0 0c0-12.052 9.765-21.815 21.815-21.815 12.041 0 21.808 9.763 21.808 21.815 0 12.044-9.767 21.802-21.808 21.802-12.05 0-21.815-9.758-21.815-21.802" fill="#fff" transform="matrix(.0717673866 0 0 -.0717673866 10.11682439 8.08717647)"/><path d="m0 0c0-7.994 6.477-14.473 14.471-14.473 8.002 0 14.479 6.479 14.479 14.473s-6.477 14.479-14.479 14.479c-7.994 0-14.471-6.485-14.471-14.479" fill="#414042" transform="matrix(.0717673866 0 0 -.0717673866 10.49354024 8.18010546)"/></g><path d="m14 5c-2.199 0-4 1.801-4 4v46c0 2.199 1.801 4 4 4h36c2.199 0 4-1.801 4-4v-33h-.008c.002-.248-.079-.501-.285-.707l-16-16c-.188-.187-.442-.289-.707-.289v-.004zm0 2h22v12c0 2.199 1.801 4 4 4h12v32c0 1.125-.875 2-2 2h-36c-1.125 0-2-.875-2-2v-46c0-1.125.875-2 2-2z" fill="#fff" fill-opacity=".59" transform="translate(0 -.000017)"/></g></svg>
diff --git a/editor/icons/GodotMonochrome.svg b/editor/icons/GodotMonochrome.svg
new file mode 100644
index 0000000000..d0991e7343
--- /dev/null
+++ b/editor/icons/GodotMonochrome.svg
@@ -0,0 +1 @@
+<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><g fill="#fff" fill-rule="nonzero" transform="matrix(.0165985 0 0 .0165985 -.498437 -.50081)"><path d="m417.615 76.875c-42.392 9.424-84.326 22.545-123.642 42.334.899 34.716 3.143 67.98 7.693 101.768-15.268 9.782-31.315 18.177-45.576 29.628-14.49 11.148-29.29 21.813-42.41 34.85-26.212-17.337-53.955-33.63-82.535-48.012-30.808 33.156-59.614 68.94-83.145 108.985 18.493 29.029 38.329 58.205 56.699 80.959v245.765c.45.005.899.021 1.344.063l150.67 14.527c7.892.762 14.077 7.115 14.627 15.024l4.646 66.509 131.43 9.379 9.055-61.386c1.174-7.959 8-13.858 16.05-13.858h158.961c8.047 0 14.873 5.899 16.047 13.858l9.055 61.386 131.434-9.379 4.642-66.509c.554-7.909 6.735-14.258 14.627-15.024l150.611-14.527c.446-.042.891-.058 1.34-.063v-19.611l.063-.02v-226.134c21.216-26.71 41.307-56.172 56.699-80.959-23.523-40.045-52.345-75.829-83.152-108.985-28.573 14.382-56.325 30.675-82.537 48.012-13.117-13.037-27.89-23.702-42.401-34.85-14.257-11.451-30.323-19.846-45.562-29.628 4.537-33.788 6.78-67.052 7.683-101.768-39.32-19.789-81.249-32.91-123.662-42.334-16.933 28.46-32.419 59.279-45.906 89.408-15.993-2.672-32.06-3.662-48.149-3.853v-.026c-.112 0-.216.026-.312.026-.1 0-.205-.026-.305-.026v.026c-16.117.191-32.171 1.181-48.168 3.853-13.478-30.129-28.955-60.948-45.914-89.408zm-119.199 359.523c50.151 0 90.799 40.618 90.799 90.752 0 50.168-40.648 90.809-90.799 90.809-50.126 0-90.787-40.641-90.787-90.809 0-50.134 40.661-90.752 90.787-90.752zm427.178 0c50.122 0 90.779 40.618 90.779 90.752 0 50.168-40.657 90.809-90.779 90.809-50.16 0-90.807-40.641-90.807-90.809 0-50.134 40.647-90.752 90.807-90.752zm-213.6 53.11c16.143 0 29.254 11.908 29.254 26.56v83.59c0 14.665-13.111 26.563-29.254 26.563-16.142 0-29.226-11.898-29.226-26.563v-83.59c0-14.652 13.084-26.56 29.226-26.56z"/><path d="m0 0-1.121-16.063c-.135-1.936-1.675-3.477-3.611-3.616l-38.555-2.751c-.094-.007-.188-.01-.281-.01-1.916 0-3.569 1.406-3.852 3.33l-2.211 14.994h-31.459l-2.211-14.994c-.297-2.018-2.101-3.469-4.133-3.32l-38.555 2.751c-1.936.139-3.476 1.68-3.611 3.616l-1.121 16.063-32.547 3.138c.015-3.498.06-7.33.06-8.093 0-34.374 43.605-50.896 97.781-51.086h.133c54.176.19 97.766 16.712 97.766 51.086 0 .777.047 4.593.063 8.093z" transform="matrix(4.16261 0 0 -4.16261 784.071 718.723)"/><path d="m0 0c0-7.994-6.479-14.473-14.479-14.473-7.996 0-14.479 6.479-14.479 14.473s6.483 14.479 14.479 14.479c8 0 14.479-6.485 14.479-14.479" transform="matrix(4.16261 0 0 -4.16261 367.367 532.537)"/><path d="m0 0c0-7.994 6.477-14.473 14.471-14.473 8.002 0 14.479 6.479 14.479 14.473s-6.477 14.479-14.479 14.479c-7.994 0-14.471-6.485-14.471-14.479" transform="matrix(4.16261 0 0 -4.16261 656.641 532.537)"/></g></svg>
diff --git a/editor/icons/editor_icons_builders.py b/editor/icons/editor_icons_builders.py
index fb9a57c429..2b621071ce 100644
--- a/editor/icons/editor_icons_builders.py
+++ b/editor/icons/editor_icons_builders.py
@@ -58,6 +58,8 @@ def make_editor_icons_action(target, source, env):
thumb_medium_indices.append(str(index))
if icon_name.endswith("BigThumb"): # don't know a better way to handle this
thumb_big_indices.append(str(index))
+ if icon_name.endswith("GodotFile"): # don't know a better way to handle this
+ thumb_big_indices.append(str(index))
s.write('\t"{0}"'.format(icon_name))
diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp
index d0f04cb46f..32c16255dd 100644
--- a/editor/import/resource_importer_scene.cpp
+++ b/editor/import/resource_importer_scene.cpp
@@ -2267,6 +2267,7 @@ Node *ResourceImporterScene::pre_import(const String &p_source_file, const HashM
Ref<EditorSceneFormatImporter> importer;
String ext = p_source_file.get_extension().to_lower();
+ // TRANSLATORS: This is an editor progress label.
EditorProgress progress("pre-import", TTR("Pre-Import Scene"), 0);
progress.step(TTR("Importing Scene..."), 0);
diff --git a/editor/import/scene_import_settings.cpp b/editor/import/scene_import_settings.cpp
index 6eebb84216..348aad1162 100644
--- a/editor/import/scene_import_settings.cpp
+++ b/editor/import/scene_import_settings.cpp
@@ -142,24 +142,23 @@ void SceneImportSettings::_fill_material(Tree *p_tree, const Ref<Material> &p_ma
String import_id;
bool has_import_id = false;
- bool created = false;
- if (!material_set.has(p_material)) {
- material_set.insert(p_material);
- created = true;
- }
-
if (p_material->has_meta("import_id")) {
import_id = p_material->get_meta("import_id");
has_import_id = true;
} else if (!p_material->get_name().is_empty()) {
import_id = p_material->get_name();
has_import_id = true;
+ } else if (unnamed_material_name_map.has(p_material)) {
+ import_id = unnamed_material_name_map[p_material];
} else {
- import_id = "@MATERIAL:" + itos(material_set.size() - 1);
+ import_id = "@MATERIAL:" + itos(material_map.size());
+ unnamed_material_name_map[p_material] = import_id;
}
+ bool created = false;
if (!material_map.has(import_id)) {
MaterialData md;
+ created = true;
md.has_import_id = has_import_id;
md.material = p_material;
@@ -169,6 +168,7 @@ void SceneImportSettings::_fill_material(Tree *p_tree, const Ref<Material> &p_ma
}
MaterialData &material_data = material_map[import_id];
+ ERR_FAIL_COND(p_material != material_data.material);
Ref<Texture2D> icon = get_theme_icon(SNAME("StandardMaterial3D"), SNAME("EditorIcons"));
@@ -564,10 +564,10 @@ void SceneImportSettings::open_settings(const String &p_path, bool p_for_animati
base_path = p_path;
- material_set.clear();
mesh_set.clear();
animation_map.clear();
material_map.clear();
+ unnamed_material_name_map.clear();
mesh_map.clear();
node_map.clear();
defaults.clear();
diff --git a/editor/import/scene_import_settings.h b/editor/import/scene_import_settings.h
index 69bf58b627..d65bb1404a 100644
--- a/editor/import/scene_import_settings.h
+++ b/editor/import/scene_import_settings.h
@@ -107,6 +107,7 @@ class SceneImportSettings : public ConfirmationDialog {
HashMap<StringName, Variant> settings;
};
HashMap<String, MaterialData> material_map;
+ HashMap<Ref<Material>, String> unnamed_material_name_map;
struct MeshData {
bool has_import_id;
@@ -141,7 +142,6 @@ class SceneImportSettings : public ConfirmationDialog {
void _fill_scene(Node *p_node, TreeItem *p_parent_item);
HashSet<Ref<Mesh>> mesh_set;
- HashSet<Ref<Material>> material_set;
String selected_type;
String selected_id;
diff --git a/editor/input_event_configuration_dialog.cpp b/editor/input_event_configuration_dialog.cpp
index fb450a41d3..c620858439 100644
--- a/editor/input_event_configuration_dialog.cpp
+++ b/editor/input_event_configuration_dialog.cpp
@@ -538,6 +538,8 @@ void InputEventConfigurationDialog::_notification(int p_what) {
icon_cache.joypad_button = get_theme_icon(SNAME("JoyButton"), SNAME("EditorIcons"));
icon_cache.joypad_axis = get_theme_icon(SNAME("JoyAxis"), SNAME("EditorIcons"));
+ event_as_text->add_theme_font_override("font", get_theme_font(SNAME("bold"), SNAME("EditorFonts")));
+
_update_input_list();
} break;
}
@@ -591,7 +593,6 @@ InputEventConfigurationDialog::InputEventConfigurationDialog() {
event_as_text = memnew(Label);
event_as_text->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART);
event_as_text->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER);
- event_as_text->add_theme_font_override("font", get_theme_font(SNAME("bold"), SNAME("EditorFonts")));
event_as_text->add_theme_font_size_override("font_size", 18 * EDSCALE);
main_vbox->add_child(event_as_text);
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp
index b33ad67f23..c5bfd968d7 100644
--- a/editor/plugins/animation_player_editor_plugin.cpp
+++ b/editor/plugins/animation_player_editor_plugin.cpp
@@ -1134,6 +1134,7 @@ void AnimationPlayerEditor::_animation_duplicate() {
name_dialog_op = TOOL_DUPLICATE_ANIM;
name_dialog->set_title(TTR("Duplicate Animation"));
+ // TRANSLATORS: This is a label for the new name field in the "Duplicate Animation" dialog.
name_title->set_text(TTR("Duplicated Animation Name:"));
name->set_text(new_name);
name_dialog->popup_centered(Size2(300, 90));
diff --git a/editor/plugins/cast_2d_editor_plugin.cpp b/editor/plugins/cast_2d_editor_plugin.cpp
index 723082c293..331b4749cc 100644
--- a/editor/plugins/cast_2d_editor_plugin.cpp
+++ b/editor/plugins/cast_2d_editor_plugin.cpp
@@ -78,7 +78,7 @@ bool Cast2DEditor::forward_canvas_gui_input(const Ref<InputEvent> &p_event) {
}
} else if (pressed) {
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
- undo_redo->create_action(TTR("Set target_position"));
+ undo_redo->create_action(TTR("Set Target Position"));
undo_redo->add_do_property(node, "target_position", target_position);
undo_redo->add_do_method(canvas_item_editor, "update_viewport");
undo_redo->add_undo_property(node, "target_position", original_target_position);
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index fc1d8936d5..96f5aeedf0 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -1666,6 +1666,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
} break;
case TRANSFORM_Z_AXIS: {
_edit.plane = TRANSFORM_VIEW;
+ // TRANSLATORS: This refers to the transform of the view plane.
set_message(TTR("View Plane Transform."), 2);
} break;
@@ -4956,6 +4957,7 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p
view_menu->get_popup()->add_separator();
view_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_lock_rotation", TTR("Lock View Rotation")), VIEW_LOCK_ROTATION);
view_menu->get_popup()->add_separator();
+ // TRANSLATORS: "Normal" as in "normal life", not "normal vector".
view_menu->get_popup()->add_radio_check_shortcut(ED_SHORTCUT("spatial_editor/view_display_normal", TTR("Display Normal")), VIEW_DISPLAY_NORMAL);
view_menu->get_popup()->add_radio_check_shortcut(ED_SHORTCUT("spatial_editor/view_display_wireframe", TTR("Display Wireframe")), VIEW_DISPLAY_WIREFRAME);
view_menu->get_popup()->add_radio_check_shortcut(ED_SHORTCUT("spatial_editor/view_display_overdraw", TTR("Display Overdraw")), VIEW_DISPLAY_OVERDRAW);
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 6d747ba6a8..ccbc7c3d74 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -2518,7 +2518,7 @@ void ScriptEditor::save_all_scripts() {
} else {
// For built-in scripts, save their scenes instead.
const String scene_path = edited_res->get_path().get_slice("::", 0);
- if (!scenes_to_save.has(scene_path)) {
+ if (!scene_path.is_empty() && !scenes_to_save.has(scene_path)) {
scenes_to_save.push_back(scene_path);
}
}
diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp
index c41bf4b8cc..20b3cf3618 100644
--- a/editor/plugins/sprite_frames_editor_plugin.cpp
+++ b/editor/plugins/sprite_frames_editor_plugin.cpp
@@ -807,13 +807,17 @@ void SpriteFramesEditor::_animation_name_edited() {
return;
}
+ if (new_name.is_empty()) {
+ new_name = "new_animation";
+ }
+
new_name = new_name.replace("/", "_").replace(",", " ");
String name = new_name;
int counter = 0;
while (frames->has_animation(name)) {
counter++;
- name = new_name + " " + itos(counter);
+ name = new_name + "_" + itos(counter);
}
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp
index 073adb467a..2519928ea3 100644
--- a/editor/plugins/theme_editor_plugin.cpp
+++ b/editor/plugins/theme_editor_plugin.cpp
@@ -3223,6 +3223,7 @@ void ThemeTypeEditor::_update_stylebox_from_leading() {
if (!leading_stylebox.pinned || leading_stylebox.stylebox.is_null()) {
return;
}
+ ERR_FAIL_COND_MSG(edited_theme.is_null(), "Leading stylebox does not have an edited theme to update");
// Prevent changes from immediately being reported while the operation is still ongoing.
edited_theme->_freeze_change_propagation();
@@ -3706,7 +3707,11 @@ void ThemeEditorPlugin::edit(Object *p_node) {
if (Object::cast_to<Theme>(p_node)) {
theme_editor->edit(Object::cast_to<Theme>(p_node));
} else {
- theme_editor->edit(Ref<Theme>());
+ // We intentionally keep a reference to the last used theme to work around
+ // the the editor being hidden while base resources are edited. Uncomment
+ // the following line again and remove this comment once that bug has been
+ // fixed (scheduled for Godot 4.1 in PR 73098):
+ // theme_editor->edit(Ref<Theme>());
}
}
diff --git a/editor/plugins/tiles/tile_map_editor.cpp b/editor/plugins/tiles/tile_map_editor.cpp
index 04a09a97e7..4d9e2db682 100644
--- a/editor/plugins/tiles/tile_map_editor.cpp
+++ b/editor/plugins/tiles/tile_map_editor.cpp
@@ -2055,7 +2055,7 @@ TileMapEditorTilesPlugin::TileMapEditorTilesPlugin() {
select_tool_button->set_flat(true);
select_tool_button->set_toggle_mode(true);
select_tool_button->set_button_group(tool_buttons_group);
- select_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/selection_tool", "Selection", Key::S));
+ select_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/selection_tool", TTR("Selection"), Key::S));
select_tool_button->connect("pressed", callable_mp(this, &TileMapEditorTilesPlugin::_update_toolbar));
tilemap_tiles_tools_buttons->add_child(select_tool_button);
@@ -2063,7 +2063,7 @@ TileMapEditorTilesPlugin::TileMapEditorTilesPlugin() {
paint_tool_button->set_flat(true);
paint_tool_button->set_toggle_mode(true);
paint_tool_button->set_button_group(tool_buttons_group);
- paint_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/paint_tool", "Paint", Key::D));
+ paint_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/paint_tool", TTR("Paint"), Key::D));
paint_tool_button->set_tooltip_text(TTR("Shift: Draw line.") + "\n" + TTR("Shift+Ctrl: Draw rectangle."));
paint_tool_button->connect("pressed", callable_mp(this, &TileMapEditorTilesPlugin::_update_toolbar));
tilemap_tiles_tools_buttons->add_child(paint_tool_button);
@@ -2072,7 +2072,8 @@ TileMapEditorTilesPlugin::TileMapEditorTilesPlugin() {
line_tool_button->set_flat(true);
line_tool_button->set_toggle_mode(true);
line_tool_button->set_button_group(tool_buttons_group);
- line_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/line_tool", "Line", Key::L));
+ // TRANSLATORS: This refers to the line tool in the tilemap editor.
+ line_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/line_tool", TTR("Line", "Tool"), Key::L));
line_tool_button->connect("pressed", callable_mp(this, &TileMapEditorTilesPlugin::_update_toolbar));
tilemap_tiles_tools_buttons->add_child(line_tool_button);
@@ -2080,7 +2081,7 @@ TileMapEditorTilesPlugin::TileMapEditorTilesPlugin() {
rect_tool_button->set_flat(true);
rect_tool_button->set_toggle_mode(true);
rect_tool_button->set_button_group(tool_buttons_group);
- rect_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/rect_tool", "Rect", Key::R));
+ rect_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/rect_tool", TTR("Rect"), Key::R));
rect_tool_button->connect("pressed", callable_mp(this, &TileMapEditorTilesPlugin::_update_toolbar));
tilemap_tiles_tools_buttons->add_child(rect_tool_button);
@@ -2088,7 +2089,7 @@ TileMapEditorTilesPlugin::TileMapEditorTilesPlugin() {
bucket_tool_button->set_flat(true);
bucket_tool_button->set_toggle_mode(true);
bucket_tool_button->set_button_group(tool_buttons_group);
- bucket_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/bucket_tool", "Bucket", Key::B));
+ bucket_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/bucket_tool", TTR("Bucket"), Key::B));
bucket_tool_button->connect("pressed", callable_mp(this, &TileMapEditorTilesPlugin::_update_toolbar));
tilemap_tiles_tools_buttons->add_child(bucket_tool_button);
toolbar->add_child(tilemap_tiles_tools_buttons);
@@ -2104,7 +2105,7 @@ TileMapEditorTilesPlugin::TileMapEditorTilesPlugin() {
picker_button = memnew(Button);
picker_button->set_flat(true);
picker_button->set_toggle_mode(true);
- picker_button->set_shortcut(ED_SHORTCUT("tiles_editor/picker", "Picker", Key::P));
+ picker_button->set_shortcut(ED_SHORTCUT("tiles_editor/picker", TTR("Picker"), Key::P));
picker_button->set_tooltip_text(TTR("Alternatively hold Ctrl with other tools to pick tile."));
picker_button->connect("pressed", callable_mp(CanvasItemEditor::get_singleton(), &CanvasItemEditor::update_viewport));
tools_settings->add_child(picker_button);
@@ -2113,7 +2114,7 @@ TileMapEditorTilesPlugin::TileMapEditorTilesPlugin() {
erase_button = memnew(Button);
erase_button->set_flat(true);
erase_button->set_toggle_mode(true);
- erase_button->set_shortcut(ED_SHORTCUT("tiles_editor/eraser", "Eraser", Key::E));
+ erase_button->set_shortcut(ED_SHORTCUT("tiles_editor/eraser", TTR("Eraser"), Key::E));
erase_button->set_tooltip_text(TTR("Alternatively use RMB to erase tiles."));
erase_button->connect("pressed", callable_mp(CanvasItemEditor::get_singleton(), &CanvasItemEditor::update_viewport));
tools_settings->add_child(erase_button);
@@ -3180,7 +3181,7 @@ void TileMapEditorTerrainsPlugin::_update_terrains_tree() {
terrain_set_tree_item->set_icon(0, main_vbox_container->get_theme_icon(SNAME("TerrainMatchSides"), SNAME("EditorIcons")));
matches = String(TTR("Matches Sides Only"));
}
- terrain_set_tree_item->set_text(0, vformat("Terrain Set %d (%s)", terrain_set_index, matches));
+ terrain_set_tree_item->set_text(0, vformat(TTR("Terrain Set %d (%s)"), terrain_set_index, matches));
terrain_set_tree_item->set_selectable(0, false);
for (int terrain_index = 0; terrain_index < tile_set->get_terrains_count(terrain_set_index); terrain_index++) {
@@ -3329,7 +3330,7 @@ TileMapEditorTerrainsPlugin::TileMapEditorTerrainsPlugin() {
main_vbox_container = memnew(VBoxContainer);
main_vbox_container->connect("tree_entered", callable_mp(this, &TileMapEditorTerrainsPlugin::_update_theme));
main_vbox_container->connect("theme_changed", callable_mp(this, &TileMapEditorTerrainsPlugin::_update_theme));
- main_vbox_container->set_name("Terrains");
+ main_vbox_container->set_name(TTR("Terrains"));
HSplitContainer *tilemap_tab_terrains = memnew(HSplitContainer);
tilemap_tab_terrains->set_h_size_flags(Control::SIZE_EXPAND_FILL);
@@ -3365,7 +3366,7 @@ TileMapEditorTerrainsPlugin::TileMapEditorTerrainsPlugin() {
paint_tool_button->set_toggle_mode(true);
paint_tool_button->set_button_group(tool_buttons_group);
paint_tool_button->set_pressed(true);
- paint_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/paint_tool", "Paint", Key::D));
+ paint_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/paint_tool", TTR("Paint"), Key::D));
paint_tool_button->connect("pressed", callable_mp(this, &TileMapEditorTerrainsPlugin::_update_toolbar));
tilemap_tiles_tools_buttons->add_child(paint_tool_button);
@@ -3373,7 +3374,7 @@ TileMapEditorTerrainsPlugin::TileMapEditorTerrainsPlugin() {
line_tool_button->set_flat(true);
line_tool_button->set_toggle_mode(true);
line_tool_button->set_button_group(tool_buttons_group);
- line_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/line_tool", "Line", Key::L));
+ line_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/line_tool", TTR("Line"), Key::L));
line_tool_button->connect("pressed", callable_mp(this, &TileMapEditorTerrainsPlugin::_update_toolbar));
tilemap_tiles_tools_buttons->add_child(line_tool_button);
@@ -3381,7 +3382,7 @@ TileMapEditorTerrainsPlugin::TileMapEditorTerrainsPlugin() {
rect_tool_button->set_flat(true);
rect_tool_button->set_toggle_mode(true);
rect_tool_button->set_button_group(tool_buttons_group);
- rect_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/rect_tool", "Rect", Key::R));
+ rect_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/rect_tool", TTR("Rect"), Key::R));
rect_tool_button->connect("pressed", callable_mp(this, &TileMapEditorTerrainsPlugin::_update_toolbar));
tilemap_tiles_tools_buttons->add_child(rect_tool_button);
@@ -3389,7 +3390,7 @@ TileMapEditorTerrainsPlugin::TileMapEditorTerrainsPlugin() {
bucket_tool_button->set_flat(true);
bucket_tool_button->set_toggle_mode(true);
bucket_tool_button->set_button_group(tool_buttons_group);
- bucket_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/bucket_tool", "Bucket", Key::B));
+ bucket_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/bucket_tool", TTR("Bucket"), Key::B));
bucket_tool_button->connect("pressed", callable_mp(this, &TileMapEditorTerrainsPlugin::_update_toolbar));
tilemap_tiles_tools_buttons->add_child(bucket_tool_button);
@@ -3406,7 +3407,7 @@ TileMapEditorTerrainsPlugin::TileMapEditorTerrainsPlugin() {
picker_button = memnew(Button);
picker_button->set_flat(true);
picker_button->set_toggle_mode(true);
- picker_button->set_shortcut(ED_SHORTCUT("tiles_editor/picker", "Picker", Key::P));
+ picker_button->set_shortcut(ED_SHORTCUT("tiles_editor/picker", TTR("Picker"), Key::P));
picker_button->connect("pressed", callable_mp(CanvasItemEditor::get_singleton(), &CanvasItemEditor::update_viewport));
tools_settings->add_child(picker_button);
@@ -3414,7 +3415,7 @@ TileMapEditorTerrainsPlugin::TileMapEditorTerrainsPlugin() {
erase_button = memnew(Button);
erase_button->set_flat(true);
erase_button->set_toggle_mode(true);
- erase_button->set_shortcut(ED_SHORTCUT("tiles_editor/eraser", "Eraser", Key::E));
+ erase_button->set_shortcut(ED_SHORTCUT("tiles_editor/eraser", TTR("Eraser"), Key::E));
erase_button->connect("pressed", callable_mp(CanvasItemEditor::get_singleton(), &CanvasItemEditor::update_viewport));
tools_settings->add_child(erase_button);
diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp
index e56541b50d..fcefbb7d06 100644
--- a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp
+++ b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp
@@ -34,6 +34,7 @@
#include "editor/editor_inspector.h"
#include "editor/editor_node.h"
+#include "editor/editor_property_name_processor.h"
#include "editor/editor_scale.h"
#include "editor/editor_settings.h"
#include "editor/editor_undo_redo_manager.h"
@@ -106,13 +107,13 @@ bool TileSetAtlasSourceEditor::TileSetAtlasSourceProxyObject::_get(const StringN
void TileSetAtlasSourceEditor::TileSetAtlasSourceProxyObject::_get_property_list(List<PropertyInfo> *p_list) const {
p_list->push_back(PropertyInfo(Variant::NIL, TTR("Atlas"), PROPERTY_HINT_NONE, String(), PROPERTY_USAGE_CATEGORY));
- p_list->push_back(PropertyInfo(Variant::INT, "id", PROPERTY_HINT_RANGE, "0," + itos(INT_MAX) + ",1"));
- p_list->push_back(PropertyInfo(Variant::STRING, "name", PROPERTY_HINT_NONE, ""));
- p_list->push_back(PropertyInfo(Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"));
- p_list->push_back(PropertyInfo(Variant::VECTOR2I, "margins", PROPERTY_HINT_NONE, "suffix:px"));
- p_list->push_back(PropertyInfo(Variant::VECTOR2I, "separation", PROPERTY_HINT_NONE));
- p_list->push_back(PropertyInfo(Variant::VECTOR2I, "texture_region_size", PROPERTY_HINT_NONE, "suffix:px"));
- p_list->push_back(PropertyInfo(Variant::BOOL, "use_texture_padding", PROPERTY_HINT_NONE, ""));
+ p_list->push_back(PropertyInfo(Variant::INT, PNAME("id"), PROPERTY_HINT_RANGE, "0," + itos(INT_MAX) + ",1"));
+ p_list->push_back(PropertyInfo(Variant::STRING, PNAME("name")));
+ p_list->push_back(PropertyInfo(Variant::OBJECT, PNAME("texture"), PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"));
+ p_list->push_back(PropertyInfo(Variant::VECTOR2I, PNAME("margins"), PROPERTY_HINT_NONE, "suffix:px"));
+ p_list->push_back(PropertyInfo(Variant::VECTOR2I, PNAME("separation")));
+ p_list->push_back(PropertyInfo(Variant::VECTOR2I, PNAME("texture_region_size"), PROPERTY_HINT_NONE, "suffix:px"));
+ p_list->push_back(PropertyInfo(Variant::BOOL, PNAME("use_texture_padding")));
}
void TileSetAtlasSourceEditor::TileSetAtlasSourceProxyObject::_bind_methods() {
@@ -392,11 +393,11 @@ void TileSetAtlasSourceEditor::AtlasTileProxyObject::_get_property_list(List<Pro
if (tiles.size() == 1) {
if (tiles.front()->get().alternative == 0) {
p_list->push_back(PropertyInfo(Variant::NIL, TTR("Base Tile"), PROPERTY_HINT_NONE, String(), PROPERTY_USAGE_CATEGORY));
- p_list->push_back(PropertyInfo(Variant::VECTOR2I, "atlas_coords"));
- p_list->push_back(PropertyInfo(Variant::VECTOR2I, "size_in_atlas"));
+ p_list->push_back(PropertyInfo(Variant::VECTOR2I, PNAME("atlas_coords")));
+ p_list->push_back(PropertyInfo(Variant::VECTOR2I, PNAME("size_in_atlas")));
} else {
p_list->push_back(PropertyInfo(Variant::NIL, TTR("Alternative Tile"), PROPERTY_HINT_NONE, String(), PROPERTY_USAGE_CATEGORY));
- p_list->push_back(PropertyInfo(Variant::INT, "alternative_id"));
+ p_list->push_back(PropertyInfo(Variant::INT, PNAME("alternative_id")));
}
} else {
p_list->push_back(PropertyInfo(Variant::NIL, TTR("Tiles"), PROPERTY_HINT_NONE, String(), PROPERTY_USAGE_CATEGORY));
@@ -413,17 +414,17 @@ void TileSetAtlasSourceEditor::AtlasTileProxyObject::_get_property_list(List<Pro
}
if (all_alternatve_id_zero) {
- p_list->push_back(PropertyInfo(Variant::NIL, "Animation", PROPERTY_HINT_NONE, "animation_", PROPERTY_USAGE_GROUP));
- p_list->push_back(PropertyInfo(Variant::INT, "animation_columns", PROPERTY_HINT_NONE, ""));
- p_list->push_back(PropertyInfo(Variant::VECTOR2I, "animation_separation", PROPERTY_HINT_NONE, ""));
- p_list->push_back(PropertyInfo(Variant::FLOAT, "animation_speed", PROPERTY_HINT_NONE, ""));
- p_list->push_back(PropertyInfo(Variant::INT, "animation_frames_count", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_ARRAY, "Frames,animation_frame_"));
+ p_list->push_back(PropertyInfo(Variant::NIL, GNAME("Animation", "animation_"), PROPERTY_HINT_NONE, "animation_", PROPERTY_USAGE_GROUP));
+ p_list->push_back(PropertyInfo(Variant::INT, PNAME("animation_columns")));
+ p_list->push_back(PropertyInfo(Variant::VECTOR2I, PNAME("animation_separation")));
+ p_list->push_back(PropertyInfo(Variant::FLOAT, PNAME("animation_speed")));
+ p_list->push_back(PropertyInfo(Variant::INT, PNAME("animation_frames_count"), PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_ARRAY, "Frames,animation_frame_"));
// Not optimal, but returns value for the first tile. This is similar to what MultiNodeEdit does.
if (tile_set_atlas_source->get_tile_animation_frames_count(tiles.front()->get().tile) == 1) {
p_list->push_back(PropertyInfo(Variant::FLOAT, "animation_frame_0/duration", PROPERTY_HINT_NONE, "suffix:s", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_READ_ONLY));
} else {
for (int i = 0; i < tile_set_atlas_source->get_tile_animation_frames_count(tiles.front()->get().tile); i++) {
- p_list->push_back(PropertyInfo(Variant::FLOAT, vformat("animation_frame_%d/duration", i), PROPERTY_HINT_NONE, "suffix:s"));
+ p_list->push_back(PropertyInfo(Variant::FLOAT, vformat("animation_frame_%d/%s", i, PNAME("duration")), PROPERTY_HINT_NONE, "suffix:s"));
}
}
}
@@ -641,9 +642,9 @@ void TileSetAtlasSourceEditor::_update_tile_data_editors() {
// List of editors.
// --- Rendering ---
- ADD_TILE_DATA_EDITOR_GROUP("Rendering");
+ ADD_TILE_DATA_EDITOR_GROUP(TTR("Rendering"));
- ADD_TILE_DATA_EDITOR(group, "Texture Origin", "texture_origin");
+ ADD_TILE_DATA_EDITOR(group, TTR("Texture Origin"), "texture_origin");
if (!tile_data_editors.has("texture_origin")) {
TileDataTextureOriginEditor *tile_data_texture_origin_editor = memnew(TileDataTextureOriginEditor);
tile_data_texture_origin_editor->hide();
@@ -653,7 +654,7 @@ void TileSetAtlasSourceEditor::_update_tile_data_editors() {
tile_data_editors["texture_origin"] = tile_data_texture_origin_editor;
}
- ADD_TILE_DATA_EDITOR(group, "Modulate", "modulate");
+ ADD_TILE_DATA_EDITOR(group, TTR("Modulate"), "modulate");
if (!tile_data_editors.has("modulate")) {
TileDataDefaultEditor *tile_data_modulate_editor = memnew(TileDataDefaultEditor());
tile_data_modulate_editor->hide();
@@ -663,7 +664,7 @@ void TileSetAtlasSourceEditor::_update_tile_data_editors() {
tile_data_editors["modulate"] = tile_data_modulate_editor;
}
- ADD_TILE_DATA_EDITOR(group, "Z Index", "z_index");
+ ADD_TILE_DATA_EDITOR(group, TTR("Z Index"), "z_index");
if (!tile_data_editors.has("z_index")) {
TileDataDefaultEditor *tile_data_z_index_editor = memnew(TileDataDefaultEditor());
tile_data_z_index_editor->hide();
@@ -673,7 +674,7 @@ void TileSetAtlasSourceEditor::_update_tile_data_editors() {
tile_data_editors["z_index"] = tile_data_z_index_editor;
}
- ADD_TILE_DATA_EDITOR(group, "Y Sort Origin", "y_sort_origin");
+ ADD_TILE_DATA_EDITOR(group, TTR("Y Sort Origin"), "y_sort_origin");
if (!tile_data_editors.has("y_sort_origin")) {
TileDataYSortEditor *tile_data_y_sort_editor = memnew(TileDataYSortEditor);
tile_data_y_sort_editor->hide();
@@ -684,7 +685,7 @@ void TileSetAtlasSourceEditor::_update_tile_data_editors() {
}
for (int i = 0; i < tile_set->get_occlusion_layers_count(); i++) {
- ADD_TILE_DATA_EDITOR(group, vformat("Occlusion Layer %d", i), vformat("occlusion_layer_%d", i));
+ ADD_TILE_DATA_EDITOR(group, vformat(TTR("Occlusion Layer %d"), i), vformat("occlusion_layer_%d", i));
if (!tile_data_editors.has(vformat("occlusion_layer_%d", i))) {
TileDataOcclusionShapeEditor *tile_data_occlusion_shape_editor = memnew(TileDataOcclusionShapeEditor());
tile_data_occlusion_shape_editor->hide();
@@ -700,7 +701,7 @@ void TileSetAtlasSourceEditor::_update_tile_data_editors() {
}
// --- Rendering ---
- ADD_TILE_DATA_EDITOR(root, "Terrains", "terrain_set");
+ ADD_TILE_DATA_EDITOR(root, TTR("Terrains"), "terrain_set");
if (!tile_data_editors.has("terrain_set")) {
TileDataTerrainsEditor *tile_data_terrains_editor = memnew(TileDataTerrainsEditor);
tile_data_terrains_editor->hide();
@@ -710,7 +711,7 @@ void TileSetAtlasSourceEditor::_update_tile_data_editors() {
}
// --- Miscellaneous ---
- ADD_TILE_DATA_EDITOR(root, "Probability", "probability");
+ ADD_TILE_DATA_EDITOR(root, TTR("Probability"), "probability");
if (!tile_data_editors.has("probability")) {
TileDataDefaultEditor *tile_data_probability_editor = memnew(TileDataDefaultEditor());
tile_data_probability_editor->hide();
@@ -721,9 +722,9 @@ void TileSetAtlasSourceEditor::_update_tile_data_editors() {
}
// --- Physics ---
- ADD_TILE_DATA_EDITOR_GROUP("Physics");
+ ADD_TILE_DATA_EDITOR_GROUP(TTR("Physics"));
for (int i = 0; i < tile_set->get_physics_layers_count(); i++) {
- ADD_TILE_DATA_EDITOR(group, vformat("Physics Layer %d", i), vformat("physics_layer_%d", i));
+ ADD_TILE_DATA_EDITOR(group, vformat(TTR("Physics Layer %d"), i), vformat("physics_layer_%d", i));
if (!tile_data_editors.has(vformat("physics_layer_%d", i))) {
TileDataCollisionEditor *tile_data_collision_editor = memnew(TileDataCollisionEditor());
tile_data_collision_editor->hide();
@@ -739,9 +740,9 @@ void TileSetAtlasSourceEditor::_update_tile_data_editors() {
}
// --- Navigation ---
- ADD_TILE_DATA_EDITOR_GROUP("Navigation");
+ ADD_TILE_DATA_EDITOR_GROUP(TTR("Navigation"));
for (int i = 0; i < tile_set->get_navigation_layers_count(); i++) {
- ADD_TILE_DATA_EDITOR(group, vformat("Navigation Layer %d", i), vformat("navigation_layer_%d", i));
+ ADD_TILE_DATA_EDITOR(group, vformat(TTR("Navigation Layer %d"), i), vformat("navigation_layer_%d", i));
if (!tile_data_editors.has(vformat("navigation_layer_%d", i))) {
TileDataNavigationEditor *tile_data_navigation_editor = memnew(TileDataNavigationEditor());
tile_data_navigation_editor->hide();
@@ -757,14 +758,14 @@ void TileSetAtlasSourceEditor::_update_tile_data_editors() {
}
// --- Custom Data ---
- ADD_TILE_DATA_EDITOR_GROUP("Custom Data");
+ ADD_TILE_DATA_EDITOR_GROUP(TTR("Custom Data"));
for (int i = 0; i < tile_set->get_custom_data_layers_count(); i++) {
String editor_name = vformat("custom_data_%d", i);
String prop_name = tile_set->get_custom_data_layer_name(i);
Variant::Type prop_type = tile_set->get_custom_data_layer_type(i);
if (prop_name.is_empty()) {
- ADD_TILE_DATA_EDITOR(group, vformat("Custom Data %d", i), editor_name);
+ ADD_TILE_DATA_EDITOR(group, vformat(TTR("Custom Data %d"), i), editor_name);
} else {
ADD_TILE_DATA_EDITOR(group, prop_name, editor_name);
}
@@ -2414,6 +2415,14 @@ void TileSetAtlasSourceEditor::_notification(int p_what) {
}
}
} break;
+
+ case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
+ if (EditorSettings::get_singleton()->check_changed_settings_in_group("interface/editor/localize_settings")) {
+ EditorPropertyNameProcessor::Style style = EditorPropertyNameProcessor::get_singleton()->get_settings_style();
+ atlas_source_inspector->set_property_name_style(style);
+ tile_inspector->set_property_name_style(style);
+ }
+ } break;
}
}
@@ -2483,6 +2492,7 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() {
tile_inspector->edit(tile_proxy_object);
tile_inspector->set_use_folding(true);
tile_inspector->connect("property_selected", callable_mp(this, &TileSetAtlasSourceEditor::_inspector_property_selected));
+ tile_inspector->set_property_name_style(EditorPropertyNameProcessor::get_singleton()->get_settings_style());
middle_vbox_container->add_child(tile_inspector);
tile_inspector_no_tile_selected_label = memnew(Label);
@@ -2534,6 +2544,7 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() {
atlas_source_inspector->set_v_size_flags(SIZE_EXPAND_FILL);
atlas_source_inspector->set_show_categories(true);
atlas_source_inspector->edit(atlas_source_proxy_object);
+ atlas_source_inspector->set_property_name_style(EditorPropertyNameProcessor::get_singleton()->get_settings_style());
middle_vbox_container->add_child(atlas_source_inspector);
// -- Right side --
diff --git a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp
index cc276597fa..101ec5f66c 100644
--- a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp
+++ b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp
@@ -32,6 +32,7 @@
#include "editor/editor_file_system.h"
#include "editor/editor_node.h"
+#include "editor/editor_property_name_processor.h"
#include "editor/editor_resource_preview.h"
#include "editor/editor_scale.h"
#include "editor/editor_settings.h"
@@ -362,6 +363,14 @@ void TileSetScenesCollectionSourceEditor::_notification(int p_what) {
_update_scenes_list();
_update_action_buttons();
} break;
+
+ case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
+ if (EditorSettings::get_singleton()->check_changed_settings_in_group("interface/editor/localize_settings")) {
+ EditorPropertyNameProcessor::Style style = EditorPropertyNameProcessor::get_singleton()->get_settings_style();
+ scenes_collection_source_inspector->set_property_name_style(style);
+ tile_inspector->set_property_name_style(style);
+ }
+ } break;
}
}
@@ -503,6 +512,7 @@ TileSetScenesCollectionSourceEditor::TileSetScenesCollectionSourceEditor() {
scenes_collection_source_inspector = memnew(EditorInspector);
scenes_collection_source_inspector->set_vertical_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED);
scenes_collection_source_inspector->edit(scenes_collection_source_proxy_object);
+ scenes_collection_source_inspector->set_property_name_style(EditorPropertyNameProcessor::get_singleton()->get_settings_style());
middle_vbox_container->add_child(scenes_collection_source_inspector);
// Tile inspector.
@@ -519,6 +529,7 @@ TileSetScenesCollectionSourceEditor::TileSetScenesCollectionSourceEditor() {
tile_inspector->set_vertical_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED);
tile_inspector->edit(tile_proxy_object);
tile_inspector->set_use_folding(true);
+ tile_inspector->set_property_name_style(EditorPropertyNameProcessor::get_singleton()->get_settings_style());
middle_vbox_container->add_child(tile_inspector);
// Scenes list.
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index dc019d8e7c..1d510703b0 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -2013,16 +2013,25 @@ void ProjectManager::_notification(int p_what) {
}
Ref<Texture2D> ProjectManager::_file_dialog_get_icon(const String &p_path) {
- return singleton->icon_type_cache["ObjectHR"];
+ if (p_path.get_extension().to_lower() == "godot") {
+ return singleton->icon_type_cache["GodotMonochrome"];
+ }
+
+ return singleton->icon_type_cache["Object"];
+}
+
+Ref<Texture2D> ProjectManager::_file_dialog_get_thumbnail(const String &p_path) {
+ if (p_path.get_extension().to_lower() == "godot") {
+ return singleton->icon_type_cache["GodotFile"];
+ }
+
+ return Ref<Texture2D>();
}
void ProjectManager::_build_icon_type_cache(Ref<Theme> p_theme) {
List<StringName> tl;
p_theme->get_icon_list(SNAME("EditorIcons"), &tl);
for (List<StringName>::Element *E = tl.front(); E; E = E->next()) {
- if (!ClassDB::class_exists(E->get())) {
- continue;
- }
icon_type_cache[E->get()] = p_theme->get_icon(E->get(), SNAME("EditorIcons"));
}
}
@@ -2651,6 +2660,7 @@ ProjectManager::ProjectManager() {
break;
}
EditorFileDialog::get_icon_func = &ProjectManager::_file_dialog_get_icon;
+ EditorFileDialog::get_thumbnail_func = &ProjectManager::_file_dialog_get_thumbnail;
}
// TRANSLATORS: This refers to the application where users manage their Godot projects.
diff --git a/editor/project_manager.h b/editor/project_manager.h
index d96f5e2641..60d9c1d45b 100644
--- a/editor/project_manager.h
+++ b/editor/project_manager.h
@@ -144,6 +144,7 @@ class ProjectManager : public Control {
void _on_search_term_changed(const String &p_term);
static Ref<Texture2D> _file_dialog_get_icon(const String &p_path);
+ static Ref<Texture2D> _file_dialog_get_thumbnail(const String &p_path);
protected:
void _notification(int p_what);
diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp
index a43745b70f..374ce98d63 100644
--- a/editor/project_settings_editor.cpp
+++ b/editor/project_settings_editor.cpp
@@ -412,7 +412,7 @@ void ProjectSettingsEditor::_action_renamed(const String &p_old_name, const Stri
Dictionary action = GLOBAL_GET(old_property_name);
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
- undo_redo->create_action(TTR("Rename Input Action Event"));
+ undo_redo->create_action(TTR("Rename Input Action"));
// Do: clear old, set new
undo_redo->add_do_method(ProjectSettings::get_singleton(), "clear", old_property_name);
undo_redo->add_do_method(ProjectSettings::get_singleton(), "set", new_property_name, action);
diff --git a/editor/renames_map_3_to_4.cpp b/editor/renames_map_3_to_4.cpp
index 4c47eac6a5..277df4e66c 100644
--- a/editor/renames_map_3_to_4.cpp
+++ b/editor/renames_map_3_to_4.cpp
@@ -33,7 +33,27 @@
#ifndef DISABLE_DEPRECATED
const char *RenamesMap3To4::enum_renames[][2] = {
- //// constants
+ // Constants
+ // @GlobalScope
+ { "BUTTON_LEFT", "MOUSE_BUTTON_LEFT" },
+ { "BUTTON_MASK_LEFT", "MOUSE_BUTTON_MASK_LEFT" },
+ { "BUTTON_MASK_MIDDLE", "MOUSE_BUTTON_MASK_MIDDLE" },
+ { "BUTTON_MASK_RIGHT", "MOUSE_BUTTON_MASK_RIGHT" },
+ { "BUTTON_MASK_XBUTTON1", "MOUSE_BUTTON_MASK_XBUTTON1" },
+ { "BUTTON_MASK_XBUTTON2", "MOUSE_BUTTON_MASK_XBUTTON2" },
+ { "BUTTON_MIDDLE", "MOUSE_BUTTON_MIDDLE" },
+ { "BUTTON_RIGHT", "MOUSE_BUTTON_RIGHT" },
+ { "BUTTON_WHEEL_DOWN", "MOUSE_BUTTON_WHEEL_DOWN" },
+ { "BUTTON_WHEEL_LEFT", "MOUSE_BUTTON_WHEEL_LEFT" },
+ { "BUTTON_WHEEL_RIGHT", "MOUSE_BUTTON_WHEEL_RIGHT" },
+ { "BUTTON_WHEEL_UP", "MOUSE_BUTTON_WHEEL_UP" },
+ { "BUTTON_XBUTTON1", "MOUSE_BUTTON_XBUTTON1" },
+ { "BUTTON_XBUTTON2", "MOUSE_BUTTON_XBUTTON2" },
+ { "KEY_CONTROL", "KEY_CTRL" },
+ { "SIDE_BOTTOM", "MARGIN_BOTTOM" },
+ { "SIDE_LEFT", "MARGIN_LEFT" },
+ { "SIDE_RIGHT", "MARGIN_RIGHT" },
+ { "SIDE_TOP", "MARGIN_TOP" },
{ "TYPE_COLOR_ARRAY", "TYPE_PACKED_COLOR_ARRAY" },
{ "TYPE_FLOAT64_ARRAY", "TYPE_PACKED_FLOAT64_ARRAY" },
{ "TYPE_INT64_ARRAY", "TYPE_PACKED_INT64_ARRAY" },
@@ -47,10 +67,10 @@ const char *RenamesMap3To4::enum_renames[][2] = {
{ "TYPE_VECTOR2_ARRAY", "TYPE_PACKED_VECTOR2_ARRAY" },
{ "TYPE_VECTOR3_ARRAY", "TYPE_PACKED_VECTOR3_ARRAY" },
- // {"FLAG_MAX", "PARTICLE_FLAG_MAX"}, // CPUParticles2D - used in more classes
- { "ALIGN_BEGIN", "ALIGNMENT_BEGIN" }, //AspectRatioContainer
- { "ALIGN_CENTER", "ALIGNMENT_CENTER" }, //AspectRatioContainer
- { "ALIGN_END", "ALIGNMENT_END" }, //AspectRatioContainer
+ // { "FLAG_MAX", "PARTICLE_FLAG_MAX" }, // CPUParticles2D -- Used in more classes.
+ { "ALIGN_BEGIN", "ALIGNMENT_BEGIN" }, // AspectRatioContainer
+ { "ALIGN_CENTER", "ALIGNMENT_CENTER" }, // AspectRatioContainer
+ { "ALIGN_END", "ALIGNMENT_END" }, // AspectRatioContainer
{ "ARRAY_COMPRESS_BASE", "ARRAY_COMPRESS_FLAGS_BASE" }, // Mesh
{ "ARVR_AR", "XR_AR" }, // XRInterface
{ "ARVR_EXCESSIVE_MOTION", "XR_EXCESSIVE_MOTION" }, // XRInterface
@@ -64,20 +84,6 @@ const char *RenamesMap3To4::enum_renames[][2] = {
{ "ARVR_UNKNOWN_TRACKING", "XR_UNKNOWN_TRACKING" }, // XRInterface
{ "BAKE_ERROR_INVALID_MESH", "BAKE_ERROR_MESHES_INVALID" }, // LightmapGI
{ "BODY_MODE_CHARACTER", "BODY_MODE_RIGID_LINEAR" }, // PhysicsServer
- { "BUTTON_LEFT", "MOUSE_BUTTON_LEFT" }, // Globals
- { "BUTTON_MASK_LEFT", "MOUSE_BUTTON_MASK_LEFT" }, // Globals
- { "BUTTON_MASK_MIDDLE", "MOUSE_BUTTON_MASK_MIDDLE" }, // Globals
- { "BUTTON_MASK_RIGHT", "MOUSE_BUTTON_MASK_RIGHT" }, // Globals
- { "BUTTON_MASK_XBUTTON1", "MOUSE_BUTTON_MASK_XBUTTON1" }, // Globals
- { "BUTTON_MASK_XBUTTON2", "MOUSE_BUTTON_MASK_XBUTTON2" }, // Globals
- { "BUTTON_MIDDLE", "MOUSE_BUTTON_MIDDLE" }, // Globals
- { "BUTTON_RIGHT", "MOUSE_BUTTON_RIGHT" }, // Globals
- { "BUTTON_WHEEL_DOWN", "MOUSE_BUTTON_WHEEL_DOWN" }, // Globals
- { "BUTTON_WHEEL_LEFT", "MOUSE_BUTTON_WHEEL_LEFT" }, // Globals
- { "BUTTON_WHEEL_RIGHT", "MOUSE_BUTTON_WHEEL_RIGHT" }, // Globals
- { "BUTTON_WHEEL_UP", "MOUSE_BUTTON_WHEEL_UP" }, // Globals
- { "BUTTON_XBUTTON1", "MOUSE_BUTTON_XBUTTON1" }, // Globals
- { "BUTTON_XBUTTON2", "MOUSE_BUTTON_XBUTTON2" }, // Globals
{ "CLEAR_MODE_ONLY_NEXT_FRAME", "CLEAR_MODE_ONCE" }, // SubViewport
{ "COMPRESS_PVRTC4", "COMPRESS_PVRTC1_4" }, // Image
{ "CONNECT_ONESHOT", "CONNECT_ONE_SHOT" }, // Object
@@ -108,7 +114,6 @@ const char *RenamesMap3To4::enum_renames[][2] = {
{ "JOINT_HINGE", "JOINT_TYPE_HINGE" }, // PhysicsServer3D
{ "JOINT_PIN", "JOINT_TYPE_PIN" }, // PhysicsServer2D
{ "JOINT_SLIDER", "JOINT_TYPE_SLIDER" }, // PhysicsServer3D
- { "KEY_CONTROL", "KEY_CTRL" }, // Globals
{ "LOOP_PING_PONG", "LOOP_PINGPONG" }, // AudioStreamWAV
{ "MODE_KINEMATIC", "FREEZE_MODE_KINEMATIC" }, // RigidBody
{ "MODE_OPEN_ANY", "FILE_MODE_OPEN_ANY" }, // FileDialog
@@ -129,23 +134,19 @@ const char *RenamesMap3To4::enum_renames[][2] = {
{ "PAUSE_MODE_STOP", "PROCESS_MODE_PAUSABLE" }, // Node
{ "RENDER_DRAW_CALLS_IN_FRAME", "RENDER_TOTAL_DRAW_CALLS_IN_FRAME" }, // Performance
{ "RENDER_OBJECTS_IN_FRAME", "RENDER_TOTAL_OBJECTS_IN_FRAME" }, // Performance
- { "SIDE_BOTTOM", "MARGIN_BOTTOM" }, // Globals
- { "SIDE_LEFT", "MARGIN_LEFT" }, // Globals
- { "SIDE_RIGHT", "MARGIN_RIGHT" }, // Globals
- { "SIDE_TOP", "MARGIN_TOP" }, // Globals
{ "TEXTURE_TYPE_2D_ARRAY", "TEXTURE_LAYERED_2D_ARRAY" }, // RenderingServer
{ "TEXTURE_TYPE_CUBEMAP", "TEXTURE_LAYERED_CUBEMAP_ARRAY" }, // RenderingServer
{ "TRACKER_LEFT_HAND", "TRACKER_HAND_LEFT" }, // XRPositionalTracker
{ "TRACKER_RIGHT_HAND", "TRACKER_HAND_RIGHT" }, // XRPositionalTracker
{ "TYPE_NORMALMAP", "TYPE_NORMAL_MAP" }, // VisualShaderNodeCubemap
- /// enums
- { "AlignMode", "AlignmentMode" }, //AspectRatioContainer
+ // Enums
+ { "AlignMode", "AlignmentMode" }, // AspectRatioContainer
{ "AnimationProcessMode", "AnimationProcessCallback" }, // AnimationTree, AnimationPlayer
{ "Camera2DProcessMode", "Camera2DProcessCallback" }, // Camera2D
{ "CubeMapSide", "CubeMapLayer" }, // RenderingServer
{ "DampedStringParam", "DampedSpringParam" }, // PhysicsServer2D
- { "FFT_Size", "FFTSize" }, // AudioEffectPitchShift,AudioEffectSpectrumAnalyzer
+ { "FFT_Size", "FFTSize" }, // AudioEffectPitchShift, AudioEffectSpectrumAnalyzer
{ "PauseMode", "ProcessMode" }, // Node
{ "TimerProcessMode", "TimerProcessCallback" }, // Timer
{ "Tracking_status", "TrackingStatus" }, // XRInterface
@@ -153,52 +154,52 @@ const char *RenamesMap3To4::enum_renames[][2] = {
};
const char *RenamesMap3To4::gdscript_function_renames[][2] = {
- // { "_set_name", "get_tracker_name"}, // XRPositionalTracker - CameraFeed use this
- // { "_unhandled_input", "_unhandled_key_input"}, // BaseButton, ViewportContainer broke Node, FileDialog,SubViewportContainer
- // { "create_gizmo", "_create_gizmo"}, // EditorNode3DGizmoPlugin - may be used
- // { "get_dependencies", "_get_dependencies" }, // ResourceFormatLoader broke ResourceLoader
- // { "get_extents", "get_size" }, // BoxShape, RectangleShape broke Decal, VoxelGI, GPUParticlesCollisionBox, GPUParticlesCollisionSDF, GPUParticlesCollisionHeightField, GPUParticlesAttractorBox, GPUParticlesAttractorVectorField, FogVolume
- // { "get_h_offset", "get_drag_horizontal_offset"}, // Camera2D, broke PathFollow, Camera
- // { "get_mode", "get_file_mode"}, // FileDialog broke Panel, Shader, CSGPolygon, Tilemap
- // { "get_motion", "get_travel"}, // PhysicsTestMotionResult2D broke ParalaxLayer
- // { "get_name", "get_tracker_name"}, // XRPositionalTracker broke OS, Node
- // { "get_network_connected_peers", "get_peers"}, // MultiplayerAPI broke SceneTree
- // { "get_network_peer", "has_multiplayer_peer"}, // MultiplayerAPI broke SceneTree
- // { "get_network_unique_id", "get_unique_id"}, // MultiplayerAPI broke SceneTree
- // { "get_offset", "get_position_offset" }, // GraphNode broke Gradient
- // { "get_peer_port", "get_peer" }, // ENetMultiplayerPeer broke WebSocketServer
- // { "get_process_mode", "get_process_callback" }, // ClippedCamera3D broke Node, Sky
- // { "get_render_info", "get_rendering_info" }, // RenderingServer broke Viewport
- // { "get_type", "get_tracker_type"}, // XRPositionalTracker broke GLTFAccessor, GLTFLight
- // { "get_v_offset", "get_drag_vertical_offset"}, // Camera2D, broke PathFollow, Camera
- // { "has_network_peer", "has_multiplayer_peer"}, // MultiplayerAPI broke SceneTree
- // { "instance", "instantiate" }, // PackedScene, ClassDB - Broke FileSystemDock signal and also tscn files - [instance=ExtResource( 17 )] - this is implemented as custom rule
- // { "is_listening", "is_bound"}, // PacketPeerUDP broke TCPServer, UDPServer
- // { "is_refusing_new_network_connections", "is_refusing_new_connections"}, // MultiplayerAPI broke SceneTree
- // { "is_valid", "has_valid_event" }, // Shortcut broke e.g. Callable
- // { "listen", "bound"}, // PacketPeerUDP broke TCPServer, UDPServer
- // { "load", "_load"}, // ResourceFormatLoader broke ConfigFile, Image, StreamTexture2D
- // { "make_current", "set_current" }, // Camera2D broke Camera3D, Listener2D
- // { "process", "_process" }, // AnimationNode - This word is commonly used
- // { "save", "_save"}, // ResourceFormatLoader broke ConfigFile, Image, StreamTexture2D
- // { "set_autowrap", "set_autowrap_mode" }, // AcceptDialog broke Label - Cyclic Rename
- // { "set_color", "surface_set_color"}, // ImmediateMesh broke Light2D, Theme, SurfaceTool
- // { "set_event", "set_shortcut" }, // BaseButton - Cyclic Rename
- // { "set_extents", "set_size"}, // BoxShape, RectangleShape broke ReflectionProbe
- // { "set_flag", "set_particle_flag"}, // ParticleProcessMaterial broke Window, HingeJoint3D
- // { "set_h_offset", "set_drag_horizontal_offset" }, // Camera2D broke Camera3D, PathFollow3D, PathFollow2D
- // { "set_margin", "set_offset" }, // Control broke Shape3D, AtlasTexture
- // { "set_mode", "set_mode_file_mode" }, // FileDialog broke Panel, Shader, CSGPolygon, Tilemap
- // { "set_normal", "surface_set_normal"}, // ImmediateGeometry broke SurfaceTool, WorldMarginShape2D
- // { "set_offset", "set_progress" }, // PathFollow2D, PathFollow3D - Too common
- // { "set_process_mode", "set_process_callback" }, // AnimationTree broke Node, Tween, Sky
- // { "set_refuse_new_network_connections", "set_refuse_new_connections"}, // MultiplayerAPI broke SceneTree
- // { "set_tooltip", "set_tooltip_text" }, // Control, breaks TreeItem, at least for now.
- // { "set_uv", "surface_set_uv" }, // ImmediateMesh broke Polygon2D
- // { "set_v_offset", "set_drag_vertical_offset" }, // Camera2D broke Camera3D, PathFollow3D, PathFollow2D
- // {"get_points","get_points_id"},// Astar, broke Line2D, Convexpolygonshape
- // {"get_v_scroll","get_v_scroll_bar"},//ItemList, broke TextView
- // { "get_stylebox", "get_theme_stylebox" }, // Control - Will rename the method in Theme as well, skipping
+ // { "_set_name", "get_tracker_name" }, // XRPositionalTracker -- CameraFeed uses this.
+ // { "_unhandled_input", "_unhandled_key_input" }, // BaseButton, ViewportContainer -- Breaks Node, FileDialog, SubViewportContainer.
+ // { "create_gizmo", "_create_gizmo" }, // EditorNode3DGizmoPlugin -- May be used.
+ // { "get_dependencies", "_get_dependencies" }, // ResourceFormatLoader -- Breaks ResourceLoader.
+ // { "get_extents", "get_size" }, // BoxShape, RectangleShape -- Breaks Decal, VoxelGI, GPUParticlesCollisionBox, GPUParticlesCollisionSDF, GPUParticlesCollisionHeightField, GPUParticlesAttractorBox, GPUParticlesAttractorVectorField, FogVolume
+ // { "get_h_offset", "get_drag_horizontal_offset" }, // Camera2D -- Breaks PathFollow, Camera.
+ // { "get_mode", "get_file_mode" }, // FileDialog -- Breaks Panel, Shader, CSGPolygon, TileMap.
+ // { "get_motion", "get_travel" }, // PhysicsTestMotionResult2D -- Breaks ParallaxLayer.
+ // { "get_name", "get_tracker_name" }, // XRPositionalTracker -- Breaks OS, Node
+ // { "get_network_connected_peers", "get_peers" }, // MultiplayerAPI -- Breaks SceneTree.
+ // { "get_network_peer", "has_multiplayer_peer" }, // MultiplayerAPI -- Breaks SceneTree.
+ // { "get_network_unique_id", "get_unique_id"}, // MultiplayerAPI -- Breaks SceneTree.
+ // { "get_offset", "get_position_offset" }, // GraphNode -- Breaks Gradient.
+ // { "get_peer_port", "get_peer" }, // ENetMultiplayerPeer -- Breaks WebSocketServer.
+ // { "get_process_mode", "get_process_callback" }, // ClippedCamera3D -- Breaks Node, Sky.
+ // { "get_render_info", "get_rendering_info" }, // RenderingServer -- Breaks Viewport.
+ // { "get_type", "get_tracker_type" }, // XRPositionalTracker -- Breaks GLTFAccessor, GLTFLight.
+ // { "get_v_offset", "get_drag_vertical_offset" }, // Camera2D -- Breaks PathFollow, Camera.
+ // { "has_network_peer", "has_multiplayer_peer" }, // MultiplayerAPI -- Breaks SceneTree.
+ // { "instance", "instantiate" }, // PackedScene, ClassDB -- Breaks FileSystemDock signal, and also .tscn files ("[instance=ExtResource( 17 )]"). This is implemented as custom rule.
+ // { "is_listening", "is_bound"}, // PacketPeerUDP -- Breaks TCPServer, UDPServer.
+ // { "is_refusing_new_network_connections", "is_refusing_new_connections"}, // MultiplayerAPI -- Breaks SceneTree.
+ // { "is_valid", "has_valid_event" }, // Shortcut -- Breaks Callable, and more.
+ // { "listen", "bound"}, // PacketPeerUDP -- Breaks TCPServer, UDPServer.
+ // { "load", "_load"}, // ResourceFormatLoader -- Breaks ConfigFile, Image, StreamTexture2D.
+ // { "make_current", "set_current" }, // Camera2D -- Breaks Camera3D, Listener2D.
+ // { "process", "_process" }, // AnimationNode -- This word is too commonly used.
+ // { "save", "_save"}, // ResourceFormatLoader -- Breaks ConfigFile, Image, StreamTexture2D.
+ // { "set_autowrap", "set_autowrap_mode" }, // AcceptDialog -- Breaks Label, also a cyclic rename.
+ // { "set_color", "surface_set_color"}, // ImmediateMesh -- Breaks Light2D, Theme, SurfaceTool.
+ // { "set_event", "set_shortcut" }, // BaseButton -- Cyclic rename.
+ // { "set_extents", "set_size"}, // BoxShape, RectangleShape -- Breaks ReflectionProbe.
+ // { "set_flag", "set_particle_flag"}, // ParticleProcessMaterial -- Breaks Window, HingeJoint3D.
+ // { "set_h_offset", "set_drag_horizontal_offset" }, // Camera2D -- Breaks Camera3D, PathFollow3D, PathFollow2D.
+ // { "set_margin", "set_offset" }, // Control -- Breaks Shape3D, AtlasTexture.
+ // { "set_mode", "set_mode_file_mode" }, // FileDialog -- Breaks Panel, Shader, CSGPolygon, TileMap.
+ // { "set_normal", "surface_set_normal"}, // ImmediateGeometry -- Breaks SurfaceTool, WorldMarginShape2D.
+ // { "set_offset", "set_progress" }, // PathFollow2D, PathFollow3D -- Too common.
+ // { "set_process_mode", "set_process_callback" }, // AnimationTree -- Breaks Node, Tween, Sky.
+ // { "set_refuse_new_network_connections", "set_refuse_new_connections"}, // MultiplayerAPI -- Breaks SceneTree.
+ // { "set_tooltip", "set_tooltip_text" }, // Control -- Breaks TreeItem, at least for now.
+ // { "set_uv", "surface_set_uv" }, // ImmediateMesh -- Breaks Polygon2D.
+ // { "set_v_offset", "set_drag_vertical_offset" }, // Camera2D -- Breaks Camera3D, PathFollow3D, PathFollow2D.
+ // {"get_points","get_points_id" }, // AStar -- Breaks Line2D, ConvexPolygonShape.
+ // {"get_v_scroll","get_v_scroll_bar" }, // ItemList -- Breaks TextView.
+ // { "get_stylebox", "get_theme_stylebox" }, // Control -- Would rename the method in Theme as well, skipping.
{ "_about_to_show", "_about_to_popup" }, // ColorPickerButton
{ "_get_configuration_warning", "_get_configuration_warnings" }, // Node
{ "_set_current", "set_current" }, // Camera2D
@@ -272,7 +273,7 @@ const char *RenamesMap3To4::gdscript_function_renames[][2] = {
{ "get_applied_torque", "get_constant_torque" }, //RigidBody2D
{ "get_audio_bus", "get_audio_bus_name" }, // Area3D
{ "get_bound_child_nodes_to_bone", "get_bone_children" }, // Skeleton3D
- { "get_camera", "get_camera_3d" }, // Viewport -> this is also convertible to get_camera_2d, broke GLTFNode
+ { "get_camera", "get_camera_3d" }, // Viewport -- This is also convertible to get_camera_2d. Breaks GLTFNode.
{ "get_cancel", "get_cancel_button" }, // ConfirmationDialog
{ "get_caption", "_get_caption" }, // AnimationNode
{ "get_cast_to", "get_target_position" }, // RayCast2D, RayCast3D
@@ -281,8 +282,8 @@ const char *RenamesMap3To4::gdscript_function_renames[][2] = {
{ "get_closest_point_to_segment_2d", "get_closest_point_to_segment" }, // Geometry2D
{ "get_closest_point_to_segment_uncapped_2d", "get_closest_point_to_segment_uncapped" }, // Geometry2D
{ "get_closest_points_between_segments_2d", "get_closest_point_to_segment" }, // Geometry2D
- { "get_collision_layer_bit", "get_collision_layer_value" }, // CSGShape3D and a lot of others like GridMap
- { "get_collision_mask_bit", "get_collision_mask_value" }, // CSGShape3D and a lot of others like GridMap
+ { "get_collision_layer_bit", "get_collision_layer_value" }, // CSGShape3D, and a lot of others like GridMap.
+ { "get_collision_mask_bit", "get_collision_mask_value" }, // CSGShape3D, and a lot of others like GridMap.
{ "get_color_types", "get_color_type_list" }, // Theme
{ "get_command", "is_command_or_control_pressed" }, // InputEventWithModifiers
{ "get_constant_types", "get_constant_type_list" }, // Theme
@@ -290,6 +291,7 @@ const char *RenamesMap3To4::gdscript_function_renames[][2] = {
{ "get_cull_mask_bit", "get_cull_mask_value" }, // Camera3D
{ "get_cursor_position", "get_caret_column" }, // LineEdit
{ "get_d", "get_distance" }, // LineShape2D
+ { "get_default_length", "get_length" }, // Bone2D
{ "get_depth_bias_enable", "get_depth_bias_enabled" }, // RDPipelineRasterizationState
{ "get_device", "get_output_device" }, // AudioServer
{ "get_device_list", "get_output_device_list" }, // AudioServer
@@ -298,13 +300,13 @@ const char *RenamesMap3To4::gdscript_function_renames[][2] = {
{ "get_enabled_focus_mode", "get_focus_mode" }, // BaseButton
{ "get_endian_swap", "is_big_endian" }, // File
{ "get_error_string", "get_error_message" }, // JSON
- { "get_filename", "get_scene_file_path" }, // Node, WARNING, this may be used in a lot of other places
+ { "get_filename", "get_scene_file_path" }, // Node -- WARNING: This may be used in a lot of other places.
{ "get_focus_neighbour", "get_focus_neighbor" }, // Control
{ "get_follow_smoothing", "get_position_smoothing_speed" }, // Camera2D
{ "get_font_types", "get_font_type_list" }, // Theme
{ "get_frame_color", "get_color" }, // ColorRect
{ "get_global_rate_scale", "get_playback_speed_scale" }, // AudioServer
- { "get_gravity_distance_scale", "get_gravity_point_unit_distance" }, // Area(2D/3D)
+ { "get_gravity_distance_scale", "get_gravity_point_unit_distance" }, // Area2D, Area3D
{ "get_gravity_vector", "get_gravity_direction" }, // Area(2D/3D)
{ "get_h_scrollbar", "get_h_scroll_bar" }, //ScrollContainer
{ "get_hand", "get_tracker_hand" }, // XRPositionalTracker
@@ -344,11 +346,11 @@ const char *RenamesMap3To4::gdscript_function_renames[][2] = {
{ "get_plugin_name", "_get_plugin_name" }, // EditorPlugin
{ "get_preset_count", "_get_preset_count" }, // EditorImportPlugin
{ "get_preset_name", "_get_preset_name" }, // EditorImportPlugin
- { "get_recognized_extensions", "_get_recognized_extensions" }, // ResourceFormatLoader, EditorImportPlugin broke ResourceSaver
+ { "get_recognized_extensions", "_get_recognized_extensions" }, // ResourceFormatLoader, EditorImportPlugin -- Breaks ResourceSaver.
{ "get_render_info", "get_rendering_info" }, // RenderingServer
{ "get_render_targetsize", "get_render_target_size" }, // XRInterface
{ "get_resource_type", "_get_resource_type" }, // ResourceFormatLoader
- { "get_result", "get_data" }, //JSON
+ { "get_result", "get_data" }, // JSON
{ "get_reverb_bus", "set_reverb_bus_name" }, // Area3D
{ "get_rpc_sender_id", "get_remote_sender_id" }, // Multiplayer API
{ "get_save_extension", "_get_save_extension" }, // EditorImportPlugin
@@ -364,44 +366,44 @@ const char *RenamesMap3To4::gdscript_function_renames[][2] = {
{ "get_spatial_node", "get_node_3d" }, // EditorNode3DGizmo
{ "get_speed", "get_velocity" }, // InputEventMouseMotion
{ "get_stylebox_types", "get_stylebox_type_list" }, // Theme
- { "get_surface_material", "get_surface_override_material" }, // MeshInstance3D broke ImporterMesh
+ { "get_surface_material", "get_surface_override_material" }, // MeshInstance3D -- Breaks ImporterMesh.
{ "get_surface_material_count", "get_surface_override_material_count" }, // MeshInstance3D
{ "get_tab_disabled", "is_tab_disabled" }, // Tab
{ "get_tab_hidden", "is_tab_hidden" }, // Tab
{ "get_text_align", "get_text_alignment" }, // Button
{ "get_theme_item_types", "get_theme_item_type_list" }, // Theme
{ "get_timer_process_mode", "get_timer_process_callback" }, // Timer
- { "get_translation", "get_position" }, // Node3D broke GLTFNode which is used rarely
+ { "get_translation", "get_position" }, // Node3D -- Breaks GLTFNode, but it is used rarely.
{ "get_unit_db", "get_volume_db" }, // AudioStreamPlayer3D
{ "get_unit_offset", "get_progress_ratio" }, // PathFollow2D, PathFollow3D
{ "get_use_in_baked_light", "is_baking_navigation" }, // GridMap
{ "get_used_cells_by_id", "get_used_cells" }, // TileMap
- { "get_v_scrollbar", "get_v_scroll_bar" }, //ScrollContainer
+ { "get_v_scrollbar", "get_v_scroll_bar" }, // ScrollContainer
{ "get_visible_name", "_get_visible_name" }, // EditorImportPlugin
{ "get_window_layout", "_get_window_layout" }, // EditorPlugin
{ "get_word_under_cursor", "get_word_under_caret" }, // TextEdit
- { "get_world", "get_world_3d" }, // Viewport, Spatial
- { "get_zfar", "get_far" }, // Camera3D broke GLTFCamera
- { "get_znear", "get_near" }, // Camera3D broke GLTFCamera
+ { "get_world", "get_world_3d" }, // Viewport, Node3D
+ { "get_zfar", "get_far" }, // Camera3D -- Breaks GLTFCamera
+ { "get_znear", "get_near" }, // Camera3D -- Breaks GLTFCamera
{ "groove_joint_create", "joint_make_groove" }, // PhysicsServer2D
{ "handle_menu_selected", "_handle_menu_selected" }, // EditorResourcePicker
{ "handles_type", "_handles_type" }, // ResourceFormatLoader
- { "has_color", "has_theme_color" }, // Control broke Theme
- { "has_color_override", "has_theme_color_override" }, // Control broke Theme
+ { "has_color", "has_theme_color" }, // Control -- Breaks Theme
+ { "has_color_override", "has_theme_color_override" }, // Control -- Breaks Theme
{ "has_constant", "has_theme_constant" }, // Control
{ "has_constant_override", "has_theme_constant_override" }, // Control
{ "has_filter", "_has_filter" }, // AnimationNode
- { "has_font", "has_theme_font" }, // Control broke Theme
+ { "has_font", "has_theme_font" }, // Control -- Breaks Theme
{ "has_font_override", "has_theme_font_override" }, // Control
- { "has_icon", "has_theme_icon" }, // Control broke Theme
+ { "has_icon", "has_theme_icon" }, // Control -- Breaks Theme
{ "has_icon_override", "has_theme_icon_override" }, // Control
{ "has_main_screen", "_has_main_screen" }, // EditorPlugin
{ "has_network_peer", "has_multiplayer_peer" }, // Multiplayer API
- { "has_stylebox", "has_theme_stylebox" }, // Control broke Theme
+ { "has_stylebox", "has_theme_stylebox" }, // Control -- Breaks Theme
{ "has_stylebox_override", "has_theme_stylebox_override" }, // Control
{ "http_escape", "uri_encode" }, // String
{ "http_unescape", "uri_decode" }, // String
- { "import_scene_from_other_importer", "_import_scene" }, //EditorSceneFormatImporter
+ { "import_scene_from_other_importer", "_import_scene" }, // EditorSceneFormatImporter
{ "instance_set_surface_material", "instance_set_surface_override_material" }, // RenderingServer
{ "interpolate", "sample" }, // Curve, Curve2D, Curve3D, Gradient
{ "intersect_polygons_2d", "intersect_polygons" }, // Geometry2D
@@ -426,7 +428,7 @@ const char *RenamesMap3To4::gdscript_function_renames[][2] = {
{ "is_shortcut", "matches_event" }, // Shortcut
{ "is_size_override_stretch_enabled", "is_size_2d_override_stretch_enabled" }, // SubViewport
{ "is_sort_enabled", "is_y_sort_enabled" }, // Node2D
- { "is_static_body", "is_able_to_sleep" }, // PhysicalBone3D - TODO - not sure
+ { "is_static_body", "is_able_to_sleep" }, // PhysicalBone3D -- Not sure.
{ "is_v_drag_enabled", "is_drag_vertical_enabled" }, // Camera2D
{ "joint_create_cone_twist", "joint_make_cone_twist" }, // PhysicsServer3D
{ "joint_create_generic_6dof", "joint_make_generic_6dof" }, // PhysicsServer3D
@@ -435,7 +437,7 @@ const char *RenamesMap3To4::gdscript_function_renames[][2] = {
{ "joint_create_slider", "joint_make_slider" }, // PhysicsServer3D
{ "line_intersects_line_2d", "line_intersects_line" }, // Geometry2D
{ "load_from_globals", "load_from_project_settings" }, // InputMap
- { "load_interactive", "load_threaded_request" }, // ResourceLoader - load_threaded_request is alternative, but is used differently
+ { "load_interactive", "load_threaded_request" }, // ResourceLoader -- "load_threaded_request" could be an alternative, but it is used differently.
{ "make_convex_from_brothers", "make_convex_from_siblings" }, // CollisionShape3D
{ "make_visible", "_make_visible" }, // EditorPlugin
{ "merge_polygons_2d", "merge_polygons" }, // Geometry2D
@@ -457,7 +459,6 @@ const char *RenamesMap3To4::gdscript_function_renames[][2] = {
{ "raise", "move_to_front" }, // CanvasItem
{ "recognize", "_recognize" }, // ResourceFormatLoader
{ "regen_normalmaps", "regen_normal_maps" }, // ArrayMesh
- { "remove", "remove_at" }, // Array, broke Directory
{ "remove_animation", "remove_animation_library" }, // AnimationPlayer
{ "remove_color_override", "remove_theme_color_override" }, // Control
{ "remove_constant_override", "remove_theme_constant_override" }, // Control
@@ -479,10 +480,10 @@ const char *RenamesMap3To4::gdscript_function_renames[][2] = {
{ "set_as_normalmap", "set_as_normal_map" }, // NoiseTexture
{ "set_as_toplevel", "set_as_top_level" }, // CanvasItem
{ "set_audio_bus", "set_audio_bus_name" }, // Area3D
- { "set_autowrap", "set_autowrap_mode" }, // Label broke AcceptDialog
+ { "set_autowrap", "set_autowrap_mode" }, // Label -- Breaks AcceptDialog.
{ "set_cast_to", "set_target_position" }, // RayCast2D, RayCast3D
- { "set_collision_layer_bit", "set_collision_layer_value" }, // CSGShape3D and a lot of others like GridMap
- { "set_collision_mask_bit", "set_collision_mask_value" }, // CSGShape3D and a lot of others like GridMap
+ { "set_collision_layer_bit", "set_collision_layer_value" }, // CSGShape3D, and a lot of others like GridMap.
+ { "set_collision_mask_bit", "set_collision_mask_value" }, // CSGShape3D, and a lot of others like GridMap.
{ "set_column_min_width", "set_column_custom_minimum_width" }, // Tree
{ "set_command", "set_meta_pressed" }, // InputEventWithModifiers
{ "set_control", "set_ctrl_pressed" }, // InputEventWithModifiers
@@ -490,6 +491,7 @@ const char *RenamesMap3To4::gdscript_function_renames[][2] = {
{ "set_cull_mask_bit", "set_cull_mask_value" }, // Camera3D
{ "set_cursor_position", "set_caret_column" }, // LineEdit
{ "set_d", "set_distance" }, // WorldMarginShape2D
+ { "set_default_length", "set_length" }, // Bone2D
{ "set_depth_bias_enable", "set_depth_bias_enabled" }, // RDPipelineRasterizationState
{ "set_device", "set_output_device" }, // AudioServer
{ "set_doubleclick", "set_double_click" }, // InputEventMouseButton
@@ -498,13 +500,13 @@ const char *RenamesMap3To4::gdscript_function_renames[][2] = {
{ "set_enabled_focus_mode", "set_focus_mode" }, // BaseButton
{ "set_endian_swap", "set_big_endian" }, // File
{ "set_expand_to_text_length", "set_expand_to_text_length_enabled" }, // LineEdit
- { "set_filename", "set_scene_file_path" }, // Node, WARNING, this may be used in a lot of other places
+ { "set_filename", "set_scene_file_path" }, // Node -- WARNING: This may be used in a lot of other places.
{ "set_focus_neighbour", "set_focus_neighbor" }, // Control
{ "set_follow_smoothing", "set_position_smoothing_speed" }, // Camera2D
{ "set_frame_color", "set_color" }, // ColorRect
{ "set_global_rate_scale", "set_playback_speed_scale" }, // AudioServer
- { "set_gravity_distance_scale", "set_gravity_point_unit_distance" }, // Area(2D/3D)
- { "set_gravity_vector", "set_gravity_direction" }, // Area(2D/3D)
+ { "set_gravity_distance_scale", "set_gravity_point_unit_distance" }, // Area2D, Area3D
+ { "set_gravity_vector", "set_gravity_direction" }, // Area2D, Area3D
{ "set_h_drag_enabled", "set_drag_horizontal_enabled" }, // Camera2D
{ "set_icon_align", "set_icon_alignment" }, // Button
{ "set_interior_ambient", "set_ambient_color" }, // ReflectionProbe
@@ -526,13 +528,13 @@ const char *RenamesMap3To4::gdscript_function_renames[][2] = {
{ "set_physical_scancode", "set_physical_keycode" }, // InputEventKey
{ "set_proximity_fade", "set_proximity_fade_enabled" }, // Material
{ "set_refuse_new_network_connections", "set_refuse_new_connections" }, // Multiplayer API
- { "set_region", "set_region_enabled" }, // Sprite2D, Sprite broke AtlasTexture
+ { "set_region", "set_region_enabled" }, // Sprite2D -- Sprite breaks AtlasTexture.
{ "set_region_filter_clip", "set_region_filter_clip_enabled" }, // Sprite2D
{ "set_reverb_bus", "set_reverb_bus_name" }, // Area3D
{ "set_rotate", "set_rotates" }, // PathFollow2D
{ "set_scancode", "set_keycode" }, // InputEventKey
{ "set_shift", "set_shift_pressed" }, // InputEventWithModifiers
- { "set_size_override", "set_size_2d_override" }, // SubViewport broke ImageTexture
+ { "set_size_override", "set_size_2d_override" }, // SubViewport -- Breaks ImageTexture.
{ "set_size_override_stretch", "set_size_2d_override_stretch" }, // SubViewport
{ "set_slips_on_slope", "set_slide_on_slope" }, // SeparationRayShape2D, SeparationRayShape3D
{ "set_sort_enabled", "set_y_sort_enabled" }, // Node2D
@@ -540,20 +542,20 @@ const char *RenamesMap3To4::gdscript_function_renames[][2] = {
{ "set_spatial_node", "set_node_3d" }, // EditorNode3DGizmo
{ "set_speed", "set_velocity" }, // InputEventMouseMotion
{ "set_ssao_edge_sharpness", "set_ssao_sharpness" }, // Environment
- { "set_surface_material", "set_surface_override_material" }, // MeshInstance3D broke ImporterMesh
- { "set_tab_align", "set_tab_alignment" }, //TabContainer
- { "set_tangent", "surface_set_tangent" }, // ImmediateGeometry broke SurfaceTool
+ { "set_surface_material", "set_surface_override_material" }, // MeshInstance3D -- Breaks ImporterMesh.
+ { "set_tab_align", "set_tab_alignment" }, // TabContainer
+ { "set_tangent", "surface_set_tangent" }, // ImmediateGeometry -- Breaks SurfaceTool.
{ "set_text_align", "set_text_alignment" }, // Button
{ "set_timer_process_mode", "set_timer_process_callback" }, // Timer
- { "set_translation", "set_position" }, // Node3D - this broke GLTFNode which is used rarely
+ { "set_translation", "set_position" }, // Node3D -- This breaks GLTFNode, but it is used rarely.
{ "set_unit_db", "set_volume_db" }, // AudioStreamPlayer3D
{ "set_unit_offset", "set_progress_ratio" }, // PathFollow2D, PathFollow3D
- { "set_uv2", "surface_set_uv2" }, // ImmediateMesh broke Surffacetool
+ { "set_uv2", "surface_set_uv2" }, // ImmediateMesh -- Breaks SurfaceTool.
{ "set_v_drag_enabled", "set_drag_vertical_enabled" }, // Camera2D
{ "set_valign", "set_vertical_alignment" }, // Label
{ "set_window_layout", "_set_window_layout" }, // EditorPlugin
- { "set_zfar", "set_far" }, // Camera3D broke GLTFCamera
- { "set_znear", "set_near" }, // Camera3D broke GLTFCamera
+ { "set_zfar", "set_far" }, // Camera3D -- Breaks GLTFCamera.
+ { "set_znear", "set_near" }, // Camera3D -- Breaks GLTFCamera.
{ "shortcut_match", "is_match" }, // InputEvent
{ "skeleton_allocate", "skeleton_allocate_data" }, // RenderingServer
{ "surface_update_region", "surface_update_attribute_region" }, // ArrayMesh
@@ -574,22 +576,23 @@ const char *RenamesMap3To4::gdscript_function_renames[][2] = {
{ "get_uniform_name", "get_parameter_name" }, // ParameterRef
// Builtin types
- // Remember to add them to builtin_types_excluded_functions variable, because for now this functions cannot be listed
- // { "empty", "is_empty" }, // Array - Used as custom rule // Be careful, this will be used everywhere
- { "clamped", "clamp" }, // Vector2 // Be careful, this will be used everywhere
+ // Remember to add them to the builtin_types_excluded_functions variable, because for now these functions cannot be listed.
+ // { "empty", "is_empty" }, // Array -- Used as custom rule. Be careful, this will be used everywhere.
+ // { "remove", "remove_at" }, // Array -- Breaks Directory and several more.
+ { "clamped", "clamp" }, // Vector2 -- Be careful, this will be used everywhere.
{ "get_rotation_quat", "get_rotation_quaternion" }, // Basis
{ "grow_margin", "grow_side" }, // Rect2
- { "invert", "reverse" }, // Array - TODO check // Be careful, this will be used everywhere
+ { "invert", "reverse" }, // Array -- Give it a check. Be careful, this will be used everywhere.
{ "is_abs_path", "is_absolute_path" }, // String
{ "is_valid_integer", "is_valid_int" }, // String
{ "linear_interpolate", "lerp" }, // Color
{ "find_last", "rfind" }, // Array, String
{ "to_ascii", "to_ascii_buffer" }, // String
{ "to_utf8", "to_utf8_buffer" }, // String
- { "to_wchar", "to_utf32_buffer" }, // String // TODO - utf32 or utf16?
+ { "to_wchar", "to_utf32_buffer" }, // String -- utf32 or utf16?
// @GlobalScope
- // Remember to add them to builtin_types_excluded_functions variable, because for now this functions cannot be listed
+ // Remember to add them to the builtin_types_excluded_functions variable, because for now these functions cannot be listed.
{ "bytes2var", "bytes_to_var" },
{ "bytes2var_with_objects", "bytes_to_var_with_objects" },
{ "db2linear", "db_to_linear" },
@@ -605,7 +608,7 @@ const char *RenamesMap3To4::gdscript_function_renames[][2] = {
{ "var2bytes_with_objects", "var_to_bytes_with_objects" },
// @GDScript
- // Remember to add them to builtin_types_excluded_functions variable, because for now this functions cannot be listed
+ // Remember to add them to the builtin_types_excluded_functions variable, because for now these functions cannot be listed.
{ "dict2inst", "dict_to_inst" },
{ "inst2dict", "inst_to_dict" },
@@ -614,54 +617,52 @@ const char *RenamesMap3To4::gdscript_function_renames[][2] = {
// gdscript_function_renames clone with CamelCase
const char *RenamesMap3To4::csharp_function_renames[][2] = {
- // { "_SetName", "GetTrackerName"}, // XRPositionalTracker - CameraFeed use this
- // { "_UnhandledInput", "_UnhandledKeyInput"}, // BaseButton, ViewportContainer broke Node, FileDialog,SubViewportContainer
- // { "CreateGizmo", "_CreateGizmo"}, // EditorNode3DGizmoPlugin - may be used
- // { "GetDependencies", "_GetDependencies" }, // ResourceFormatLoader broke ResourceLoader
- // { "GetExtents", "GetSize" }, // BoxShape, RectangleShape broke Decal, VoxelGI, GPUParticlesCollisionBox, GPUParticlesCollisionSDF, GPUParticlesCollisionHeightField, GPUParticlesAttractorBox, GPUParticlesAttractorVectorField, FogVolume
- // { "GetHOffset", "GetDragHorizontalOffset"}, // Camera2D, broke PathFollow, Camera
- // { "GetMode", "GetFileMode"}, // FileDialog broke Panel, Shader, CSGPolygon, Tilemap
- // { "GetMotion", "GetTravel"}, // PhysicsTestMotionResult2D broke ParalaxLayer
- // { "GetName", "GetTrackerName"}, // XRPositionalTracker broke OS, Node
- // { "GetNetworkConnectedPeers", "GetPeers"}, // MultiplayerAPI broke SceneTree
- // { "GetNetworkPeer", "HasMultiplayerPeer"}, // MultiplayerAPI broke SceneTree
- // { "GetNetworkUniqueId", "GetUniqueId"}, // MultiplayerAPI broke SceneTree
- // { "GetOffset", "GetPositionOffset" }, // GraphNode broke Gradient
- // { "GetPeerPort", "GetPeer" }, // ENetMultiplayerPeer broke WebSocketServer
- // { "GetProcessMode", "GetProcessCallback" }, // ClippedCamera3D broke Node, Sky
- // { "GetRenderInfo", "GetRenderingInfo" }, // RenderingServer broke Viewport
- // { "GetType", "GetTrackerType"}, // XRPositionalTracker broke GLTFAccessor, GLTFLight
- // { "GetVOffset", "GetDragVerticalOffset"}, // Camera2D, broke PathFollow, Camera
- // { "HasNetworkPeer", "HasMultiplayerPeer"}, // MultiplayerAPI broke SceneTree
- // { "Instance", "Instantiate" }, // PackedScene, ClassDB - Broke FileSystemDock signal and also tscn files - [instance=ExtResource( 17 )] - this is implemented as custom rule
- // { "IsListening", "IsBound"}, // PacketPeerUDP broke TCPServer, UDPServer
- // { "IsRefusingNewNetworkConnections", "IsRefusingNewConnections"}, // MultiplayerAPI broke SceneTree
- // { "IsValid", "HasValidEvent" }, // Shortcut broke e.g. Callable
- // { "Listen", "Bound"}, // PacketPeerUDP broke TCPServer, UDPServer
- // { "Load", "_Load"}, // ResourceFormatLoader broke ConfigFile, Image, StreamTexture2D
- // { "MakeCurrent", "SetCurrent" }, // Camera2D broke Camera3D, Listener2D
- // { "Process", "_Process" }, // AnimationNode - This word is commonly used
- // { "Save", "_Save"}, // ResourceFormatLoader broke ConfigFile, Image, StreamTexture2D
- // { "SetAutowrap", "SetAutowrapMode" }, // AcceptDialog broke Label - Cyclic Rename
- // { "SetColor", "SurfaceSetColor"}, // ImmediateMesh broke Light2D, Theme, SurfaceTool
- // { "SetEvent", "SetShortcut" }, // BaseButton - Cyclic Rename
- // { "SetExtents", "SetSize"}, // BoxShape, RectangleShape broke ReflectionProbe
- // { "SetFlag", "SetParticleFlag"}, // ParticleProcessMaterial broke Window, HingeJoint3D
- // { "SetHOffset", "SetDragHorizontalOffset" }, // Camera2D broke Camera3D, PathFollow3D, PathFollow2D
- // { "SetMargin", "SetOffset" }, // Control broke Shape3D, AtlasTexture
- // { "SetMode", "SetModeFileMode" }, // FileDialog broke Panel, Shader, CSGPolygon, Tilemap
- // { "SetNormal", "SurfaceSetNormal"}, // ImmediateGeometry broke SurfaceTool, WorldMarginShape2D
- // { "SetOffset", "SetProgress" }, // PathFollow2D, PathFollow3D - Too common
- // { "SetProcessMode", "SetProcessCallback" }, // AnimationTree broke Node, Tween, Sky
- // { "SetRefuseNewNetworkConnections", "SetRefuseNewConnections"}, // MultiplayerAPI broke SceneTree
- // { "SetTooltip", "SetTooltipText" }, // Control, breaks TreeItem, at least for now.
- // { "SetUv", "SurfaceSetUv" }, // ImmediateMesh broke Polygon2D
- // { "SetVOffset", "SetDragVerticalOffset" }, // Camera2D broke Camera3D, PathFollow3D, PathFollow2D
- // {"GetPoints","GetPointsId"},// Astar, broke Line2D, Convexpolygonshape
- // {"GetVScroll","GetVScrollBar"},//ItemList, broke TextView
- // { "GetStylebox", "GetThemeStylebox" }, // Control - Will rename the method in Theme as well, skipping
- { "AddSpatialGizmoPlugin", "AddNode3dGizmoPlugin" }, // EditorPlugin
- { "RenderingServer", "GetTabAlignment" }, // Tab
+ // { "_SetName", "GetTrackerName" }, // XRPositionalTracker -- CameraFeed uses this.
+ // { "_UnhandledInput", "_UnhandledKeyInput" }, // BaseButton, ViewportContainer -- Breaks Node, FileDialog, SubViewportContainer.
+ // { "CreateGizmo", "_CreateGizmo" }, // EditorNode3DGizmoPlugin -- May be used.
+ // { "GetDependencies", "_GetDependencies" }, // ResourceFormatLoader -- Breaks ResourceLoader.
+ // { "GetExtents", "GetSize" }, // BoxShape, RectangleShape -- Breaks Decal, VoxelGI, GPUParticlesCollisionBox, GPUParticlesCollisionSDF, GPUParticlesCollisionHeightField, GPUParticlesAttractorBox, GPUParticlesAttractorVectorField, FogVolume.
+ // { "GetHOffset", "GetDragHorizontalOffset" }, // Camera2D -- Breaks PathFollow, Camera.
+ // { "GetMode", "GetFileMode" }, // FileDialog -- Breaks Panel, Shader, CSGPolygon, TileMap.
+ // { "GetMotion", "GetTravel" }, // PhysicsTestMotionResult2D -- Breaks ParallaxLayer.
+ // { "GetName", "GetTrackerName" }, // XRPositionalTracker -- Breaks OS, Node
+ // { "GetNetworkConnectedPeers", "GetPeers" }, // MultiplayerAPI -- Breaks SceneTree.
+ // { "GetNetworkPeer", "HasMultiplayerPeer" }, // MultiplayerAPI -- Breaks SceneTree.
+ // { "GetNetworkUniqueId", "GetUniqueId" }, // MultiplayerAPI -- Breaks SceneTree.
+ // { "GetOffset", "GetPositionOffset" }, // GraphNode -- Breaks Gradient.
+ // { "GetPeerPort", "GetPeer" }, // ENetMultiplayerPeer -- Breaks WebSocketServer.
+ // { "GetProcessMode", "GetProcessCallback" }, // ClippedCamera3D -- Breaks Node, Sky.
+ // { "GetRenderInfo", "GetRenderingInfo" }, // RenderingServer -- Breaks Viewport.
+ // { "GetType", "GetTrackerType" }, // XRPositionalTracker -- Breaks GLTFAccessor, GLTFLight.
+ // { "GetVOffset", "GetDragVerticalOffset" }, // Camera2D -- Breaks PathFollow, Camera.
+ // { "HasNetworkPeer", "HasMultiplayerPeer" }, // MultiplayerAPI -- Breaks SceneTree.
+ // { "Instance", "Instantiate" }, // PackedScene, ClassDB -- Breaks FileSystemDock signal, and also .tscn files ("[instance=ExtResource( 17 )]"). This is implemented as custom rule.
+ // { "IsListening", "IsBound"}, // PacketPeerUDP -- Breaks TCPServer, UDPServer.
+ // { "IsRefusingNewNetworkConnections", "IsRefusingNewConnections"}, // MultiplayerAPI -- Breaks SceneTree.
+ // { "IsValid", "HasValidEvent" }, // Shortcut -- Breaks Callable, and more.
+ // { "Listen", "Bound"}, // PacketPeerUDP -- Breaks TCPServer, UDPServer.
+ // { "Load", "_Load"}, // ResourceFormatLoader -- Breaks ConfigFile, Image, StreamTexture2D.
+ // { "MakeCurrent", "SetCurrent" }, // Camera2D -- Breaks Camera3D, Listener2D.
+ // { "Process", "_Process" }, // AnimationNode -- This word is too commonly used.
+ // { "Save", "_Save"}, // ResourceFormatLoader -- Breaks ConfigFile, Image, StreamTexture2D.
+ // { "SetAutowrap", "SetAutowrapMode" }, // AcceptDialog -- Breaks Label, also a cyclic rename.
+ // { "SetColor", "SurfaceSetColor"}, // ImmediateMesh -- Breaks Light2D, Theme, SurfaceTool.
+ // { "SetEvent", "SetShortcut" }, // BaseButton -- Cyclic rename.
+ // { "SetExtents", "SetSize"}, // BoxShape, RectangleShape -- Breaks ReflectionProbe.
+ // { "SetFlag", "SetParticleFlag"}, // ParticleProcessMaterial -- Breaks Window, HingeJoint3D.
+ // { "SetHOffset", "SetDragHorizontalOffset" }, // Camera2D -- Breaks Camera3D, PathFollow3D, PathFollow2D.
+ // { "SetMargin", "SetOffset" }, // Control -- Breaks Shape3D, AtlasTexture.
+ // { "SetMode", "SetModeFileMode" }, // FileDialog -- Breaks Panel, Shader, CSGPolygon, TileMap.
+ // { "SetNormal", "SurfaceSetNormal"}, // ImmediateGeometry -- Breaks SurfaceTool, WorldMarginShape2D.
+ // { "SetOffset", "SetProgress" }, // PathFollow2D, PathFollow3D -- Too common.
+ // { "SetProcessMode", "SetProcessCallback" }, // AnimationTree -- Breaks Node, Tween, Sky.
+ // { "SetRefuseNewNetworkConnections", "SetRefuseNewConnections"}, // MultiplayerAPI -- Breaks SceneTree.
+ // { "SetTooltip", "SetTooltipText" }, // Control -- Breaks TreeItem, at least for now.
+ // { "SetUv", "SurfaceSetUv" }, // ImmediateMesh -- Breaks Polygon2D.
+ // { "SetVOffset", "SetDragVerticalOffset" }, // Camera2D -- Breaks Camera3D, PathFollow3D, PathFollow2D.
+ // {"GetPoints","GetPointsId" }, // AStar -- Breaks Line2D, ConvexPolygonShape.
+ // {"GetVScroll","GetVScrollBar" }, // ItemList -- Breaks TextView.
+ // { "GetStylebox", "GetThemeStylebox" }, // Control -- Would rename the method in Theme as well, skipping.
{ "_AboutToShow", "_AboutToPopup" }, // ColorPickerButton
{ "_GetConfigurationWarning", "_GetConfigurationWarnings" }, // Node
{ "_SetCurrent", "SetCurrent" }, // Camera2D
@@ -679,6 +680,7 @@ const char *RenamesMap3To4::csharp_function_renames[][2] = {
{ "AddForce", "AddConstantForce" }, //RigidBody2D
{ "AddIconOverride", "AddThemeIconOverride" }, // Control
{ "AddSceneImportPlugin", "AddSceneFormatImporterPlugin" }, //EditorPlugin
+ { "AddSpatialGizmoPlugin", "AddNode3dGizmoPlugin" }, // EditorPlugin
{ "AddStyleboxOverride", "AddThemeStyleboxOverride" }, // Control
{ "AddTorque", "AddConstantTorque" }, //RigidBody2D
{ "AgentSetNeighborDist", "AgentSetNeighborDistance" }, // NavigationServer2D, NavigationServer3D
@@ -731,7 +733,7 @@ const char *RenamesMap3To4::csharp_function_renames[][2] = {
{ "GetAppliedTorque", "GetConstantTorque" }, //RigidBody2D
{ "GetAudioBus", "GetAudioBusName" }, // Area3D
{ "GetBoundChildNodesToBone", "GetBoneChildren" }, // Skeleton3D
- { "GetCamera", "GetCamera3d" }, // Viewport -> this is also convertible to getCamera2d, broke GLTFNode
+ { "GetCamera", "GetCamera3d" }, // Viewport -- This is also convertible to GetCamera2d. Breaks GLTFNode.
{ "GetCancel", "GetCancelButton" }, // ConfirmationDialog
{ "GetCaption", "_GetCaption" }, // AnimationNode
{ "GetCastTo", "GetTargetPosition" }, // RayCast2D, RayCast3D
@@ -740,8 +742,8 @@ const char *RenamesMap3To4::csharp_function_renames[][2] = {
{ "GetClosestPointToSegment2d", "GetClosestPointToSegment" }, // Geometry2D
{ "GetClosestPointToSegmentUncapped2d", "GetClosestPointToSegmentUncapped" }, // Geometry2D
{ "GetClosestPointsBetweenSegments2d", "GetClosestPointToSegment" }, // Geometry2D
- { "GetCollisionLayerBit", "GetCollisionLayerValue" }, // CSGShape3D and a lot of others like GridMap
- { "GetCollisionMaskBit", "GetCollisionMaskValue" }, // CSGShape3D and a lot of others like GridMap
+ { "GetCollisionLayerBit", "GetCollisionLayerValue" }, // CSGShape3D, and a lot of others like GridMap.
+ { "GetCollisionMaskBit", "GetCollisionMaskValue" }, // CSGShape3D, and a lot of others like GridMap.
{ "GetColorTypes", "GetColorTypeList" }, // Theme
{ "GetCommand", "IsCommandPressed" }, // InputEventWithModifiers
{ "GetConstantTypes", "GetConstantTypeList" }, // Theme
@@ -749,6 +751,7 @@ const char *RenamesMap3To4::csharp_function_renames[][2] = {
{ "GetCullMaskBit", "GetCullMaskValue" }, // Camera3D
{ "GetCursorPosition", "GetCaretColumn" }, // LineEdit
{ "GetD", "GetDistance" }, // LineShape2D
+ { "GetDefaultLength", "GetLength" }, // Bone2D
{ "GetDepthBiasEnable", "GetDepthBiasEnabled" }, // RDPipelineRasterizationState
{ "GetDevice", "GetOutputDevice" }, // AudioServer
{ "GetDeviceList", "GetOutputDeviceList" }, // AudioServer
@@ -762,9 +765,9 @@ const char *RenamesMap3To4::csharp_function_renames[][2] = {
{ "GetFontTypes", "GetFontTypeList" }, // Theme
{ "GetFrameColor", "GetColor" }, // ColorRect
{ "GetGlobalRateScale", "GetPlaybackSpeedScale" }, // AudioServer
- { "GetGravityDistanceScale", "GetGravityPointDistanceScale" }, //Area2D
- { "GetGravityVector", "GetGravityDirection" }, //Area2D
- { "GetHScrollbar", "GetHScrollBar" }, //ScrollContainer
+ { "GetGravityDistanceScale", "GetGravityPointDistanceScale" }, // Area2D
+ { "GetGravityVector", "GetGravityDirection" }, // Area2D
+ { "GetHScrollbar", "GetHScrollBar" }, // ScrollContainer
{ "GetHand", "GetTrackerHand" }, // XRPositionalTracker
{ "GetHandleName", "_GetHandleName" }, // EditorNode3DGizmo
{ "GetHandleValue", "_GetHandleValue" }, // EditorNode3DGizmo
@@ -801,11 +804,11 @@ const char *RenamesMap3To4::csharp_function_renames[][2] = {
{ "GetPluginName", "_GetPluginName" }, // EditorPlugin
{ "GetPresetCount", "_GetPresetCount" }, // EditorImportPlugin
{ "GetPresetName", "_GetPresetName" }, // EditorImportPlugin
- { "GetRecognizedExtensions", "_GetRecognizedExtensions" }, // ResourceFormatLoader, EditorImportPlugin broke ResourceSaver
+ { "GetRecognizedExtensions", "_GetRecognizedExtensions" }, // ResourceFormatLoader, EditorImportPlugin -- Breaks ResourceSaver.
{ "GetRenderInfo", "GetRenderingInfo" }, // RenderingServer
{ "GetRenderTargetsize", "GetRenderTargetSize" }, // XRInterface
{ "GetResourceType", "_GetResourceType" }, // ResourceFormatLoader
- { "GetResult", "GetData" }, //JSON
+ { "GetResult", "GetData" }, // JSON
{ "GetReverbBus", "GetReverbBusName" }, // Area3D
{ "GetRpcSenderId", "GetRemoteSenderId" }, // Multiplayer API
{ "GetSaveExtension", "_GetSaveExtension" }, // EditorImportPlugin
@@ -819,45 +822,45 @@ const char *RenamesMap3To4::csharp_function_renames[][2] = {
{ "GetSpatialNode", "GetNode3d" }, // EditorNode3DGizmo
{ "GetSpeed", "GetVelocity" }, // InputEventMouseMotion
{ "GetStyleboxTypes", "GetStyleboxTypeList" }, // Theme
- { "GetSurfaceMaterial", "GetSurfaceOverrideMaterial" }, // MeshInstance3D broke ImporterMesh
+ { "GetSurfaceMaterial", "GetSurfaceOverrideMaterial" }, // MeshInstance3D -- Breaks ImporterMesh.
{ "GetSurfaceMaterialCount", "GetSurfaceOverrideMaterialCount" }, // MeshInstance3D
{ "GetTabDisabled", "IsTabDisabled" }, // Tab
{ "GetTabHidden", "IsTabHidden" }, // Tab
{ "GetTextAlign", "GetTextAlignment" }, // Button
{ "GetThemeItemTypes", "GetThemeItemTypeList" }, // Theme
{ "GetTimerProcessMode", "GetTimerProcessCallback" }, // Timer
- { "GetTranslation", "GetPosition" }, // Node3D broke GLTFNode which is used rarely
+ { "GetTranslation", "GetPosition" }, // Node3D -- Breaks GLTFNode, but it is used rarely.
{ "GetUnitDb", "GetVolumeDb" }, // AudioStreamPlayer3D
{ "GetUnitOffset", "GetProgressRatio" }, // PathFollow2D, PathFollow3D
{ "GetUseInBakedLight", "IsBakingNavigation" }, // GridMap
{ "GetUsedCellsById", "GetUsedCells" }, // TileMap
- { "GetVScrollbar", "GetVScrollBar" }, //ScrollContainer
+ { "GetVScrollbar", "GetVScrollBar" }, // ScrollContainer
{ "GetVisibleName", "_GetVisibleName" }, // EditorImportPlugin
{ "GetWindowLayout", "_GetWindowLayout" }, // EditorPlugin
{ "GetWordUnderCursor", "GetWordUnderCaret" }, // TextEdit
- { "GetWorld", "GetWorld3d" }, // Viewport, Spatial
- { "GetZfar", "GetFar" }, // Camera3D broke GLTFCamera
- { "GetZnear", "GetNear" }, // Camera3D broke GLTFCamera
+ { "GetWorld", "GetWorld3d" }, // Viewport, Node3D
+ { "GetZfar", "GetFar" }, // Camera3D -- Breaks GLTFCamera
+ { "GetZnear", "GetNear" }, // Camera3D -- Breaks GLTFCamera
{ "GrooveJointCreate", "JointMakeGroove" }, // PhysicsServer2D
{ "HandleMenuSelected", "_HandleMenuSelected" }, // EditorResourcePicker
{ "HandlesType", "_HandlesType" }, // ResourceFormatLoader
- { "HasColor", "HasThemeColor" }, // Control broke Theme
- { "HasColorOverride", "HasThemeColorOverride" }, // Control broke Theme
+ { "HasColor", "HasThemeColor" }, // Control -- Breaks Theme
+ { "HasColorOverride", "HasThemeColorOverride" }, // Control -- Breaks Theme
{ "HasConstant", "HasThemeConstant" }, // Control
{ "HasConstantOverride", "HasThemeConstantOverride" }, // Control
{ "HasFilter", "_HasFilter" }, // AnimationNode
- { "HasFont", "HasThemeFont" }, // Control broke Theme
+ { "HasFont", "HasThemeFont" }, // Control -- Breaks Theme
{ "HasFontOverride", "HasThemeFontOverride" }, // Control
- { "HasIcon", "HasThemeIcon" }, // Control broke Theme
+ { "HasIcon", "HasThemeIcon" }, // Control -- Breaks Theme
{ "HasIconOverride", "HasThemeIconOverride" }, // Control
{ "HasMainScreen", "_HasMainScreen" }, // EditorPlugin
{ "HasNetworkPeer", "HasMultiplayerPeer" }, // Multiplayer API
- { "HasStylebox", "HasThemeStylebox" }, // Control broke Theme
+ { "HasStylebox", "HasThemeStylebox" }, // Control -- Breaks Theme
{ "HasStyleboxOverride", "HasThemeStyleboxOverride" }, // Control
{ "HttpEscape", "UriEncode" }, // String
{ "HttpUnescape", "UriDecode" }, // String
- { "ImportAnimationFromOtherImporter", "_ImportAnimation" }, //EditorSceneFormatImporter
- { "ImportSceneFromOtherImporter", "_ImportScene" }, //EditorSceneFormatImporter
+ { "ImportAnimationFromOtherImporter", "_ImportAnimation" }, // EditorSceneFormatImporter
+ { "ImportSceneFromOtherImporter", "_ImportScene" }, // EditorSceneFormatImporter
{ "InstanceSetSurfaceMaterial", "InstanceSetSurfaceOverrideMaterial" }, // RenderingServer
{ "IntersectPolygons2d", "IntersectPolygons" }, // Geometry2D
{ "IntersectPolylineWithPolygon2d", "IntersectPolylineWithPolygon" }, // Geometry2D
@@ -879,7 +882,7 @@ const char *RenamesMap3To4::csharp_function_renames[][2] = {
{ "IsShortcut", "MatchesEvent" }, // Shortcut
{ "IsSizeOverrideStretchEnabled", "IsSize2dOverrideStretchEnabled" }, // SubViewport
{ "IsSortEnabled", "IsYSortEnabled" }, // Node2D
- { "IsStaticBody", "IsAbleToSleep" }, // PhysicalBone3D - TODO - not sure
+ { "IsStaticBody", "IsAbleToSleep" }, // PhysicalBone3D -- Not sure.
{ "IsVDragEnabled", "IsDragVerticalEnabled" }, // Camera2D
{ "JointCreateConeTwist", "JointMakeConeTwist" }, // PhysicsServer3D
{ "JointCreateGeneric6dof", "JointMakeGeneric6dof" }, // PhysicsServer3D
@@ -907,7 +910,6 @@ const char *RenamesMap3To4::csharp_function_renames[][2] = {
{ "PropertyListChangedNotify", "NotifyPropertyListChanged" }, // Object
{ "Recognize", "_Recognize" }, // ResourceFormatLoader
{ "RegenNormalmaps", "RegenNormalMaps" }, // ArrayMesh
- { "Remove", "RemoveAt" }, // Array, broke Directory
{ "RemoveAnimation", "RemoveAnimationLibrary" }, // AnimationPlayer
{ "RemoveColorOverride", "RemoveThemeColorOverride" }, // Control
{ "RemoveConstantOverride", "RemoveThemeConstantOverride" }, // Control
@@ -928,10 +930,10 @@ const char *RenamesMap3To4::csharp_function_renames[][2] = {
{ "SetAsNormalmap", "SetAsNormalMap" }, // NoiseTexture
{ "SetAsToplevel", "SetAsTopLevel" }, // CanvasItem
{ "SetAudioBus", "SetAudioBusName" }, // Area3D
- { "SetAutowrap", "SetAutowrapMode" }, // Label broke AcceptDialog
+ { "SetAutowrap", "SetAutowrapMode" }, // Label -- Breaks AcceptDialog.
{ "SetCastTo", "SetTargetPosition" }, // RayCast2D, RayCast3D
- { "SetCollisionLayerBit", "SetCollisionLayerValue" }, // CSGShape3D and a lot of others like GridMap
- { "SetCollisionMaskBit", "SetCollisionMaskValue" }, // CSGShape3D and a lot of others like GridMap
+ { "SetCollisionLayerBit", "SetCollisionLayerValue" }, // CSGShape3D, and a lot of others like GridMap.
+ { "SetCollisionMaskBit", "SetCollisionMaskValue" }, // CSGShape3D, and a lot of others like GridMap.
{ "SetColumnMinWidth", "SetColumnCustomMinimumWidth" }, // Tree
{ "SetCommand", "SetCommandPressed" }, // InputEventWithModifiers
{ "SetControl", "SetCtrlPressed" }, // InputEventWithModifiers
@@ -939,6 +941,7 @@ const char *RenamesMap3To4::csharp_function_renames[][2] = {
{ "SetCullMaskBit", "SetCullMaskValue" }, // Camera3D
{ "SetCursorPosition", "SetCaretColumn" }, // LineEdit
{ "SetD", "SetDistance" }, // WorldMarginShape2D
+ { "SetDefaultLength", "SetLength" }, // Bone2D
{ "SetDepthBiasEnable", "SetDepthBiasEnabled" }, // RDPipelineRasterizationState
{ "SetDevice", "SetOutputDevice" }, // AudioServer
{ "SetDoubleclick", "SetDoubleClick" }, // InputEventMouseButton
@@ -960,7 +963,7 @@ const char *RenamesMap3To4::csharp_function_renames[][2] = {
{ "SetIsPrimary", "SetPrimary" }, // XRInterface
{ "SetIterationsPerSecond", "SetPhysicsTicksPerSecond" }, // Engine
{ "SetLayerMaskBit", "SetLayerMaskValue" }, // VisualInstance3D
- { "SetMarginsPreset", "SetOffsetsPreset" }, // Control
+ { "SetMarginsPreset", "SetOffsetsPreset" }, // Control
{ "SetMaxAtlasSize", "SetMaxTextureSize" }, // LightmapGI
{ "SetMetakey", "SetMetaPressed" }, // InputEventWithModifiers
{ "SetMidHeight", "SetHeight" }, // CapsuleMesh
@@ -971,13 +974,13 @@ const char *RenamesMap3To4::csharp_function_renames[][2] = {
{ "SetPhysicalScancode", "SetPhysicalKeycode" }, // InputEventKey
{ "SetProximityFade", "SetProximityFadeEnabled" }, // Material
{ "SetRefuseNewNetworkConnections", "SetRefuseNewConnections" }, // Multiplayer API
- { "SetRegion", "SetRegionEnabled" }, // Sprite2D, Sprite broke AtlasTexture
+ { "SetRegion", "SetRegionEnabled" }, // Sprite2D -- Sprite breaks AtlasTexture.
{ "SetRegionFilterClip", "SetRegionFilterClipEnabled" }, // Sprite2D
{ "SetReverbBus", "SetReverbBusName" }, // Area3D
{ "SetRotate", "SetRotates" }, // PathFollow2D
{ "SetScancode", "SetKeycode" }, // InputEventKey
{ "SetShift", "SetShiftPressed" }, // InputEventWithModifiers
- { "SetSizeOverride", "SetSize2dOverride" }, // SubViewport broke ImageTexture
+ { "SetSizeOverride", "SetSize2dOverride" }, // SubViewport -- Breaks ImageTexture.
{ "SetSizeOverrideStretch", "SetSize2dOverrideStretch" }, // SubViewport
{ "SetSlipsOnSlope", "SetSlideOnSlope" }, // SeparationRayShape2D, SeparationRayShape3D
{ "SetSortEnabled", "SetYSortEnabled" }, // Node2D
@@ -985,21 +988,21 @@ const char *RenamesMap3To4::csharp_function_renames[][2] = {
{ "SetSpatialNode", "SetNode3d" }, // EditorNode3DGizmo
{ "SetSpeed", "SetVelocity" }, // InputEventMouseMotion
{ "SetSsaoEdgeSharpness", "SetSsaoSharpness" }, // Environment
- { "SetSurfaceMaterial", "SetSurfaceOverrideMaterial" }, // MeshInstance3D broke ImporterMesh
- { "SetTabAlign", "SetTabAlignment" }, //TabContainer
- { "SetTangent", "SurfaceSetTangent" }, // ImmediateGeometry broke SurfaceTool
+ { "SetSurfaceMaterial", "SetSurfaceOverrideMaterial" }, // MeshInstance3D -- Breaks ImporterMesh.
+ { "SetTabAlign", "SetTabAlignment" }, // TabContainer
+ { "SetTangent", "SurfaceSetTangent" }, // ImmediateGeometry -- Breaks SurfaceTool.
{ "SetTextAlign", "SetTextAlignment" }, // Button
{ "SetTimerProcessMode", "SetTimerProcessCallback" }, // Timer
{ "SetTonemapAutoExposure", "SetTonemapAutoExposureEnabled" }, // Environment
- { "SetTranslation", "SetPosition" }, // Node3D - this broke GLTFNode which is used rarely
+ { "SetTranslation", "SetPosition" }, // Node3D -- This breaks GLTFNode, but it is used rarely.
{ "SetUnitDb", "SetVolumeDb" }, // AudioStreamPlayer3D
{ "SetUnitOffset", "SetProgressRatio" }, // PathFollow2D, PathFollow3D
- { "SetUv2", "SurfaceSetUv2" }, // ImmediateMesh broke Surffacetool
+ { "SetUv2", "SurfaceSetUv2" }, // ImmediateMesh -- Breaks SurfaceTool.
{ "SetVDragEnabled", "SetDragVerticalEnabled" }, // Camera2D
{ "SetValign", "SetVerticalAlignment" }, // Label
{ "SetWindowLayout", "_SetWindowLayout" }, // EditorPlugin
- { "SetZfar", "SetFar" }, // Camera3D broke GLTFCamera
- { "SetZnear", "SetNear" }, // Camera3D broke GLTFCamera
+ { "SetZfar", "SetFar" }, // Camera3D -- Breaks GLTFCamera.
+ { "SetZnear", "SetNear" }, // Camera3D -- Breaks GLTFCamera.
{ "ShortcutMatch", "IsMatch" }, // InputEvent
{ "SkeletonAllocate", "SkeletonAllocateData" }, // RenderingServer
{ "SurfaceUpdateRegion", "SurfaceUpdateAttributeRegion" }, // ArrayMesh
@@ -1021,17 +1024,18 @@ const char *RenamesMap3To4::csharp_function_renames[][2] = {
{ "GetUniformName", "GetParameterName" }, // ParameterRef
// Builtin types
- // { "Empty", "IsEmpty" }, // Array - Used as custom rule // Be careful, this will be used everywhere
- { "Clamped", "Clamp" }, // Vector2 // Be careful, this will be used everywhere
+ // { "Empty", "IsEmpty" }, // Array -- Used as custom rule. Be careful, this will be used everywhere.
+ // { "Remove", "RemoveAt" }, // Array -- Breaks Directory and several more.
+ { "Clamped", "Clamp" }, // Vector2 -- Be careful, this will be used everywhere.
{ "GetRotationQuat", "GetRotationQuaternion" }, // Basis
{ "GrowMargin", "GrowSide" }, // Rect2
- { "Invert", "Reverse" }, // Array - TODO check // Be careful, this will be used everywhere
+ { "Invert", "Reverse" }, // Array -- Give it a check. Be careful, this will be used everywhere.
{ "IsAbsPath", "IsAbsolutePath" }, // String
{ "IsValidInteger", "IsValidInt" }, // String
{ "LinearInterpolate", "Lerp" }, // Color
{ "ToAscii", "ToAsciiBuffer" }, // String
{ "ToUtf8", "ToUtf8Buffer" }, // String
- { "ToWchar", "ToUtf32Buffer" }, // String // TODO - utf32 or utf16?
+ { "ToWchar", "ToUtf32Buffer" }, // String -- utf32 or utf16?
// @GlobalScope
{ "Bytes2Var", "BytesToVar" },
@@ -1055,23 +1059,24 @@ const char *RenamesMap3To4::csharp_function_renames[][2] = {
{ nullptr, nullptr },
};
-// Some needs to be disabled, because users can use this names as variables
const char *RenamesMap3To4::gdscript_properties_renames[][2] = {
- // // { "d", "distance" }, //WorldMarginShape2D - TODO, looks that polish letters ą ę are treaten as space, not as letter, so `będą` are renamed to `będistanceą`
- // // {"alt","alt_pressed"}, // This may broke a lot of comments and user variables
- // // {"command","command_pressed"},// This may broke a lot of comments and user variables
- // // {"control","ctrl_pressed"},// This may broke a lot of comments and user variables
- // // {"extends","size"}, // BoxShape3D, LightmapGI broke ReflectionProbe
- // // {"meta","meta_pressed"},// This may broke a lot of comments and user variables
- // // {"pause_mode","process_mode"}, // Node - Cyclic rename, look for others
- // // {"rotate","rotates"}, // PathFollow2D - probably function exists with same name
- // // {"offset","progress"}, // PathFollow2D, PathFollow3D - Name is way too vague
- // // {"shift","shift_pressed"},// This may broke a lot of comments and user variables
+ // Some need to be disabled, because users frequently use these names for variables.
+ // // { "d", "distance" }, // WorldMarginShape2D -- TODO: looks like polish letters "ą" "ę" are treaten as space, not as letters. As such, "będą" is renamed to "będistanceą".
+ // // { "alt", "alt_pressed" }, // This may break a lot of comments and user variables.
+ // // { "command", "command_pressed" }, // This may break a lot of comments and user variables.
+ // // { "control", "ctrl_pressed" }, // This may break a lot of comments and user variables.
+ // // { "extends", "size" }, // BoxShape3D, LightmapGI -- Breaks ReflectionProbe.
+ // // { "meta", "meta_pressed" }, // This may break a lot of comments and user variables.
+ // // { "pause_mode", "process_mode" }, // Node -- Cyclic rename, look for others.
+ // // { "rotate", "rotates" }, // PathFollow2D - probably function exists with same name.
+ // // { "offset", "progress" }, // PathFollow2D, PathFollow3D -- Way too vague.
+ // // { "shift", "shift_pressed" }, // This may break a lot of comments and user variables.
// { "autowrap", "autowrap_mode" }, // Label
// { "cast_to", "target_position" }, // RayCast2D, RayCast3D
- // { "device", "output_device"}, // AudioServer - Too vague, most likely breaks comments & variables
+ // { "device", "output_device" }, // AudioServer - Too vague, most likely breaks comments & variables
// { "doubleclick", "double_click" }, // InputEventMouseButton
// { "group", "button_group" }, // BaseButton
+ // { "percent_visible, "show_percentage }, // ProgressBar -- Breaks Label and RichTextLabel. Could it be worth it?
// { "process_mode", "process_callback" }, // AnimationTree, Camera2D
// { "scancode", "keycode" }, // InputEventKey
// { "toplevel", "top_level" }, // Node
@@ -1080,7 +1085,7 @@ const char *RenamesMap3To4::gdscript_properties_renames[][2] = {
// { "zfar", "far" }, // Camera3D
// { "znear", "near" }, // Camera3D
// { "filename", "scene_file_path" }, // Node
- // { "pressed", "button_pressed" }, // BaseButton - Will also rename the signal, skipping for now
+ // { "pressed", "button_pressed" }, // BaseButton -- Would also rename the signal, skipping for now.
{ "as_normalmap", "as_normal_map" }, // NoiseTexture
{ "bbcode_text", "text" }, // RichTextLabel
{ "bg", "panel" }, // Theme
@@ -1120,10 +1125,10 @@ const char *RenamesMap3To4::gdscript_properties_renames[][2] = {
{ "icon_align", "icon_alignment" }, // Button
{ "iterations_per_second", "physics_ticks_per_second" }, // Engine
{ "invert_enable", "invert_enabled" }, // Polygon2D
- { "margin_bottom", "offset_bottom" }, // Control broke NinePatchRect, StyleBox
- { "margin_left", "offset_left" }, // Control broke NinePatchRect, StyleBox
- { "margin_right", "offset_right" }, // Control broke NinePatchRect, StyleBox
- { "margin_top", "offset_top" }, // Control broke NinePatchRect, StyleBox
+ { "margin_bottom", "offset_bottom" }, // Control -- Breaks NinePatchRect, StyleBox.
+ { "margin_left", "offset_left" }, // Control -- Breaks NinePatchRect, StyleBox.
+ { "margin_right", "offset_right" }, // Control -- Breaks NinePatchRect, StyleBox.
+ { "margin_top", "offset_top" }, // Control -- Breaks NinePatchRect, StyleBox.
{ "mid_height", "height" }, // CapsuleMesh
{ "neighbor_dist", "neighbor_distance" }, // NavigationAgent2D, NavigationAgent3D
{ "offset_h", "drag_horizontal_offset" }, // Camera2D
@@ -1165,7 +1170,7 @@ const char *RenamesMap3To4::gdscript_properties_renames[][2] = {
{ "tab_align", "tab_alignment" }, // TabContainer
{ "table_hseparation", "table_h_separation" }, // Theme
{ "table_vseparation", "table_v_separation" }, // Theme
- { "translation", "position" }, // Node3D - broke GLTFNode
+ { "translation", "position" }, // Node3D -- Breaks GLTFNode
{ "unit_db", "volume_db" }, // AudioStreamPlayer3D
{ "unit_offset", "progress_ratio" }, // PathFollow2D, PathFollow3D
{ "vseparation", "v_separation" }, // Theme
@@ -1174,23 +1179,23 @@ const char *RenamesMap3To4::gdscript_properties_renames[][2] = {
{ nullptr, nullptr },
};
-// Some needs to be disabled, because users can use this names as variables
const char *RenamesMap3To4::csharp_properties_renames[][2] = {
- // // { "D", "Distance" }, //WorldMarginShape2D - TODO, looks that polish letters ą ę are treaten as space, not as letter, so `będą` are renamed to `będistanceą`
- // // {"Alt","AltPressed"}, // This may broke a lot of comments and user variables
- // // {"Command","CommandPressed"},// This may broke a lot of comments and user variables
- // // {"Control","CtrlPressed"},// This may broke a lot of comments and user variables
- // // {"Extends","Size"}, // BoxShape3D, LightmapGI broke ReflectionProbe
- // // {"Meta","MetaPressed"},// This may broke a lot of comments and user variables
- // // {"PauseMode","ProcessMode"}, // Node - Cyclic rename, look for others
- // // {"Rotate","Rotates"}, // PathFollow2D - probably function exists with same name
- // // {"Offset","Progress"}, // PathFollow2D, PathFollow3D - Name is way too vague
- // // {"Shift","ShiftPressed"},// This may broke a lot of comments and user variables
+ // Some need to be disabled, because users frequently use these names for variables.
+ // // { "D", "Distance" }, // WorldMarginShape2D -- TODO: looks like polish letters "ą" "ę" are treaten as space, not as letters. As such, "będą" is renamed to "będistanceą".
+ // // { "Alt", "AltPressed" }, // This may break a lot of comments and user variables.
+ // // { "Command", "CommandPressed" }, // This may break a lot of comments and user variables.
+ // // { "Control", "CtrlPressed" }, // This may break a lot of comments and user variables.
+ // // { "Extends", "Size" }, // BoxShape3D, LightmapGI -- Breaks ReflectionProbe.
+ // // { "Meta", "MetaPressed" }, // This may break a lot of comments and user variables.
+ // // { "PauseMode", "ProcessMode" }, // Node -- Cyclic rename, look for others.
+ // // { "Rotate", "Rotates" }, // PathFollow2D - probably function exists with same name.
+ // // { "Offset", "Progress" }, // PathFollow2D, PathFollow3D -- Way too vague.
+ // // { "Shift", "ShiftPressed" }, // This may break a lot of comments and user variables.
// { "Autowrap", "AutowrapMode" }, // Label
// { "CastTo", "TargetPosition" }, // RayCast2D, RayCast3D
// { "Doubleclick", "DoubleClick" }, // InputEventMouseButton
// { "Group", "ButtonGroup" }, // BaseButton
- // { "PercentVisible, "ShowPercentage}, // ProgressBar, conflicts with Label and RichTextLabel, but may be a worth it.
+ // { "PercentVisible, "ShowPercentage}, // ProgressBar -- Breaks Label and RichTextLabel. Could it be worth it?
// { "ProcessMode", "ProcessCallback" }, // AnimationTree, Camera2D
// { "Scancode", "Keycode" }, // InputEventKey
// { "Toplevel", "TopLevel" }, // Node
@@ -1198,7 +1203,7 @@ const char *RenamesMap3To4::csharp_properties_renames[][2] = {
// { "WrapEnabled", "WrapMode" }, // TextEdit
// { "Zfar", "Far" }, // Camera3D
// { "Znear", "Near" }, // Camera3D
- // { "Pressed", "ButtonPressed" }, // BaseButton - Will also rename the signal, skipping for now
+ // { "Pressed", "ButtonPressed" }, // BaseButton -- Would also rename the signal, skipping for now.
{ "AsNormalmap", "AsNormalMap" }, // NoiseTexture
{ "BbcodeText", "Text" }, // RichTextLabel
{ "CaretBlinkSpeed", "CaretBlinkInterval" }, // TextEdit, LineEdit
@@ -1231,10 +1236,10 @@ const char *RenamesMap3To4::csharp_properties_renames[][2] = {
{ "IconAlign", "IconAlignment" }, // Button
{ "IterationsPerSecond", "PhysicsTicksPerSecond" }, // Engine
{ "InvertEnable", "InvertEnabled" }, // Polygon2D
- { "MarginBottom", "OffsetBottom" }, // Control broke NinePatchRect, StyleBox
- { "MarginLeft", "OffsetLeft" }, // Control broke NinePatchRect, StyleBox
- { "MarginRight", "OffsetRight" }, // Control broke NinePatchRect, StyleBox
- { "MarginTop", "OffsetTop" }, // Control broke NinePatchRect, StyleBox
+ { "MarginBottom", "OffsetBottom" }, // Control -- Breaks NinePatchRect, StyleBox.
+ { "MarginLeft", "OffsetLeft" }, // Control -- Breaks NinePatchRect, StyleBox.
+ { "MarginRight", "OffsetRight" }, // Control -- Breaks NinePatchRect, StyleBox.
+ { "MarginTop", "OffsetTop" }, // Control -- Breaks NinePatchRect, StyleBox.
{ "MidHeight", "Height" }, // CapsuleMesh
{ "NeighborDist", "NeighborDistance" }, // NavigationAgent2D, NavigationAgent3D
{ "OffsetH", "DragHorizontalOffset" }, // Camera2D
@@ -1272,7 +1277,7 @@ const char *RenamesMap3To4::csharp_properties_renames[][2] = {
{ "TabAlign", "TabAlignment" }, // TabContainer
{ "TableHseparation", "TableHSeparation" }, // Theme
{ "TableVseparation", "TableVSeparation" }, // Theme
- { "Translation", "Position" }, // Node3D - broke GLTFNode
+ { "Translation", "Position" }, // Node3D -- Breaks GLTFNode
{ "UnitDb", "VolumeDb" }, // AudioStreamPlayer3D
{ "UnitOffset", "ProgressRatio" }, // PathFollow2D, PathFollow3D
{ "Vseparation", "VSeparation" }, // Theme
@@ -1281,10 +1286,10 @@ const char *RenamesMap3To4::csharp_properties_renames[][2] = {
};
const char *RenamesMap3To4::gdscript_signals_renames[][2] = {
- // {"instantiate","instance"}, // FileSystemDock
- // { "hide", "hidden" }, // CanvasItem - function with same name exists
- // { "tween_all_completed","loop_finished"}, // Tween - TODO, not sure
- // {"changed","settings_changed"}, // EditorSettings
+ // { "instantiate", "instance" }, // FileSystemDock
+ // { "hide", "hidden" }, // CanvasItem -- Function with same name exists.
+ // { "tween_all_completed", "loop_finished" }, // Tween -- TODO, not sure.
+ // { "changed", "settings_changed" }, // EditorSettings
{ "about_to_show", "about_to_popup" }, // Popup
{ "button_release", "button_released" }, // XRController3D
{ "cancelled", "canceled" }, // AcceptDialog
@@ -1294,8 +1299,8 @@ const char *RenamesMap3To4::gdscript_signals_renames[][2] = {
{ "network_peer_packet", "peer_packet" }, // MultiplayerAPI
{ "node_unselected", "node_deselected" }, // GraphEdit
{ "offset_changed", "position_offset_changed" }, // GraphNode
- { "settings_changed", "changed" }, // TileMap broke EditorSettings
- { "skeleton_updated", "pose_updated" }, //
+ { "settings_changed", "changed" }, // TileMap -- Breaks EditorSettings
+ { "skeleton_updated", "pose_updated" }, // Skeleton3D
{ "tab_close", "tab_closed" }, // TextEdit
{ "tab_hover", "tab_hovered" }, // TextEdit
{ "text_entered", "text_submitted" }, // LineEdit
@@ -1306,10 +1311,10 @@ const char *RenamesMap3To4::gdscript_signals_renames[][2] = {
};
const char *RenamesMap3To4::csharp_signals_renames[][2] = {
- // {"Instantiate","Instance"}, // FileSystemDock
- // { "Hide", "Hidden" }, // CanvasItem - function with same name exists
- // { "TweenAllCompleted","LoopFinished"}, // Tween - TODO, not sure
- // {"Changed","SettingsChanged"}, // EditorSettings
+ // { "Instantiate", "Instance" }, // FileSystemDock
+ // { "Hide", "Hidden" }, // CanvasItem -- Function with same name exists.
+ // { "TweenAllCompleted", "LoopFinished" }, // Tween -- TODO, not sure.
+ // { "Changed", "SettingsChanged" }, // EditorSettings
{ "AboutToShow", "AboutToPopup" }, // Popup
{ "ButtonRelease", "ButtonReleased" }, // XRController3D
{ "NetworkPeerConnected", "PeerConnected" }, // MultiplayerAPI
@@ -1317,7 +1322,7 @@ const char *RenamesMap3To4::csharp_signals_renames[][2] = {
{ "NetworkPeerPacket", "PeerPacket" }, // MultiplayerAPI
{ "NodeUnselected", "NodeDeselected" }, // GraphEdit
{ "OffsetChanged", "PositionOffsetChanged" }, // GraphNode
- { "SettingsChanged", "Changed" }, // TileMap broke EditorSettings
+ { "SettingsChanged", "Changed" }, // TileMap -- Breaks EditorSettings
{ "SkeletonUpdated", "PoseUpdated" }, //
{ "TabClose", "TabClosed" }, // TextEdit
{ "TabHover", "TabHovered" }, // TextEdit
@@ -1347,7 +1352,7 @@ const char *RenamesMap3To4::project_settings_renames[][2] = {
{ "network/limits/debugger_stdout/max_messages_per_frame", "network/limits/debugger/max_queued_messages" },
{ "network/limits/debugger_stdout/max_warnings_per_second", "network/limits/debugger/max_warnings_per_second" },
{ "network/ssl/certificates", "network/tls/certificate_bundle_override" },
- { "physics/2d/thread_model", "physics/2d/run_on_thread" }, // TODO not sure
+ { "physics/2d/thread_model", "physics/2d/run_on_thread" }, // TODO: Not sure.
{ "rendering/environment/default_clear_color", "rendering/environment/defaults/default_clear_color" },
{ "rendering/environment/default_environment", "rendering/environment/defaults/default_environment" },
{ "rendering/quality/depth_prepass/disable_for_vendors", "rendering/driver/depth_prepass/disable_for_vendors" },
@@ -1419,15 +1424,15 @@ const char *RenamesMap3To4::shaders_renames[][2] = {
};
const char *RenamesMap3To4::class_renames[][2] = {
- // { "BulletPhysicsDirectBodyState", "BulletPhysicsDirectBodyState3D" }, // Class is not visible in ClassDB
- // { "BulletPhysicsServer", "BulletPhysicsServer3D" }, // Class is not visible in ClassDB
- // { "GDScriptFunctionState", "Node3D" }, // TODO - not sure to which should be changed
- // { "GDScriptNativeClass", "Node3D" }, // TODO - not sure to which should be changed
- // { "InputDefault",""}, // TODO ?
- // { "Physics2DDirectBodyStateSW", "GodotPhysicsDirectBodyState2D" }, // Class is not visible in ClassDB
- // { "Physics2DShapeQueryResult", "PhysicsShapeQueryResult2D" }, // Class is not visible in ClassDB
- // { "PhysicsShapeQueryResult", "PhysicsShapeQueryResult3D" }, // Class is not visible in ClassDB
- // { "NativeScript","GDExtension"}, ??
+ // { "BulletPhysicsDirectBodyState", "BulletPhysicsDirectBodyState3D" }, // Class is not visible in ClassDB.
+ // { "BulletPhysicsServer", "BulletPhysicsServer3D" }, // Class is not visible in ClassDB.
+ // { "GDScriptFunctionState", "Node3D" }, // TODO: Not sure to which this should be changed.
+ // { "GDScriptNativeClass", "Node3D" }, // TODO: Not sure to which this should be changed.
+ // { "InputDefault",""}, // TODO: ?
+ // { "Physics2DDirectBodyStateSW", "GodotPhysicsDirectBodyState2D" }, // Class is not visible in ClassDB.
+ // { "Physics2DShapeQueryResult", "PhysicsShapeQueryResult2D" }, // Class is not visible in ClassDB.
+ // { "PhysicsShapeQueryResult", "PhysicsShapeQueryResult3D" }, // Class is not visible in ClassDB.
+ // { "NativeScript","GDExtension"}, // ??
{ "ARVRAnchor", "XRAnchor3D" },
{ "ARVRCamera", "XRCamera3D" },
{ "ARVRController", "XRController3D" },
@@ -1438,8 +1443,8 @@ const char *RenamesMap3To4::class_renames[][2] = {
{ "ARVRServer", "XRServer" },
{ "AStar", "AStar3D" },
{ "AnimatedSprite", "AnimatedSprite2D" },
- { "AnimationTreePlayer", "AnimationTree" },
- { "Area", "Area3D" }, // Be careful, this will be used everywhere
+ { "AnimationTreePlayer", "AnimationTree" }, // Was deprecated since Godot 3.1.
+ { "Area", "Area3D" }, // Be careful, this will be used everywhere.
{ "AudioStreamOGGVorbis", "AudioStreamOggVorbis" },
{ "AudioStreamRandomPitch", "AudioStreamRandomizer" },
{ "AudioStreamSample", "AudioStreamWAV" },
@@ -1458,7 +1463,7 @@ const char *RenamesMap3To4::class_renames[][2] = {
{ "CSGShape", "CSGShape3D" },
{ "CSGSphere", "CSGSphere3D" },
{ "CSGTorus", "CSGTorus3D" },
- { "Camera", "Camera3D" }, // Be careful, this will be used everywhere
+ { "Camera", "Camera3D" }, // Be careful, this will be used everywhere.
{ "CapsuleShape", "CapsuleShape3D" },
{ "ClippedCamera", "Camera3D" },
{ "CollisionObject", "CollisionObject3D" },
@@ -1484,7 +1489,7 @@ const char *RenamesMap3To4::class_renames[][2] = {
{ "GIProbe", "VoxelGI" },
{ "GIProbeData", "VoxelGIData" },
{ "Generic6DOFJoint", "Generic6DOFJoint3D" },
- { "Geometry", "Geometry2D" }, // Geometry class is split between Geometry2D and Geometry3D so we need to choose one
+ { "Geometry", "Geometry2D" }, // Geometry class is split between Geometry2D and Geometry3D, so we need to choose one.
{ "GeometryInstance", "GeometryInstance3D" },
{ "GradientTexture", "GradientTexture2D" },
{ "HeightMapShape", "HeightMapShape3D" },
@@ -1509,9 +1514,9 @@ const char *RenamesMap3To4::class_renames[][2] = {
{ "MultiMeshInstance", "MultiMeshInstance3D" },
{ "MultiplayerPeerGDNative", "MultiplayerPeerExtension" },
{ "Navigation", "Node3D" },
- { "Navigation2D", "Node2D" },
+ { "Navigation2D", "Node2D" }, // Replaced by other 2D Navigation nodes.
{ "Navigation2DServer", "NavigationServer2D" },
- { "Navigation3D", "Node3D" },
+ { "Navigation3D", "Node3D" }, // Replaced by other 3D Navigation nodes.
{ "NavigationAgent", "NavigationAgent3D" },
{ "NavigationMeshInstance", "NavigationRegion3D" },
{ "NavigationObstacle", "NavigationObstacle3D" },
@@ -1525,10 +1530,10 @@ const char *RenamesMap3To4::class_renames[][2] = {
{ "PHashTranslation", "OptimizedTranslation" },
{ "PacketPeerGDNative", "PacketPeerExtension" },
{ "PanoramaSky", "Sky" },
- { "Particles", "GPUParticles3D" }, // Be careful, this will be used everywhere
+ { "Particles", "GPUParticles3D" }, // Be careful, this will be used everywhere.
{ "Particles2D", "GPUParticles2D" },
{ "ParticlesMaterial", "ParticleProcessMaterial" },
- { "Path", "Path3D" }, // Be careful, this will be used everywhere
+ { "Path", "Path3D" }, // Be careful, this will be used everywhere.
{ "PathFollow", "PathFollow3D" },
{ "PhysicalBone", "PhysicalBone3D" },
{ "Physics2DDirectBodyState", "PhysicsDirectBodyState2D" },
@@ -1552,12 +1557,12 @@ const char *RenamesMap3To4::class_renames[][2] = {
{ "RayCast", "RayCast3D" },
{ "RayShape", "SeparationRayShape3D" },
{ "RayShape2D", "SeparationRayShape2D" },
- { "Reference", "RefCounted" }, // Be careful, this will be used everywhere
+ { "Reference", "RefCounted" }, // Be careful, this will be used everywhere.
{ "RemoteTransform", "RemoteTransform3D" },
{ "ResourceInteractiveLoader", "ResourceLoader" },
{ "RigidBody", "RigidBody3D" },
{ "SceneTreeTween", "Tween" },
- { "Shape", "Shape3D" }, // Be careful, this will be used everywhere
+ { "Shape", "Shape3D" }, // Be careful, this will be used everywhere.
{ "ShortCut", "Shortcut" },
{ "Skeleton", "Skeleton3D" },
{ "SkeletonIK", "SkeletonIK3D" },
@@ -1580,9 +1585,9 @@ const char *RenamesMap3To4::class_renames[][2] = {
{ "StreamTexture2DArray", "CompressedTexture2DArray" },
{ "StreamTextureLayered", "CompressedTextureLayered" },
{ "TCP_Server", "TCPServer" },
- { "Tabs", "TabBar" }, // Be careful, this will be used everywhere
+ { "Tabs", "TabBar" }, // Be careful, this will be used everywhere.
{ "TextFile", "Node3D" },
- { "Texture", "Texture2D" }, // May broke TextureRect
+ { "Texture", "Texture2D" }, // May break TextureRect.
{ "TextureArray", "Texture2DArray" },
{ "TextureProgress", "TextureProgressBar" },
{ "ToolButton", "Button" },
@@ -1628,17 +1633,18 @@ const char *RenamesMap3To4::class_renames[][2] = {
{ "WebRTCMultiplayer", "WebRTCMultiplayerPeer" },
{ "WebRTCPeerConnectionGDNative", "WebRTCPeerConnectionExtension" },
{ "WindowDialog", "Window" },
- { "World", "World3D" }, // Be careful, this will be used everywhere
+ { "World", "World3D" }, // Be careful, this will be used everywhere.
{ "XRAnchor", "XRAnchor3D" },
{ "XRController", "XRController3D" },
{ "XROrigin", "XROrigin3D" },
- { "YSort", "Node2D" },
+ { "YSort", "Node2D" }, // CanvasItem has a new "y_sort_enabled" property.
- { "CullInstance", "Node3D" }, // Probably this type needs to be added to Godot 4.0, since it is for now only available only in Godot 3.x
- { "RoomGroup", "Node3D" }, // Probably this type needs to be added to Godot 4.0, since it is for now only available only in Godot 3.x
- { "Room", "Node3D" }, // Probably this type needs to be added to Godot 4.0, since it is for now only available only in Godot 3.x
- { "RoomManager", "Node3D" }, // Probably this type needs to be added to Godot 4.0, since it is for now only available only in Godot 3.x
- { "Portal", "Node3D" }, // Probably this type needs to be added to Godot 4.0, since it is for now only available only in Godot 3.x
+ // Portal and room occlusion culling was replaced by raster occlusion culling.
+ { "CullInstance", "Node3D" },
+ { "RoomGroup", "Node3D" },
+ { "Room", "Node3D" },
+ { "RoomManager", "Node3D" },
+ { "Portal", "Node3D" },
{ nullptr, nullptr },
};
diff --git a/main/main.cpp b/main/main.cpp
index 81f2c101a1..5bb37df3ca 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -1813,7 +1813,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
window_orientation = DisplayServer::ScreenOrientation(int(GLOBAL_DEF_BASIC("display/window/handheld/orientation", DisplayServer::ScreenOrientation::SCREEN_LANDSCAPE)));
}
{
- window_vsync_mode = DisplayServer::VSyncMode(int(GLOBAL_DEF("display/window/vsync/vsync_mode", DisplayServer::VSyncMode::VSYNC_ENABLED)));
+ window_vsync_mode = DisplayServer::VSyncMode(int(GLOBAL_DEF_BASIC("display/window/vsync/vsync_mode", DisplayServer::VSyncMode::VSYNC_ENABLED)));
if (disable_vsync) {
window_vsync_mode = DisplayServer::VSyncMode::VSYNC_DISABLED;
}
@@ -1843,7 +1843,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
GLOBAL_DEF("display/window/ios/hide_home_indicator", true);
GLOBAL_DEF("display/window/ios/hide_status_bar", true);
GLOBAL_DEF("display/window/ios/suppress_ui_gesture", true);
- GLOBAL_DEF(PropertyInfo(Variant::FLOAT, "input_devices/pointing/ios/touch_delay", PROPERTY_HINT_RANGE, "0,1,0.001"), 0.15);
// XR project settings.
GLOBAL_DEF_RST_BASIC("xr/openxr/enabled", false);
@@ -2195,7 +2194,7 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
RenderingServer::get_singleton()->set_default_clear_color(
GLOBAL_GET("rendering/environment/defaults/default_clear_color"));
- GLOBAL_DEF(PropertyInfo(Variant::STRING, "application/config/icon", PROPERTY_HINT_FILE, "*.png,*.webp,*.svg"), String());
+ GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "application/config/icon", PROPERTY_HINT_FILE, "*.png,*.webp,*.svg"), String());
GLOBAL_DEF(PropertyInfo(Variant::STRING, "application/config/macos_native_icon", PROPERTY_HINT_FILE, "*.icns"), String());
GLOBAL_DEF(PropertyInfo(Variant::STRING, "application/config/windows_native_icon", PROPERTY_HINT_FILE, "*.ico"), String());
diff --git a/methods.py b/methods.py
index 7ede2592ff..dddac9bd86 100644
--- a/methods.py
+++ b/methods.py
@@ -732,7 +732,7 @@ def add_to_vs_project(env, sources):
env.vs_srcs += [basename + ".cpp"]
-def generate_vs_project(env, num_jobs):
+def generate_vs_project(env, num_jobs, project_name="godot"):
batch_file = find_visual_c_batch_file(env)
if batch_file:
@@ -873,7 +873,7 @@ def generate_vs_project(env, num_jobs):
env["MSVS"]["PROJECTSUFFIX"] = ".vcxproj"
env["MSVS"]["SOLUTIONSUFFIX"] = ".sln"
env.MSVSProject(
- target=["#godot" + env["MSVSPROJECTSUFFIX"]],
+ target=["#" + project_name + env["MSVSPROJECTSUFFIX"]],
incs=env.vs_incs,
srcs=env.vs_srcs,
auto_build_solution=1,
diff --git a/misc/dist/ios_xcode/godot_ios/vulkan/icd.d/MoltenVK_icd.json b/misc/dist/ios_xcode/godot_ios/vulkan/icd.d/MoltenVK_icd.json
deleted file mode 100644
index 7501cb548c..0000000000
--- a/misc/dist/ios_xcode/godot_ios/vulkan/icd.d/MoltenVK_icd.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "file_format_version" : "1.0.0",
- "ICD": {
- "library_path": "./../../Frameworks/MoltenVK.framework/MoltenVK",
- "api_version" : "1.0.0"
- }
-}
diff --git a/modules/basis_universal/SCsub b/modules/basis_universal/SCsub
index 161b0f3814..14669847bc 100644
--- a/modules/basis_universal/SCsub
+++ b/modules/basis_universal/SCsub
@@ -40,6 +40,9 @@ if not env.msvc:
else:
env_basisu.Prepend(CPPPATH=[thirdparty_dir])
+if env["builtin_zstd"]:
+ env_basisu.Prepend(CPPPATH=["#thirdparty/zstd"])
+
if env.dev_build:
env_basisu.Append(CPPDEFINES=[("BASISU_DEVEL_MESSAGES", 1), ("BASISD_ENABLE_DEBUG_FLAGS", 1)])
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp
index fe79f37454..00f8d2817a 100644
--- a/modules/gdscript/gdscript.cpp
+++ b/modules/gdscript/gdscript.cpp
@@ -2563,7 +2563,7 @@ GDScriptLanguage::GDScriptLanguage() {
script_frame_time = 0;
_debug_call_stack_pos = 0;
- int dmcs = GLOBAL_DEF(PropertyInfo(Variant::INT, "debug/settings/gdscript/max_call_stack", PROPERTY_HINT_RANGE, "1024,4096,1,or_greater"), 1024);
+ int dmcs = GLOBAL_DEF(PropertyInfo(Variant::INT, "debug/settings/gdscript/max_call_stack", PROPERTY_HINT_RANGE, "512," + itos(GDScriptFunction::MAX_CALL_DEPTH - 1) + ",1"), 1024);
if (EngineDebugger::is_active()) {
//debugging enabled!
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp
index 8d09249125..c8dfdbdd68 100644
--- a/modules/gdscript/gdscript_analyzer.cpp
+++ b/modules/gdscript/gdscript_analyzer.cpp
@@ -1742,6 +1742,7 @@ void GDScriptAnalyzer::resolve_assignable(GDScriptParser::AssignableNode *p_assi
}
type.is_constant = is_constant;
+ type.is_read_only = false;
p_assignable->set_datatype(type);
}
@@ -4251,18 +4252,22 @@ Variant GDScriptAnalyzer::make_subscript_reduced_value(GDScriptParser::Subscript
Array GDScriptAnalyzer::make_array_from_element_datatype(const GDScriptParser::DataType &p_element_datatype, const GDScriptParser::Node *p_source_node) {
Array array;
- Ref<Script> script_type = p_element_datatype.script_type;
- if (p_element_datatype.kind == GDScriptParser::DataType::CLASS && script_type.is_null()) {
- Error err = OK;
- Ref<GDScript> scr = GDScriptCache::get_shallow_script(p_element_datatype.script_path, err);
- if (err) {
- push_error(vformat(R"(Error while getting cache for script "%s".)", p_element_datatype.script_path), p_source_node);
- return array;
+ if (p_element_datatype.builtin_type == Variant::OBJECT) {
+ Ref<Script> script_type = p_element_datatype.script_type;
+ if (p_element_datatype.kind == GDScriptParser::DataType::CLASS && script_type.is_null()) {
+ Error err = OK;
+ Ref<GDScript> scr = GDScriptCache::get_shallow_script(p_element_datatype.script_path, err);
+ if (err) {
+ push_error(vformat(R"(Error while getting cache for script "%s".)", p_element_datatype.script_path), p_source_node);
+ return array;
+ }
+ script_type.reference_ptr(scr->find_class(p_element_datatype.class_type->fqcn));
}
- script_type.reference_ptr(scr->find_class(p_element_datatype.class_type->fqcn));
- }
- array.set_typed(p_element_datatype.builtin_type, p_element_datatype.native_type, script_type);
+ array.set_typed(p_element_datatype.builtin_type, p_element_datatype.native_type, script_type);
+ } else {
+ array.set_typed(p_element_datatype.builtin_type, StringName(), Variant());
+ }
return array;
}
diff --git a/modules/gdscript/gdscript_byte_codegen.cpp b/modules/gdscript/gdscript_byte_codegen.cpp
index ec7a2b0f1c..45008b0e87 100644
--- a/modules/gdscript/gdscript_byte_codegen.cpp
+++ b/modules/gdscript/gdscript_byte_codegen.cpp
@@ -143,6 +143,11 @@ void GDScriptByteCodeGenerator::pop_temporary() {
ERR_FAIL_COND(used_temporaries.is_empty());
int slot_idx = used_temporaries.back()->get();
const StackSlot &slot = temporaries[slot_idx];
+ if (slot.type == Variant::OBJECT) {
+ // Avoid keeping in the stack long-lived references to objects,
+ // which may prevent RefCounted objects from being freed.
+ write_assign_false(Address(Address::TEMPORARY, slot_idx));
+ }
temporaries_pool[slot.type].push_back(slot_idx);
used_temporaries.pop_back();
}
@@ -954,7 +959,7 @@ void GDScriptByteCodeGenerator::write_cast(const Address &p_target, const Addres
append(index);
}
-GDScriptCodeGenerator::Address GDScriptByteCodeGenerator::get_call_target(const GDScriptCodeGenerator::Address &p_target, Variant::Type p_type) {
+GDScriptByteCodeGenerator::CallTarget GDScriptByteCodeGenerator::get_call_target(const GDScriptCodeGenerator::Address &p_target, Variant::Type p_type) {
if (p_target.mode == Address::NIL) {
GDScriptDataType type;
if (p_type != Variant::NIL) {
@@ -963,10 +968,9 @@ GDScriptCodeGenerator::Address GDScriptByteCodeGenerator::get_call_target(const
type.builtin_type = p_type;
}
uint32_t addr = add_temporary(type);
- pop_temporary();
- return Address(Address::TEMPORARY, addr, type);
+ return CallTarget(Address(Address::TEMPORARY, addr, type), true, this);
} else {
- return p_target;
+ return CallTarget(p_target, false, this);
}
}
@@ -976,9 +980,11 @@ void GDScriptByteCodeGenerator::write_call(const Address &p_target, const Addres
append(p_arguments[i]);
}
append(p_base);
- append(get_call_target(p_target));
+ CallTarget ct = get_call_target(p_target);
+ append(ct.target);
append(p_arguments.size());
append(p_function_name);
+ ct.cleanup();
}
void GDScriptByteCodeGenerator::write_super_call(const Address &p_target, const StringName &p_function_name, const Vector<Address> &p_arguments) {
@@ -986,9 +992,11 @@ void GDScriptByteCodeGenerator::write_super_call(const Address &p_target, const
for (int i = 0; i < p_arguments.size(); i++) {
append(p_arguments[i]);
}
- append(get_call_target(p_target));
+ CallTarget ct = get_call_target(p_target);
+ append(ct.target);
append(p_arguments.size());
append(p_function_name);
+ ct.cleanup();
}
void GDScriptByteCodeGenerator::write_call_async(const Address &p_target, const Address &p_base, const StringName &p_function_name, const Vector<Address> &p_arguments) {
@@ -997,9 +1005,11 @@ void GDScriptByteCodeGenerator::write_call_async(const Address &p_target, const
append(p_arguments[i]);
}
append(p_base);
- append(get_call_target(p_target));
+ CallTarget ct = get_call_target(p_target);
+ append(ct.target);
append(p_arguments.size());
append(p_function_name);
+ ct.cleanup();
}
void GDScriptByteCodeGenerator::write_call_gdscript_utility(const Address &p_target, const StringName &p_function, const Vector<Address> &p_arguments) {
@@ -1008,9 +1018,11 @@ void GDScriptByteCodeGenerator::write_call_gdscript_utility(const Address &p_tar
for (int i = 0; i < p_arguments.size(); i++) {
append(p_arguments[i]);
}
- append(get_call_target(p_target));
+ CallTarget ct = get_call_target(p_target);
+ append(ct.target);
append(p_arguments.size());
append(gds_function);
+ ct.cleanup();
#ifdef DEBUG_ENABLED
add_debug_name(gds_utilities_names, get_gds_utility_pos(gds_function), p_function);
#endif
@@ -1034,18 +1046,19 @@ void GDScriptByteCodeGenerator::write_call_utility(const Address &p_target, cons
if (is_validated) {
Variant::Type result_type = Variant::has_utility_function_return_value(p_function) ? Variant::get_utility_function_return_type(p_function) : Variant::NIL;
- Address target = get_call_target(p_target, result_type);
- Variant::Type temp_type = temporaries[target.address].type;
+ CallTarget ct = get_call_target(p_target, result_type);
+ Variant::Type temp_type = temporaries[ct.target.address].type;
if (result_type != temp_type) {
- write_type_adjust(target, result_type);
+ write_type_adjust(ct.target, result_type);
}
append_opcode_and_argcount(GDScriptFunction::OPCODE_CALL_UTILITY_VALIDATED, 1 + p_arguments.size());
for (int i = 0; i < p_arguments.size(); i++) {
append(p_arguments[i]);
}
- append(target);
+ append(ct.target);
append(p_arguments.size());
append(Variant::get_validated_utility_function(p_function));
+ ct.cleanup();
#ifdef DEBUG_ENABLED
add_debug_name(utilities_names, get_utility_pos(Variant::get_validated_utility_function(p_function)), p_function);
#endif
@@ -1054,9 +1067,11 @@ void GDScriptByteCodeGenerator::write_call_utility(const Address &p_target, cons
for (int i = 0; i < p_arguments.size(); i++) {
append(p_arguments[i]);
}
- append(get_call_target(p_target));
+ CallTarget ct = get_call_target(p_target);
+ append(ct.target);
append(p_arguments.size());
append(p_function);
+ ct.cleanup();
}
}
@@ -1085,10 +1100,12 @@ void GDScriptByteCodeGenerator::write_call_builtin_type(const Address &p_target,
for (int i = 0; i < p_arguments.size(); i++) {
append(p_arguments[i]);
}
- append(get_call_target(p_target));
+ CallTarget ct = get_call_target(p_target);
+ append(ct.target);
append(p_type);
append(p_method);
append(p_arguments.size());
+ ct.cleanup();
} else {
write_call(p_target, p_base, p_method, p_arguments);
}
@@ -1096,10 +1113,10 @@ void GDScriptByteCodeGenerator::write_call_builtin_type(const Address &p_target,
}
Variant::Type result_type = Variant::get_builtin_method_return_type(p_type, p_method);
- Address target = get_call_target(p_target, result_type);
- Variant::Type temp_type = temporaries[target.address].type;
+ CallTarget ct = get_call_target(p_target, result_type);
+ Variant::Type temp_type = temporaries[ct.target.address].type;
if (result_type != temp_type) {
- write_type_adjust(target, result_type);
+ write_type_adjust(ct.target, result_type);
}
append_opcode_and_argcount(GDScriptFunction::OPCODE_CALL_BUILTIN_TYPE_VALIDATED, 2 + p_arguments.size());
@@ -1108,9 +1125,11 @@ void GDScriptByteCodeGenerator::write_call_builtin_type(const Address &p_target,
append(p_arguments[i]);
}
append(p_base);
- append(target);
+ append(ct.target);
append(p_arguments.size());
append(Variant::get_validated_builtin_method(p_type, p_method));
+ ct.cleanup();
+
#ifdef DEBUG_ENABLED
add_debug_name(builtin_methods_names, get_builtin_method_pos(Variant::get_validated_builtin_method(p_type, p_method)), p_method);
#endif
@@ -1135,9 +1154,11 @@ void GDScriptByteCodeGenerator::write_call_native_static(const Address &p_target
for (int i = 0; i < p_arguments.size(); i++) {
append(p_arguments[i]);
}
- append(get_call_target(p_target));
+ CallTarget ct = get_call_target(p_target);
+ append(ct.target);
append(method);
append(p_arguments.size());
+ ct.cleanup();
return;
}
}
@@ -1147,10 +1168,12 @@ void GDScriptByteCodeGenerator::write_call_method_bind(const Address &p_target,
for (int i = 0; i < p_arguments.size(); i++) {
append(p_arguments[i]);
}
+ CallTarget ct = get_call_target(p_target);
append(p_base);
- append(get_call_target(p_target));
+ append(ct.target);
append(p_arguments.size());
append(p_method);
+ ct.cleanup();
}
void GDScriptByteCodeGenerator::write_call_ptrcall(const Address &p_target, const Address &p_base, MethodBind *p_method, const Vector<Address> &p_arguments) {
@@ -1212,9 +1235,11 @@ void GDScriptByteCodeGenerator::write_call_ptrcall(const Address &p_target, cons
append(p_arguments[i]);
}
append(p_base);
- append(get_call_target(p_target));
+ CallTarget ct = get_call_target(p_target);
+ append(ct.target);
append(p_arguments.size());
append(p_method);
+ ct.cleanup();
if (is_ptrcall) {
alloc_ptrcall(p_arguments.size());
}
@@ -1228,9 +1253,11 @@ void GDScriptByteCodeGenerator::write_call_self(const Address &p_target, const S
append(p_arguments[i]);
}
append(GDScriptFunction::ADDR_TYPE_STACK << GDScriptFunction::ADDR_BITS);
- append(get_call_target(p_target));
+ CallTarget ct = get_call_target(p_target);
+ append(ct.target);
append(p_arguments.size());
append(p_function_name);
+ ct.cleanup();
}
void GDScriptByteCodeGenerator::write_call_self_async(const Address &p_target, const StringName &p_function_name, const Vector<Address> &p_arguments) {
@@ -1239,9 +1266,11 @@ void GDScriptByteCodeGenerator::write_call_self_async(const Address &p_target, c
append(p_arguments[i]);
}
append(GDScriptFunction::ADDR_SELF);
- append(get_call_target(p_target));
+ CallTarget ct = get_call_target(p_target);
+ append(ct.target);
append(p_arguments.size());
append(p_function_name);
+ ct.cleanup();
}
void GDScriptByteCodeGenerator::write_call_script_function(const Address &p_target, const Address &p_base, const StringName &p_function_name, const Vector<Address> &p_arguments) {
@@ -1250,9 +1279,11 @@ void GDScriptByteCodeGenerator::write_call_script_function(const Address &p_targ
append(p_arguments[i]);
}
append(p_base);
- append(get_call_target(p_target));
+ CallTarget ct = get_call_target(p_target);
+ append(ct.target);
append(p_arguments.size());
append(p_function_name);
+ ct.cleanup();
}
void GDScriptByteCodeGenerator::write_lambda(const Address &p_target, GDScriptFunction *p_function, const Vector<Address> &p_captures, bool p_use_self) {
@@ -1261,9 +1292,11 @@ void GDScriptByteCodeGenerator::write_lambda(const Address &p_target, GDScriptFu
append(p_captures[i]);
}
- append(get_call_target(p_target));
+ CallTarget ct = get_call_target(p_target);
+ append(ct.target);
append(p_captures.size());
append(p_function);
+ ct.cleanup();
}
void GDScriptByteCodeGenerator::write_construct(const Address &p_target, Variant::Type p_type, const Vector<Address> &p_arguments) {
@@ -1300,9 +1333,11 @@ void GDScriptByteCodeGenerator::write_construct(const Address &p_target, Variant
for (int i = 0; i < p_arguments.size(); i++) {
append(p_arguments[i]);
}
- append(get_call_target(p_target));
+ CallTarget ct = get_call_target(p_target);
+ append(ct.target);
append(p_arguments.size());
append(Variant::get_validated_constructor(p_type, valid_constructor));
+ ct.cleanup();
#ifdef DEBUG_ENABLED
add_debug_name(constructors_names, get_constructor_pos(Variant::get_validated_constructor(p_type, valid_constructor)), Variant::get_type_name(p_type));
#endif
@@ -1314,9 +1349,11 @@ void GDScriptByteCodeGenerator::write_construct(const Address &p_target, Variant
for (int i = 0; i < p_arguments.size(); i++) {
append(p_arguments[i]);
}
- append(get_call_target(p_target));
+ CallTarget ct = get_call_target(p_target);
+ append(ct.target);
append(p_arguments.size());
append(p_type);
+ ct.cleanup();
}
void GDScriptByteCodeGenerator::write_construct_array(const Address &p_target, const Vector<Address> &p_arguments) {
@@ -1324,8 +1361,10 @@ void GDScriptByteCodeGenerator::write_construct_array(const Address &p_target, c
for (int i = 0; i < p_arguments.size(); i++) {
append(p_arguments[i]);
}
- append(get_call_target(p_target));
+ CallTarget ct = get_call_target(p_target);
+ append(ct.target);
append(p_arguments.size());
+ ct.cleanup();
}
void GDScriptByteCodeGenerator::write_construct_typed_array(const Address &p_target, const GDScriptDataType &p_element_type, const Vector<Address> &p_arguments) {
@@ -1333,11 +1372,13 @@ void GDScriptByteCodeGenerator::write_construct_typed_array(const Address &p_tar
for (int i = 0; i < p_arguments.size(); i++) {
append(p_arguments[i]);
}
- append(get_call_target(p_target));
+ CallTarget ct = get_call_target(p_target);
+ append(ct.target);
append(get_constant_pos(p_element_type.script_type) | (GDScriptFunction::ADDR_TYPE_CONSTANT << GDScriptFunction::ADDR_BITS));
append(p_arguments.size());
append(p_element_type.builtin_type);
append(p_element_type.native_type);
+ ct.cleanup();
}
void GDScriptByteCodeGenerator::write_construct_dictionary(const Address &p_target, const Vector<Address> &p_arguments) {
@@ -1345,8 +1386,10 @@ void GDScriptByteCodeGenerator::write_construct_dictionary(const Address &p_targ
for (int i = 0; i < p_arguments.size(); i++) {
append(p_arguments[i]);
}
- append(get_call_target(p_target));
+ CallTarget ct = get_call_target(p_target);
+ append(ct.target);
append(p_arguments.size() / 2); // This is number of key-value pairs, so only half of actual arguments.
+ ct.cleanup();
}
void GDScriptByteCodeGenerator::write_await(const Address &p_target, const Address &p_operand) {
diff --git a/modules/gdscript/gdscript_byte_codegen.h b/modules/gdscript/gdscript_byte_codegen.h
index 8aa02b86c4..1d1b22e196 100644
--- a/modules/gdscript/gdscript_byte_codegen.h
+++ b/modules/gdscript/gdscript_byte_codegen.h
@@ -48,6 +48,33 @@ class GDScriptByteCodeGenerator : public GDScriptCodeGenerator {
const static int RESERVED_STACK = 3; // For self, class, and nil.
+ struct CallTarget {
+ Address target;
+ bool is_new_temporary = false;
+ GDScriptByteCodeGenerator *codegen = nullptr;
+#ifdef DEV_ENABLED
+ bool cleaned = false;
+#endif
+
+ void cleanup() {
+ DEV_ASSERT(!cleaned);
+ if (is_new_temporary) {
+ codegen->pop_temporary();
+ }
+#ifdef DEV_ENABLED
+ cleaned = true;
+#endif
+ }
+
+ CallTarget(Address p_target, bool p_is_new_temporary, GDScriptByteCodeGenerator *p_codegen) :
+ target(p_target),
+ is_new_temporary(p_is_new_temporary),
+ codegen(p_codegen) {}
+ ~CallTarget() { DEV_ASSERT(cleaned); }
+ CallTarget(const CallTarget &) = delete;
+ CallTarget &operator=(CallTarget &) = delete;
+ };
+
bool ended = false;
GDScriptFunction *function = nullptr;
bool debug_stack = false;
@@ -326,7 +353,7 @@ class GDScriptByteCodeGenerator : public GDScriptCodeGenerator {
}
}
- Address get_call_target(const Address &p_target, Variant::Type p_type = Variant::NIL);
+ CallTarget get_call_target(const Address &p_target, Variant::Type p_type = Variant::NIL);
int address_of(const Address &p_address) {
switch (p_address.mode) {
diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp
index 46cd4b0d55..b34be11169 100644
--- a/modules/gdscript/gdscript_compiler.cpp
+++ b/modules/gdscript/gdscript_compiler.cpp
@@ -254,7 +254,7 @@ GDScriptCodeGenerator::Address GDScriptCompiler::_parse_expression(CodeGen &code
if (codegen.script->member_indices.has(identifier)) {
if (codegen.script->member_indices[identifier].getter != StringName() && codegen.script->member_indices[identifier].getter != codegen.function_name) {
// Perform getter.
- GDScriptCodeGenerator::Address temp = codegen.add_temporary();
+ GDScriptCodeGenerator::Address temp = codegen.add_temporary(codegen.script->member_indices[identifier].data_type);
Vector<GDScriptCodeGenerator::Address> args; // No argument needed.
gen->write_call_self(temp, codegen.script->member_indices[identifier].getter, args);
return temp;
diff --git a/modules/gdscript/gdscript_function.h b/modules/gdscript/gdscript_function.h
index f45c1f9577..2624fb8dd9 100644
--- a/modules/gdscript/gdscript_function.h
+++ b/modules/gdscript/gdscript_function.h
@@ -544,6 +544,8 @@ private:
#endif
public:
+ static constexpr int MAX_CALL_DEPTH = 2048; // Limit to try to avoid crash because of a stack overflow.
+
struct CallState {
GDScript *script = nullptr;
GDScriptInstance *instance = nullptr;
diff --git a/modules/gdscript/gdscript_vm.cpp b/modules/gdscript/gdscript_vm.cpp
index 7a11ea52f0..9f7d27d841 100644
--- a/modules/gdscript/gdscript_vm.cpp
+++ b/modules/gdscript/gdscript_vm.cpp
@@ -459,6 +459,33 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
r_err.error = Callable::CallError::CALL_OK;
+ static thread_local int call_depth = 0;
+ if (unlikely(++call_depth > MAX_CALL_DEPTH)) {
+ call_depth--;
+#ifdef DEBUG_ENABLED
+ String err_file;
+ if (p_instance && ObjectDB::get_instance(p_instance->owner_id) != nullptr && p_instance->script->is_valid() && !p_instance->script->path.is_empty()) {
+ err_file = p_instance->script->path;
+ } else if (_script) {
+ err_file = _script->path;
+ }
+ if (err_file.is_empty()) {
+ err_file = "<built-in>";
+ }
+ String err_func = name;
+ if (p_instance && ObjectDB::get_instance(p_instance->owner_id) != nullptr && p_instance->script->is_valid() && !p_instance->script->name.is_empty()) {
+ err_func = p_instance->script->name + "." + err_func;
+ }
+ int err_line = _initial_line;
+ const char *err_text = "Stack overflow. Check for infinite recursion in your script.";
+ if (!GDScriptLanguage::get_singleton()->debug_break(err_text, false)) {
+ // Debugger break did not happen.
+ _err_print_error(err_func.utf8().get_data(), err_file.utf8().get_data(), err_line, err_text, false, ERR_HANDLER_SCRIPT);
+ }
+#endif
+ return _get_default_variant_for_data_type(return_type);
+ }
+
Variant retvalue;
Variant *stack = nullptr;
Variant **instruction_args = nullptr;
@@ -493,10 +520,12 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
r_err.error = Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS;
r_err.argument = _argument_count;
+ call_depth--;
return _get_default_variant_for_data_type(return_type);
} else if (p_argcount < _argument_count - _default_arg_count) {
r_err.error = Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS;
r_err.argument = _argument_count - _default_arg_count;
+ call_depth--;
return _get_default_variant_for_data_type(return_type);
} else {
defarg = _argument_count - p_argcount;
@@ -524,6 +553,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
r_err.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_err.argument = i;
r_err.expected = argument_types[i].builtin_type;
+ call_depth--;
return _get_default_variant_for_data_type(return_type);
}
if (argument_types[i].kind == GDScriptDataType::BUILTIN) {
@@ -1244,12 +1274,20 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
"' to a variable of type '" + nc->get_name() + "'.";
OPCODE_BREAK;
}
- Object *src_obj = src->operator Object *();
- if (src_obj && !ClassDB::is_parent_class(src_obj->get_class_name(), nc->get_name())) {
- err_text = "Trying to assign value of type '" + src_obj->get_class_name() +
- "' to a variable of type '" + nc->get_name() + "'.";
- OPCODE_BREAK;
+ if (src->get_type() == Variant::OBJECT) {
+ bool was_freed = false;
+ Object *src_obj = src->get_validated_object_with_check(was_freed);
+ if (!src_obj && was_freed) {
+ err_text = "Trying to assign invalid previously freed instance.";
+ OPCODE_BREAK;
+ }
+
+ if (src_obj && !ClassDB::is_parent_class(src_obj->get_class_name(), nc->get_name())) {
+ err_text = "Trying to assign value of type '" + src_obj->get_class_name() +
+ "' to a variable of type '" + nc->get_name() + "'.";
+ OPCODE_BREAK;
+ }
}
#endif // DEBUG_ENABLED
*dst = *src;
@@ -1274,15 +1312,22 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
OPCODE_BREAK;
}
- if (src->get_type() != Variant::NIL && src->operator Object *() != nullptr) {
- ScriptInstance *scr_inst = src->operator Object *()->get_script_instance();
+ if (src->get_type() == Variant::OBJECT) {
+ bool was_freed = false;
+ Object *val_obj = src->get_validated_object_with_check(was_freed);
+ if (!val_obj && was_freed) {
+ err_text = "Trying to assign invalid previously freed instance.";
+ OPCODE_BREAK;
+ }
+
+ ScriptInstance *scr_inst = val_obj->get_script_instance();
if (!scr_inst) {
- err_text = "Trying to assign value of type '" + src->operator Object *()->get_class_name() +
+ err_text = "Trying to assign value of type '" + val_obj->get_class_name() +
"' to a variable of type '" + base_type->get_path().get_file() + "'.";
OPCODE_BREAK;
}
- Script *src_type = src->operator Object *()->get_script_instance()->get_script().ptr();
+ Script *src_type = val_obj->get_script_instance()->get_script().ptr();
bool valid = false;
while (src_type) {
@@ -1294,7 +1339,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
}
if (!valid) {
- err_text = "Trying to assign value of type '" + src->operator Object *()->get_script_instance()->get_script()->get_path().get_file() +
+ err_text = "Trying to assign value of type '" + val_obj->get_script_instance()->get_script()->get_path().get_file() +
"' to a variable of type '" + base_type->get_path().get_file() + "'.";
OPCODE_BREAK;
}
@@ -3582,5 +3627,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
stack[i].~Variant();
}
+ call_depth--;
+
return retvalue;
}
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/native_freed_instance.gd b/modules/gdscript/tests/scripts/analyzer/errors/native_freed_instance.gd
new file mode 100644
index 0000000000..dd2708b21d
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/errors/native_freed_instance.gd
@@ -0,0 +1,7 @@
+func test():
+ var x = Node.new()
+
+ x.free()
+
+ var ok = x
+ var bad : Node = x
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/native_freed_instance.out b/modules/gdscript/tests/scripts/analyzer/errors/native_freed_instance.out
new file mode 100644
index 0000000000..679e51ed81
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/errors/native_freed_instance.out
@@ -0,0 +1,6 @@
+GDTEST_RUNTIME_ERROR
+>> SCRIPT ERROR
+>> on function: test()
+>> analyzer/errors/native_freed_instance.gd
+>> 7
+>> Trying to assign invalid previously freed instance.
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/script_freed_instance.gd b/modules/gdscript/tests/scripts/analyzer/errors/script_freed_instance.gd
new file mode 100644
index 0000000000..758fbaccc9
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/errors/script_freed_instance.gd
@@ -0,0 +1,10 @@
+class A extends Node:
+ pass
+
+func test():
+ var x = A.new()
+
+ x.free()
+
+ var ok = x
+ var bad : A = x
diff --git a/modules/gdscript/tests/scripts/analyzer/errors/script_freed_instance.out b/modules/gdscript/tests/scripts/analyzer/errors/script_freed_instance.out
new file mode 100644
index 0000000000..dec7090322
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/errors/script_freed_instance.out
@@ -0,0 +1,6 @@
+GDTEST_RUNTIME_ERROR
+>> SCRIPT ERROR
+>> on function: test()
+>> analyzer/errors/script_freed_instance.gd
+>> 10
+>> Trying to assign invalid previously freed instance.
diff --git a/modules/gdscript/tests/scripts/analyzer/features/getter_return_type.gd b/modules/gdscript/tests/scripts/analyzer/features/getter_return_type.gd
new file mode 100644
index 0000000000..38bb7f6e9c
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/features/getter_return_type.gd
@@ -0,0 +1,9 @@
+var Value:int = 8 :
+ get:
+ return Value
+ set(v):
+ Value = v
+
+func test():
+ var f:float = Value
+ print(int(f))
diff --git a/modules/gdscript/tests/scripts/analyzer/features/getter_return_type.out b/modules/gdscript/tests/scripts/analyzer/features/getter_return_type.out
new file mode 100644
index 0000000000..b0cb63ef59
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/features/getter_return_type.out
@@ -0,0 +1,2 @@
+GDTEST_OK
+8
diff --git a/modules/gdscript/tests/scripts/analyzer/features/native_typed_assign_null.gd b/modules/gdscript/tests/scripts/analyzer/features/native_typed_assign_null.gd
new file mode 100644
index 0000000000..c197062d9f
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/features/native_typed_assign_null.gd
@@ -0,0 +1,15 @@
+extends Node
+
+func test():
+ var typed: Variant = get_node_or_null("does_not_exist")
+ var untyped = null
+ var node_1: Node = typed
+ var node_2: Node = untyped
+ var node_3 = typed
+ var node_4 = untyped
+ print(typed)
+ print(untyped)
+ print(node_1)
+ print(node_2)
+ print(node_3)
+ print(node_4)
diff --git a/modules/gdscript/tests/scripts/analyzer/features/native_typed_assign_null.out b/modules/gdscript/tests/scripts/analyzer/features/native_typed_assign_null.out
new file mode 100644
index 0000000000..d66b72f5c3
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/features/native_typed_assign_null.out
@@ -0,0 +1,7 @@
+GDTEST_OK
+<Object#null>
+<null>
+<Object#null>
+<null>
+<Object#null>
+<null>
diff --git a/modules/gdscript/tests/scripts/analyzer/features/typed_array_usage.gd b/modules/gdscript/tests/scripts/analyzer/features/typed_array_usage.gd
index 7416ecd87a..26542a9e2f 100644
--- a/modules/gdscript/tests/scripts/analyzer/features/typed_array_usage.gd
+++ b/modules/gdscript/tests/scripts/analyzer/features/typed_array_usage.gd
@@ -201,6 +201,10 @@ func test():
assert(str(typed_enums) == '[391]')
assert(typed_enums.get_typed_builtin() == TYPE_INT)
+ const const_enums: Array[E] = []
+ assert(const_enums.get_typed_builtin() == TYPE_INT)
+ assert(const_enums.get_typed_class_name() == &'')
+
var a := A.new()
var typed_natives: Array[RefCounted] = [a]
diff --git a/modules/gridmap/editor/grid_map_editor_plugin.cpp b/modules/gridmap/editor/grid_map_editor_plugin.cpp
index 183190460e..9a7b37df21 100644
--- a/modules/gridmap/editor/grid_map_editor_plugin.cpp
+++ b/modules/gridmap/editor/grid_map_editor_plugin.cpp
@@ -1197,6 +1197,7 @@ GridMapEditor::GridMapEditor() {
options->get_popup()->add_item(TTR("Cursor Back Rotate Z"), MENU_OPTION_CURSOR_BACK_ROTATE_Z, KeyModifierMask::SHIFT + Key::D);
options->get_popup()->add_item(TTR("Cursor Clear Rotation"), MENU_OPTION_CURSOR_CLEAR_ROTATION, Key::W);
options->get_popup()->add_separator();
+ // TRANSLATORS: This is a toggle to select after pasting the new content.
options->get_popup()->add_check_item(TTR("Paste Selects"), MENU_OPTION_PASTE_SELECTS);
options->get_popup()->add_separator();
options->get_popup()->add_item(TTR("Duplicate Selection"), MENU_OPTION_SELECTION_DUPLICATE, KeyModifierMask::CTRL + Key::C);
diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/BuildManager.cs b/modules/mono/editor/GodotTools/GodotTools/Build/BuildManager.cs
index ed3a4c6e26..6c5c61acb9 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Build/BuildManager.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Build/BuildManager.cs
@@ -302,7 +302,7 @@ namespace GodotTools.Build
public static bool CleanProjectBlocking(
[DisallowNull] string configuration,
[AllowNull] string platform = null
- ) => CleanProjectBlocking(CreateBuildInfo(configuration, platform, rebuild: false));
+ ) => CleanProjectBlocking(CreateBuildInfo(configuration, platform, rebuild: false, onlyClean: true));
public static bool PublishProjectBlocking(
[DisallowNull] string configuration,
diff --git a/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs b/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs
index 43ead4af69..c267d32f5a 100644
--- a/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs
@@ -272,15 +272,14 @@ namespace GodotTools
}
}
- string resourcePath = ProjectSettings.GlobalizePath("res://");
- args.Add(resourcePath);
+ args.Add(Path.GetDirectoryName(GodotSharpDirs.ProjectSlnPath));
string scriptPath = ProjectSettings.GlobalizePath(script.ResourcePath);
if (line >= 0)
{
args.Add("-g");
- args.Add($"{scriptPath}:{line}:{col}");
+ args.Add($"{scriptPath}:{line + 1}:{col + 1}");
}
else
{
diff --git a/modules/mono/glue/GodotSharp/Godot.SourceGenerators.Internal/UnmanagedCallbacksGenerator.cs b/modules/mono/glue/GodotSharp/Godot.SourceGenerators.Internal/UnmanagedCallbacksGenerator.cs
index 3226ca79e5..6b000cc89b 100644
--- a/modules/mono/glue/GodotSharp/Godot.SourceGenerators.Internal/UnmanagedCallbacksGenerator.cs
+++ b/modules/mono/glue/GodotSharp/Godot.SourceGenerators.Internal/UnmanagedCallbacksGenerator.cs
@@ -168,7 +168,9 @@ using Godot.NativeInterop;
{
var parameter = callback.Parameters[i];
- source.Append(parameter.ToDisplayString());
+ AppendRefKind(source, parameter.RefKind);
+ source.Append(' ');
+ source.Append(parameter.Type.FullQualifiedNameIncludeGlobal());
source.Append(' ');
source.Append(parameter.Name);
diff --git a/modules/navigation/SCsub b/modules/navigation/SCsub
index 0b0822db2d..a9277657f4 100644
--- a/modules/navigation/SCsub
+++ b/modules/navigation/SCsub
@@ -10,7 +10,7 @@ env_navigation = env_modules.Clone()
thirdparty_obj = []
# Recast Thirdparty source files
-if env["builtin_recast"]:
+if env["builtin_recastnavigation"]:
thirdparty_dir = "#thirdparty/recastnavigation/Recast/"
thirdparty_sources = [
"Source/Recast.cpp",
diff --git a/modules/ogg/ogg_packet_sequence.h b/modules/ogg/ogg_packet_sequence.h
index 4aa5ffa254..7085504500 100644
--- a/modules/ogg/ogg_packet_sequence.h
+++ b/modules/ogg/ogg_packet_sequence.h
@@ -32,11 +32,10 @@
#define OGG_PACKET_SEQUENCE_H
#include "core/io/resource.h"
-#include "core/object/gdvirtual.gen.inc"
-#include "core/variant/native_ptr.h"
#include "core/variant/typed_array.h"
#include "core/variant/variant.h"
-#include "thirdparty/libogg/ogg/ogg.h"
+
+#include <ogg/ogg.h>
class OggPacketSequencePlayback;
diff --git a/modules/text_server_adv/SCsub b/modules/text_server_adv/SCsub
index 4a9c7b3567..b7b7dccdb0 100644
--- a/modules/text_server_adv/SCsub
+++ b/modules/text_server_adv/SCsub
@@ -7,7 +7,6 @@ env_text_server_adv = env_modules.Clone()
def make_icu_data(target, source, env):
-
dst = target[0].srcnode().abspath
g = open(dst, "w", encoding="utf-8")
@@ -126,7 +125,7 @@ if env["builtin_harfbuzz"]:
env_harfbuzz.Prepend(CPPPATH=["#thirdparty/harfbuzz/src"])
env_harfbuzz.Append(CCFLAGS=["-DHAVE_ICU"])
- if env["builtin_icu"]:
+ if env["builtin_icu4c"]:
env_harfbuzz.Prepend(CPPPATH=["#thirdparty/icu4c/common/", "#thirdparty/icu4c/i18n/"])
env_harfbuzz.Append(CCFLAGS=["-DU_HAVE_LIB_SUFFIX=1", "-DU_LIB_SUFFIX_C_NAME=_godot", "-DHAVE_ICU_BUILTIN"])
@@ -240,7 +239,7 @@ if env["builtin_graphite"] and freetype_enabled and env["graphite"]:
env.Append(LIBS=[lib])
-if env["builtin_icu"]:
+if env["builtin_icu4c"]:
env_icu = env_modules.Clone()
env_icu.disable_warnings()
diff --git a/modules/vorbis/audio_stream_ogg_vorbis.cpp b/modules/vorbis/audio_stream_ogg_vorbis.cpp
index f3ae35ce42..fcd717cfec 100644
--- a/modules/vorbis/audio_stream_ogg_vorbis.cpp
+++ b/modules/vorbis/audio_stream_ogg_vorbis.cpp
@@ -32,7 +32,8 @@
#include "core/io/file_access.h"
#include "core/variant/typed_array.h"
-#include "thirdparty/libogg/ogg/ogg.h"
+
+#include <ogg/ogg.h>
int AudioStreamPlaybackOggVorbis::_mix_internal(AudioFrame *p_buffer, int p_frames) {
ERR_FAIL_COND_V(!ready, 0);
diff --git a/modules/vorbis/audio_stream_ogg_vorbis.h b/modules/vorbis/audio_stream_ogg_vorbis.h
index ad6746eae2..c76df7f84d 100644
--- a/modules/vorbis/audio_stream_ogg_vorbis.h
+++ b/modules/vorbis/audio_stream_ogg_vorbis.h
@@ -34,7 +34,8 @@
#include "core/variant/variant.h"
#include "modules/ogg/ogg_packet_sequence.h"
#include "servers/audio/audio_stream.h"
-#include "thirdparty/libvorbis/vorbis/codec.h"
+
+#include <vorbis/codec.h>
class AudioStreamOggVorbis;
diff --git a/modules/vorbis/resource_importer_ogg_vorbis.cpp b/modules/vorbis/resource_importer_ogg_vorbis.cpp
index b712d63030..9e280de0ca 100644
--- a/modules/vorbis/resource_importer_ogg_vorbis.cpp
+++ b/modules/vorbis/resource_importer_ogg_vorbis.cpp
@@ -33,8 +33,9 @@
#include "core/io/file_access.h"
#include "core/io/resource_saver.h"
#include "scene/resources/texture.h"
-#include "thirdparty/libogg/ogg/ogg.h"
-#include "thirdparty/libvorbis/vorbis/codec.h"
+
+#include <ogg/ogg.h>
+#include <vorbis/codec.h>
#ifdef TOOLS_ENABLED
#include "editor/import/audio_stream_import_settings.h"
diff --git a/platform/android/display_server_android.cpp b/platform/android/display_server_android.cpp
index 3fcb926f86..af4ba1255b 100644
--- a/platform/android/display_server_android.cpp
+++ b/platform/android/display_server_android.cpp
@@ -656,6 +656,7 @@ void DisplayServerAndroid::_cursor_set_shape_helper(CursorShape p_shape, bool fo
}
void DisplayServerAndroid::cursor_set_shape(DisplayServer::CursorShape p_shape) {
+ ERR_FAIL_INDEX(p_shape, CURSOR_MAX);
_cursor_set_shape_helper(p_shape);
}
@@ -664,6 +665,7 @@ DisplayServer::CursorShape DisplayServerAndroid::cursor_get_shape() const {
}
void DisplayServerAndroid::cursor_set_custom_image(const Ref<Resource> &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) {
+ ERR_FAIL_INDEX(p_shape, CURSOR_MAX);
String cursor_path = p_cursor.is_valid() ? p_cursor->get_path() : "";
if (!cursor_path.is_empty()) {
cursor_path = ProjectSettings::get_singleton()->globalize_path(cursor_path);
diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp
index fdd2fed836..641258a26c 100644
--- a/platform/android/export/export_plugin.cpp
+++ b/platform/android/export/export_plugin.cpp
@@ -251,7 +251,7 @@ static const int EXPORT_FORMAT_AAB = 1;
static const char *APK_ASSETS_DIRECTORY = "res://android/build/assets";
static const char *AAB_ASSETS_DIRECTORY = "res://android/build/assetPacks/installTime/src/main/assets";
-static const int DEFAULT_MIN_SDK_VERSION = 21; // Should match the value in 'platform/android/java/app/config.gradle#minSdk'
+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'
@@ -1706,7 +1706,7 @@ void EditorExportPlatformAndroid::get_export_options(List<ExportOption> *r_optio
r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "gradle_build/export_format", PROPERTY_HINT_ENUM, "Export APK,Export AAB"), EXPORT_FORMAT_APK));
// Using String instead of int to default to an empty string (no override) with placeholder for instructions (see GH-62465).
// This implies doing validation that the string is a proper int.
- r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "gradle_build/min_sdk", PROPERTY_HINT_PLACEHOLDER_TEXT, vformat("%d (default)", DEFAULT_MIN_SDK_VERSION)), ""));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "gradle_build/min_sdk", PROPERTY_HINT_PLACEHOLDER_TEXT, vformat("%d (default)", VULKAN_MIN_SDK_VERSION)), ""));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "gradle_build/target_sdk", PROPERTY_HINT_PLACEHOLDER_TEXT, vformat("%d (default)", DEFAULT_TARGET_SDK_VERSION)), ""));
Vector<PluginConfigAndroid> plugins_configs = get_plugins();
@@ -2337,7 +2337,7 @@ bool EditorExportPlatformAndroid::has_valid_project_configuration(const Ref<Edit
// Check the min sdk version.
String min_sdk_str = p_preset->get("gradle_build/min_sdk");
- int min_sdk_int = DEFAULT_MIN_SDK_VERSION;
+ int min_sdk_int = VULKAN_MIN_SDK_VERSION;
if (!min_sdk_str.is_empty()) { // Empty means no override, nothing to do.
if (!gradle_build_enabled) {
valid = false;
@@ -2350,9 +2350,9 @@ bool EditorExportPlatformAndroid::has_valid_project_configuration(const Ref<Edit
err += "\n";
} else {
min_sdk_int = min_sdk_str.to_int();
- if (min_sdk_int < DEFAULT_MIN_SDK_VERSION) {
+ if (min_sdk_int < OPENGL_MIN_SDK_VERSION) {
valid = false;
- err += vformat(TTR("\"Min SDK\" cannot be lower than %d, which is the version needed by the Godot library."), DEFAULT_MIN_SDK_VERSION);
+ err += vformat(TTR("\"Min SDK\" cannot be lower than %d, which is the version needed by the Godot library."), OPENGL_MIN_SDK_VERSION);
err += "\n";
}
}
@@ -2808,7 +2808,7 @@ Error EditorExportPlatformAndroid::export_project_helper(const Ref<EditorExportP
String version_name = p_preset->get("version/name");
String min_sdk_version = p_preset->get("gradle_build/min_sdk");
if (!min_sdk_version.is_valid_int()) {
- min_sdk_version = itos(DEFAULT_MIN_SDK_VERSION);
+ min_sdk_version = itos(VULKAN_MIN_SDK_VERSION);
}
String target_sdk_version = p_preset->get("gradle_build/target_sdk");
if (!target_sdk_version.is_valid_int()) {
diff --git a/platform/android/file_access_android.cpp b/platform/android/file_access_android.cpp
index 5df05580a5..1249f2219f 100644
--- a/platform/android/file_access_android.cpp
+++ b/platform/android/file_access_android.cpp
@@ -169,6 +169,10 @@ bool FileAccessAndroid::file_exists(const String &p_path) {
return true;
}
+void FileAccessAndroid::close() {
+ _close();
+}
+
FileAccessAndroid::~FileAccessAndroid() {
_close();
}
diff --git a/platform/android/file_access_android.h b/platform/android/file_access_android.h
index 1d25a28d90..b8f45628e5 100644
--- a/platform/android/file_access_android.h
+++ b/platform/android/file_access_android.h
@@ -78,6 +78,8 @@ public:
virtual uint32_t _get_unix_permissions(const String &p_file) override { return 0; }
virtual Error _set_unix_permissions(const String &p_file, uint32_t p_permissions) override { return FAILED; }
+ virtual void close() override;
+
~FileAccessAndroid();
};
diff --git a/platform/android/file_access_filesystem_jandroid.cpp b/platform/android/file_access_filesystem_jandroid.cpp
index 7174d57344..ea8459d1ed 100644
--- a/platform/android/file_access_filesystem_jandroid.cpp
+++ b/platform/android/file_access_filesystem_jandroid.cpp
@@ -333,6 +333,12 @@ void FileAccessFilesystemJAndroid::setup(jobject p_file_access_handler) {
_file_last_modified = env->GetMethodID(cls, "fileLastModified", "(Ljava/lang/String;)J");
}
+void FileAccessFilesystemJAndroid::close() {
+ if (is_open()) {
+ _close();
+ }
+}
+
FileAccessFilesystemJAndroid::FileAccessFilesystemJAndroid() {
id = 0;
}
diff --git a/platform/android/file_access_filesystem_jandroid.h b/platform/android/file_access_filesystem_jandroid.h
index 7829ab7cf9..5e74d9de24 100644
--- a/platform/android/file_access_filesystem_jandroid.h
+++ b/platform/android/file_access_filesystem_jandroid.h
@@ -93,6 +93,8 @@ public:
virtual uint32_t _get_unix_permissions(const String &p_file) override { return 0; }
virtual Error _set_unix_permissions(const String &p_file, uint32_t p_permissions) override { return FAILED; }
+ virtual void close() override;
+
FileAccessFilesystemJAndroid();
~FileAccessFilesystemJAndroid();
};
diff --git a/platform/ios/SCsub b/platform/ios/SCsub
index f3925c146f..18ba6617af 100644
--- a/platform/ios/SCsub
+++ b/platform/ios/SCsub
@@ -17,7 +17,6 @@ ios_lib = [
"display_layer.mm",
"godot_app_delegate.m",
"godot_view_renderer.mm",
- "godot_view_gesture_recognizer.mm",
"device_metrics.m",
"keyboard_input_view.mm",
"key_mapping_ios.mm",
diff --git a/platform/ios/godot_view.h b/platform/ios/godot_view.h
index 077584baa6..b00ca37ebe 100644
--- a/platform/ios/godot_view.h
+++ b/platform/ios/godot_view.h
@@ -59,9 +59,4 @@ class String;
- (void)stopRendering;
- (void)startRendering;
-- (void)godotTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
-- (void)godotTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
-- (void)godotTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
-- (void)godotTouchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event;
-
@end
diff --git a/platform/ios/godot_view.mm b/platform/ios/godot_view.mm
index 4b10f95ab8..fafec79bf6 100644
--- a/platform/ios/godot_view.mm
+++ b/platform/ios/godot_view.mm
@@ -35,7 +35,6 @@
#include "core/string/ustring.h"
#import "display_layer.h"
#include "display_server_ios.h"
-#import "godot_view_gesture_recognizer.h"
#import "godot_view_renderer.h"
#import <CoreMotion/CoreMotion.h>
@@ -60,8 +59,6 @@ static const float earth_gravity = 9.80665;
@property(strong, nonatomic) CMMotionManager *motionManager;
-@property(strong, nonatomic) GodotViewGestureRecognizer *delayGestureRecognizer;
-
@end
@implementation GodotView
@@ -148,10 +145,6 @@ static const float earth_gravity = 9.80665;
[self.animationTimer invalidate];
self.animationTimer = nil;
}
-
- if (self.delayGestureRecognizer) {
- self.delayGestureRecognizer = nil;
- }
}
- (void)godot_commonInit {
@@ -171,11 +164,6 @@ static const float earth_gravity = 9.80665;
self.motionManager = nil;
}
}
-
- // Initialize delay gesture recognizer
- GodotViewGestureRecognizer *gestureRecognizer = [[GodotViewGestureRecognizer alloc] init];
- self.delayGestureRecognizer = gestureRecognizer;
- [self addGestureRecognizer:self.delayGestureRecognizer];
}
- (void)stopRendering {
@@ -347,58 +335,42 @@ static const float earth_gravity = 9.80665;
}
}
-- (void)godotTouchesBegan:(NSSet *)touchesSet withEvent:(UIEvent *)event {
- NSArray *tlist = [event.allTouches allObjects];
- for (unsigned int i = 0; i < [tlist count]; i++) {
- if ([touchesSet containsObject:[tlist objectAtIndex:i]]) {
- UITouch *touch = [tlist objectAtIndex:i];
- int tid = [self getTouchIDForTouch:touch];
- ERR_FAIL_COND(tid == -1);
- CGPoint touchPoint = [touch locationInView:self];
- DisplayServerIOS::get_singleton()->touch_press(tid, touchPoint.x * self.contentScaleFactor, touchPoint.y * self.contentScaleFactor, true, touch.tapCount > 1);
- }
+- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
+ for (UITouch *touch in touches) {
+ int tid = [self getTouchIDForTouch:touch];
+ ERR_FAIL_COND(tid == -1);
+ CGPoint touchPoint = [touch locationInView:self];
+ DisplayServerIOS::get_singleton()->touch_press(tid, touchPoint.x * self.contentScaleFactor, touchPoint.y * self.contentScaleFactor, true, touch.tapCount > 1);
}
}
-- (void)godotTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
- NSArray *tlist = [event.allTouches allObjects];
- for (unsigned int i = 0; i < [tlist count]; i++) {
- if ([touches containsObject:[tlist objectAtIndex:i]]) {
- UITouch *touch = [tlist objectAtIndex:i];
- int tid = [self getTouchIDForTouch:touch];
- ERR_FAIL_COND(tid == -1);
- CGPoint touchPoint = [touch locationInView:self];
- CGPoint prev_point = [touch previousLocationInView:self];
- CGFloat alt = [touch altitudeAngle];
- CGVector azim = [touch azimuthUnitVectorInView:self];
- DisplayServerIOS::get_singleton()->touch_drag(tid, prev_point.x * self.contentScaleFactor, prev_point.y * self.contentScaleFactor, touchPoint.x * self.contentScaleFactor, touchPoint.y * self.contentScaleFactor, [touch force] / [touch maximumPossibleForce], Vector2(azim.dx, azim.dy) * Math::cos(alt));
- }
+- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
+ for (UITouch *touch in touches) {
+ int tid = [self getTouchIDForTouch:touch];
+ ERR_FAIL_COND(tid == -1);
+ CGPoint touchPoint = [touch locationInView:self];
+ CGPoint prev_point = [touch previousLocationInView:self];
+ CGFloat alt = [touch altitudeAngle];
+ CGVector azim = [touch azimuthUnitVectorInView:self];
+ DisplayServerIOS::get_singleton()->touch_drag(tid, prev_point.x * self.contentScaleFactor, prev_point.y * self.contentScaleFactor, touchPoint.x * self.contentScaleFactor, touchPoint.y * self.contentScaleFactor, [touch force] / [touch maximumPossibleForce], Vector2(azim.dx, azim.dy) * Math::cos(alt));
}
}
-- (void)godotTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
- NSArray *tlist = [event.allTouches allObjects];
- for (unsigned int i = 0; i < [tlist count]; i++) {
- if ([touches containsObject:[tlist objectAtIndex:i]]) {
- UITouch *touch = [tlist objectAtIndex:i];
- int tid = [self getTouchIDForTouch:touch];
- ERR_FAIL_COND(tid == -1);
- [self removeTouch:touch];
- CGPoint touchPoint = [touch locationInView:self];
- DisplayServerIOS::get_singleton()->touch_press(tid, touchPoint.x * self.contentScaleFactor, touchPoint.y * self.contentScaleFactor, false, false);
- }
+- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
+ for (UITouch *touch in touches) {
+ int tid = [self getTouchIDForTouch:touch];
+ ERR_FAIL_COND(tid == -1);
+ [self removeTouch:touch];
+ CGPoint touchPoint = [touch locationInView:self];
+ DisplayServerIOS::get_singleton()->touch_press(tid, touchPoint.x * self.contentScaleFactor, touchPoint.y * self.contentScaleFactor, false, false);
}
}
-- (void)godotTouchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
- NSArray *tlist = [event.allTouches allObjects];
- for (unsigned int i = 0; i < [tlist count]; i++) {
- if ([touches containsObject:[tlist objectAtIndex:i]]) {
- UITouch *touch = [tlist objectAtIndex:i];
- int tid = [self getTouchIDForTouch:touch];
- ERR_FAIL_COND(tid == -1);
- DisplayServerIOS::get_singleton()->touches_canceled(tid);
- }
+- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
+ for (UITouch *touch in touches) {
+ int tid = [self getTouchIDForTouch:touch];
+ ERR_FAIL_COND(tid == -1);
+ DisplayServerIOS::get_singleton()->touches_canceled(tid);
}
[self clearTouches];
}
diff --git a/platform/ios/godot_view_gesture_recognizer.h b/platform/ios/godot_view_gesture_recognizer.h
deleted file mode 100644
index 57bfc75568..0000000000
--- a/platform/ios/godot_view_gesture_recognizer.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/**************************************************************************/
-/* godot_view_gesture_recognizer.h */
-/**************************************************************************/
-/* This file is part of: */
-/* GODOT ENGINE */
-/* https://godotengine.org */
-/**************************************************************************/
-/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
-/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
-/* */
-/* Permission is hereby granted, free of charge, to any person obtaining */
-/* a copy of this software and associated documentation files (the */
-/* "Software"), to deal in the Software without restriction, including */
-/* without limitation the rights to use, copy, modify, merge, publish, */
-/* distribute, sublicense, and/or sell copies of the Software, and to */
-/* permit persons to whom the Software is furnished to do so, subject to */
-/* the following conditions: */
-/* */
-/* The above copyright notice and this permission notice shall be */
-/* included in all copies or substantial portions of the Software. */
-/* */
-/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
-/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
-/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
-/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
-/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
-/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
-/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-/**************************************************************************/
-
-// GLViewGestureRecognizer allows iOS gestures to work correctly by
-// emulating UIScrollView's UIScrollViewDelayedTouchesBeganGestureRecognizer.
-// It catches all gestures incoming to UIView and delays them for 150ms
-// (the same value used by UIScrollViewDelayedTouchesBeganGestureRecognizer)
-// If touch cancellation or end message is fired it fires delayed
-// begin touch immediately as well as last touch signal
-
-#import <UIKit/UIKit.h>
-
-@interface GodotViewGestureRecognizer : UIGestureRecognizer
-
-@property(nonatomic, readonly, assign) NSTimeInterval delayTimeInterval;
-
-- (instancetype)init;
-
-@end
diff --git a/platform/ios/godot_view_gesture_recognizer.mm b/platform/ios/godot_view_gesture_recognizer.mm
deleted file mode 100644
index 9b71228864..0000000000
--- a/platform/ios/godot_view_gesture_recognizer.mm
+++ /dev/null
@@ -1,186 +0,0 @@
-/**************************************************************************/
-/* godot_view_gesture_recognizer.mm */
-/**************************************************************************/
-/* This file is part of: */
-/* GODOT ENGINE */
-/* https://godotengine.org */
-/**************************************************************************/
-/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
-/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
-/* */
-/* Permission is hereby granted, free of charge, to any person obtaining */
-/* a copy of this software and associated documentation files (the */
-/* "Software"), to deal in the Software without restriction, including */
-/* without limitation the rights to use, copy, modify, merge, publish, */
-/* distribute, sublicense, and/or sell copies of the Software, and to */
-/* permit persons to whom the Software is furnished to do so, subject to */
-/* the following conditions: */
-/* */
-/* The above copyright notice and this permission notice shall be */
-/* included in all copies or substantial portions of the Software. */
-/* */
-/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
-/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
-/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
-/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
-/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
-/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
-/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
-/**************************************************************************/
-
-#import "godot_view_gesture_recognizer.h"
-
-#import "godot_view.h"
-
-#include "core/config/project_settings.h"
-
-// Minimum distance for touches to move to fire
-// a delay timer before scheduled time.
-// Should be the low enough to not cause issues with dragging
-// but big enough to allow click to work.
-const CGFloat kGLGestureMovementDistance = 0.5;
-
-@interface GodotViewGestureRecognizer ()
-
-@property(nonatomic, readwrite, assign) NSTimeInterval delayTimeInterval;
-
-@end
-
-@interface GodotViewGestureRecognizer ()
-
-// Timer used to delay begin touch message.
-// Should work as simple emulation of UIDelayedAction
-@property(strong, nonatomic) NSTimer *delayTimer;
-
-// Delayed touch parameters
-@property(strong, nonatomic) NSSet *delayedTouches;
-@property(strong, nonatomic) UIEvent *delayedEvent;
-
-@end
-
-@implementation GodotViewGestureRecognizer
-
-- (GodotView *)godotView {
- return (GodotView *)self.view;
-}
-
-- (instancetype)init {
- self = [super init];
-
- self.cancelsTouchesInView = YES;
- self.delaysTouchesBegan = YES;
- self.delaysTouchesEnded = YES;
- self.requiresExclusiveTouchType = NO;
-
- self.delayTimeInterval = GLOBAL_GET("input_devices/pointing/ios/touch_delay");
-
- return self;
-}
-
-- (void)dealloc {
- if (self.delayTimer) {
- [self.delayTimer invalidate];
- self.delayTimer = nil;
- }
-
- if (self.delayedTouches) {
- self.delayedTouches = nil;
- }
-
- if (self.delayedEvent) {
- self.delayedEvent = nil;
- }
-}
-
-- (void)delayTouches:(NSSet *)touches andEvent:(UIEvent *)event {
- [self.delayTimer fire];
-
- self.delayedTouches = touches;
- self.delayedEvent = event;
-
- self.delayTimer = [NSTimer
- scheduledTimerWithTimeInterval:self.delayTimeInterval
- target:self
- selector:@selector(fireDelayedTouches:)
- userInfo:nil
- repeats:NO];
-}
-
-- (void)fireDelayedTouches:(id)timer {
- [self.delayTimer invalidate];
- self.delayTimer = nil;
-
- if (self.delayedTouches) {
- [self.godotView godotTouchesBegan:self.delayedTouches withEvent:self.delayedEvent];
- }
-
- self.delayedTouches = nil;
- self.delayedEvent = nil;
-}
-
-- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
- NSSet *cleared = [self copyClearedTouches:touches phase:UITouchPhaseBegan];
- [self delayTouches:cleared andEvent:event];
-
- [super touchesBegan:touches withEvent:event];
-}
-
-- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
- NSSet *cleared = [self copyClearedTouches:touches phase:UITouchPhaseMoved];
-
- if (self.delayTimer) {
- // We should check if movement was significant enough to fire an event
- // for dragging to work correctly.
- for (UITouch *touch in cleared) {
- CGPoint from = [touch locationInView:self.godotView];
- CGPoint to = [touch previousLocationInView:self.godotView];
- CGFloat xDistance = from.x - to.x;
- CGFloat yDistance = from.y - to.y;
-
- CGFloat distance = sqrt(xDistance * xDistance + yDistance * yDistance);
-
- // Early exit, since one of touches has moved enough to fire a drag event.
- if (distance > kGLGestureMovementDistance) {
- [self.delayTimer fire];
- [self.godotView godotTouchesMoved:cleared withEvent:event];
- return;
- }
- }
-
- return;
- }
-
- [self.godotView godotTouchesMoved:cleared withEvent:event];
-
- [super touchesMoved:touches withEvent:event];
-}
-
-- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
- [self.delayTimer fire];
-
- NSSet *cleared = [self copyClearedTouches:touches phase:UITouchPhaseEnded];
- [self.godotView godotTouchesEnded:cleared withEvent:event];
-
- [super touchesEnded:touches withEvent:event];
-}
-
-- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
- [self.delayTimer fire];
- [self.godotView godotTouchesCancelled:touches withEvent:event];
-
- [super touchesCancelled:touches withEvent:event];
-}
-
-- (NSSet *)copyClearedTouches:(NSSet *)touches phase:(UITouchPhase)phaseToSave {
- NSMutableSet *cleared = [touches mutableCopy];
-
- for (UITouch *touch in touches) {
- if (touch.view != self.view || touch.phase != phaseToSave) {
- [cleared removeObject:touch];
- }
- }
-
- return cleared;
-}
-
-@end
diff --git a/platform/ios/joypad_ios.mm b/platform/ios/joypad_ios.mm
index 057f439b81..9194b09ef6 100644
--- a/platform/ios/joypad_ios.mm
+++ b/platform/ios/joypad_ios.mm
@@ -305,6 +305,25 @@ void JoypadIOS::start_processing() {
float value = gamepad.rightTrigger.value;
Input::get_singleton()->joy_axis(joy_id, JoyAxis::TRIGGER_RIGHT, value);
}
+
+ if (@available(iOS 13, *)) {
+ // iOS uses 'buttonOptions' and 'buttonMenu' names for BACK and START joy buttons.
+ if (element == gamepad.buttonOptions) {
+ Input::get_singleton()->joy_button(joy_id, JoyButton::BACK,
+ gamepad.buttonOptions.isPressed);
+ } else if (element == gamepad.buttonMenu) {
+ Input::get_singleton()->joy_button(joy_id, JoyButton::START,
+ gamepad.buttonMenu.isPressed);
+ }
+ }
+
+ if (@available(iOS 14, *)) {
+ // iOS uses 'buttonHome' for the GUIDE joy button.
+ if (element == gamepad.buttonHome) {
+ Input::get_singleton()->joy_button(joy_id, JoyButton::GUIDE,
+ gamepad.buttonHome.isPressed);
+ }
+ }
};
} else if (controller.microGamepad != nil) {
// micro gamepads were added in OS 9 and feature just 2 buttons and a d-pad
diff --git a/platform/linuxbsd/SCsub b/platform/linuxbsd/SCsub
index 3c5dc78c60..4dd74ff9d0 100644
--- a/platform/linuxbsd/SCsub
+++ b/platform/linuxbsd/SCsub
@@ -11,23 +11,30 @@ common_linuxbsd = [
"joypad_linux.cpp",
"freedesktop_portal_desktop.cpp",
"freedesktop_screensaver.cpp",
- "xkbcommon-so_wrap.c",
]
+if env["use_sowrap"]:
+ common_linuxbsd.append("xkbcommon-so_wrap.c")
+
if env["x11"]:
common_linuxbsd += SConscript("x11/SCsub")
if env["speechd"]:
- common_linuxbsd.append(["speechd-so_wrap.c", "tts_linux.cpp"])
+ common_linuxbsd.append("tts_linux.cpp")
+ if env["use_sowrap"]:
+ common_linuxbsd.append("speechd-so_wrap.c")
if env["fontconfig"]:
- common_linuxbsd.append("fontconfig-so_wrap.c")
+ if env["use_sowrap"]:
+ common_linuxbsd.append("fontconfig-so_wrap.c")
if env["udev"]:
- common_linuxbsd.append("libudev-so_wrap.c")
+ if env["use_sowrap"]:
+ common_linuxbsd.append("libudev-so_wrap.c")
if env["dbus"]:
- common_linuxbsd.append("dbus-so_wrap.c")
+ if env["use_sowrap"]:
+ common_linuxbsd.append("dbus-so_wrap.c")
prog = env.add_program("#bin/godot", ["godot_linuxbsd.cpp"] + common_linuxbsd)
diff --git a/platform/linuxbsd/detect.py b/platform/linuxbsd/detect.py
index bae5a98aee..3f713d2db3 100644
--- a/platform/linuxbsd/detect.py
+++ b/platform/linuxbsd/detect.py
@@ -43,6 +43,7 @@ def get_opts():
BoolVariable("use_lsan", "Use LLVM/GCC compiler leak sanitizer (LSAN)", False),
BoolVariable("use_tsan", "Use LLVM/GCC compiler thread sanitizer (TSAN)", False),
BoolVariable("use_msan", "Use LLVM compiler memory sanitizer (MSAN)", False),
+ BoolVariable("use_sowrap", "Dynamically load system libraries", True),
BoolVariable("alsa", "Use ALSA", True),
BoolVariable("pulseaudio", "Use PulseAudio", True),
BoolVariable("dbus", "Use D-Bus to handle screensaver and portal desktop settings", True),
@@ -184,25 +185,30 @@ def configure(env: "Environment"):
## Dependencies
+ if env["use_sowrap"]:
+ env.Append(CPPDEFINES=["SOWRAP_ENABLED"])
+
if env["touch"]:
env.Append(CPPDEFINES=["TOUCH_ENABLED"])
# FIXME: Check for existence of the libs before parsing their flags with pkg-config
# freetype depends on libpng and zlib, so bundling one of them while keeping others
- # as shared libraries leads to weird issues
- if (
- env["builtin_freetype"]
- or env["builtin_libpng"]
- or env["builtin_zlib"]
- or env["builtin_graphite"]
- or env["builtin_harfbuzz"]
- ):
- env["builtin_freetype"] = True
- env["builtin_libpng"] = True
- env["builtin_zlib"] = True
- env["builtin_graphite"] = True
- env["builtin_harfbuzz"] = True
+ # as shared libraries leads to weird issues. And graphite and harfbuzz need freetype.
+ ft_linked_deps = [
+ env["builtin_freetype"],
+ env["builtin_libpng"],
+ env["builtin_zlib"],
+ env["builtin_graphite"],
+ env["builtin_harfbuzz"],
+ ]
+ if (not all(ft_linked_deps)) and any(ft_linked_deps): # All or nothing.
+ print(
+ "These libraries should be either all builtin, or all system provided:\n"
+ "freetype, libpng, zlib, graphite, harfbuzz.\n"
+ "Please specify `builtin_<name>=no` for all of them, or none."
+ )
+ sys.exit()
if not env["builtin_freetype"]:
env.ParseConfig("pkg-config freetype2 --cflags --libs")
@@ -210,8 +216,8 @@ def configure(env: "Environment"):
if not env["builtin_graphite"]:
env.ParseConfig("pkg-config graphite2 --cflags --libs")
- if not env["builtin_icu"]:
- env.ParseConfig("pkg-config icu-uc --cflags --libs")
+ if not env["builtin_icu4c"]:
+ env.ParseConfig("pkg-config icu-i18n icu-uc --cflags --libs")
if not env["builtin_harfbuzz"]:
env.ParseConfig("pkg-config harfbuzz harfbuzz-icu --cflags --libs")
@@ -266,31 +272,93 @@ def configure(env: "Environment"):
if not env["builtin_pcre2"]:
env.ParseConfig("pkg-config libpcre2-32 --cflags --libs")
+ if not env["builtin_recastnavigation"]:
+ # No pkgconfig file so far, hardcode default paths.
+ env.Prepend(CPPPATH=["/usr/include/recastnavigation"])
+ env.Append(LIBS=["Recast"])
+
if not env["builtin_embree"]:
# No pkgconfig file so far, hardcode expected lib name.
env.Append(LIBS=["embree3"])
## Flags
-
if env["fontconfig"]:
- env.Append(CPPDEFINES=["FONTCONFIG_ENABLED"])
+ if not env["use_sowrap"]:
+ if os.system("pkg-config --exists fontconfig") == 0: # 0 means found
+ env.ParseConfig("pkg-config fontconfig --cflags --libs")
+ env.Append(CPPDEFINES=["FONTCONFIG_ENABLED"])
+ else:
+ print("Warning: fontconfig development libraries not found. Disabling the system fonts support.")
+ env["fontconfig"] = False
+ else:
+ env.Append(CPPDEFINES=["FONTCONFIG_ENABLED"])
if env["alsa"]:
- env.Append(CPPDEFINES=["ALSA_ENABLED", "ALSAMIDI_ENABLED"])
+ if not env["use_sowrap"]:
+ if os.system("pkg-config --exists alsa") == 0: # 0 means found
+ env.ParseConfig("pkg-config alsa --cflags --libs")
+ env.Append(CPPDEFINES=["ALSA_ENABLED", "ALSAMIDI_ENABLED"])
+ else:
+ print("Warning: ALSA development libraries not found. Disabling the ALSA audio driver.")
+ env["alsa"] = False
+ else:
+ env.Append(CPPDEFINES=["ALSA_ENABLED", "ALSAMIDI_ENABLED"])
if env["pulseaudio"]:
+ if not env["use_sowrap"]:
+ if os.system("pkg-config --exists libpulse") == 0: # 0 means found
+ env.ParseConfig("pkg-config libpulse --cflags --libs")
+ env.Append(CPPDEFINES=["PULSEAUDIO_ENABLED", "_REENTRANT"])
+ else:
+ print("Warning: PulseAudio development libraries not found. Disabling the PulseAudio audio driver.")
+ env["pulseaudio"] = False
env.Append(CPPDEFINES=["PULSEAUDIO_ENABLED", "_REENTRANT"])
if env["dbus"]:
- env.Append(CPPDEFINES=["DBUS_ENABLED"])
+ if not env["use_sowrap"]:
+ if os.system("pkg-config --exists dbus-1") == 0: # 0 means found
+ env.ParseConfig("pkg-config dbus-1 --cflags --libs")
+ env.Append(CPPDEFINES=["DBUS_ENABLED"])
+ else:
+ print("Warning: D-Bus development libraries not found. Disabling screensaver prevention.")
+ env["dbus"] = False
+ else:
+ env.Append(CPPDEFINES=["DBUS_ENABLED"])
if env["speechd"]:
- env.Append(CPPDEFINES=["SPEECHD_ENABLED"])
+ if not env["use_sowrap"]:
+ if os.system("pkg-config --exists speech-dispatcher") == 0: # 0 means found
+ env.ParseConfig("pkg-config speech-dispatcher --cflags --libs")
+ env.Append(CPPDEFINES=["SPEECHD_ENABLED"])
+ else:
+ print("Warning: speech-dispatcher development libraries not found. Disabling text to speech support.")
+ env["speechd"] = False
+ else:
+ env.Append(CPPDEFINES=["SPEECHD_ENABLED"])
+
+ if not env["use_sowrap"]:
+ if os.system("pkg-config --exists xkbcommon") == 0: # 0 means found
+ env.ParseConfig("pkg-config xkbcommon --cflags --libs")
+ env.Append(CPPDEFINES=["XKB_ENABLED"])
+ else:
+ print(
+ "Warning: libxkbcommon development libraries not found. Disabling dead key composition and key label support."
+ )
+ else:
+ env.Append(CPPDEFINES=["XKB_ENABLED"])
if platform.system() == "Linux":
env.Append(CPPDEFINES=["JOYDEV_ENABLED"])
if env["udev"]:
- env.Append(CPPDEFINES=["UDEV_ENABLED"])
+ if not env["use_sowrap"]:
+ if os.system("pkg-config --exists libudev") == 0: # 0 means found
+ env.ParseConfig("pkg-config libudev --cflags --libs")
+ env.Append(CPPDEFINES=["UDEV_ENABLED"])
+ else:
+ print("Warning: libudev development libraries not found. Disabling controller hotplugging support.")
+ env["udev"] = False
+ else:
+ env.Append(CPPDEFINES=["UDEV_ENABLED"])
else:
env["udev"] = False # Linux specific
@@ -298,7 +366,9 @@ def configure(env: "Environment"):
if not env["builtin_zlib"]:
env.ParseConfig("pkg-config zlib --cflags --libs")
- env.Prepend(CPPPATH=["#platform/linuxbsd", "#thirdparty/linuxbsd_headers"])
+ env.Prepend(CPPPATH=["#platform/linuxbsd"])
+ if env["use_sowrap"]:
+ env.Prepend(CPPPATH=["#thirdparty/linuxbsd_headers"])
env.Append(
CPPDEFINES=[
@@ -309,6 +379,35 @@ def configure(env: "Environment"):
)
if env["x11"]:
+ if not env["use_sowrap"]:
+ if os.system("pkg-config --exists x11"):
+ print("Error: X11 libraries not found. Aborting.")
+ sys.exit(255)
+ env.ParseConfig("pkg-config x11 --cflags --libs")
+ if os.system("pkg-config --exists xcursor"):
+ print("Error: Xcursor library not found. Aborting.")
+ sys.exit(255)
+ env.ParseConfig("pkg-config xcursor --cflags --libs")
+ if os.system("pkg-config --exists xinerama"):
+ print("Error: Xinerama library not found. Aborting.")
+ sys.exit(255)
+ env.ParseConfig("pkg-config xinerama --cflags --libs")
+ if os.system("pkg-config --exists xext"):
+ print("Error: Xext library not found. Aborting.")
+ sys.exit(255)
+ env.ParseConfig("pkg-config xext --cflags --libs")
+ if os.system("pkg-config --exists xrandr"):
+ print("Error: XrandR library not found. Aborting.")
+ sys.exit(255)
+ env.ParseConfig("pkg-config xrandr --cflags --libs")
+ if os.system("pkg-config --exists xrender"):
+ print("Error: XRender library not found. Aborting.")
+ sys.exit(255)
+ env.ParseConfig("pkg-config xrender --cflags --libs")
+ if os.system("pkg-config --exists xi"):
+ print("Error: Xi library not found. Aborting.")
+ sys.exit(255)
+ env.ParseConfig("pkg-config xi --cflags --libs")
env.Append(CPPDEFINES=["X11_ENABLED"])
if env["vulkan"]:
diff --git a/platform/linuxbsd/freedesktop_portal_desktop.cpp b/platform/linuxbsd/freedesktop_portal_desktop.cpp
index 72d4e3772f..ec1fcf6698 100644
--- a/platform/linuxbsd/freedesktop_portal_desktop.cpp
+++ b/platform/linuxbsd/freedesktop_portal_desktop.cpp
@@ -36,7 +36,11 @@
#include "core/os/os.h"
#include "core/string/ustring.h"
+#ifdef SOWRAP_ENABLED
#include "dbus-so_wrap.h"
+#else
+#include <dbus/dbus.h>
+#endif
#include "core/variant/variant.h"
@@ -124,12 +128,16 @@ uint32_t FreeDesktopPortalDesktop::get_appearance_color_scheme() {
}
FreeDesktopPortalDesktop::FreeDesktopPortalDesktop() {
+#ifdef SOWRAP_ENABLED
#ifdef DEBUG_ENABLED
int dylibloader_verbose = 1;
#else
int dylibloader_verbose = 0;
#endif
unsupported = (initialize_dbus(dylibloader_verbose) != 0);
+#else
+ unsupported = false;
+#endif
}
#endif // DBUS_ENABLED
diff --git a/platform/linuxbsd/freedesktop_screensaver.cpp b/platform/linuxbsd/freedesktop_screensaver.cpp
index 159fd0df61..d07e781a5f 100644
--- a/platform/linuxbsd/freedesktop_screensaver.cpp
+++ b/platform/linuxbsd/freedesktop_screensaver.cpp
@@ -34,7 +34,11 @@
#include "core/config/project_settings.h"
+#ifdef SOWRAP_ENABLED
#include "dbus-so_wrap.h"
+#else
+#include <dbus/dbus.h>
+#endif
#define BUS_OBJECT_NAME "org.freedesktop.ScreenSaver"
#define BUS_OBJECT_PATH "/org/freedesktop/ScreenSaver"
@@ -127,12 +131,16 @@ void FreeDesktopScreenSaver::uninhibit() {
}
FreeDesktopScreenSaver::FreeDesktopScreenSaver() {
+#ifdef SOWRAP_ENABLED
#ifdef DEBUG_ENABLED
int dylibloader_verbose = 1;
#else
int dylibloader_verbose = 0;
#endif
unsupported = (initialize_dbus(dylibloader_verbose) != 0);
+#else
+ unsupported = false;
+#endif
}
#endif // DBUS_ENABLED
diff --git a/platform/linuxbsd/joypad_linux.cpp b/platform/linuxbsd/joypad_linux.cpp
index b77f989677..0256af0a59 100644
--- a/platform/linuxbsd/joypad_linux.cpp
+++ b/platform/linuxbsd/joypad_linux.cpp
@@ -39,7 +39,11 @@
#include <unistd.h>
#ifdef UDEV_ENABLED
+#ifdef SOWRAP_ENABLED
#include "libudev-so_wrap.h"
+#else
+#include <libudev.h>
+#endif
#endif
#define LONG_BITS (sizeof(long) * 8)
@@ -70,6 +74,7 @@ void JoypadLinux::Joypad::reset() {
JoypadLinux::JoypadLinux(Input *in) {
#ifdef UDEV_ENABLED
+#ifdef SOWRAP_ENABLED
#ifdef DEBUG_ENABLED
int dylibloader_verbose = 1;
#else
@@ -81,6 +86,7 @@ JoypadLinux::JoypadLinux(Input *in) {
} else {
print_verbose("JoypadLinux: udev enabled, but couldn't be loaded. Falling back to /dev/input to detect joypads.");
}
+#endif
#else
print_verbose("JoypadLinux: udev disabled, parsing /dev/input to detect joypads.");
#endif
diff --git a/platform/linuxbsd/os_linuxbsd.cpp b/platform/linuxbsd/os_linuxbsd.cpp
index 41d1f1d050..54bb34ef73 100644
--- a/platform/linuxbsd/os_linuxbsd.cpp
+++ b/platform/linuxbsd/os_linuxbsd.cpp
@@ -1083,12 +1083,16 @@ OS_LinuxBSD::OS_LinuxBSD() {
#endif
#ifdef FONTCONFIG_ENABLED
+#ifdef SOWRAP_ENABLED
#ifdef DEBUG_ENABLED
int dylibloader_verbose = 1;
#else
int dylibloader_verbose = 0;
#endif
font_config_initialized = (initialize_fontconfig(dylibloader_verbose) == 0);
+#else
+ font_config_initialized = true;
+#endif
if (font_config_initialized) {
config = FcInitLoadConfigAndFonts();
if (!config) {
diff --git a/platform/linuxbsd/os_linuxbsd.h b/platform/linuxbsd/os_linuxbsd.h
index 045d3d95ba..9423514944 100644
--- a/platform/linuxbsd/os_linuxbsd.h
+++ b/platform/linuxbsd/os_linuxbsd.h
@@ -41,7 +41,11 @@
#include "servers/audio_server.h"
#ifdef FONTCONFIG_ENABLED
+#ifdef SOWRAP_ENABLED
#include "fontconfig-so_wrap.h"
+#else
+#include <fontconfig/fontconfig.h>
+#endif
#endif
class OS_LinuxBSD : public OS_Unix {
diff --git a/platform/linuxbsd/tts_linux.cpp b/platform/linuxbsd/tts_linux.cpp
index 4662aaf02d..04d7c5444f 100644
--- a/platform/linuxbsd/tts_linux.cpp
+++ b/platform/linuxbsd/tts_linux.cpp
@@ -39,12 +39,18 @@ void TTS_Linux::speech_init_thread_func(void *p_userdata) {
TTS_Linux *tts = (TTS_Linux *)p_userdata;
if (tts) {
MutexLock thread_safe_method(tts->_thread_safe_);
+#ifdef SOWRAP_ENABLED
#ifdef DEBUG_ENABLED
int dylibloader_verbose = 1;
#else
int dylibloader_verbose = 0;
#endif
- if (initialize_speechd(dylibloader_verbose) == 0) {
+ if (initialize_speechd(dylibloader_verbose) != 0) {
+ print_verbose("Text-to-Speech: Cannot load Speech Dispatcher library!");
+ } else {
+#else
+ {
+#endif
CharString class_str;
String config_name = GLOBAL_GET("application/config/name");
if (config_name.length() == 0) {
@@ -64,8 +70,6 @@ void TTS_Linux::speech_init_thread_func(void *p_userdata) {
} else {
print_verbose("Text-to-Speech: Cannot initialize Speech Dispatcher synthesizer!");
}
- } else {
- print_verbose("Text-to-Speech: Cannot load Speech Dispatcher library!");
}
}
}
diff --git a/platform/linuxbsd/tts_linux.h b/platform/linuxbsd/tts_linux.h
index 425654d975..3fe7b659d0 100644
--- a/platform/linuxbsd/tts_linux.h
+++ b/platform/linuxbsd/tts_linux.h
@@ -39,7 +39,11 @@
#include "core/variant/array.h"
#include "servers/display_server.h"
+#ifdef SOWRAP_ENABLED
#include "speechd-so_wrap.h"
+#else
+#include <libspeechd.h>
+#endif
class TTS_Linux {
_THREAD_SAFE_CLASS_
diff --git a/platform/linuxbsd/x11/SCsub b/platform/linuxbsd/x11/SCsub
index 8b2e2aabe4..a4890391ce 100644
--- a/platform/linuxbsd/x11/SCsub
+++ b/platform/linuxbsd/x11/SCsub
@@ -5,15 +5,21 @@ Import("env")
source_files = [
"display_server_x11.cpp",
"key_mapping_x11.cpp",
- "dynwrappers/xlib-so_wrap.c",
- "dynwrappers/xcursor-so_wrap.c",
- "dynwrappers/xinerama-so_wrap.c",
- "dynwrappers/xinput2-so_wrap.c",
- "dynwrappers/xrandr-so_wrap.c",
- "dynwrappers/xrender-so_wrap.c",
- "dynwrappers/xext-so_wrap.c",
]
+if env["use_sowrap"]:
+ source_files.append(
+ [
+ "dynwrappers/xlib-so_wrap.c",
+ "dynwrappers/xcursor-so_wrap.c",
+ "dynwrappers/xinerama-so_wrap.c",
+ "dynwrappers/xinput2-so_wrap.c",
+ "dynwrappers/xrandr-so_wrap.c",
+ "dynwrappers/xrender-so_wrap.c",
+ "dynwrappers/xext-so_wrap.c",
+ ]
+ )
+
if env["vulkan"]:
source_files.append("vulkan_context_x11.cpp")
diff --git a/platform/linuxbsd/x11/detect_prime_x11.cpp b/platform/linuxbsd/x11/detect_prime_x11.cpp
index 8d586599e6..3d07be1c76 100644
--- a/platform/linuxbsd/x11/detect_prime_x11.cpp
+++ b/platform/linuxbsd/x11/detect_prime_x11.cpp
@@ -41,7 +41,13 @@
#include "thirdparty/glad/glad/gl.h"
#include "thirdparty/glad/glad/glx.h"
+#ifdef SOWRAP_ENABLED
#include "dynwrappers/xlib-so_wrap.h"
+#else
+#include <X11/XKBlib.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#endif
#include <cstring>
diff --git a/platform/linuxbsd/x11/display_server_x11.cpp b/platform/linuxbsd/x11/display_server_x11.cpp
index 5d70af56bd..dff2f536a8 100644
--- a/platform/linuxbsd/x11/display_server_x11.cpp
+++ b/platform/linuxbsd/x11/display_server_x11.cpp
@@ -1329,12 +1329,14 @@ void DisplayServerX11::delete_sub_window(WindowID p_id) {
wd.xic = nullptr;
}
XDestroyWindow(x11_display, wd.x11_xim_window);
+#ifdef XKB_ENABLED
if (xkb_loaded) {
if (wd.xkb_state) {
xkb_compose_state_unref(wd.xkb_state);
wd.xkb_state = nullptr;
}
}
+#endif
XUnmapWindow(x11_display, wd.x11_window);
XDestroyWindow(x11_display, wd.x11_window);
@@ -2055,6 +2057,22 @@ void DisplayServerX11::_validate_mode_on_map(WindowID p_window) {
} else if (wd.minimized && !_window_minimize_check(p_window)) {
_set_wm_minimized(p_window, true);
}
+
+ if (wd.on_top) {
+ Atom wm_state = XInternAtom(x11_display, "_NET_WM_STATE", False);
+ Atom wm_above = XInternAtom(x11_display, "_NET_WM_STATE_ABOVE", False);
+
+ XClientMessageEvent xev;
+ memset(&xev, 0, sizeof(xev));
+ xev.type = ClientMessage;
+ xev.window = wd.x11_window;
+ xev.message_type = wm_state;
+ xev.format = 32;
+ xev.data.l[0] = _NET_WM_STATE_ADD;
+ xev.data.l[1] = wm_above;
+ xev.data.l[3] = 1;
+ XSendEvent(x11_display, DefaultRootWindow(x11_display), False, SubstructureRedirectMask | SubstructureNotifyMask, (XEvent *)&xev);
+ }
}
bool DisplayServerX11::window_is_maximize_allowed(WindowID p_window) const {
@@ -2597,6 +2615,8 @@ DisplayServerX11::CursorShape DisplayServerX11::cursor_get_shape() const {
void DisplayServerX11::cursor_set_custom_image(const Ref<Resource> &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) {
_THREAD_SAFE_METHOD_
+ ERR_FAIL_INDEX(p_shape, CURSOR_MAX);
+
if (p_cursor.is_valid()) {
HashMap<CursorShape, Vector<Variant>>::Iterator cursor_c = cursors_cache.find(p_shape);
@@ -2942,11 +2962,13 @@ void DisplayServerX11::_handle_key_event(WindowID p_window, XKeyEvent *p_event,
XLookupString(&xkeyevent_no_mod, nullptr, 0, &keysym_keycode, nullptr);
String keysym;
+#ifdef XKB_ENABLED
if (xkb_loaded) {
KeySym keysym_unicode_nm = 0; // keysym used to find unicode
XLookupString(&xkeyevent_no_mod, nullptr, 0, &keysym_unicode_nm, nullptr);
keysym = String::chr(xkb_keysym_to_utf32(xkb_keysym_to_upper(keysym_unicode_nm)));
}
+#endif
// Meanwhile, XLookupString returns keysyms useful for unicode.
@@ -3035,6 +3057,7 @@ void DisplayServerX11::_handle_key_event(WindowID p_window, XKeyEvent *p_event,
}
} while (status == XBufferOverflow);
#endif
+#ifdef XKB_ENABLED
} else if (xkeyevent->type == KeyPress && wd.xkb_state && xkb_loaded) {
xkb_compose_feed_result res = xkb_compose_state_feed(wd.xkb_state, keysym_unicode);
if (res == XKB_COMPOSE_FEED_ACCEPTED) {
@@ -3093,6 +3116,7 @@ void DisplayServerX11::_handle_key_event(WindowID p_window, XKeyEvent *p_event,
return;
}
}
+#endif
}
/* Phase 2, obtain a Godot keycode from the keysym */
@@ -4948,11 +4972,11 @@ DisplayServerX11::WindowID DisplayServerX11::_create_window(WindowMode p_mode, V
window_attributes_ime.event_mask = KeyPressMask | KeyReleaseMask | StructureNotifyMask | ExposureMask;
wd.x11_xim_window = XCreateWindow(x11_display, wd.x11_window, 0, 0, 1, 1, 0, CopyFromParent, InputOnly, CopyFromParent, CWEventMask, &window_attributes_ime);
-
+#ifdef XKB_ENABLED
if (dead_tbl && xkb_loaded) {
wd.xkb_state = xkb_compose_state_new(dead_tbl, XKB_COMPOSE_STATE_NO_FLAGS);
}
-
+#endif
// Enable receiving notification when the window is initialized (MapNotify)
// so the focus can be set at the right time.
if (!wd.no_focus && !wd.is_popup) {
@@ -5217,6 +5241,7 @@ static ::XIMStyle _get_best_xim_style(const ::XIMStyle &p_style_a, const ::XIMSt
DisplayServerX11::DisplayServerX11(const String &p_rendering_driver, WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Vector2i *p_position, const Vector2i &p_resolution, int p_screen, Error &r_error) {
KeyMappingX11::initialize();
+#ifdef SOWRAP_ENABLED
#ifdef DEBUG_ENABLED
int dylibloader_verbose = 1;
#else
@@ -5231,9 +5256,9 @@ DisplayServerX11::DisplayServerX11(const String &p_rendering_driver, WindowMode
r_error = ERR_UNAVAILABLE;
ERR_FAIL_MSG("Can't load XCursor dynamically.");
}
-
+#ifdef XKB_ENABLED
xkb_loaded = (initialize_xkbcommon(dylibloader_verbose) == 0);
-
+#endif
if (initialize_xext(dylibloader_verbose) != 0) {
r_error = ERR_UNAVAILABLE;
ERR_FAIL_MSG("Can't load Xext dynamically.");
@@ -5258,7 +5283,13 @@ DisplayServerX11::DisplayServerX11(const String &p_rendering_driver, WindowMode
r_error = ERR_UNAVAILABLE;
ERR_FAIL_MSG("Can't load Xinput2 dynamically.");
}
+#else
+#ifdef XKB_ENABLED
+ xkb_loaded = true;
+#endif
+#endif
+#ifdef XKB_ENABLED
if (xkb_loaded) {
xkb_ctx = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
if (xkb_ctx) {
@@ -5275,6 +5306,7 @@ DisplayServerX11::DisplayServerX11(const String &p_rendering_driver, WindowMode
dead_tbl = xkb_compose_table_new_from_locale(xkb_ctx, locale, XKB_COMPOSE_COMPILE_NO_FLAGS);
}
}
+#endif
Input::get_singleton()->set_event_dispatch_function(_dispatch_input_events);
@@ -5717,16 +5749,19 @@ DisplayServerX11::~DisplayServerX11() {
wd.xic = nullptr;
}
XDestroyWindow(x11_display, wd.x11_xim_window);
+#ifdef XKB_ENABLED
if (xkb_loaded) {
if (wd.xkb_state) {
xkb_compose_state_unref(wd.xkb_state);
wd.xkb_state = nullptr;
}
}
+#endif
XUnmapWindow(x11_display, wd.x11_window);
XDestroyWindow(x11_display, wd.x11_window);
}
+#ifdef XKB_ENABLED
if (xkb_loaded) {
if (dead_tbl) {
xkb_compose_table_unref(dead_tbl);
@@ -5735,6 +5770,7 @@ DisplayServerX11::~DisplayServerX11() {
xkb_context_unref(xkb_ctx);
}
}
+#endif
//destroy drivers
#if defined(VULKAN_ENABLED)
diff --git a/platform/linuxbsd/x11/display_server_x11.h b/platform/linuxbsd/x11/display_server_x11.h
index ea54b42262..dbe8a0ce2b 100644
--- a/platform/linuxbsd/x11/display_server_x11.h
+++ b/platform/linuxbsd/x11/display_server_x11.h
@@ -36,6 +36,8 @@
#include "servers/display_server.h"
#include "core/input/input.h"
+#include "core/os/mutex.h"
+#include "core/os/thread.h"
#include "core/templates/local_vector.h"
#include "drivers/alsa/audio_driver_alsa.h"
#include "drivers/alsamidi/midi_driver_alsamidi.h"
@@ -69,6 +71,7 @@
#include <X11/Xutil.h>
#include <X11/keysym.h>
+#ifdef SOWRAP_ENABLED
#include "dynwrappers/xlib-so_wrap.h"
#include "dynwrappers/xcursor-so_wrap.h"
@@ -79,6 +82,25 @@
#include "dynwrappers/xrender-so_wrap.h"
#include "../xkbcommon-so_wrap.h"
+#else
+#include <X11/XKBlib.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+
+#include <X11/Xcursor/Xcursor.h>
+#include <X11/extensions/XInput2.h>
+#include <X11/extensions/Xext.h>
+#include <X11/extensions/Xinerama.h>
+#include <X11/extensions/Xrandr.h>
+#include <X11/extensions/Xrender.h>
+#include <X11/extensions/shape.h>
+
+#ifdef XKB_ENABLED
+#include <xkbcommon/xkbcommon-compose.h>
+#include <xkbcommon/xkbcommon-keysyms.h>
+#include <xkbcommon/xkbcommon.h>
+#endif
+#endif
typedef struct _xrr_monitor_info {
Atom name;
@@ -142,7 +164,9 @@ class DisplayServerX11 : public DisplayServer {
bool ime_active = false;
bool ime_in_progress = false;
bool ime_suppress_next_keyup = false;
+#ifdef XKB_ENABLED
xkb_compose_state *xkb_state = nullptr;
+#endif
Size2i min_size;
Size2i max_size;
@@ -186,9 +210,11 @@ class DisplayServerX11 : public DisplayServer {
Point2i im_selection;
String im_text;
+#ifdef XKB_ENABLED
bool xkb_loaded = false;
xkb_context *xkb_ctx = nullptr;
xkb_compose_table *dead_tbl = nullptr;
+#endif
HashMap<WindowID, WindowData> windows;
diff --git a/platform/linuxbsd/x11/gl_manager_x11.h b/platform/linuxbsd/x11/gl_manager_x11.h
index 713b13376c..0eb8ab64f4 100644
--- a/platform/linuxbsd/x11/gl_manager_x11.h
+++ b/platform/linuxbsd/x11/gl_manager_x11.h
@@ -37,9 +37,22 @@
#include "core/os/os.h"
#include "core/templates/local_vector.h"
-#include "dynwrappers/xext-so_wrap.h"
+
+#ifdef SOWRAP_ENABLED
#include "dynwrappers/xlib-so_wrap.h"
+
+#include "dynwrappers/xext-so_wrap.h"
#include "dynwrappers/xrender-so_wrap.h"
+#else
+#include <X11/XKBlib.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+
+#include <X11/extensions/Xext.h>
+#include <X11/extensions/Xrender.h>
+#include <X11/extensions/shape.h>
+#endif
+
#include "servers/display_server.h"
struct GLManager_X11_Private;
diff --git a/platform/macos/display_server_macos.mm b/platform/macos/display_server_macos.mm
index 65546392c1..14778b5f03 100644
--- a/platform/macos/display_server_macos.mm
+++ b/platform/macos/display_server_macos.mm
@@ -3284,6 +3284,8 @@ DisplayServerMacOS::CursorShape DisplayServerMacOS::cursor_get_shape() const {
void DisplayServerMacOS::cursor_set_custom_image(const Ref<Resource> &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) {
_THREAD_SAFE_METHOD_
+ ERR_FAIL_INDEX(p_shape, CURSOR_MAX);
+
if (p_cursor.is_valid()) {
HashMap<CursorShape, Vector<Variant>>::Iterator cursor_c = cursors_cache.find(p_shape);
diff --git a/platform/macos/export/export_plugin.cpp b/platform/macos/export/export_plugin.cpp
index bb96308a75..5a097adf39 100644
--- a/platform/macos/export/export_plugin.cpp
+++ b/platform/macos/export/export_plugin.cpp
@@ -137,7 +137,7 @@ void EditorExportPlatformMacOS::get_export_options(List<ExportOption> *r_options
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/version"), "1.0"));
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "application/copyright"), ""));
r_options->push_back(ExportOption(PropertyInfo(Variant::DICTIONARY, "application/copyright_localized", PROPERTY_HINT_LOCALIZABLE_STRING), Dictionary()));
- r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "display/high_res"), false));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "display/high_res"), true));
#ifdef MACOS_ENABLED
r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "codesign/codesign", PROPERTY_HINT_ENUM, "Disabled,Built-in (ad-hoc only),rcodesign,Xcode codesign"), 3, true));
diff --git a/platform/web/display_server_web.cpp b/platform/web/display_server_web.cpp
index e89a79834b..565d439a92 100644
--- a/platform/web/display_server_web.cpp
+++ b/platform/web/display_server_web.cpp
@@ -395,6 +395,7 @@ DisplayServer::CursorShape DisplayServerWeb::cursor_get_shape() const {
}
void DisplayServerWeb::cursor_set_custom_image(const Ref<Resource> &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) {
+ ERR_FAIL_INDEX(p_shape, CURSOR_MAX);
if (p_cursor.is_valid()) {
Ref<Texture2D> texture = p_cursor;
Ref<AtlasTexture> atlas_texture = p_cursor;
diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp
index 1cfc9c9f47..d2889a3442 100644
--- a/platform/windows/display_server_windows.cpp
+++ b/platform/windows/display_server_windows.cpp
@@ -1719,6 +1719,8 @@ DisplayServer::CursorShape DisplayServerWindows::cursor_get_shape() const {
void DisplayServerWindows::cursor_set_custom_image(const Ref<Resource> &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) {
_THREAD_SAFE_METHOD_
+ ERR_FAIL_INDEX(p_shape, CURSOR_MAX);
+
if (p_cursor.is_valid()) {
RBMap<CursorShape, Vector<Variant>>::Element *cursor_c = cursors_cache.find(p_shape);
diff --git a/scene/2d/audio_stream_player_2d.cpp b/scene/2d/audio_stream_player_2d.cpp
index 902fba38bf..c175edb6cb 100644
--- a/scene/2d/audio_stream_player_2d.cpp
+++ b/scene/2d/audio_stream_player_2d.cpp
@@ -234,7 +234,7 @@ float AudioStreamPlayer2D::get_volume_db() const {
}
void AudioStreamPlayer2D::set_pitch_scale(float p_pitch_scale) {
- ERR_FAIL_COND(p_pitch_scale <= 0.0);
+ ERR_FAIL_COND(!(p_pitch_scale > 0.0));
pitch_scale = p_pitch_scale;
for (Ref<AudioStreamPlayback> &playback : stream_playbacks) {
AudioServer::get_singleton()->set_playback_pitch_scale(playback, p_pitch_scale);
diff --git a/scene/2d/cpu_particles_2d.cpp b/scene/2d/cpu_particles_2d.cpp
index afd4763d74..04c7555306 100644
--- a/scene/2d/cpu_particles_2d.cpp
+++ b/scene/2d/cpu_particles_2d.cpp
@@ -1402,8 +1402,8 @@ void CPUParticles2D::_bind_methods() {
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "tangential_accel_max", PROPERTY_HINT_RANGE, "-100,100,0.01,or_less,or_greater"), "set_param_max", "get_param_max", PARAM_TANGENTIAL_ACCEL);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "tangential_accel_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_TANGENTIAL_ACCEL);
ADD_GROUP("Damping", "");
- ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "damping_min", PROPERTY_HINT_RANGE, "0,100,0.01"), "set_param_min", "get_param_min", PARAM_DAMPING);
- ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "damping_max", PROPERTY_HINT_RANGE, "0,100,0.01"), "set_param_max", "get_param_max", PARAM_DAMPING);
+ ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "damping_min", PROPERTY_HINT_RANGE, "0,100,0.01,or_greater"), "set_param_min", "get_param_min", PARAM_DAMPING);
+ ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "damping_max", PROPERTY_HINT_RANGE, "0,100,0.01,or_greater"), "set_param_max", "get_param_max", PARAM_DAMPING);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "damping_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_DAMPING);
ADD_GROUP("Angle", "");
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angle_min", PROPERTY_HINT_RANGE, "-720,720,0.1,or_less,or_greater,degrees"), "set_param_min", "get_param_min", PARAM_ANGLE);
diff --git a/scene/2d/navigation_agent_2d.cpp b/scene/2d/navigation_agent_2d.cpp
index 52a1213a49..bfe2f6252e 100644
--- a/scene/2d/navigation_agent_2d.cpp
+++ b/scene/2d/navigation_agent_2d.cpp
@@ -31,6 +31,7 @@
#include "navigation_agent_2d.h"
#include "core/math/geometry_2d.h"
+#include "scene/2d/navigation_link_2d.h"
#include "scene/resources/world_2d.h"
#include "servers/navigation_server_2d.h"
@@ -94,19 +95,19 @@ void NavigationAgent2D::_bind_methods() {
ADD_GROUP("Pathfinding", "");
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "target_position", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NO_EDITOR), "set_target_position", "get_target_position");
- ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "path_desired_distance", PROPERTY_HINT_RANGE, "0.1,1000,0.01,suffix:px"), "set_path_desired_distance", "get_path_desired_distance");
- ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "target_desired_distance", PROPERTY_HINT_RANGE, "0.1,1000,0.01,suffix:px"), "set_target_desired_distance", "get_target_desired_distance");
- ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "path_max_distance", PROPERTY_HINT_RANGE, "10,1000,1,suffix:px"), "set_path_max_distance", "get_path_max_distance");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "path_desired_distance", PROPERTY_HINT_RANGE, "0.1,1000,0.01,or_greater,suffix:px"), "set_path_desired_distance", "get_path_desired_distance");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "target_desired_distance", PROPERTY_HINT_RANGE, "0.1,1000,0.01,or_greater,suffix:px"), "set_target_desired_distance", "get_target_desired_distance");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "path_max_distance", PROPERTY_HINT_RANGE, "10,1000,1,or_greater,suffix:px"), "set_path_max_distance", "get_path_max_distance");
ADD_PROPERTY(PropertyInfo(Variant::INT, "navigation_layers", PROPERTY_HINT_LAYERS_2D_NAVIGATION), "set_navigation_layers", "get_navigation_layers");
ADD_PROPERTY(PropertyInfo(Variant::INT, "path_metadata_flags", PROPERTY_HINT_FLAGS, "Include Types,Include RIDs,Include Owners"), "set_path_metadata_flags", "get_path_metadata_flags");
ADD_GROUP("Avoidance", "");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "avoidance_enabled"), "set_avoidance_enabled", "get_avoidance_enabled");
- ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "radius", PROPERTY_HINT_RANGE, "0.1,500,0.01,suffix:px"), "set_radius", "get_radius");
- ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "neighbor_distance", PROPERTY_HINT_RANGE, "0.1,100000,0.01,suffix:px"), "set_neighbor_distance", "get_neighbor_distance");
- ADD_PROPERTY(PropertyInfo(Variant::INT, "max_neighbors", PROPERTY_HINT_RANGE, "1,10000,1"), "set_max_neighbors", "get_max_neighbors");
- ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "time_horizon", PROPERTY_HINT_RANGE, "0.1,10,0.01,suffix:s"), "set_time_horizon", "get_time_horizon");
- ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "max_speed", PROPERTY_HINT_RANGE, "0.1,10000,0.01,suffix:px/s"), "set_max_speed", "get_max_speed");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "radius", PROPERTY_HINT_RANGE, "0.1,500,0.01,or_greater,suffix:px"), "set_radius", "get_radius");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "neighbor_distance", PROPERTY_HINT_RANGE, "0.1,100000,0.01,or_greater,suffix:px"), "set_neighbor_distance", "get_neighbor_distance");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "max_neighbors", PROPERTY_HINT_RANGE, "1,10000,or_greater,1"), "set_max_neighbors", "get_max_neighbors");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "time_horizon", PROPERTY_HINT_RANGE, "0.1,10,0.01,or_greater,suffix:s"), "set_time_horizon", "get_time_horizon");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "max_speed", PROPERTY_HINT_RANGE, "0.1,10000,0.01,or_greater,suffix:px/s"), "set_max_speed", "get_max_speed");
ClassDB::bind_method(D_METHOD("set_debug_enabled", "enabled"), &NavigationAgent2D::set_debug_enabled);
ClassDB::bind_method(D_METHOD("get_debug_enabled"), &NavigationAgent2D::get_debug_enabled);
@@ -623,6 +624,21 @@ void NavigationAgent2D::update_navigation() {
}
details[SNAME("owner")] = owner;
+
+ if (waypoint_type == NavigationPathQueryResult2D::PATH_SEGMENT_TYPE_LINK) {
+ const NavigationLink2D *navlink = Object::cast_to<NavigationLink2D>(owner);
+ if (navlink) {
+ Vector2 link_global_start_position = navlink->get_global_start_position();
+ Vector2 link_global_end_position = navlink->get_global_end_position();
+ if (waypoint.distance_to(link_global_start_position) < waypoint.distance_to(link_global_end_position)) {
+ details[SNAME("link_entry_position")] = link_global_start_position;
+ details[SNAME("link_exit_position")] = link_global_end_position;
+ } else {
+ details[SNAME("link_entry_position")] = link_global_end_position;
+ details[SNAME("link_exit_position")] = link_global_start_position;
+ }
+ }
+ }
}
// Emit a signal for the waypoint
diff --git a/scene/2d/navigation_link_2d.cpp b/scene/2d/navigation_link_2d.cpp
index 26dca40176..8adb7c6305 100644
--- a/scene/2d/navigation_link_2d.cpp
+++ b/scene/2d/navigation_link_2d.cpp
@@ -54,6 +54,12 @@ void NavigationLink2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_end_position", "position"), &NavigationLink2D::set_end_position);
ClassDB::bind_method(D_METHOD("get_end_position"), &NavigationLink2D::get_end_position);
+ ClassDB::bind_method(D_METHOD("set_global_start_position", "position"), &NavigationLink2D::set_global_start_position);
+ ClassDB::bind_method(D_METHOD("get_global_start_position"), &NavigationLink2D::get_global_start_position);
+
+ ClassDB::bind_method(D_METHOD("set_global_end_position", "position"), &NavigationLink2D::set_global_end_position);
+ ClassDB::bind_method(D_METHOD("get_global_end_position"), &NavigationLink2D::get_global_end_position);
+
ClassDB::bind_method(D_METHOD("set_enter_cost", "enter_cost"), &NavigationLink2D::set_enter_cost);
ClassDB::bind_method(D_METHOD("get_enter_cost"), &NavigationLink2D::get_enter_cost);
@@ -271,6 +277,38 @@ void NavigationLink2D::set_end_position(Vector2 p_position) {
#endif // DEBUG_ENABLED
}
+void NavigationLink2D::set_global_start_position(Vector2 p_position) {
+ if (is_inside_tree()) {
+ set_start_position(to_local(p_position));
+ } else {
+ set_start_position(p_position);
+ }
+}
+
+Vector2 NavigationLink2D::get_global_start_position() const {
+ if (is_inside_tree()) {
+ return to_global(start_position);
+ } else {
+ return start_position;
+ }
+}
+
+void NavigationLink2D::set_global_end_position(Vector2 p_position) {
+ if (is_inside_tree()) {
+ set_end_position(to_local(p_position));
+ } else {
+ set_end_position(p_position);
+ }
+}
+
+Vector2 NavigationLink2D::get_global_end_position() const {
+ if (is_inside_tree()) {
+ return to_global(end_position);
+ } else {
+ return end_position;
+ }
+}
+
void NavigationLink2D::set_enter_cost(real_t p_enter_cost) {
ERR_FAIL_COND_MSG(p_enter_cost < 0.0, "The enter_cost must be positive.");
if (Math::is_equal_approx(enter_cost, p_enter_cost)) {
diff --git a/scene/2d/navigation_link_2d.h b/scene/2d/navigation_link_2d.h
index 5bf2a72358..8a24d611c9 100644
--- a/scene/2d/navigation_link_2d.h
+++ b/scene/2d/navigation_link_2d.h
@@ -78,6 +78,12 @@ public:
void set_end_position(Vector2 p_position);
Vector2 get_end_position() const { return end_position; }
+ void set_global_start_position(Vector2 p_position);
+ Vector2 get_global_start_position() const;
+
+ void set_global_end_position(Vector2 p_position);
+ Vector2 get_global_end_position() const;
+
void set_enter_cost(real_t p_enter_cost);
real_t get_enter_cost() const { return enter_cost; }
diff --git a/scene/2d/skeleton_2d.cpp b/scene/2d/skeleton_2d.cpp
index 96711bbe72..4fdc7b3584 100644
--- a/scene/2d/skeleton_2d.cpp
+++ b/scene/2d/skeleton_2d.cpp
@@ -378,9 +378,6 @@ void Bone2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_skeleton_rest"), &Bone2D::get_skeleton_rest);
ClassDB::bind_method(D_METHOD("get_index_in_skeleton"), &Bone2D::get_index_in_skeleton);
- ClassDB::bind_method(D_METHOD("set_default_length", "default_length"), &Bone2D::set_default_length);
- ClassDB::bind_method(D_METHOD("get_default_length"), &Bone2D::get_default_length);
-
ClassDB::bind_method(D_METHOD("set_autocalculate_length_and_angle", "auto_calculate"), &Bone2D::set_autocalculate_length_and_angle);
ClassDB::bind_method(D_METHOD("get_autocalculate_length_and_angle"), &Bone2D::get_autocalculate_length_and_angle);
ClassDB::bind_method(D_METHOD("set_length", "length"), &Bone2D::set_length);
@@ -416,16 +413,6 @@ void Bone2D::apply_rest() {
set_transform(rest);
}
-void Bone2D::set_default_length(real_t p_length) {
- WARN_DEPRECATED_MSG("set_default_length is deprecated. Please use set_length instead!");
- set_length(p_length);
-}
-
-real_t Bone2D::get_default_length() const {
- WARN_DEPRECATED_MSG("get_default_length is deprecated. Please use get_length instead!");
- return get_length();
-}
-
int Bone2D::get_index_in_skeleton() const {
ERR_FAIL_COND_V(!skeleton, -1);
skeleton->_update_bone_setup();
diff --git a/scene/2d/skeleton_2d.h b/scene/2d/skeleton_2d.h
index 149ab64306..6a36a31552 100644
--- a/scene/2d/skeleton_2d.h
+++ b/scene/2d/skeleton_2d.h
@@ -80,9 +80,6 @@ public:
PackedStringArray get_configuration_warnings() const override;
- void set_default_length(real_t p_length);
- real_t get_default_length() const;
-
void set_autocalculate_length_and_angle(bool p_autocalculate);
bool get_autocalculate_length_and_angle() const;
void set_length(real_t p_length);
diff --git a/scene/2d/touch_screen_button.cpp b/scene/2d/touch_screen_button.cpp
index 54ed96f585..1c2903fe22 100644
--- a/scene/2d/touch_screen_button.cpp
+++ b/scene/2d/touch_screen_button.cpp
@@ -194,10 +194,6 @@ void TouchScreenButton::input(const Ref<InputEvent> &p_event) {
return;
}
- if (p_event->get_device() != 0) {
- return;
- }
-
const InputEventScreenTouch *st = Object::cast_to<InputEventScreenTouch>(*p_event);
if (passby_press) {
diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp
index 77bf15125e..ac626d0d2a 100644
--- a/scene/3d/audio_stream_player_3d.cpp
+++ b/scene/3d/audio_stream_player_3d.cpp
@@ -559,7 +559,7 @@ float AudioStreamPlayer3D::get_max_db() const {
}
void AudioStreamPlayer3D::set_pitch_scale(float p_pitch_scale) {
- ERR_FAIL_COND(p_pitch_scale <= 0.0);
+ ERR_FAIL_COND(!(p_pitch_scale > 0.0));
pitch_scale = p_pitch_scale;
}
diff --git a/scene/3d/cpu_particles_3d.cpp b/scene/3d/cpu_particles_3d.cpp
index b9a161e476..c88eb033de 100644
--- a/scene/3d/cpu_particles_3d.cpp
+++ b/scene/3d/cpu_particles_3d.cpp
@@ -1588,8 +1588,8 @@ void CPUParticles3D::_bind_methods() {
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "tangential_accel_max", PROPERTY_HINT_RANGE, "-100,100,0.01,or_less,or_greater"), "set_param_max", "get_param_max", PARAM_TANGENTIAL_ACCEL);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "tangential_accel_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_TANGENTIAL_ACCEL);
ADD_GROUP("Damping", "");
- ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "damping_min", PROPERTY_HINT_RANGE, "0,100,0.01"), "set_param_min", "get_param_min", PARAM_DAMPING);
- ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "damping_max", PROPERTY_HINT_RANGE, "0,100,0.01"), "set_param_max", "get_param_max", PARAM_DAMPING);
+ ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "damping_min", PROPERTY_HINT_RANGE, "0,100,0.01,or_greater"), "set_param_min", "get_param_min", PARAM_DAMPING);
+ ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "damping_max", PROPERTY_HINT_RANGE, "0,100,0.01,or_greater"), "set_param_max", "get_param_max", PARAM_DAMPING);
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "damping_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_DAMPING);
ADD_GROUP("Angle", "");
ADD_PROPERTYI(PropertyInfo(Variant::FLOAT, "angle_min", PROPERTY_HINT_RANGE, "-720,720,0.1,or_less,or_greater,degrees"), "set_param_min", "get_param_min", PARAM_ANGLE);
diff --git a/scene/3d/navigation_agent_3d.cpp b/scene/3d/navigation_agent_3d.cpp
index 16f357194e..396e4b72af 100644
--- a/scene/3d/navigation_agent_3d.cpp
+++ b/scene/3d/navigation_agent_3d.cpp
@@ -30,6 +30,7 @@
#include "navigation_agent_3d.h"
+#include "scene/3d/navigation_link_3d.h"
#include "servers/navigation_server_3d.h"
void NavigationAgent3D::_bind_methods() {
@@ -98,20 +99,20 @@ void NavigationAgent3D::_bind_methods() {
ADD_GROUP("Pathfinding", "");
ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "target_position", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NO_EDITOR), "set_target_position", "get_target_position");
- ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "path_desired_distance", PROPERTY_HINT_RANGE, "0.1,100,0.01,suffix:m"), "set_path_desired_distance", "get_path_desired_distance");
- ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "target_desired_distance", PROPERTY_HINT_RANGE, "0.1,100,0.01,suffix:m"), "set_target_desired_distance", "get_target_desired_distance");
- ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "agent_height_offset", PROPERTY_HINT_RANGE, "-100.0,100,0.01,suffix:m"), "set_agent_height_offset", "get_agent_height_offset");
- ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "path_max_distance", PROPERTY_HINT_RANGE, "0.01,100,0.1,suffix:m"), "set_path_max_distance", "get_path_max_distance");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "path_desired_distance", PROPERTY_HINT_RANGE, "0.1,100,0.01,or_greater,suffix:m"), "set_path_desired_distance", "get_path_desired_distance");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "target_desired_distance", PROPERTY_HINT_RANGE, "0.1,100,0.01,or_greater,suffix:m"), "set_target_desired_distance", "get_target_desired_distance");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "agent_height_offset", PROPERTY_HINT_RANGE, "-100.0,100,0.01,or_greater,suffix:m"), "set_agent_height_offset", "get_agent_height_offset");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "path_max_distance", PROPERTY_HINT_RANGE, "0.01,100,0.1,or_greater,suffix:m"), "set_path_max_distance", "get_path_max_distance");
ADD_PROPERTY(PropertyInfo(Variant::INT, "navigation_layers", PROPERTY_HINT_LAYERS_3D_NAVIGATION), "set_navigation_layers", "get_navigation_layers");
ADD_PROPERTY(PropertyInfo(Variant::INT, "path_metadata_flags", PROPERTY_HINT_FLAGS, "Include Types,Include RIDs,Include Owners"), "set_path_metadata_flags", "get_path_metadata_flags");
ADD_GROUP("Avoidance", "");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "avoidance_enabled"), "set_avoidance_enabled", "get_avoidance_enabled");
- ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "radius", PROPERTY_HINT_RANGE, "0.1,100,0.01,suffix:m"), "set_radius", "get_radius");
- ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "neighbor_distance", PROPERTY_HINT_RANGE, "0.1,10000,0.01,suffix:m"), "set_neighbor_distance", "get_neighbor_distance");
- ADD_PROPERTY(PropertyInfo(Variant::INT, "max_neighbors", PROPERTY_HINT_RANGE, "1,10000,1"), "set_max_neighbors", "get_max_neighbors");
- ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "time_horizon", PROPERTY_HINT_RANGE, "0.01,100,0.01,suffix:s"), "set_time_horizon", "get_time_horizon");
- ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "max_speed", PROPERTY_HINT_RANGE, "0.1,10000,0.01,suffix:m/s"), "set_max_speed", "get_max_speed");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "radius", PROPERTY_HINT_RANGE, "0.1,100,0.01,or_greater,suffix:m"), "set_radius", "get_radius");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "neighbor_distance", PROPERTY_HINT_RANGE, "0.1,10000,0.01,or_greater,suffix:m"), "set_neighbor_distance", "get_neighbor_distance");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "max_neighbors", PROPERTY_HINT_RANGE, "1,10000,1,or_greater"), "set_max_neighbors", "get_max_neighbors");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "time_horizon", PROPERTY_HINT_RANGE, "0.01,10,0.01,or_greater,suffix:s"), "set_time_horizon", "get_time_horizon");
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "max_speed", PROPERTY_HINT_RANGE, "0.1,1000,0.01,or_greater,suffix:m/s"), "set_max_speed", "get_max_speed");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "ignore_y"), "set_ignore_y", "get_ignore_y");
ADD_SIGNAL(MethodInfo("path_changed"));
@@ -649,6 +650,21 @@ void NavigationAgent3D::update_navigation() {
}
details[SNAME("owner")] = owner;
+
+ if (waypoint_type == NavigationPathQueryResult3D::PATH_SEGMENT_TYPE_LINK) {
+ const NavigationLink3D *navlink = Object::cast_to<NavigationLink3D>(owner);
+ if (navlink) {
+ Vector3 link_global_start_position = navlink->get_global_start_position();
+ Vector3 link_global_end_position = navlink->get_global_end_position();
+ if (waypoint.distance_to(link_global_start_position) < waypoint.distance_to(link_global_end_position)) {
+ details[SNAME("link_entry_position")] = link_global_start_position;
+ details[SNAME("link_exit_position")] = link_global_end_position;
+ } else {
+ details[SNAME("link_entry_position")] = link_global_end_position;
+ details[SNAME("link_exit_position")] = link_global_start_position;
+ }
+ }
+ }
}
// Emit a signal for the waypoint
diff --git a/scene/3d/navigation_agent_3d.h b/scene/3d/navigation_agent_3d.h
index 072ca1d3e8..cde826ed5c 100644
--- a/scene/3d/navigation_agent_3d.h
+++ b/scene/3d/navigation_agent_3d.h
@@ -52,14 +52,14 @@ class NavigationAgent3D : public Node {
real_t path_desired_distance = 1.0;
real_t target_desired_distance = 1.0;
- real_t radius = 1.0;
+ real_t radius = 0.5;
real_t navigation_height_offset = 0.0;
bool ignore_y = true;
real_t neighbor_distance = 50.0;
int max_neighbors = 10;
- real_t time_horizon = 5.0;
+ real_t time_horizon = 1.0;
real_t max_speed = 10.0;
- real_t path_max_distance = 3.0;
+ real_t path_max_distance = 5.0;
Vector3 target_position;
bool target_position_submitted = false;
diff --git a/scene/3d/navigation_link_3d.cpp b/scene/3d/navigation_link_3d.cpp
index f47fcfaf51..9c4b8e7905 100644
--- a/scene/3d/navigation_link_3d.cpp
+++ b/scene/3d/navigation_link_3d.cpp
@@ -163,6 +163,12 @@ void NavigationLink3D::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_end_position", "position"), &NavigationLink3D::set_end_position);
ClassDB::bind_method(D_METHOD("get_end_position"), &NavigationLink3D::get_end_position);
+ ClassDB::bind_method(D_METHOD("set_global_start_position", "position"), &NavigationLink3D::set_global_start_position);
+ ClassDB::bind_method(D_METHOD("get_global_start_position"), &NavigationLink3D::get_global_start_position);
+
+ ClassDB::bind_method(D_METHOD("set_global_end_position", "position"), &NavigationLink3D::set_global_end_position);
+ ClassDB::bind_method(D_METHOD("get_global_end_position"), &NavigationLink3D::get_global_end_position);
+
ClassDB::bind_method(D_METHOD("set_enter_cost", "enter_cost"), &NavigationLink3D::set_enter_cost);
ClassDB::bind_method(D_METHOD("get_enter_cost"), &NavigationLink3D::get_enter_cost);
@@ -386,6 +392,38 @@ void NavigationLink3D::set_end_position(Vector3 p_position) {
update_configuration_warnings();
}
+void NavigationLink3D::set_global_start_position(Vector3 p_position) {
+ if (is_inside_tree()) {
+ set_start_position(to_local(p_position));
+ } else {
+ set_start_position(p_position);
+ }
+}
+
+Vector3 NavigationLink3D::get_global_start_position() const {
+ if (is_inside_tree()) {
+ return to_global(start_position);
+ } else {
+ return start_position;
+ }
+}
+
+void NavigationLink3D::set_global_end_position(Vector3 p_position) {
+ if (is_inside_tree()) {
+ set_end_position(to_local(p_position));
+ } else {
+ set_end_position(p_position);
+ }
+}
+
+Vector3 NavigationLink3D::get_global_end_position() const {
+ if (is_inside_tree()) {
+ return to_global(end_position);
+ } else {
+ return end_position;
+ }
+}
+
void NavigationLink3D::set_enter_cost(real_t p_enter_cost) {
ERR_FAIL_COND_MSG(p_enter_cost < 0.0, "The enter_cost must be positive.");
if (Math::is_equal_approx(enter_cost, p_enter_cost)) {
diff --git a/scene/3d/navigation_link_3d.h b/scene/3d/navigation_link_3d.h
index 5c9ec36189..991f45c85d 100644
--- a/scene/3d/navigation_link_3d.h
+++ b/scene/3d/navigation_link_3d.h
@@ -83,6 +83,12 @@ public:
void set_end_position(Vector3 p_position);
Vector3 get_end_position() const { return end_position; }
+ void set_global_start_position(Vector3 p_position);
+ Vector3 get_global_start_position() const;
+
+ void set_global_end_position(Vector3 p_position);
+ Vector3 get_global_end_position() const;
+
void set_enter_cost(real_t p_enter_cost);
real_t get_enter_cost() const { return enter_cost; }
diff --git a/scene/3d/voxelizer.cpp b/scene/3d/voxelizer.cpp
index d169999de4..42b0748698 100644
--- a/scene/3d/voxelizer.cpp
+++ b/scene/3d/voxelizer.cpp
@@ -346,25 +346,29 @@ Voxelizer::MaterialCache Voxelizer::_get_material_cache(Ref<Material> p_material
} else {
mc.albedo = _get_bake_texture(img_albedo, Color(1, 1, 1), mat->get_albedo()); // no albedo texture, color is additive
}
+ if (mat->get_feature(BaseMaterial3D::FEATURE_EMISSION)) {
+ Ref<Texture2D> emission_tex = mat->get_texture(BaseMaterial3D::TEXTURE_EMISSION);
- Ref<Texture2D> emission_tex = mat->get_texture(BaseMaterial3D::TEXTURE_EMISSION);
-
- Color emission_col = mat->get_emission();
- float emission_energy = mat->get_emission_energy_multiplier() * exposure_normalization;
- if (GLOBAL_GET("rendering/lights_and_shadows/use_physical_light_units")) {
- emission_energy *= mat->get_emission_intensity();
- }
+ Color emission_col = mat->get_emission();
+ float emission_energy = mat->get_emission_energy_multiplier() * exposure_normalization;
+ if (GLOBAL_GET("rendering/lights_and_shadows/use_physical_light_units")) {
+ emission_energy *= mat->get_emission_intensity();
+ }
- Ref<Image> img_emission;
+ Ref<Image> img_emission;
- if (emission_tex.is_valid()) {
- img_emission = emission_tex->get_image();
- }
+ if (emission_tex.is_valid()) {
+ img_emission = emission_tex->get_image();
+ }
- if (mat->get_emission_operator() == BaseMaterial3D::EMISSION_OP_ADD) {
- mc.emission = _get_bake_texture(img_emission, Color(1, 1, 1) * emission_energy, emission_col * emission_energy);
+ if (mat->get_emission_operator() == BaseMaterial3D::EMISSION_OP_ADD) {
+ mc.emission = _get_bake_texture(img_emission, Color(1, 1, 1) * emission_energy, emission_col * emission_energy);
+ } else {
+ mc.emission = _get_bake_texture(img_emission, emission_col * emission_energy, Color(0, 0, 0));
+ }
} else {
- mc.emission = _get_bake_texture(img_emission, emission_col * emission_energy, Color(0, 0, 0));
+ Ref<Image> empty;
+ mc.emission = _get_bake_texture(empty, Color(0, 0, 0), Color(0, 0, 0));
}
} else {
diff --git a/scene/audio/audio_stream_player.cpp b/scene/audio/audio_stream_player.cpp
index 7533a56b59..6c37d6f81d 100644
--- a/scene/audio/audio_stream_player.cpp
+++ b/scene/audio/audio_stream_player.cpp
@@ -111,7 +111,7 @@ float AudioStreamPlayer::get_volume_db() const {
}
void AudioStreamPlayer::set_pitch_scale(float p_pitch_scale) {
- ERR_FAIL_COND(p_pitch_scale <= 0.0);
+ ERR_FAIL_COND(!(p_pitch_scale > 0.0));
pitch_scale = p_pitch_scale;
for (Ref<AudioStreamPlayback> &playback : stream_playbacks) {
diff --git a/scene/gui/aspect_ratio_container.cpp b/scene/gui/aspect_ratio_container.cpp
index 802189c374..94240ccead 100644
--- a/scene/gui/aspect_ratio_container.cpp
+++ b/scene/gui/aspect_ratio_container.cpp
@@ -30,6 +30,8 @@
#include "aspect_ratio_container.h"
+#include "scene/gui/texture_rect.h"
+
Size2 AspectRatioContainer::get_minimum_size() const {
Size2 ms;
for (int i = 0; i < get_child_count(); i++) {
@@ -113,6 +115,16 @@ void AspectRatioContainer::_notification(int p_what) {
if (c->is_set_as_top_level()) {
continue;
}
+
+ // Temporary fix for editor crash.
+ TextureRect *trect = Object::cast_to<TextureRect>(c);
+ if (trect) {
+ if (trect->get_expand_mode() == TextureRect::EXPAND_FIT_WIDTH_PROPORTIONAL || trect->get_expand_mode() == TextureRect::EXPAND_FIT_HEIGHT_PROPORTIONAL) {
+ WARN_PRINT_ONCE("Proportional TextureRect is currently not supported inside AspectRatioContainer");
+ continue;
+ }
+ }
+
Size2 child_minsize = c->get_combined_minimum_size();
Size2 child_size = Size2(ratio, 1.0);
float scale_factor = 1.0;
diff --git a/scene/gui/code_edit.cpp b/scene/gui/code_edit.cpp
index e2f7ec860c..ee39327d4d 100644
--- a/scene/gui/code_edit.cpp
+++ b/scene/gui/code_edit.cpp
@@ -896,6 +896,7 @@ void CodeEdit::indent_lines() {
set_caret_column(get_caret_column(c) + selection_offset, false, c);
}
end_complex_operation();
+ queue_redraw();
}
void CodeEdit::unindent_lines() {
@@ -973,6 +974,7 @@ void CodeEdit::unindent_lines() {
set_caret_column(initial_cursor_column - removed_characters, false, c);
}
end_complex_operation();
+ queue_redraw();
}
int CodeEdit::_calculate_spaces_till_next_left_indent(int p_column) const {
diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp
index 0b0698188c..48e3759981 100644
--- a/scene/gui/color_picker.cpp
+++ b/scene/gui/color_picker.cpp
@@ -31,10 +31,12 @@
#include "color_picker.h"
#include "core/input/input.h"
+#include "core/io/image.h"
#include "core/math/color.h"
#include "core/os/keyboard.h"
#include "core/os/os.h"
#include "scene/gui/color_mode.h"
+#include "servers/display_server.h"
#include "thirdparty/misc/ok_color.h"
#include "thirdparty/misc/ok_color_shader.h"
@@ -90,8 +92,8 @@ void ColorPicker::_notification(int p_what) {
} break;
case NOTIFICATION_WM_CLOSE_REQUEST: {
- if (screen != nullptr && screen->is_visible()) {
- screen->hide();
+ if (picker_window != nullptr && picker_window->is_visible()) {
+ picker_window->hide();
}
} break;
}
@@ -1372,30 +1374,26 @@ void ColorPicker::_recent_preset_pressed(const bool p_pressed, ColorPresetButton
emit_signal(SNAME("color_changed"), p_preset->get_preset_color());
}
-void ColorPicker::_screen_input(const Ref<InputEvent> &p_event) {
+void ColorPicker::_picker_texture_input(const Ref<InputEvent> &p_event) {
if (!is_inside_tree()) {
return;
}
Ref<InputEventMouseButton> bev = p_event;
if (bev.is_valid() && bev->get_button_index() == MouseButton::LEFT && !bev->is_pressed()) {
+ set_pick_color(picker_color);
emit_signal(SNAME("color_changed"), color);
- screen->hide();
+ picker_window->hide();
}
Ref<InputEventMouseMotion> mev = p_event;
if (mev.is_valid()) {
- Viewport *r = get_tree()->get_root();
- if (!r->get_visible_rect().has_point(mev->get_global_position())) {
- return;
- }
-
- Ref<Image> img = r->get_texture()->get_image();
+ Ref<Image> img = picker_texture_rect->get_texture()->get_image();
if (img.is_valid() && !img->is_empty()) {
- Vector2 ofs = mev->get_global_position();
- Color c = img->get_pixel(ofs.x, ofs.y);
-
- set_pick_color(c);
+ Vector2 ofs = mev->get_position();
+ picker_color = img->get_pixel(ofs.x, ofs.y);
+ picker_preview_style_box->set_bg_color(picker_color);
+ picker_preview_label->set_self_modulate(picker_color.get_luminance() < 0.5 ? Color(1.0f, 1.0f, 1.0f) : Color(0.0f, 0.0f, 0.0f));
}
}
}
@@ -1409,27 +1407,79 @@ void ColorPicker::_add_preset_pressed() {
emit_signal(SNAME("preset_added"), color);
}
-void ColorPicker::_screen_pick_pressed() {
+void ColorPicker::_pick_button_pressed() {
if (!is_inside_tree()) {
return;
}
- Viewport *r = get_tree()->get_root();
- if (!screen) {
- screen = memnew(Control);
- r->add_child(screen);
- screen->set_as_top_level(true);
- screen->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT);
- screen->set_default_cursor_shape(CURSOR_POINTING_HAND);
- screen->connect("gui_input", callable_mp(this, &ColorPicker::_screen_input));
- // It immediately toggles off in the first press otherwise.
- screen->call_deferred(SNAME("connect"), "hidden", Callable(btn_pick, "set_pressed").bind(false));
+ if (!picker_window) {
+ picker_window = memnew(Popup);
+ picker_window->hide();
+ picker_window->set_transient(true);
+ add_child(picker_window);
+
+ picker_texture_rect = memnew(TextureRect);
+ picker_texture_rect->set_anchors_preset(Control::PRESET_FULL_RECT);
+ picker_window->add_child(picker_texture_rect);
+ picker_texture_rect->set_default_cursor_shape(CURSOR_POINTING_HAND);
+ picker_texture_rect->connect(SNAME("gui_input"), callable_mp(this, &ColorPicker::_picker_texture_input));
+
+ picker_preview = memnew(Panel);
+ picker_preview->set_anchors_preset(Control::PRESET_CENTER_TOP);
+ picker_preview->set_mouse_filter(MOUSE_FILTER_IGNORE);
+ picker_window->add_child(picker_preview);
+
+ picker_preview_label = memnew(Label);
+ picker_preview->set_anchors_preset(Control::PRESET_CENTER_TOP);
+ picker_preview_label->set_text("Color Picking active");
+ picker_preview->add_child(picker_preview_label);
+
+ picker_preview_style_box = (Ref<StyleBoxFlat>)memnew(StyleBoxFlat);
+ picker_preview_style_box->set_bg_color(Color(1.0, 1.0, 1.0));
+ picker_preview->add_theme_style_override("panel", picker_preview_style_box);
+ }
+
+ Rect2i screen_rect;
+ if (picker_window->is_embedded()) {
+ screen_rect = picker_window->get_embedder()->get_visible_rect();
+ picker_window->set_position(Point2i());
+ picker_texture_rect->set_texture(ImageTexture::create_from_image(picker_window->get_embedder()->get_texture()->get_image()));
} else {
- screen->show();
+ screen_rect = picker_window->get_parent_rect();
+ picker_window->set_position(screen_rect.position);
+
+ Ref<Image> target_image = Image::create_empty(screen_rect.size.x, screen_rect.size.y, false, Image::FORMAT_RGB8);
+ DisplayServer *ds = DisplayServer::get_singleton();
+
+ // Add the Texture of each Window to the Image.
+ Vector<DisplayServer::WindowID> wl = ds->get_window_list();
+ // FIXME: sort windows by visibility.
+ for (int index = 0; index < wl.size(); index++) {
+ DisplayServer::WindowID wid = wl[index];
+ if (wid == DisplayServer::INVALID_WINDOW_ID) {
+ continue;
+ }
+
+ ObjectID woid = DisplayServer::get_singleton()->window_get_attached_instance_id(wid);
+ if (woid == ObjectID()) {
+ continue;
+ }
+
+ Window *w = Object::cast_to<Window>(ObjectDB::get_instance(woid));
+ Ref<Image> img = w->get_texture()->get_image();
+ if (!img.is_valid() || img->is_empty()) {
+ continue;
+ }
+ img->convert(Image::FORMAT_RGB8);
+ target_image->blit_rect(img, Rect2i(Point2i(0, 0), img->get_size()), w->get_position());
+ }
+
+ picker_texture_rect->set_texture(ImageTexture::create_from_image(target_image));
}
- screen->move_to_front();
- // TODO: show modal no longer works, needs to be converted to a popup.
- //screen->show_modal();
+
+ picker_window->set_size(screen_rect.size);
+ picker_preview->set_size(screen_rect.size / 10.0); // 10% of size in each axis.
+ picker_window->popup();
}
void ColorPicker::_html_focus_exit() {
@@ -1595,9 +1645,8 @@ ColorPicker::ColorPicker() {
btn_pick = memnew(Button);
sample_hbc->add_child(btn_pick);
- btn_pick->set_toggle_mode(true);
- btn_pick->set_tooltip_text(RTR("Pick a color from the editor window."));
- btn_pick->connect("pressed", callable_mp(this, &ColorPicker::_screen_pick_pressed));
+ btn_pick->set_tooltip_text(RTR("Pick a color from the application window."));
+ btn_pick->connect(SNAME("pressed"), callable_mp(this, &ColorPicker::_pick_button_pressed));
sample = memnew(TextureRect);
sample_hbc->add_child(sample);
diff --git a/scene/gui/color_picker.h b/scene/gui/color_picker.h
index f7578612cd..d02c3278e6 100644
--- a/scene/gui/color_picker.h
+++ b/scene/gui/color_picker.h
@@ -40,6 +40,7 @@
#include "scene/gui/line_edit.h"
#include "scene/gui/menu_button.h"
#include "scene/gui/option_button.h"
+#include "scene/gui/panel.h"
#include "scene/gui/popup.h"
#include "scene/gui/separator.h"
#include "scene/gui/slider.h"
@@ -111,7 +112,12 @@ private:
Vector<ColorMode *> modes;
- Control *screen = nullptr;
+ Popup *picker_window = nullptr;
+ TextureRect *picker_texture_rect = nullptr;
+ Panel *picker_preview = nullptr;
+ Label *picker_preview_label = nullptr;
+ Ref<StyleBoxFlat> picker_preview_style_box;
+ Color picker_color;
Control *uv_edit = nullptr;
Control *w_edit = nullptr;
AspectRatioContainer *wheel_edit = nullptr;
@@ -211,10 +217,10 @@ private:
void _line_edit_input(const Ref<InputEvent> &p_event);
void _preset_input(const Ref<InputEvent> &p_event, const Color &p_color);
void _recent_preset_pressed(const bool pressed, ColorPresetButton *p_preset);
- void _screen_input(const Ref<InputEvent> &p_event);
+ void _picker_texture_input(const Ref<InputEvent> &p_event);
void _text_changed(const String &p_new_text);
void _add_preset_pressed();
- void _screen_pick_pressed();
+ void _pick_button_pressed();
void _html_focus_exit();
inline int _get_preset_size();
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp
index 5dd8cde342..02abddaa43 100644
--- a/scene/gui/file_dialog.cpp
+++ b/scene/gui/file_dialog.cpp
@@ -35,7 +35,6 @@
#include "scene/gui/label.h"
FileDialog::GetIconFunc FileDialog::get_icon_func = nullptr;
-FileDialog::GetIconFunc FileDialog::get_large_icon_func = nullptr;
FileDialog::RegisterFunc FileDialog::register_func = nullptr;
FileDialog::RegisterFunc FileDialog::unregister_func = nullptr;
@@ -347,14 +346,15 @@ void FileDialog::_action_pressed() {
}
}
- if (!valid) {
+ String file_name = file_text.strip_edges().get_file();
+ if (!valid || file_name.is_empty()) {
exterr->popup_centered(Size2(250, 80));
return;
}
if (dir_access->file_exists(f)) {
- confirm_save->set_text(RTR("File exists, overwrite?"));
- confirm_save->popup_centered(Size2(200, 80));
+ confirm_save->set_text(vformat(RTR("File \"%s\" already exists.\nDo you want to overwrite it?"), f));
+ confirm_save->popup_centered(Size2(250, 80));
} else {
emit_signal(SNAME("file_selected"), f);
hide();
@@ -1136,7 +1136,7 @@ FileDialog::FileDialog() {
add_child(mkdirerr, false, INTERNAL_MODE_FRONT);
exterr = memnew(AcceptDialog);
- exterr->set_text(RTR("Must use a valid extension."));
+ exterr->set_text(RTR("Invalid extension, or empty filename."));
add_child(exterr, false, INTERNAL_MODE_FRONT);
update_filters();
diff --git a/scene/gui/file_dialog.h b/scene/gui/file_dialog.h
index d85cdcac90..7f80caf01d 100644
--- a/scene/gui/file_dialog.h
+++ b/scene/gui/file_dialog.h
@@ -60,7 +60,6 @@ public:
typedef void (*RegisterFunc)(FileDialog *);
static GetIconFunc get_icon_func;
- static GetIconFunc get_large_icon_func;
static RegisterFunc register_func;
static RegisterFunc unregister_func;
diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp
index 25a27d5e1a..d367a8d281 100644
--- a/scene/gui/item_list.cpp
+++ b/scene/gui/item_list.cpp
@@ -801,8 +801,9 @@ void ItemList::gui_input(const Ref<InputEvent> &p_event) {
search_string = ""; //any mousepress cancels
for (int i = 4; i > 0; i--) {
- if (current - current_columns * i >= 0 && CAN_SELECT(current - current_columns * i)) {
- set_current(current - current_columns * i);
+ int index = current - current_columns * i;
+ if (index >= 0 && index < items.size() && CAN_SELECT(index)) {
+ set_current(index);
ensure_current_is_visible();
if (select_mode == SELECT_SINGLE) {
emit_signal(SNAME("item_selected"), current);
@@ -815,8 +816,9 @@ void ItemList::gui_input(const Ref<InputEvent> &p_event) {
search_string = ""; //any mousepress cancels
for (int i = 4; i > 0; i--) {
- if (current + current_columns * i < items.size() && CAN_SELECT(current + current_columns * i)) {
- set_current(current + current_columns * i);
+ int index = current + current_columns * i;
+ if (index >= 0 && index < items.size() && CAN_SELECT(index)) {
+ set_current(index);
ensure_current_is_visible();
if (select_mode == SELECT_SINGLE) {
emit_signal(SNAME("item_selected"), current);
@@ -832,7 +834,7 @@ void ItemList::gui_input(const Ref<InputEvent> &p_event) {
if (current % current_columns != 0) {
int current_row = current / current_columns;
int next = current - 1;
- while (!CAN_SELECT(next)) {
+ while (next >= 0 && !CAN_SELECT(next)) {
next = next - 1;
}
if (next < 0 || !IS_SAME_ROW(next, current_row)) {
@@ -852,7 +854,7 @@ void ItemList::gui_input(const Ref<InputEvent> &p_event) {
if (current % current_columns != (current_columns - 1) && current + 1 < items.size()) {
int current_row = current / current_columns;
int next = current + 1;
- while (!CAN_SELECT(next)) {
+ while (next < items.size() && !CAN_SELECT(next)) {
next = next + 1;
}
if (items.size() <= next || !IS_SAME_ROW(next, current_row)) {
diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp
index 45218773fe..b861d7af01 100644
--- a/scene/gui/label.cpp
+++ b/scene/gui/label.cpp
@@ -139,11 +139,14 @@ bool Label::_shape() {
can_process_lines = true;
lines_dirty = false;
} else {
- // With autowrap on, we won't compute the minimum size until width is stable (two shape requests in a
- // row with the same width.) This avoids situations in which the initial width is very narrow and the label
- // would break text into many very short lines, causing a very tall label that can leave a deformed container.
-
- can_process_lines = get_size().width == stable_width || autowrap_mode == TextServer::AUTOWRAP_OFF;
+ // With autowrap on or off with trimming enabled, we won't compute the minimum size until width is stable
+ // (two shape requests in a row with the same width.) This avoids situations in which the initial width is
+ // very narrow and the label would break text into many very short lines, causing a very tall label that can
+ // leave a deformed container. In the remaining case (namely, autowrap off and no trimming), the label is
+ // free to dictate its own width, something that will be taken advtantage of.
+ bool can_dictate_width = autowrap_mode == TextServer::AUTOWRAP_OFF && overrun_behavior == TextServer::OVERRUN_NO_TRIMMING;
+ bool is_width_stable = get_size().width == stable_width;
+ can_process_lines = can_dictate_width || is_width_stable;
stable_width = get_size().width;
if (can_process_lines) {
@@ -171,14 +174,13 @@ bool Label::_shape() {
}
}
- if (autowrap_mode == TextServer::AUTOWRAP_OFF) {
+ if (can_dictate_width) {
for (int i = 0; i < lines_rid.size(); i++) {
if (minsize.width < TS->shaped_text_get_size(lines_rid[i]).x) {
minsize.width = TS->shaped_text_get_size(lines_rid[i]).x;
}
}
- // With autowrap off, by now we already know the width the label will take.
width = (minsize.width - style->get_minimum_size().width);
}
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp
index 1a6adca121..cf73729c0a 100644
--- a/scene/gui/popup_menu.cpp
+++ b/scene/gui/popup_menu.cpp
@@ -1715,12 +1715,12 @@ void PopupMenu::activate_item(int p_item) {
need_hide = false;
}
+ emit_signal(SNAME("id_pressed"), id);
+ emit_signal(SNAME("index_pressed"), p_item);
+
if (need_hide) {
hide();
}
-
- emit_signal(SNAME("id_pressed"), id);
- emit_signal(SNAME("index_pressed"), p_item);
}
void PopupMenu::remove_item(int p_idx) {
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index 2c1c44322a..973b02b3a3 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -1179,7 +1179,7 @@ int RichTextLabel::_draw_line(ItemFrame *p_frame, int p_line, const Vector2 &p_o
dot_ul_started = false;
float y_off = TS->shaped_text_get_underline_position(rid);
float underline_width = TS->shaped_text_get_underline_thickness(rid) * theme_cache.base_scale;
- draw_dashed_line(dot_ul_start + Vector2(0, y_off), p_ofs + Vector2(off.x, off.y + y_off), dot_ul_color, underline_width, underline_width * 2);
+ draw_dashed_line(dot_ul_start + Vector2(0, y_off), p_ofs + Vector2(off.x, off.y + y_off), dot_ul_color, underline_width, MAX(2.0, underline_width * 2));
}
if (_find_strikethrough(it)) {
if (!st_started) {
@@ -1341,7 +1341,7 @@ int RichTextLabel::_draw_line(ItemFrame *p_frame, int p_line, const Vector2 &p_o
dot_ul_started = false;
float y_off = TS->shaped_text_get_underline_position(rid);
float underline_width = TS->shaped_text_get_underline_thickness(rid) * theme_cache.base_scale;
- draw_dashed_line(dot_ul_start + Vector2(0, y_off), p_ofs + Vector2(off.x, off.y + y_off), dot_ul_color, underline_width, underline_width * 2);
+ draw_dashed_line(dot_ul_start + Vector2(0, y_off), p_ofs + Vector2(off.x, off.y + y_off), dot_ul_color, underline_width, MAX(2.0, underline_width * 2));
}
if (st_started) {
st_started = false;
@@ -1363,7 +1363,7 @@ int RichTextLabel::_draw_line(ItemFrame *p_frame, int p_line, const Vector2 &p_o
dot_ul_started = false;
float y_off = TS->shaped_text_get_underline_position(rid);
float underline_width = TS->shaped_text_get_underline_thickness(rid) * theme_cache.base_scale;
- draw_dashed_line(dot_ul_start + Vector2(0, y_off), p_ofs + Vector2(off.x, off.y + y_off), dot_ul_color, underline_width, underline_width * 2);
+ draw_dashed_line(dot_ul_start + Vector2(0, y_off), p_ofs + Vector2(off.x, off.y + y_off), dot_ul_color, underline_width, MAX(2.0, underline_width * 2));
}
if (st_started) {
st_started = false;
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index d785280701..ebca8296a0 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -2681,6 +2681,7 @@ void TextEdit::_do_backspace(bool p_word, bool p_all_to_left) {
set_caret_line(get_caret_line(caret_idx), false, true, 0, caret_idx);
set_caret_column(column, caret_idx == 0, caret_idx);
+ adjust_carets_after_edit(caret_idx, get_caret_line(caret_idx), column, get_caret_line(caret_idx), from_column);
// Now we can clean up the overlapping caret.
if (overlapping_caret_index != -1) {
@@ -4362,7 +4363,9 @@ int TextEdit::get_minimap_line_at_pos(const Point2i &p_pos) const {
if (first_vis_line > 0 && minimap_line >= 0) {
minimap_line -= get_next_visible_line_index_offset_from(first_vis_line, 0, -num_lines_before).x;
minimap_line -= (minimap_line > 0 && smooth_scroll_enabled ? 1 : 0);
- } else {
+ }
+
+ if (minimap_line < 0) {
minimap_line = 0;
}
diff --git a/scene/main/canvas_item.cpp b/scene/main/canvas_item.cpp
index e5dcdd2afd..b36353158b 100644
--- a/scene/main/canvas_item.cpp
+++ b/scene/main/canvas_item.cpp
@@ -513,14 +513,16 @@ bool CanvasItem::is_y_sort_enabled() const {
void CanvasItem::draw_dashed_line(const Point2 &p_from, const Point2 &p_to, const Color &p_color, real_t p_width, real_t p_dash, bool p_aligned) {
ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal.");
+ ERR_FAIL_COND(p_dash <= 0.0);
float length = (p_to - p_from).length();
- if (length < p_dash) {
+ Vector2 step = p_dash * (p_to - p_from).normalized();
+
+ if (length < p_dash || step == Vector2()) {
RenderingServer::get_singleton()->canvas_item_add_line(canvas_item, p_from, p_to, p_color, p_width);
return;
}
- Vector2 step = p_dash * (p_to - p_from).normalized();
int steps = (p_aligned) ? Math::ceil(length / p_dash) : Math::floor(length / p_dash);
if (steps % 2 == 0) {
steps--;
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 126b1d54fc..244e0d5b93 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -1330,7 +1330,7 @@ void Viewport::_gui_show_tooltip() {
Window *window = gui.tooltip_popup->get_parent_visible_window();
Rect2i vr;
if (gui.tooltip_popup->is_embedded()) {
- vr = gui.tooltip_popup->_get_embedder()->get_visible_rect();
+ vr = gui.tooltip_popup->get_embedder()->get_visible_rect();
} else {
vr = window->get_usable_parent_rect();
}
@@ -1851,7 +1851,7 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
Window *w = Object::cast_to<Window>(this);
if (w) {
if (w->is_embedded()) {
- embedder = w->_get_embedder();
+ embedder = w->get_embedder();
viewport_pos = get_final_transform().xform(mpos) + w->get_position(); // To parent coords.
}
diff --git a/scene/main/window.cpp b/scene/main/window.cpp
index b79a9ba444..59e3d307c6 100644
--- a/scene/main/window.cpp
+++ b/scene/main/window.cpp
@@ -485,7 +485,7 @@ void Window::set_ime_position(const Point2i &p_pos) {
bool Window::is_embedded() const {
ERR_FAIL_COND_V(!is_inside_tree(), false);
- return _get_embedder() != nullptr;
+ return get_embedder() != nullptr;
}
bool Window::is_in_edited_scene_root() const {
@@ -710,7 +710,7 @@ void Window::set_visible(bool p_visible) {
// Stop any queued resizing, as the window will be resized right now.
updating_child_controls = false;
- Viewport *embedder_vp = _get_embedder();
+ Viewport *embedder_vp = get_embedder();
if (!embedder_vp) {
if (!p_visible && window_id != DisplayServer::INVALID_WINDOW_ID) {
@@ -1053,7 +1053,7 @@ void Window::_update_window_callbacks() {
DisplayServer::get_singleton()->window_set_drop_files_callback(callable_mp(this, &Window::_window_drop_files), window_id);
}
-Viewport *Window::_get_embedder() const {
+Viewport *Window::get_embedder() const {
Viewport *vp = get_parent_viewport();
while (vp) {
@@ -1088,7 +1088,7 @@ void Window::_notification(int p_what) {
case NOTIFICATION_ENTER_TREE: {
bool embedded = false;
{
- embedder = _get_embedder();
+ embedder = get_embedder();
if (embedder) {
embedded = true;
if (!visible) {
@@ -1431,7 +1431,7 @@ void Window::popup_centered_clamped(const Size2i &p_size, float p_fallback_ratio
Rect2 parent_rect;
if (is_embedded()) {
- parent_rect = _get_embedder()->get_visible_rect();
+ parent_rect = get_embedder()->get_visible_rect();
} else {
DisplayServer::WindowID parent_id = get_parent_visible_window()->get_window_id();
int parent_screen = DisplayServer::get_singleton()->window_get_current_screen(parent_id);
@@ -1462,7 +1462,7 @@ void Window::popup_centered(const Size2i &p_minsize) {
Rect2 parent_rect;
if (is_embedded()) {
- parent_rect = _get_embedder()->get_visible_rect();
+ parent_rect = get_embedder()->get_visible_rect();
} else {
DisplayServer::WindowID parent_id = get_parent_visible_window()->get_window_id();
int parent_screen = DisplayServer::get_singleton()->window_get_current_screen(parent_id);
@@ -1488,7 +1488,7 @@ void Window::popup_centered_ratio(float p_ratio) {
Rect2 parent_rect;
if (is_embedded()) {
- parent_rect = _get_embedder()->get_visible_rect();
+ parent_rect = get_embedder()->get_visible_rect();
} else {
DisplayServer::WindowID parent_id = get_parent_visible_window()->get_window_id();
int parent_screen = DisplayServer::get_singleton()->window_get_current_screen(parent_id);
@@ -1509,7 +1509,7 @@ void Window::popup_centered_ratio(float p_ratio) {
void Window::popup(const Rect2i &p_screen_rect) {
emit_signal(SNAME("about_to_popup"));
- if (!_get_embedder() && get_flag(FLAG_POPUP)) {
+ if (!get_embedder() && get_flag(FLAG_POPUP)) {
// Send a focus-out notification when opening a Window Manager Popup.
SceneTree *scene_tree = get_tree();
if (scene_tree) {
@@ -1545,7 +1545,7 @@ void Window::popup(const Rect2i &p_screen_rect) {
Rect2i parent_rect;
if (is_embedded()) {
- parent_rect = _get_embedder()->get_visible_rect();
+ parent_rect = get_embedder()->get_visible_rect();
} else {
int screen_id = DisplayServer::get_singleton()->window_get_current_screen(get_window_id());
parent_rect = DisplayServer::get_singleton()->screen_get_usable_rect(screen_id);
@@ -1587,7 +1587,7 @@ Rect2i Window::get_usable_parent_rect() const {
ERR_FAIL_COND_V(!is_inside_tree(), Rect2());
Rect2i parent_rect;
if (is_embedded()) {
- parent_rect = _get_embedder()->get_visible_rect();
+ parent_rect = get_embedder()->get_visible_rect();
} else {
const Window *w = is_visible() ? this : get_parent_visible_window();
//find a parent that can contain us
@@ -2154,9 +2154,9 @@ Transform2D Window::get_final_transform() const {
Transform2D Window::get_screen_transform_internal(bool p_absolute_position) const {
Transform2D embedder_transform;
- if (_get_embedder()) {
+ if (get_embedder()) {
embedder_transform.translate_local(get_position());
- embedder_transform = _get_embedder()->get_screen_transform_internal(p_absolute_position) * embedder_transform;
+ embedder_transform = get_embedder()->get_screen_transform_internal(p_absolute_position) * embedder_transform;
} else if (p_absolute_position) {
embedder_transform.translate_local(get_position());
}
@@ -2170,8 +2170,8 @@ Transform2D Window::get_popup_base_transform() const {
Transform2D popup_base_transform;
popup_base_transform.set_origin(get_position());
popup_base_transform *= get_final_transform();
- if (_get_embedder()) {
- return _get_embedder()->get_popup_base_transform() * popup_base_transform;
+ if (get_embedder()) {
+ return get_embedder()->get_popup_base_transform() * popup_base_transform;
}
return popup_base_transform;
}
diff --git a/scene/main/window.h b/scene/main/window.h
index 5359c37e9a..40b629ed11 100644
--- a/scene/main/window.h
+++ b/scene/main/window.h
@@ -192,7 +192,6 @@ private:
Ref<Shortcut> debugger_stop_shortcut;
protected:
- Viewport *_get_embedder() const;
virtual Rect2i _popup_adjust_rect() const { return Rect2i(); }
virtual void _update_theme_item_cache();
@@ -278,6 +277,7 @@ public:
void set_ime_position(const Point2i &p_pos);
bool is_embedded() const;
+ Viewport *get_embedder() const;
void set_content_scale_size(const Size2i &p_size);
Size2i get_content_scale_size() const;
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp
index 7e84814ab3..2627898f5f 100644
--- a/scene/resources/material.cpp
+++ b/scene/resources/material.cpp
@@ -369,7 +369,15 @@ void ShaderMaterial::set_shader_parameter(const StringName &p_param, const Varia
param_cache.erase(p_param);
RS::get_singleton()->material_set_param(_get_material(), p_param, Variant());
} else {
- param_cache[p_param] = p_value;
+ Variant *v = param_cache.getptr(p_param);
+ if (!v) {
+ // Never assigned, also update the remap cache.
+ remap_cache["shader_parameter/" + p_param.operator String()] = p_param;
+ param_cache.insert(p_param, p_value);
+ } else {
+ *v = p_value;
+ }
+
if (p_value.get_type() == Variant::OBJECT) {
RID tex_rid = p_value;
if (tex_rid == RID()) {
@@ -955,11 +963,14 @@ void BaseMaterial3D::_update_shader() {
} break;
case BILLBOARD_PARTICLES: {
//make billboard
- code += " mat4 mat_world = mat4(normalize(INV_VIEW_MATRIX[0]) * length(MODEL_MATRIX[0]), normalize(INV_VIEW_MATRIX[1]) * length(MODEL_MATRIX[0]),normalize(INV_VIEW_MATRIX[2]) * length(MODEL_MATRIX[2]), MODEL_MATRIX[3]);\n";
+ code += " mat4 mat_world = mat4(normalize(INV_VIEW_MATRIX[0]), normalize(INV_VIEW_MATRIX[1]) ,normalize(INV_VIEW_MATRIX[2]), MODEL_MATRIX[3]);\n";
//rotate by rotation
code += " mat_world = mat_world * mat4(vec4(cos(INSTANCE_CUSTOM.x), -sin(INSTANCE_CUSTOM.x), 0.0, 0.0), vec4(sin(INSTANCE_CUSTOM.x), cos(INSTANCE_CUSTOM.x), 0.0, 0.0), vec4(0.0, 0.0, 1.0, 0.0), vec4(0.0, 0.0, 0.0, 1.0));\n";
//set modelview
code += " MODELVIEW_MATRIX = VIEW_MATRIX * mat_world;\n";
+ if (flags[FLAG_BILLBOARD_KEEP_SCALE]) {
+ code += " MODELVIEW_MATRIX = MODELVIEW_MATRIX * mat4(vec4(length(MODEL_MATRIX[0].xyz), 0.0, 0.0, 0.0),vec4(0.0, length(MODEL_MATRIX[1].xyz), 0.0, 0.0), vec4(0.0, 0.0, length(MODEL_MATRIX[2].xyz), 0.0), vec4(0.0, 0.0, 0.0, 1.0));\n";
+ }
//set modelview normal
code += " MODELVIEW_NORMAL_MATRIX = mat3(MODELVIEW_MATRIX);\n";
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp
index 7e3156d2ff..05be40c446 100644
--- a/scene/resources/texture.cpp
+++ b/scene/resources/texture.cpp
@@ -2566,73 +2566,6 @@ void GradientTexture2D::_bind_methods() {
//////////////////////////////////////
-void ProxyTexture::set_base(const Ref<Texture2D> &p_texture) {
- ERR_FAIL_COND(p_texture == this);
-
- base = p_texture;
- if (base.is_valid()) {
- ERR_FAIL_NULL(RenderingServer::get_singleton());
- if (proxy_ph.is_valid()) {
- RS::get_singleton()->texture_proxy_update(proxy, base->get_rid());
- RS::get_singleton()->free(proxy_ph);
- proxy_ph = RID();
- } else if (proxy.is_valid()) {
- RS::get_singleton()->texture_proxy_update(proxy, base->get_rid());
- } else {
- proxy = RS::get_singleton()->texture_proxy_create(base->get_rid());
- }
- }
-}
-
-Ref<Texture2D> ProxyTexture::get_base() const {
- return base;
-}
-
-int ProxyTexture::get_width() const {
- if (base.is_valid()) {
- return base->get_width();
- }
- return 1;
-}
-
-int ProxyTexture::get_height() const {
- if (base.is_valid()) {
- return base->get_height();
- }
- return 1;
-}
-
-RID ProxyTexture::get_rid() const {
- if (proxy.is_null()) {
- proxy_ph = RS::get_singleton()->texture_2d_placeholder_create();
- proxy = RS::get_singleton()->texture_proxy_create(proxy_ph);
- }
- return proxy;
-}
-
-bool ProxyTexture::has_alpha() const {
- if (base.is_valid()) {
- return base->has_alpha();
- }
- return false;
-}
-
-ProxyTexture::ProxyTexture() {
- //proxy = RS::get_singleton()->texture_create();
-}
-
-ProxyTexture::~ProxyTexture() {
- ERR_FAIL_NULL(RenderingServer::get_singleton());
- if (proxy_ph.is_valid()) {
- RS::get_singleton()->free(proxy_ph);
- }
- if (proxy.is_valid()) {
- RS::get_singleton()->free(proxy);
- }
-}
-
-//////////////////////////////////////////////
-
void AnimatedTexture::_update_proxy() {
RWLockRead r(rw_lock);
@@ -2704,6 +2637,7 @@ void AnimatedTexture::set_current_frame(int p_frame) {
RWLockWrite r(rw_lock);
current_frame = p_frame;
+ time = 0;
}
int AnimatedTexture::get_current_frame() const {
diff --git a/scene/resources/texture.h b/scene/resources/texture.h
index 7f74ae6941..7c4d479da8 100644
--- a/scene/resources/texture.h
+++ b/scene/resources/texture.h
@@ -892,29 +892,6 @@ public:
VARIANT_ENUM_CAST(GradientTexture2D::Fill);
VARIANT_ENUM_CAST(GradientTexture2D::Repeat);
-class ProxyTexture : public Texture2D {
-private:
- mutable RID proxy_ph;
- mutable RID proxy;
- Ref<Texture2D> base;
-
-protected:
- static void _bind_methods();
-
-public:
- void set_base(const Ref<Texture2D> &p_texture);
- Ref<Texture2D> get_base() const;
-
- virtual int get_width() const override;
- virtual int get_height() const override;
- virtual RID get_rid() const override;
-
- virtual bool has_alpha() const override;
-
- ProxyTexture();
- ~ProxyTexture();
-};
-
class AnimatedTexture : public Texture2D {
GDCLASS(AnimatedTexture, Texture2D);
diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp
index fee0a4a910..d4b2be355e 100644
--- a/scene/resources/tile_set.cpp
+++ b/scene/resources/tile_set.cpp
@@ -3308,7 +3308,7 @@ bool TileSet::_get(const StringName &p_name, Variant &r_ret) const {
void TileSet::_get_property_list(List<PropertyInfo> *p_list) const {
PropertyInfo property_info;
// Rendering.
- p_list->push_back(PropertyInfo(Variant::NIL, "Rendering", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP));
+ p_list->push_back(PropertyInfo(Variant::NIL, GNAME("Rendering", ""), PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP));
for (int i = 0; i < occlusion_layers.size(); i++) {
p_list->push_back(PropertyInfo(Variant::INT, vformat("occlusion_layer_%d/light_mask", i), PROPERTY_HINT_LAYERS_2D_RENDER));
@@ -3321,7 +3321,7 @@ void TileSet::_get_property_list(List<PropertyInfo> *p_list) const {
}
// Physics.
- p_list->push_back(PropertyInfo(Variant::NIL, "Physics", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP));
+ p_list->push_back(PropertyInfo(Variant::NIL, GNAME("Physics", ""), PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP));
for (int i = 0; i < physics_layers.size(); i++) {
p_list->push_back(PropertyInfo(Variant::INT, vformat("physics_layer_%d/collision_layer", i), PROPERTY_HINT_LAYERS_2D_PHYSICS));
@@ -3341,7 +3341,7 @@ void TileSet::_get_property_list(List<PropertyInfo> *p_list) const {
}
// Terrains.
- p_list->push_back(PropertyInfo(Variant::NIL, "Terrains", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP));
+ p_list->push_back(PropertyInfo(Variant::NIL, GNAME("Terrains", ""), PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP));
for (int terrain_set_index = 0; terrain_set_index < terrain_sets.size(); terrain_set_index++) {
p_list->push_back(PropertyInfo(Variant::INT, vformat("terrain_set_%d/mode", terrain_set_index), PROPERTY_HINT_ENUM, "Match Corners and Sides,Match Corners,Match Sides"));
p_list->push_back(PropertyInfo(Variant::NIL, vformat("terrain_set_%d/terrains", terrain_set_index), PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_ARRAY, vformat("terrain_set_%d/terrain_", terrain_set_index)));
@@ -3352,7 +3352,7 @@ void TileSet::_get_property_list(List<PropertyInfo> *p_list) const {
}
// Navigation.
- p_list->push_back(PropertyInfo(Variant::NIL, "Navigation", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP));
+ p_list->push_back(PropertyInfo(Variant::NIL, GNAME("Navigation", ""), PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP));
for (int i = 0; i < navigation_layers.size(); i++) {
p_list->push_back(PropertyInfo(Variant::INT, vformat("navigation_layer_%d/layers", i), PROPERTY_HINT_LAYERS_2D_NAVIGATION));
}
@@ -3362,7 +3362,7 @@ void TileSet::_get_property_list(List<PropertyInfo> *p_list) const {
for (int i = 1; i < Variant::VARIANT_MAX; i++) {
argt += "," + Variant::get_type_name(Variant::Type(i));
}
- p_list->push_back(PropertyInfo(Variant::NIL, "Custom data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP));
+ p_list->push_back(PropertyInfo(Variant::NIL, GNAME("Custom Data", ""), PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP));
for (int i = 0; i < custom_data_layers.size(); i++) {
p_list->push_back(PropertyInfo(Variant::STRING, vformat("custom_data_layer_%d/name", i)));
p_list->push_back(PropertyInfo(Variant::INT, vformat("custom_data_layer_%d/type", i), PROPERTY_HINT_ENUM, argt));
@@ -3376,10 +3376,10 @@ void TileSet::_get_property_list(List<PropertyInfo> *p_list) const {
// Tile Proxies.
// Note: proxies need to be set after sources are set.
- p_list->push_back(PropertyInfo(Variant::NIL, "Tile Proxies", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP));
- p_list->push_back(PropertyInfo(Variant::ARRAY, "tile_proxies/source_level", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NO_EDITOR));
- p_list->push_back(PropertyInfo(Variant::ARRAY, "tile_proxies/coords_level", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NO_EDITOR));
- p_list->push_back(PropertyInfo(Variant::ARRAY, "tile_proxies/alternative_level", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NO_EDITOR));
+ p_list->push_back(PropertyInfo(Variant::NIL, GNAME("Tile Proxies", ""), PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP));
+ p_list->push_back(PropertyInfo(Variant::ARRAY, PNAME("tile_proxies/source_level"), PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NO_EDITOR));
+ p_list->push_back(PropertyInfo(Variant::ARRAY, PNAME("tile_proxies/coords_level"), PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NO_EDITOR));
+ p_list->push_back(PropertyInfo(Variant::ARRAY, PNAME("tile_proxies/alternative_level"), PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NO_EDITOR));
// Patterns.
for (unsigned int pattern_index = 0; pattern_index < patterns.size(); pattern_index++) {
@@ -4887,9 +4887,9 @@ bool TileSetScenesCollectionSource::_get(const StringName &p_name, Variant &r_re
void TileSetScenesCollectionSource::_get_property_list(List<PropertyInfo> *p_list) const {
for (int i = 0; i < scenes_ids.size(); i++) {
- p_list->push_back(PropertyInfo(Variant::OBJECT, vformat("scenes/%d/scene", scenes_ids[i]), PROPERTY_HINT_RESOURCE_TYPE, "TileSetScenesCollectionSource"));
+ p_list->push_back(PropertyInfo(Variant::OBJECT, vformat("%s/%d/%s", PNAME("scenes"), scenes_ids[i], PNAME("scene")), PROPERTY_HINT_RESOURCE_TYPE, "TileSetScenesCollectionSource"));
- PropertyInfo property_info = PropertyInfo(Variant::BOOL, vformat("scenes/%d/display_placeholder", scenes_ids[i]));
+ PropertyInfo property_info = PropertyInfo(Variant::BOOL, vformat("%s/%d/%s", PNAME("scenes"), scenes_ids[i], PNAME("display_placeholder")));
if (scenes[scenes_ids[i]].display_placeholder == false) {
property_info.usage ^= PROPERTY_USAGE_STORAGE;
}
@@ -5692,10 +5692,10 @@ void TileData::_get_property_list(List<PropertyInfo> *p_list) const {
// Add the groups manually.
if (tile_set) {
// Occlusion layers.
- p_list->push_back(PropertyInfo(Variant::NIL, "Rendering", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP));
+ p_list->push_back(PropertyInfo(Variant::NIL, GNAME("Rendering", ""), PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP));
for (int i = 0; i < occluders.size(); i++) {
// occlusion_layer_%d/polygon
- property_info = PropertyInfo(Variant::OBJECT, vformat("occlusion_layer_%d/polygon", i), PROPERTY_HINT_RESOURCE_TYPE, "OccluderPolygon2D", PROPERTY_USAGE_DEFAULT);
+ property_info = PropertyInfo(Variant::OBJECT, vformat("occlusion_layer_%d/%s", i, PNAME("polygon")), PROPERTY_HINT_RESOURCE_TYPE, "OccluderPolygon2D", PROPERTY_USAGE_DEFAULT);
if (!occluders[i].is_valid()) {
property_info.usage ^= PROPERTY_USAGE_STORAGE;
}
@@ -5703,29 +5703,29 @@ void TileData::_get_property_list(List<PropertyInfo> *p_list) const {
}
// Physics layers.
- p_list->push_back(PropertyInfo(Variant::NIL, "Physics", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP));
+ p_list->push_back(PropertyInfo(Variant::NIL, GNAME("Physics", ""), PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP));
for (int i = 0; i < physics.size(); i++) {
- p_list->push_back(PropertyInfo(Variant::VECTOR2, vformat("physics_layer_%d/linear_velocity", i), PROPERTY_HINT_NONE));
- p_list->push_back(PropertyInfo(Variant::FLOAT, vformat("physics_layer_%d/angular_velocity", i), PROPERTY_HINT_NONE));
- p_list->push_back(PropertyInfo(Variant::INT, vformat("physics_layer_%d/polygons_count", i), PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR));
+ p_list->push_back(PropertyInfo(Variant::VECTOR2, vformat("physics_layer_%d/%s", i, PNAME("linear_velocity")), PROPERTY_HINT_NONE));
+ p_list->push_back(PropertyInfo(Variant::FLOAT, vformat("physics_layer_%d/%s", i, PNAME("angular_velocity")), PROPERTY_HINT_NONE));
+ p_list->push_back(PropertyInfo(Variant::INT, vformat("physics_layer_%d/%s", i, PNAME("polygons_count")), PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR));
for (int j = 0; j < physics[i].polygons.size(); j++) {
// physics_layer_%d/points
- property_info = PropertyInfo(Variant::ARRAY, vformat("physics_layer_%d/polygon_%d/points", i, j), PROPERTY_HINT_ARRAY_TYPE, "Vector2", PROPERTY_USAGE_DEFAULT);
+ property_info = PropertyInfo(Variant::ARRAY, vformat("physics_layer_%d/polygon_%d/%s", i, j, PNAME("points")), PROPERTY_HINT_ARRAY_TYPE, "Vector2", PROPERTY_USAGE_DEFAULT);
if (physics[i].polygons[j].polygon.is_empty()) {
property_info.usage ^= PROPERTY_USAGE_STORAGE;
}
p_list->push_back(property_info);
// physics_layer_%d/polygon_%d/one_way
- property_info = PropertyInfo(Variant::BOOL, vformat("physics_layer_%d/polygon_%d/one_way", i, j));
+ property_info = PropertyInfo(Variant::BOOL, vformat("physics_layer_%d/polygon_%d/%s", i, j, PNAME("one_way")));
if (physics[i].polygons[j].one_way == false) {
property_info.usage ^= PROPERTY_USAGE_STORAGE;
}
p_list->push_back(property_info);
// physics_layer_%d/polygon_%d/one_way_margin
- property_info = PropertyInfo(Variant::FLOAT, vformat("physics_layer_%d/polygon_%d/one_way_margin", i, j));
+ property_info = PropertyInfo(Variant::FLOAT, vformat("physics_layer_%d/polygon_%d/%s", i, j, PNAME("one_way_margin")));
if (physics[i].polygons[j].one_way_margin == 1.0) {
property_info.usage ^= PROPERTY_USAGE_STORAGE;
}
@@ -5735,7 +5735,7 @@ void TileData::_get_property_list(List<PropertyInfo> *p_list) const {
// Terrain data
if (terrain_set >= 0) {
- p_list->push_back(PropertyInfo(Variant::NIL, "Terrains", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP));
+ p_list->push_back(PropertyInfo(Variant::NIL, GNAME("Terrains", ""), PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP));
for (int i = 0; i < TileSet::CELL_NEIGHBOR_MAX; i++) {
TileSet::CellNeighbor bit = TileSet::CellNeighbor(i);
if (is_valid_terrain_peering_bit(bit)) {
@@ -5749,9 +5749,9 @@ void TileData::_get_property_list(List<PropertyInfo> *p_list) const {
}
// Navigation layers.
- p_list->push_back(PropertyInfo(Variant::NIL, "Navigation", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP));
+ p_list->push_back(PropertyInfo(Variant::NIL, GNAME("Navigation", ""), PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP));
for (int i = 0; i < navigation.size(); i++) {
- property_info = PropertyInfo(Variant::OBJECT, vformat("navigation_layer_%d/polygon", i), PROPERTY_HINT_RESOURCE_TYPE, "NavigationPolygon", PROPERTY_USAGE_DEFAULT);
+ property_info = PropertyInfo(Variant::OBJECT, vformat("navigation_layer_%d/%s", i, PNAME("polygon")), PROPERTY_HINT_RESOURCE_TYPE, "NavigationPolygon", PROPERTY_USAGE_DEFAULT);
if (!navigation[i].is_valid()) {
property_info.usage ^= PROPERTY_USAGE_STORAGE;
}
@@ -5759,7 +5759,7 @@ void TileData::_get_property_list(List<PropertyInfo> *p_list) const {
}
// Custom data layers.
- p_list->push_back(PropertyInfo(Variant::NIL, "Custom data", PROPERTY_HINT_NONE, "custom_data_", PROPERTY_USAGE_GROUP));
+ p_list->push_back(PropertyInfo(Variant::NIL, GNAME("Custom Data", "custom_data_"), PROPERTY_HINT_NONE, "custom_data_", PROPERTY_USAGE_GROUP));
for (int i = 0; i < custom_data.size(); i++) {
Variant default_val;
Callable::CallError error;
diff --git a/scene/resources/visual_shader_nodes.cpp b/scene/resources/visual_shader_nodes.cpp
index 7550f598f8..9f5a64597a 100644
--- a/scene/resources/visual_shader_nodes.cpp
+++ b/scene/resources/visual_shader_nodes.cpp
@@ -7606,8 +7606,11 @@ String VisualShaderNodeBillboard::generate_code(Shader::Mode p_mode, VisualShade
break;
case BILLBOARD_TYPE_PARTICLES:
code += " {\n";
- code += " mat4 __wm = mat4(normalize(INV_VIEW_MATRIX[0]) * length(MODEL_MATRIX[0]), normalize(INV_VIEW_MATRIX[1]) * length(MODEL_MATRIX[0]), normalize(INV_VIEW_MATRIX[2]) * length(MODEL_MATRIX[2]), MODEL_MATRIX[3]);\n";
+ code += " mat4 __wm = mat4(normalize(INV_VIEW_MATRIX[0]), normalize(INV_VIEW_MATRIX[1]), normalize(INV_VIEW_MATRIX[2]), MODEL_MATRIX[3]);\n";
code += " __wm = __wm * mat4(vec4(cos(INSTANCE_CUSTOM.x), -sin(INSTANCE_CUSTOM.x), 0.0, 0.0), vec4(sin(INSTANCE_CUSTOM.x), cos(INSTANCE_CUSTOM.x), 0.0, 0.0), vec4(0.0, 0.0, 1.0, 0.0), vec4(0.0, 0.0, 0.0, 1.0));\n";
+ if (keep_scale) {
+ code += " __wm = __wm * mat4(vec4(length(MODEL_MATRIX[0].xyz), 0.0, 0.0, 0.0), vec4(0.0, length(MODEL_MATRIX[1].xyz), 0.0, 0.0), vec4(0.0, 0.0, length(MODEL_MATRIX[2].xyz), 0.0), vec4(0.0, 0.0, 0.0, 1.0));\n";
+ }
code += " " + p_output_vars[0] + " = VIEW_MATRIX * __wm;\n";
code += " }\n";
break;
@@ -7650,7 +7653,7 @@ bool VisualShaderNodeBillboard::is_keep_scale_enabled() const {
Vector<StringName> VisualShaderNodeBillboard::get_editable_properties() const {
Vector<StringName> props;
props.push_back("billboard_type");
- if (billboard_type == BILLBOARD_TYPE_ENABLED || billboard_type == BILLBOARD_TYPE_FIXED_Y) {
+ if (billboard_type == BILLBOARD_TYPE_ENABLED || billboard_type == BILLBOARD_TYPE_FIXED_Y || billboard_type == BILLBOARD_TYPE_PARTICLES) {
props.push_back("keep_scale");
}
return props;
diff --git a/servers/audio/effects/audio_effect_pitch_shift.cpp b/servers/audio/effects/audio_effect_pitch_shift.cpp
index 2693b2a56a..11c1d44472 100644
--- a/servers/audio/effects/audio_effect_pitch_shift.cpp
+++ b/servers/audio/effects/audio_effect_pitch_shift.cpp
@@ -309,7 +309,7 @@ Ref<AudioEffectInstance> AudioEffectPitchShift::instantiate() {
}
void AudioEffectPitchShift::set_pitch_scale(float p_pitch_scale) {
- ERR_FAIL_COND(p_pitch_scale <= 0.0);
+ ERR_FAIL_COND(!(p_pitch_scale > 0.0));
pitch_scale = p_pitch_scale;
}
diff --git a/servers/navigation_server_2d.cpp b/servers/navigation_server_2d.cpp
index 668b1dffc3..273bb9ceda 100644
--- a/servers/navigation_server_2d.cpp
+++ b/servers/navigation_server_2d.cpp
@@ -152,14 +152,15 @@ void NavigationServer2D::_emit_map_changed(RID p_map) {
emit_signal(SNAME("map_changed"), p_map);
}
-#ifdef DEBUG_ENABLED
void NavigationServer2D::set_debug_enabled(bool p_enabled) {
NavigationServer3D::get_singleton()->set_debug_enabled(p_enabled);
}
+
bool NavigationServer2D::get_debug_enabled() const {
return NavigationServer3D::get_singleton()->get_debug_enabled();
}
+#ifdef DEBUG_ENABLED
void NavigationServer2D::set_debug_navigation_edge_connection_color(const Color &p_color) {
NavigationServer3D::get_singleton()->set_debug_navigation_edge_connection_color(p_color);
}
@@ -341,6 +342,9 @@ void NavigationServer2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("free_rid", "rid"), &NavigationServer2D::free);
+ ClassDB::bind_method(D_METHOD("set_debug_enabled", "enabled"), &NavigationServer2D::set_debug_enabled);
+ ClassDB::bind_method(D_METHOD("get_debug_enabled"), &NavigationServer2D::get_debug_enabled);
+
ADD_SIGNAL(MethodInfo("map_changed", PropertyInfo(Variant::RID, "map")));
ADD_SIGNAL(MethodInfo("navigation_debug_changed"));
diff --git a/servers/navigation_server_2d.h b/servers/navigation_server_2d.h
index 153e60272c..ed2e39e53c 100644
--- a/servers/navigation_server_2d.h
+++ b/servers/navigation_server_2d.h
@@ -234,10 +234,10 @@ public:
NavigationServer2D();
virtual ~NavigationServer2D();
-#ifdef DEBUG_ENABLED
void set_debug_enabled(bool p_enabled);
bool get_debug_enabled() const;
+#ifdef DEBUG_ENABLED
void set_debug_navigation_edge_connection_color(const Color &p_color);
Color get_debug_navigation_edge_connection_color() const;
diff --git a/servers/navigation_server_3d.cpp b/servers/navigation_server_3d.cpp
index fbe97b9acb..e5cc426708 100644
--- a/servers/navigation_server_3d.cpp
+++ b/servers/navigation_server_3d.cpp
@@ -116,6 +116,9 @@ void NavigationServer3D::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_active", "active"), &NavigationServer3D::set_active);
+ ClassDB::bind_method(D_METHOD("set_debug_enabled", "enabled"), &NavigationServer3D::set_debug_enabled);
+ ClassDB::bind_method(D_METHOD("get_debug_enabled"), &NavigationServer3D::get_debug_enabled);
+
ADD_SIGNAL(MethodInfo("map_changed", PropertyInfo(Variant::RID, "map")));
ADD_SIGNAL(MethodInfo("navigation_debug_changed"));
@@ -184,6 +187,24 @@ NavigationServer3D::~NavigationServer3D() {
singleton = nullptr;
}
+void NavigationServer3D::set_debug_enabled(bool p_enabled) {
+#ifdef DEBUG_ENABLED
+ if (debug_enabled != p_enabled) {
+ debug_dirty = true;
+ }
+
+ debug_enabled = p_enabled;
+
+ if (debug_dirty) {
+ call_deferred("_emit_navigation_debug_changed_signal");
+ }
+#endif // DEBUG_ENABLED
+}
+
+bool NavigationServer3D::get_debug_enabled() const {
+ return debug_enabled;
+}
+
#ifdef DEBUG_ENABLED
void NavigationServer3D::_emit_navigation_debug_changed_signal() {
if (debug_dirty) {
@@ -533,22 +554,6 @@ bool NavigationServer3D::get_debug_navigation_enable_link_connections_xray() con
return debug_navigation_enable_link_connections_xray;
}
-void NavigationServer3D::set_debug_enabled(bool p_enabled) {
- if (debug_enabled != p_enabled) {
- debug_dirty = true;
- }
-
- debug_enabled = p_enabled;
-
- if (debug_dirty) {
- call_deferred("_emit_navigation_debug_changed_signal");
- }
-}
-
-bool NavigationServer3D::get_debug_enabled() const {
- return debug_enabled;
-}
-
void NavigationServer3D::set_debug_navigation_enable_agent_paths(const bool p_value) {
if (debug_navigation_enable_agent_paths != p_value) {
debug_dirty = true;
diff --git a/servers/navigation_server_3d.h b/servers/navigation_server_3d.h
index 79729c55be..05df5ca0fe 100644
--- a/servers/navigation_server_3d.h
+++ b/servers/navigation_server_3d.h
@@ -274,9 +274,13 @@ public:
virtual int get_process_info(ProcessInfo p_info) const = 0;
-#ifdef DEBUG_ENABLED
+ void set_debug_enabled(bool p_enabled);
+ bool get_debug_enabled() const;
+
private:
bool debug_enabled = false;
+
+#ifdef DEBUG_ENABLED
bool debug_dirty = true;
void _emit_navigation_debug_changed_signal();
@@ -313,9 +317,6 @@ private:
Ref<StandardMaterial3D> debug_navigation_agent_path_point_material;
public:
- void set_debug_enabled(bool p_enabled);
- bool get_debug_enabled() const;
-
void set_debug_navigation_edge_connection_color(const Color &p_color);
Color get_debug_navigation_edge_connection_color() const;
diff --git a/servers/navigation_server_3d_dummy.h b/servers/navigation_server_3d_dummy.h
index d2f8fe6048..fd9226e59e 100644
--- a/servers/navigation_server_3d_dummy.h
+++ b/servers/navigation_server_3d_dummy.h
@@ -112,6 +112,8 @@ public:
void process(real_t delta_time) override {}
NavigationUtilities::PathQueryResult _query_path(const NavigationUtilities::PathQueryParameters &p_parameters) const override { return NavigationUtilities::PathQueryResult(); }
int get_process_info(ProcessInfo p_info) const override { return 0; }
+ void set_debug_enabled(bool p_enabled) {}
+ bool get_debug_enabled() const { return false; }
};
#endif // NAVIGATION_SERVER_3D_DUMMY_H
diff --git a/servers/physics_3d/godot_shape_3d.cpp b/servers/physics_3d/godot_shape_3d.cpp
index 300dca4e08..d566d612ce 100644
--- a/servers/physics_3d/godot_shape_3d.cpp
+++ b/servers/physics_3d/godot_shape_3d.cpp
@@ -1092,6 +1092,8 @@ void GodotConvexPolygonShape3D::_setup(const Vector<Vector3> &p_vertices) {
if (err != OK) {
ERR_PRINT("Failed to build convex hull");
}
+ extreme_vertices.resize(0);
+ vertex_neighbors.resize(0);
AABB _aabb;
diff --git a/servers/rendering/renderer_rd/effects/ss_effects.cpp b/servers/rendering/renderer_rd/effects/ss_effects.cpp
index e031e33041..9389f8149e 100644
--- a/servers/rendering/renderer_rd/effects/ss_effects.cpp
+++ b/servers/rendering/renderer_rd/effects/ss_effects.cpp
@@ -484,7 +484,7 @@ void SSEffects::downsample_depth(Ref<RenderSceneBuffersRD> p_render_buffers, uin
downsample_uniform_set = uniform_set_cache->get_cache_vec(shader, 2, u_depths);
}
- float depth_linearize_mul = -p_projection.columns[3][2];
+ float depth_linearize_mul = -p_projection.columns[3][2] * 0.5;
float depth_linearize_add = p_projection.columns[2][2];
if (depth_linearize_mul * depth_linearize_add < 0) {
depth_linearize_add = -depth_linearize_add;
@@ -668,8 +668,14 @@ void SSEffects::screen_space_indirect_lighting(Ref<RenderSceneBuffersRD> p_rende
ssil.gather_push_constant.screen_size[0] = p_settings.full_screen_size.x;
ssil.gather_push_constant.screen_size[1] = p_settings.full_screen_size.y;
- ssil.gather_push_constant.half_screen_pixel_size[0] = 1.0 / p_ssil_buffers.buffer_width;
- ssil.gather_push_constant.half_screen_pixel_size[1] = 1.0 / p_ssil_buffers.buffer_height;
+ ssil.gather_push_constant.half_screen_pixel_size[0] = 2.0 / p_settings.full_screen_size.x;
+ ssil.gather_push_constant.half_screen_pixel_size[1] = 2.0 / p_settings.full_screen_size.y;
+ if (ssil_half_size) {
+ ssil.gather_push_constant.half_screen_pixel_size[0] *= 2.0;
+ ssil.gather_push_constant.half_screen_pixel_size[1] *= 2.0;
+ }
+ ssil.gather_push_constant.half_screen_pixel_size_x025[0] = ssil.gather_push_constant.half_screen_pixel_size[0] * 0.75;
+ ssil.gather_push_constant.half_screen_pixel_size_x025[1] = ssil.gather_push_constant.half_screen_pixel_size[1] * 0.75;
float tan_half_fov_x = 1.0 / p_projection.columns[0][0];
float tan_half_fov_y = 1.0 / p_projection.columns[1][1];
ssil.gather_push_constant.NDC_to_view_mul[0] = tan_half_fov_x * 2.0;
@@ -680,9 +686,6 @@ void SSEffects::screen_space_indirect_lighting(Ref<RenderSceneBuffersRD> p_rende
ssil.gather_push_constant.z_far = p_projection.get_z_far();
ssil.gather_push_constant.is_orthogonal = p_projection.is_orthogonal();
- ssil.gather_push_constant.half_screen_pixel_size_x025[0] = ssil.gather_push_constant.half_screen_pixel_size[0] * 0.25;
- ssil.gather_push_constant.half_screen_pixel_size_x025[1] = ssil.gather_push_constant.half_screen_pixel_size[1] * 0.25;
-
ssil.gather_push_constant.radius = p_settings.radius;
float radius_near_limit = (p_settings.radius * 1.2f);
if (ssil_quality <= RS::ENV_SSIL_QUALITY_LOW) {
@@ -733,7 +736,7 @@ void SSEffects::screen_space_indirect_lighting(Ref<RenderSceneBuffersRD> p_rende
RD::Uniform u_depth_texture_view;
u_depth_texture_view.uniform_type = RD::UNIFORM_TYPE_SAMPLER_WITH_TEXTURE;
u_depth_texture_view.binding = 0;
- u_depth_texture_view.append_id(default_sampler);
+ u_depth_texture_view.append_id(ss_effects.mirror_sampler);
u_depth_texture_view.append_id(depth_texture_view);
RD::Uniform u_normal_buffer;
@@ -1056,8 +1059,14 @@ void SSEffects::generate_ssao(Ref<RenderSceneBuffersRD> p_render_buffers, SSAORe
ssao.gather_push_constant.screen_size[0] = p_settings.full_screen_size.x;
ssao.gather_push_constant.screen_size[1] = p_settings.full_screen_size.y;
- ssao.gather_push_constant.half_screen_pixel_size[0] = 1.0 / p_ssao_buffers.buffer_width;
- ssao.gather_push_constant.half_screen_pixel_size[1] = 1.0 / p_ssao_buffers.buffer_height;
+ ssao.gather_push_constant.half_screen_pixel_size[0] = 2.0 / p_settings.full_screen_size.x;
+ ssao.gather_push_constant.half_screen_pixel_size[1] = 2.0 / p_settings.full_screen_size.y;
+ if (ssao_half_size) {
+ ssao.gather_push_constant.half_screen_pixel_size[0] *= 2.0;
+ ssao.gather_push_constant.half_screen_pixel_size[1] *= 2.0;
+ }
+ ssao.gather_push_constant.half_screen_pixel_size_x025[0] = ssao.gather_push_constant.half_screen_pixel_size[0] * 0.75;
+ ssao.gather_push_constant.half_screen_pixel_size_x025[1] = ssao.gather_push_constant.half_screen_pixel_size[1] * 0.75;
float tan_half_fov_x = 1.0 / p_projection.columns[0][0];
float tan_half_fov_y = 1.0 / p_projection.columns[1][1];
ssao.gather_push_constant.NDC_to_view_mul[0] = tan_half_fov_x * 2.0;
@@ -1066,9 +1075,6 @@ void SSEffects::generate_ssao(Ref<RenderSceneBuffersRD> p_render_buffers, SSAORe
ssao.gather_push_constant.NDC_to_view_add[1] = tan_half_fov_y;
ssao.gather_push_constant.is_orthogonal = p_projection.is_orthogonal();
- ssao.gather_push_constant.half_screen_pixel_size_x025[0] = ssao.gather_push_constant.half_screen_pixel_size[0] * 0.25;
- ssao.gather_push_constant.half_screen_pixel_size_x025[1] = ssao.gather_push_constant.half_screen_pixel_size[1] * 0.25;
-
ssao.gather_push_constant.radius = p_settings.radius;
float radius_near_limit = (p_settings.radius * 1.2f);
if (ssao_quality <= RS::ENV_SSAO_QUALITY_LOW) {
@@ -1105,7 +1111,7 @@ void SSEffects::generate_ssao(Ref<RenderSceneBuffersRD> p_render_buffers, SSAORe
RD::Uniform u_depth_texture_view;
u_depth_texture_view.uniform_type = RD::UNIFORM_TYPE_SAMPLER_WITH_TEXTURE;
u_depth_texture_view.binding = 0;
- u_depth_texture_view.append_id(default_sampler);
+ u_depth_texture_view.append_id(ss_effects.mirror_sampler);
u_depth_texture_view.append_id(depth_texture_view);
RD::Uniform u_normal_buffer;
diff --git a/servers/rendering/renderer_rd/shaders/effects/ss_effects_downsample.glsl b/servers/rendering/renderer_rd/shaders/effects/ss_effects_downsample.glsl
index b1ff46dd3b..4f81e36c58 100644
--- a/servers/rendering/renderer_rd/shaders/effects/ss_effects_downsample.glsl
+++ b/servers/rendering/renderer_rd/shaders/effects/ss_effects_downsample.glsl
@@ -161,17 +161,11 @@ void prepare_depths_and_mips(vec4 p_samples, uvec2 p_output_coord, uvec2 p_gtid)
still_alive = p_gtid.x % 16 == depth_array_offset.x && depth_array_offset.y % 16 == depth_array_offset.y;
p_output_coord /= 2;
- groupMemoryBarrier();
- barrier();
if (still_alive) {
+ // Use the previous average, not ideal, but still not bad.
float sample_00 = depth_buffer[depth_array_index][buffer_coord.x + 0][buffer_coord.y + 0];
- float sample_01 = depth_buffer[depth_array_index][buffer_coord.x + 0][buffer_coord.y + 8];
- float sample_10 = depth_buffer[depth_array_index][buffer_coord.x + 8][buffer_coord.y + 0];
- float sample_11 = depth_buffer[depth_array_index][buffer_coord.x + 8][buffer_coord.y + 8];
-
- float avg = mip_smart_average(vec4(sample_00, sample_01, sample_10, sample_11));
- imageStore(dest_image4, ivec3(p_output_coord.x, p_output_coord.y, depth_array_index), vec4(avg));
+ imageStore(dest_image4, ivec3(p_output_coord.x, p_output_coord.y, depth_array_index), vec4(sample_00));
}
#endif
}
@@ -190,6 +184,7 @@ void prepare_depths(vec4 p_samples, uvec2 p_tid) {
void main() {
#ifdef USE_HALF_BUFFERS
+// Half buffers means that we divide depth into two half res buffers (we only capture 1/4 of pixels).
#ifdef USE_HALF_SIZE
float sample_00 = texelFetch(source_depth, ivec2(4 * gl_GlobalInvocationID.x + 0, 4 * gl_GlobalInvocationID.y + 0), 0).x;
float sample_11 = texelFetch(source_depth, ivec2(4 * gl_GlobalInvocationID.x + 2, 4 * gl_GlobalInvocationID.y + 2), 0).x;
@@ -219,11 +214,11 @@ void main() {
vec2 uv = (vec2(depth_buffer_coord) + 0.5f) * params.pixel_size;
vec4 samples = textureGather(source_depth, uv);
-#endif
+#endif //USE_HALF_SIZE
#ifdef GENERATE_MIPS
prepare_depths_and_mips(samples, output_coord, gl_LocalInvocationID.xy);
#else
prepare_depths(samples, gl_GlobalInvocationID.xy);
#endif
-#endif
+#endif //USE_HALF_BUFFERS
}
diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp
index a727e83513..940363a7e8 100644
--- a/servers/rendering/shader_language.cpp
+++ b/servers/rendering/shader_language.cpp
@@ -8780,7 +8780,7 @@ Error ShaderLanguage::_parse_shader(const HashMap<StringName, FunctionInfo> &p_f
--texture_uniforms;
--texture_binding;
if (OS::get_singleton()->get_current_rendering_method() == "gl_compatibility") {
- _set_error(RTR("'hint_normal_roughness_texture is not supported in gl_compatibility shaders."));
+ _set_error(RTR("'hint_normal_roughness_texture' is not supported in gl_compatibility shaders."));
return ERR_PARSE_ERROR;
}
} break;
diff --git a/servers/rendering_server.cpp b/servers/rendering_server.cpp
index 05b1a8f87a..3d0443b494 100644
--- a/servers/rendering_server.cpp
+++ b/servers/rendering_server.cpp
@@ -2856,8 +2856,8 @@ RenderingServer::RenderingServer() {
}
void RenderingServer::init() {
- GLOBAL_DEF_RST("rendering/textures/vram_compression/import_s3tc_bptc", OS::get_singleton()->get_preferred_texture_format() == OS::PREFERRED_TEXTURE_FORMAT_S3TC_BPTC);
- GLOBAL_DEF_RST("rendering/textures/vram_compression/import_etc2_astc", OS::get_singleton()->get_preferred_texture_format() == OS::PREFERRED_TEXTURE_FORMAT_ETC2_ASTC);
+ GLOBAL_DEF_RST_NOVAL_BASIC("rendering/textures/vram_compression/import_s3tc_bptc", OS::get_singleton()->get_preferred_texture_format() == OS::PREFERRED_TEXTURE_FORMAT_S3TC_BPTC);
+ GLOBAL_DEF_RST_NOVAL_BASIC("rendering/textures/vram_compression/import_etc2_astc", OS::get_singleton()->get_preferred_texture_format() == OS::PREFERRED_TEXTURE_FORMAT_ETC2_ASTC);
GLOBAL_DEF("rendering/textures/lossless_compression/force_png", false);
diff --git a/tests/core/templates/test_paged_array.h b/tests/core/templates/test_paged_array.h
index 37be3080e8..10dc4473ca 100644
--- a/tests/core/templates/test_paged_array.h
+++ b/tests/core/templates/test_paged_array.h
@@ -148,6 +148,57 @@ TEST_CASE("[PagedArray] Shared pool fill, including merging") {
array2.reset(); //reset so pagepool can be reset
pool.reset();
}
+
+TEST_CASE("[PagedArray] Extensive merge_unordered() test") {
+ for (int page_size = 1; page_size <= 128; page_size *= 2) {
+ PagedArrayPool<uint32_t> pool(page_size);
+ PagedArray<uint32_t> array1;
+ PagedArray<uint32_t> array2;
+ array1.set_page_pool(&pool);
+ array2.set_page_pool(&pool);
+
+ const int max_count = 123;
+ // Test merging arrays of lengths 0+123, 1+122, 2+121, ..., 123+0
+ for (uint32_t j = 0; j < max_count; j++) {
+ CHECK(array1.size() == 0);
+ CHECK(array2.size() == 0);
+
+ uint32_t sum = 12345;
+ for (uint32_t i = 0; i < j; i++) {
+ // Hashing the addend makes it extremely unlikely for any values
+ // other than the original inputs to produce a matching sum
+ uint32_t addend = hash_murmur3_one_32(i) + i;
+ array1.push_back(addend);
+ sum += addend;
+ }
+ for (uint32_t i = j; i < max_count; i++) {
+ // See above
+ uint32_t addend = hash_murmur3_one_32(i) + i;
+ array2.push_back(addend);
+ sum += addend;
+ }
+
+ CHECK(array1.size() == j);
+ CHECK(array2.size() == max_count - j);
+
+ array1.merge_unordered(array2);
+ CHECK_MESSAGE(array1.size() == max_count, "merge_unordered() added/dropped elements while merging");
+
+ // If any elements were altered during merging, the sum will not match up.
+ for (uint32_t i = 0; i < array1.size(); i++) {
+ sum -= array1[i];
+ }
+ CHECK_MESSAGE(sum == 12345, "merge_unordered() altered elements while merging");
+
+ array1.clear();
+ }
+
+ array1.reset();
+ array2.reset();
+ pool.reset();
+ }
+}
+
} // namespace TestPagedArray
#endif // TEST_PAGED_ARRAY_H
diff --git a/tests/scene/test_text_edit.h b/tests/scene/test_text_edit.h
index 64ad3bd5b0..f3f2b4cb34 100644
--- a/tests/scene/test_text_edit.h
+++ b/tests/scene/test_text_edit.h
@@ -1779,6 +1779,50 @@ TEST_CASE("[SceneTree][TextEdit] text entry") {
SIGNAL_CHECK("lines_edited_from", lines_edited_args);
}
+ SUBCASE("[TextEdit] ui_text_backspace_word same line") {
+ text_edit->set_text("test test test");
+ text_edit->set_caret_column(4);
+ text_edit->add_caret(0, 9);
+ text_edit->add_caret(0, 15);
+
+ // For the second caret.
+ Array args2;
+ args2.push_back(0);
+ lines_edited_args.push_front(args2);
+
+ // For the third caret.
+ Array args3;
+ args2.push_back(0);
+ lines_edited_args.push_front(args2);
+
+ CHECK(text_edit->get_caret_count() == 3);
+ MessageQueue::get_singleton()->flush();
+
+ SIGNAL_DISCARD("text_set");
+ SIGNAL_DISCARD("text_changed");
+ SIGNAL_DISCARD("lines_edited_from");
+ SIGNAL_DISCARD("caret_changed");
+
+ SEND_GUI_ACTION("ui_text_backspace_word");
+ CHECK(text_edit->get_viewport()->is_input_handled());
+ CHECK(text_edit->get_text() == " ");
+ CHECK(text_edit->get_caret_line() == 0);
+ CHECK(text_edit->get_caret_column() == 0);
+ CHECK_FALSE(text_edit->has_selection(0));
+
+ CHECK(text_edit->get_caret_line(1) == 0);
+ CHECK(text_edit->get_caret_column(1) == 1);
+ CHECK_FALSE(text_edit->has_selection(1));
+
+ CHECK(text_edit->get_caret_line(2) == 0);
+ CHECK(text_edit->get_caret_column(2) == 2);
+ CHECK_FALSE(text_edit->has_selection(1));
+
+ SIGNAL_CHECK("caret_changed", empty_signal_args);
+ SIGNAL_CHECK("text_changed", empty_signal_args);
+ SIGNAL_CHECK("lines_edited_from", lines_edited_args);
+ }
+
SUBCASE("[TextEdit] ui_text_backspace") {
text_edit->set_text("\nthis is some test text.\n\nthis is some test text.");
text_edit->select(1, 0, 1, 4);
diff --git a/thirdparty/basis_universal/encoder/basisu_comp.cpp b/thirdparty/basis_universal/encoder/basisu_comp.cpp
index 41eae2b78a..4e69e9e2ee 100644
--- a/thirdparty/basis_universal/encoder/basisu_comp.cpp
+++ b/thirdparty/basis_universal/encoder/basisu_comp.cpp
@@ -28,7 +28,7 @@
#endif
#if BASISD_SUPPORT_KTX2_ZSTD
-#include "../zstd/zstd.h"
+#include <zstd.h>
#endif
// Set to 1 to disable the mipPadding alignment workaround (which only seems to be needed when no key-values are written at all)
diff --git a/thirdparty/basis_universal/transcoder/basisu_transcoder.cpp b/thirdparty/basis_universal/transcoder/basisu_transcoder.cpp
index 3aeba0ee7a..c698861f3b 100644
--- a/thirdparty/basis_universal/transcoder/basisu_transcoder.cpp
+++ b/thirdparty/basis_universal/transcoder/basisu_transcoder.cpp
@@ -155,7 +155,7 @@
// If BASISD_SUPPORT_KTX2_ZSTD is 0, UASTC files compressed with Zstd cannot be loaded.
#if BASISD_SUPPORT_KTX2_ZSTD
// We only use two Zstd API's: ZSTD_decompress() and ZSTD_isError()
- #include "../zstd/zstd.h"
+ #include <zstd.h>
#endif
#endif