summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/SCsub65
-rw-r--r--modules/astcenc/image_compress_astcenc.cpp5
-rw-r--r--modules/csg/csg.cpp4
-rw-r--r--modules/csg/csg_shape.cpp6
-rw-r--r--modules/enet/doc_classes/ENetConnection.xml2
-rw-r--r--modules/enet/enet_multiplayer_peer.cpp4
-rw-r--r--modules/fbx/fbx_document.cpp38
-rw-r--r--modules/gdscript/README.md2
-rw-r--r--modules/gdscript/doc_classes/@GDScript.xml3
-rw-r--r--modules/gdscript/editor/gdscript_translation_parser_plugin.cpp8
-rw-r--r--modules/gdscript/editor/gdscript_translation_parser_plugin.h2
-rw-r--r--modules/gdscript/gdscript.cpp68
-rw-r--r--modules/gdscript/gdscript.h2
-rw-r--r--modules/gdscript/gdscript_analyzer.cpp58
-rw-r--r--modules/gdscript/gdscript_compiler.cpp22
-rw-r--r--modules/gdscript/gdscript_editor.cpp60
-rw-r--r--modules/gdscript/gdscript_parser.cpp52
-rw-r--r--modules/gdscript/gdscript_parser.h11
-rw-r--r--modules/gdscript/gdscript_utility_functions.cpp2
-rw-r--r--modules/gdscript/gdscript_vm.cpp11
-rw-r--r--modules/gdscript/gdscript_warning.cpp2
-rw-r--r--modules/gdscript/language_server/gdscript_extend_parser.cpp2
-rw-r--r--modules/gdscript/language_server/gdscript_workspace.cpp8
-rw-r--r--modules/gdscript/tests/gdscript_test_runner.cpp5
-rw-r--r--modules/gdscript/tests/gdscript_test_runner_suite.h18
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/cast_enum_to_int.gd1
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/export_enum_as_dictionary.out10
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/preload_constant_types_are_inferred.gd1
-rw-r--r--modules/gdscript/tests/scripts/completion/get_node/literal_scene/dollar_class_scene.cfg2
-rw-r--r--modules/gdscript/tests/scripts/completion/get_node/literal_scene/dollar_native_scene.cfg2
-rw-r--r--modules/gdscript/tests/scripts/completion/get_node/literal_scene/percent_class_scene.cfg2
-rw-r--r--modules/gdscript/tests/scripts/completion/get_node/literal_scene/percent_native_scene.cfg2
-rw-r--r--modules/gdscript/tests/scripts/completion/get_node/local_interfered_scene/class_local_interfered_scene.cfg2
-rw-r--r--modules/gdscript/tests/scripts/completion/get_node/local_interfered_scene/native_local_interfered_scene.cfg2
-rw-r--r--modules/gdscript/tests/scripts/completion/get_node/local_scene/class_local_scene.cfg2
-rw-r--r--modules/gdscript/tests/scripts/completion/get_node/local_scene/native_local_scene.cfg2
-rw-r--r--modules/gdscript/tests/scripts/completion/get_node/local_typehint/class_local_typehint.cfg2
-rw-r--r--modules/gdscript/tests/scripts/completion/get_node/local_typehint/native_local_typehint.cfg2
-rw-r--r--modules/gdscript/tests/scripts/completion/get_node/member_interfered_scene/class_member_interfered_scene.cfg2
-rw-r--r--modules/gdscript/tests/scripts/completion/get_node/member_interfered_scene/native_member_interfered_scene.cfg2
-rw-r--r--modules/gdscript/tests/scripts/completion/get_node/member_scene/class_member_scene.cfg2
-rw-r--r--modules/gdscript/tests/scripts/completion/get_node/member_scene/native_member_scene.cfg2
-rw-r--r--modules/gdscript/tests/scripts/completion/get_node/member_typehint/class_member_typehint.cfg2
-rw-r--r--modules/gdscript/tests/scripts/completion/get_node/member_typehint/native_member_typehint.cfg2
-rw-r--r--modules/gdscript/tests/scripts/lsp/lambdas.gd4
-rw-r--r--modules/gdscript/tests/scripts/lsp/local_variables.gd4
-rw-r--r--modules/gdscript/tests/scripts/lsp/properties.gd2
-rw-r--r--modules/gdscript/tests/scripts/lsp/scopes.gd10
-rw-r--r--modules/gdscript/tests/scripts/parser/features/annotations.out24
-rw-r--r--modules/gdscript/tests/scripts/parser/features/export_arrays.out138
-rw-r--r--modules/gdscript/tests/scripts/parser/features/export_enum.out40
-rw-r--r--modules/gdscript/tests/scripts/parser/features/export_variable.gd34
-rw-r--r--modules/gdscript/tests/scripts/parser/features/export_variable.out60
-rw-r--r--modules/gdscript/tests/scripts/parser/features/match_multiple_patterns_with_array.gd1
-rw-r--r--modules/gdscript/tests/scripts/parser/warnings/return_value_discarded.gd1
-rw-r--r--modules/gdscript/tests/scripts/parser/warnings/return_value_discarded.out4
-rw-r--r--modules/gdscript/tests/scripts/parser/warnings/standalone_expression.gd13
-rw-r--r--modules/gdscript/tests/scripts/parser/warnings/standalone_expression.out8
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/argument_count.gd2
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/call_native_static_method_validated.gd1
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/export_group_no_name_conflict_with_properties.out6
-rw-r--r--modules/gdscript/tests/scripts/utils.notest.gd15
-rw-r--r--modules/gdscript/tests/test_gdscript.cpp6
-rw-r--r--modules/gdscript/tests/test_lsp.h2
-rw-r--r--modules/gltf/editor/editor_scene_exporter_gltf_settings.cpp10
-rw-r--r--modules/gltf/editor/editor_scene_importer_blend.cpp2
-rw-r--r--modules/gltf/gltf_document.cpp75
-rw-r--r--modules/gltf/skin_tool.cpp24
-rw-r--r--modules/gridmap/doc_classes/GridMap.xml2
-rw-r--r--modules/gridmap/editor/grid_map_editor_plugin.cpp17
-rw-r--r--modules/gridmap/grid_map.cpp6
-rw-r--r--modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp54
-rw-r--r--modules/lightmapper_rd/lightmapper_rd.cpp14
-rw-r--r--modules/lightmapper_rd/lightmapper_rd.h9
-rw-r--r--modules/lightmapper_rd/lm_compute.glsl5
-rw-r--r--modules/modules_builders.py15
-rw-r--r--modules/mono/class_db_api_json.cpp4
-rw-r--r--modules/mono/csharp_script.cpp50
-rw-r--r--modules/mono/csharp_script.h4
-rw-r--r--modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Sdk/Sdk.props2
-rw-r--r--modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Sdk/iOSNativeAOT.targets10
-rw-r--r--modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/AllReadOnly_ScriptProperties.generated.cs6
-rw-r--r--modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/AllWriteOnly_ScriptProperties.generated.cs2
-rw-r--r--modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ClassPartialModifier.GD0001.fixed.cs2
-rw-r--r--modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ExportedFields_ScriptProperties.generated.cs236
-rw-r--r--modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ExportedProperties_ScriptProperties.generated.cs272
-rw-r--r--modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/MixedReadOnlyWriteOnly_ScriptProperties.generated.cs10
-rw-r--r--modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ScriptBoilerplate_ScriptMethods.generated.cs2
-rw-r--r--modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ScriptBoilerplate_ScriptProperties.generated.cs4
-rw-r--r--modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/ClassPartialModifier.GD0001.cs2
-rw-r--r--modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/GlobalClass.GD0401.cs2
-rw-r--r--modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/GlobalClass.GD0402.cs2
-rw-r--r--modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/MustBeVariant.GD0301.cs4
-rw-r--r--modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptMethodsGenerator.cs9
-rw-r--r--modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs63
-rw-r--r--modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptSignalsGenerator.cs9
-rw-r--r--modules/mono/editor/GodotTools/GodotTools.OpenVisualStudio/GodotTools.OpenVisualStudio.csproj1
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Build/BuildProblemsView.cs2
-rw-r--r--modules/mono/editor/bindings_generator.cpp41
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Aabb.cs6
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/ScriptManagerBridge.cs18
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/StringExtensions.cs18
-rw-r--r--modules/multiplayer/editor/editor_network_profiler.cpp4
-rw-r--r--modules/multiplayer/editor/multiplayer_editor_plugin.cpp2
-rw-r--r--modules/multiplayer/editor/replication_editor.cpp6
-rw-r--r--modules/multiplayer/multiplayer_spawner.cpp5
-rw-r--r--modules/multiplayer/multiplayer_synchronizer.cpp2
-rw-r--r--modules/multiplayer/scene_cache_interface.cpp5
-rw-r--r--modules/multiplayer/scene_replication_config.cpp13
-rw-r--r--modules/multiplayer/scene_replication_interface.cpp15
-rw-r--r--modules/navigation/3d/godot_navigation_server_3d.cpp2
-rw-r--r--modules/navigation/editor/navigation_mesh_editor_plugin.cpp4
-rw-r--r--modules/navigation/nav_map.cpp4
-rw-r--r--modules/noise/editor/noise_editor_plugin.cpp2
-rw-r--r--modules/noise/noise_texture_2d.cpp1
-rw-r--r--modules/openxr/action_map/openxr_action_map.cpp8
-rw-r--r--modules/openxr/action_map/openxr_action_set.cpp2
-rw-r--r--modules/openxr/action_map/openxr_interaction_profile.cpp2
-rw-r--r--modules/openxr/doc_classes/OpenXRCompositionLayer.xml4
-rw-r--r--modules/openxr/editor/openxr_action_editor.cpp2
-rw-r--r--modules/openxr/editor/openxr_action_map_editor.cpp8
-rw-r--r--modules/openxr/editor/openxr_action_set_editor.cpp6
-rw-r--r--modules/openxr/editor/openxr_interaction_profile_editor.cpp4
-rw-r--r--modules/openxr/editor/openxr_select_action_dialog.cpp2
-rw-r--r--modules/openxr/editor/openxr_select_interaction_profile_dialog.cpp2
-rw-r--r--modules/openxr/extensions/openxr_composition_layer_extension.cpp9
-rw-r--r--modules/openxr/openxr_api.cpp10
-rw-r--r--modules/openxr/openxr_interface.cpp2
-rw-r--r--modules/openxr/scene/openxr_composition_layer.cpp129
-rw-r--r--modules/openxr/scene/openxr_composition_layer.h10
-rw-r--r--modules/openxr/scene/openxr_composition_layer_cylinder.cpp7
-rw-r--r--modules/openxr/scene/openxr_composition_layer_cylinder.h1
-rw-r--r--modules/openxr/scene/openxr_composition_layer_equirect.cpp7
-rw-r--r--modules/openxr/scene/openxr_composition_layer_equirect.h1
-rw-r--r--modules/openxr/scene/openxr_composition_layer_quad.cpp7
-rw-r--r--modules/openxr/scene/openxr_composition_layer_quad.h1
-rw-r--r--modules/regex/regex.cpp2
-rw-r--r--modules/svg/SCsub13
-rw-r--r--modules/text_server_adv/SCsub2
-rw-r--r--modules/text_server_adv/gdextension_build/SConstruct25
-rw-r--r--modules/text_server_adv/text_server_adv.h40
-rw-r--r--modules/text_server_fb/gdextension_build/SConstruct23
-rw-r--r--modules/text_server_fb/text_server_fb.h40
-rw-r--r--modules/upnp/SCsub3
-rw-r--r--modules/upnp/upnp.cpp8
-rw-r--r--modules/webp/SCsub1
-rw-r--r--modules/webrtc/webrtc_multiplayer_peer.cpp22
-rw-r--r--modules/websocket/remote_debugger_peer_websocket.cpp4
-rw-r--r--modules/webxr/webxr_interface_js.cpp3
149 files changed, 1367 insertions, 1001 deletions
diff --git a/modules/SCsub b/modules/SCsub
index 6fb2aa67f4..739c5de0b5 100644
--- a/modules/SCsub
+++ b/modules/SCsub
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-import modules_builders
+import methods
import os
Import("env")
@@ -12,15 +12,51 @@ env_modules.Append(CPPDEFINES=["GODOT_MODULE"])
Export("env_modules")
-# Header with MODULE_*_ENABLED defines.
-env.Depends("modules_enabled.gen.h", Value(env.module_list))
-env.CommandNoCache(
- "modules_enabled.gen.h",
- Value(env.module_list),
- env.Run(modules_builders.generate_modules_enabled),
+
+def register_module_types_builder(target, source, env):
+ modules = source[0].read()
+ mod_inc = "\n".join([f'#include "{p}/register_types.h"' for p in modules.values()])
+ mod_init = "\n".join(
+ [f"#ifdef MODULE_{n.upper()}_ENABLED\n\tinitialize_{n}_module(p_level);\n#endif" for n in modules.keys()]
+ )
+ mod_uninit = "\n".join(
+ [f"#ifdef MODULE_{n.upper()}_ENABLED\n\tuninitialize_{n}_module(p_level);\n#endif" for n in modules.keys()]
+ )
+ with methods.generated_wrapper(target) as file:
+ file.write(
+ f"""\
+#include "register_module_types.h"
+
+#include "modules/modules_enabled.gen.h"
+
+{mod_inc}
+
+void initialize_modules(ModuleInitializationLevel p_level) {{
+{mod_init}
+}}
+
+void uninitialize_modules(ModuleInitializationLevel p_level) {{
+{mod_uninit}
+}}
+"""
+ )
+
+
+register_module_types = env.CommandNoCache(
+ "register_module_types.gen.cpp", env.Value(env.modules_detected), env.Run(register_module_types_builder)
)
+# Header with MODULE_*_ENABLED defines.
+def modules_enabled_builder(target, source, env):
+ with methods.generated_wrapper(target) as file:
+ for module in source[0].read():
+ file.write(f"#define MODULE_{module.upper()}_ENABLED\n")
+
+
+env.CommandNoCache("modules_enabled.gen.h", env.Value(env.module_list), env.Run(modules_enabled_builder))
+
+
vs_sources = []
test_headers = []
# libmodule_<name>.a for each active module.
@@ -47,18 +83,19 @@ for name, path in env.module_list.items():
# Generate header to be included in `tests/test_main.cpp` to run module-specific tests.
if env["tests"]:
- env.Depends("modules_tests.gen.h", test_headers)
- env.CommandNoCache(
- "modules_tests.gen.h",
- test_headers,
- env.Run(modules_builders.generate_modules_tests),
- )
+
+ def modules_tests_builder(target, source, env):
+ with methods.generated_wrapper(target) as file:
+ for header in source:
+ file.write('#include "{}"\n'.format(os.path.normpath(header.path).replace("\\", "/")))
+
+ env.CommandNoCache("modules_tests.gen.h", test_headers, env.Run(modules_tests_builder))
# libmodules.a with only register_module_types.
# Must be last so that all libmodule_<name>.a libraries are on the right side
# in the linker command.
env.modules_sources = []
-env_modules.add_source_files(env.modules_sources, "register_module_types.gen.cpp")
+env_modules.add_source_files(env.modules_sources, register_module_types)
lib = env_modules.add_library("modules", env.modules_sources)
env.Prepend(LIBS=[lib])
if env["vsproj"]:
diff --git a/modules/astcenc/image_compress_astcenc.cpp b/modules/astcenc/image_compress_astcenc.cpp
index 941c1f44be..499cf739c4 100644
--- a/modules/astcenc/image_compress_astcenc.cpp
+++ b/modules/astcenc/image_compress_astcenc.cpp
@@ -132,7 +132,10 @@ void _compress_astc(Image *r_img, Image::ASTCFormat p_format) {
int dst_mip_w, dst_mip_h;
int dst_ofs = Image::get_image_mipmap_offset_and_dimensions(width, height, target_format, i, dst_mip_w, dst_mip_h);
// Ensure that mip offset is a multiple of 8 (etcpak expects uint64_t pointer).
- ERR_FAIL_COND(dst_ofs % 8 != 0);
+ if (unlikely(dst_ofs % 8 != 0)) {
+ astcenc_context_free(context);
+ ERR_FAIL_MSG("astcenc: Mip offset is not a multiple of 8.");
+ }
uint8_t *dest_mip_write = (uint8_t *)&dest_write[dst_ofs];
// Compress image.
diff --git a/modules/csg/csg.cpp b/modules/csg/csg.cpp
index 878664bb9c..a4a3c768e9 100644
--- a/modules/csg/csg.cpp
+++ b/modules/csg/csg.cpp
@@ -852,7 +852,7 @@ int CSGBrushOperation::Build2DFaces::_add_vertex(const Vertex2D &p_vertex) {
}
void CSGBrushOperation::Build2DFaces::_add_vertex_idx_sorted(Vector<int> &r_vertex_indices, int p_new_vertex_index) {
- if (p_new_vertex_index >= 0 && r_vertex_indices.find(p_new_vertex_index) == -1) {
+ if (p_new_vertex_index >= 0 && !r_vertex_indices.has(p_new_vertex_index)) {
ERR_FAIL_COND_MSG(p_new_vertex_index >= vertices.size(), "Invalid vertex index.");
// The first vertex.
@@ -1098,7 +1098,7 @@ void CSGBrushOperation::Build2DFaces::_find_edge_intersections(const Vector2 p_s
};
// Check if edge has already been processed.
- if (processed_edges.find(edge_points_and_uvs) != -1) {
+ if (processed_edges.has(edge_points_and_uvs)) {
continue;
}
diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp
index 7c93fbf081..8d2847ab1a 100644
--- a/modules/csg/csg_shape.cpp
+++ b/modules/csg/csg_shape.cpp
@@ -1824,13 +1824,13 @@ CSGBrush *CSGPolygon3D::_build_brush() {
Path3D *current_path = Object::cast_to<Path3D>(get_node_or_null(path_node));
if (path != current_path) {
if (path) {
- path->disconnect("tree_exited", callable_mp(this, &CSGPolygon3D::_path_exited));
+ path->disconnect(SceneStringName(tree_exited), callable_mp(this, &CSGPolygon3D::_path_exited));
path->disconnect("curve_changed", callable_mp(this, &CSGPolygon3D::_path_changed));
path->set_update_callback(Callable());
}
path = current_path;
if (path) {
- path->connect("tree_exited", callable_mp(this, &CSGPolygon3D::_path_exited));
+ path->connect(SceneStringName(tree_exited), callable_mp(this, &CSGPolygon3D::_path_exited));
path->connect("curve_changed", callable_mp(this, &CSGPolygon3D::_path_changed));
path->set_update_callback(callable_mp(this, &CSGPolygon3D::_path_changed));
}
@@ -2140,7 +2140,7 @@ CSGBrush *CSGPolygon3D::_build_brush() {
void CSGPolygon3D::_notification(int p_what) {
if (p_what == NOTIFICATION_EXIT_TREE) {
if (path) {
- path->disconnect("tree_exited", callable_mp(this, &CSGPolygon3D::_path_exited));
+ path->disconnect(SceneStringName(tree_exited), callable_mp(this, &CSGPolygon3D::_path_exited));
path->disconnect("curve_changed", callable_mp(this, &CSGPolygon3D::_path_changed));
path = nullptr;
}
diff --git a/modules/enet/doc_classes/ENetConnection.xml b/modules/enet/doc_classes/ENetConnection.xml
index 5ca1ec2228..5795dd8976 100644
--- a/modules/enet/doc_classes/ENetConnection.xml
+++ b/modules/enet/doc_classes/ENetConnection.xml
@@ -151,7 +151,7 @@
<param index="1" name="destination_port" type="int" />
<param index="2" name="packet" type="PackedByteArray" />
<description>
- Sends a [param packet] toward a destination from the address and port currently bound by this ENetConnection instance.
+ Sends a [param packet] toward a destination from the address and port currently bound by this ENetConnection instance.
This is useful as it serves to establish entries in NAT routing tables on all devices between this bound instance and the public facing internet, allowing a prospective client's connection packets to be routed backward through the NAT device(s) between the public internet and this host.
This requires forward knowledge of a prospective client's address and communication port as seen by the public internet - after any NAT devices have handled their connection request. This information can be obtained by a [url=https://en.wikipedia.org/wiki/STUN]STUN[/url] service, and must be handed off to your host by an entity that is not the prospective client. This will never work for a client behind a Symmetric NAT due to the nature of the Symmetric NAT routing algorithm, as their IP and Port cannot be known beforehand.
</description>
diff --git a/modules/enet/enet_multiplayer_peer.cpp b/modules/enet/enet_multiplayer_peer.cpp
index 910c4ed242..6f87a398c7 100644
--- a/modules/enet/enet_multiplayer_peer.cpp
+++ b/modules/enet/enet_multiplayer_peer.cpp
@@ -124,9 +124,9 @@ Error ENetMultiplayerPeer::add_mesh_peer(int p_id, Ref<ENetConnection> p_host) {
ERR_FAIL_COND_V_MSG(active_mode != MODE_MESH, ERR_UNCONFIGURED, "The multiplayer instance is not configured as a mesh. Call 'create_mesh' first.");
List<Ref<ENetPacketPeer>> host_peers;
p_host->get_peers(host_peers);
- ERR_FAIL_COND_V_MSG(host_peers.size() != 1 || host_peers[0]->get_state() != ENetPacketPeer::STATE_CONNECTED, ERR_INVALID_PARAMETER, "The provided host must have exactly one peer in the connected state.");
+ ERR_FAIL_COND_V_MSG(host_peers.size() != 1 || host_peers.front()->get()->get_state() != ENetPacketPeer::STATE_CONNECTED, ERR_INVALID_PARAMETER, "The provided host must have exactly one peer in the connected state.");
hosts[p_id] = p_host;
- peers[p_id] = host_peers[0];
+ peers[p_id] = host_peers.front()->get();
emit_signal(SNAME("peer_connected"), p_id);
return OK;
}
diff --git a/modules/fbx/fbx_document.cpp b/modules/fbx/fbx_document.cpp
index 6e9b85dc35..1361e871de 100644
--- a/modules/fbx/fbx_document.cpp
+++ b/modules/fbx/fbx_document.cpp
@@ -217,6 +217,16 @@ static ufbx_skin_deformer *_find_skin_deformer(ufbx_skin_cluster *p_cluster) {
return nullptr;
}
+static String _find_element_name(ufbx_element *p_element) {
+ if (p_element->name.length > 0) {
+ return FBXDocument::_as_string(p_element->name);
+ } else if (p_element->instances.count > 0) {
+ return _find_element_name(&p_element->instances[0]->element);
+ } else {
+ return "";
+ }
+}
+
struct ThreadPoolFBX {
struct Group {
ufbx_thread_pool_context ctx = {};
@@ -2026,7 +2036,7 @@ Error FBXDocument::_parse(Ref<FBXState> p_state, String p_path, Ref<FileAccess>
opts.space_conversion = UFBX_SPACE_CONVERSION_MODIFY_GEOMETRY;
if (!p_state->get_allow_geometry_helper_nodes()) {
opts.geometry_transform_handling = UFBX_GEOMETRY_TRANSFORM_HANDLING_MODIFY_GEOMETRY_NO_FALLBACK;
- opts.inherit_mode_handling = UFBX_INHERIT_MODE_HANDLING_IGNORE;
+ opts.inherit_mode_handling = UFBX_INHERIT_MODE_HANDLING_COMPENSATE_NO_FALLBACK;
} else {
opts.geometry_transform_handling = UFBX_GEOMETRY_TRANSFORM_HANDLING_HELPER_NODES;
opts.inherit_mode_handling = UFBX_INHERIT_MODE_HANDLING_COMPENSATE;
@@ -2068,6 +2078,32 @@ Error FBXDocument::_parse(Ref<FBXState> p_state, String p_path, Ref<FileAccess>
ERR_FAIL_V_MSG(ERR_PARSE_ERROR, err_buf);
}
+ const int max_warning_count = 10;
+ int warning_count[UFBX_WARNING_TYPE_COUNT] = {};
+ int ignored_warning_count = 0;
+ for (const ufbx_warning &warning : p_state->scene->metadata.warnings) {
+ if (warning_count[warning.type]++ < max_warning_count) {
+ if (warning.count > 1) {
+ WARN_PRINT(vformat("FBX: ufbx warning: %s (x%d)", _as_string(warning.description), (int)warning.count));
+ } else {
+ String element_name;
+ if (warning.element_id != UFBX_NO_INDEX) {
+ element_name = _find_element_name(p_state->scene->elements[warning.element_id]);
+ }
+ if (!element_name.is_empty()) {
+ WARN_PRINT(vformat("FBX: ufbx warning in '%s': %s", element_name, _as_string(warning.description)));
+ } else {
+ WARN_PRINT(vformat("FBX: ufbx warning: %s", _as_string(warning.description)));
+ }
+ }
+ } else {
+ ignored_warning_count++;
+ }
+ }
+ if (ignored_warning_count > 0) {
+ WARN_PRINT(vformat("FBX: ignored %d further ufbx warnings", ignored_warning_count));
+ }
+
err = _parse_fbx_state(p_state, p_path);
ERR_FAIL_COND_V(err != OK, err);
diff --git a/modules/gdscript/README.md b/modules/gdscript/README.md
index 865475d37d..a4367b39ff 100644
--- a/modules/gdscript/README.md
+++ b/modules/gdscript/README.md
@@ -136,4 +136,4 @@ There are many other classes in the GDScript module. Here is a brief overview of
- The [virtual machine](gdscript_vm.cpp) is essentially defined as calling `GDScriptFunction::call()`.
- Editor-related functions can be found in parts of `GDScriptLanguage`, originally declared in [`gdscript.h`](gdscript.h) but defined in [`gdscript_editor.cpp`](gdscript_editor.cpp). Code highlighting can be found in [`GDScriptSyntaxHighlighter`](editor/gdscript_highlighter.h).
- GDScript decompilation is found in [`gdscript_disassembler.cpp`](gdscript_disassembler.h), defined as `GDScriptFunction::disassemble()`.
-- Documentation generation from GDScript comments in [`GDScriptDocGen`](editor/gdscript_docgen.h) \ No newline at end of file
+- Documentation generation from GDScript comments in [`GDScriptDocGen`](editor/gdscript_docgen.h)
diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml
index 07d917ea04..1909ca5ab5 100644
--- a/modules/gdscript/doc_classes/@GDScript.xml
+++ b/modules/gdscript/doc_classes/@GDScript.xml
@@ -349,10 +349,11 @@
<param index="1" name="hint_string" type="String" />
<param index="2" name="usage" type="int" enum="PropertyUsageFlags" is_bitfield="true" default="6" />
<description>
- Allows you to set a custom hint, hint string, and usage flags for the exported property. Note that there's no validation done in GDScript, it will just pass the hint along to the editor.
+ Allows you to set a custom hint, hint string, and usage flags for the exported property. Note that there's no validation done in GDScript, it will just pass the parameters to the editor.
[codeblock]
@export_custom(PROPERTY_HINT_NONE, "suffix:m") var suffix: Vector3
[/codeblock]
+ [b]Note:[/b] Regardless of the [param usage] value, the [constant PROPERTY_USAGE_SCRIPT_VARIABLE] flag is always added, as with any explicitly declared script variable.
</description>
</annotation>
<annotation name="@export_dir">
diff --git a/modules/gdscript/editor/gdscript_translation_parser_plugin.cpp b/modules/gdscript/editor/gdscript_translation_parser_plugin.cpp
index 316281209a..d74d316704 100644
--- a/modules/gdscript/editor/gdscript_translation_parser_plugin.cpp
+++ b/modules/gdscript/editor/gdscript_translation_parser_plugin.cpp
@@ -276,8 +276,8 @@ void GDScriptEditorTranslationParserPlugin::_assess_call(const GDScriptParser::C
id_ctx_plural.resize(3);
bool extract_id_ctx_plural = true;
- if (function_name == tr_func) {
- // Extract from tr(id, ctx).
+ if (function_name == tr_func || function_name == atr_func) {
+ // Extract from `tr(id, ctx)` or `atr(id, ctx)`.
for (int i = 0; i < p_call->arguments.size(); i++) {
if (_is_constant_string(p_call->arguments[i])) {
id_ctx_plural.write[i] = p_call->arguments[i]->reduced_value;
@@ -289,8 +289,8 @@ void GDScriptEditorTranslationParserPlugin::_assess_call(const GDScriptParser::C
if (extract_id_ctx_plural) {
ids_ctx_plural->push_back(id_ctx_plural);
}
- } else if (function_name == trn_func) {
- // Extract from tr_n(id, plural, n, ctx).
+ } else if (function_name == trn_func || function_name == atrn_func) {
+ // Extract from `tr_n(id, plural, n, ctx)` or `atr_n(id, plural, n, ctx)`.
Vector<int> indices;
indices.push_back(0);
indices.push_back(3);
diff --git a/modules/gdscript/editor/gdscript_translation_parser_plugin.h b/modules/gdscript/editor/gdscript_translation_parser_plugin.h
index fe876134c2..61ff81ed66 100644
--- a/modules/gdscript/editor/gdscript_translation_parser_plugin.h
+++ b/modules/gdscript/editor/gdscript_translation_parser_plugin.h
@@ -45,6 +45,8 @@ class GDScriptEditorTranslationParserPlugin : public EditorTranslationParserPlug
// List of patterns used for extracting translation strings.
StringName tr_func = "tr";
StringName trn_func = "tr_n";
+ StringName atr_func = "atr";
+ StringName atrn_func = "atr_n";
HashSet<StringName> assignment_patterns;
HashSet<StringName> first_arg_patterns;
HashSet<StringName> second_arg_patterns;
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp
index 19b264d764..0c58b41fcb 100644
--- a/modules/gdscript/gdscript.cpp
+++ b/modules/gdscript/gdscript.cpp
@@ -49,11 +49,12 @@
#include "core/config/engine.h"
#include "core/config/project_settings.h"
#include "core/core_constants.h"
-#include "core/core_string_names.h"
#include "core/io/file_access.h"
#include "core/io/file_access_encrypted.h"
#include "core/os/os.h"
+#include "scene/scene_string_names.h"
+
#ifdef TOOLS_ENABLED
#include "editor/editor_paths.h"
#endif
@@ -395,6 +396,8 @@ bool GDScript::get_property_default_value(const StringName &p_property, Variant
}
ScriptInstance *GDScript::instance_create(Object *p_this) {
+ ERR_FAIL_COND_V_MSG(!valid, nullptr, "Script is invalid!");
+
GDScript *top = this;
while (top->_base) {
top = top->_base;
@@ -901,6 +904,11 @@ void GDScript::unload_static() const {
}
Variant GDScript::callp(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
+ if (unlikely(!valid)) {
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
+ return Variant();
+ }
+
GDScript *top = this;
while (top) {
HashMap<StringName, GDScriptFunction *>::Iterator E = top->member_functions.find(p_method);
@@ -923,6 +931,10 @@ bool GDScript::_get(const StringName &p_name, Variant &r_ret) const {
return true;
}
+ if (unlikely(!valid)) {
+ return false;
+ }
+
const GDScript *top = this;
while (top) {
{
@@ -979,6 +991,10 @@ bool GDScript::_set(const StringName &p_name, const Variant &p_value) {
return true;
}
+ if (unlikely(!valid)) {
+ return false;
+ }
+
GDScript *top = this;
while (top) {
HashMap<StringName, MemberInfo>::ConstIterator E = top->static_variables_indices.find(p_name);
@@ -1013,6 +1029,10 @@ bool GDScript::_set(const StringName &p_name, const Variant &p_value) {
void GDScript::_get_property_list(List<PropertyInfo> *p_properties) const {
p_properties->push_back(PropertyInfo(Variant::STRING, "script/source", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NO_EDITOR | PROPERTY_USAGE_INTERNAL));
+ if (unlikely(!valid)) {
+ return;
+ }
+
List<const GDScript *> classes;
const GDScript *top = this;
while (top) {
@@ -1629,6 +1649,10 @@ GDScript::~GDScript() {
//////////////////////////////
bool GDScriptInstance::set(const StringName &p_name, const Variant &p_value) {
+ if (unlikely(!script->valid)) {
+ return false;
+ }
+
{
HashMap<StringName, GDScript::MemberInfo>::Iterator E = script->member_indices.find(p_name);
if (E) {
@@ -1702,6 +1726,10 @@ bool GDScriptInstance::set(const StringName &p_name, const Variant &p_value) {
}
bool GDScriptInstance::get(const StringName &p_name, Variant &r_ret) const {
+ if (unlikely(!script->valid)) {
+ return false;
+ }
+
{
HashMap<StringName, GDScript::MemberInfo>::ConstIterator E = script->member_indices.find(p_name);
if (E) {
@@ -1822,6 +1850,10 @@ void GDScriptInstance::validate_property(PropertyInfo &p_property) const {
}
void GDScriptInstance::get_property_list(List<PropertyInfo> *p_properties) const {
+ if (unlikely(!script->valid)) {
+ return;
+ }
+
// exported members, not done yet!
const GDScript *sptr = script.ptr();
@@ -1900,6 +1932,10 @@ void GDScriptInstance::get_property_list(List<PropertyInfo> *p_properties) const
}
bool GDScriptInstance::property_can_revert(const StringName &p_name) const {
+ if (unlikely(!script->valid)) {
+ return false;
+ }
+
Variant name = p_name;
const Variant *args[1] = { &name };
@@ -1920,6 +1956,10 @@ bool GDScriptInstance::property_can_revert(const StringName &p_name) const {
}
bool GDScriptInstance::property_get_revert(const StringName &p_name, Variant &r_ret) const {
+ if (unlikely(!script->valid)) {
+ return false;
+ }
+
Variant name = p_name;
const Variant *args[1] = { &name };
@@ -1994,8 +2034,13 @@ void GDScriptInstance::_call_implicit_ready_recursively(GDScript *p_script) {
}
Variant GDScriptInstance::callp(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
+ if (unlikely(!script->valid)) {
+ r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
+ return Variant();
+ }
+
GDScript *sptr = script.ptr();
- if (unlikely(p_method == SNAME("_ready"))) {
+ if (unlikely(p_method == SceneStringName(_ready))) {
// Call implicit ready first, including for the super classes recursively.
_call_implicit_ready_recursively(sptr);
}
@@ -2011,6 +2056,10 @@ Variant GDScriptInstance::callp(const StringName &p_method, const Variant **p_ar
}
void GDScriptInstance::notification(int p_notification, bool p_reversed) {
+ if (unlikely(!script->valid)) {
+ return;
+ }
+
//notification is not virtual, it gets called at ALL levels just like in C.
Variant value = p_notification;
const Variant *args[1] = { &value };
@@ -2038,15 +2087,15 @@ void GDScriptInstance::notification(int p_notification, bool p_reversed) {
}
String GDScriptInstance::to_string(bool *r_valid) {
- if (has_method(CoreStringNames::get_singleton()->_to_string)) {
+ if (has_method(CoreStringName(_to_string))) {
Callable::CallError ce;
- Variant ret = callp(CoreStringNames::get_singleton()->_to_string, nullptr, 0, ce);
+ Variant ret = callp(CoreStringName(_to_string), nullptr, 0, ce);
if (ce.error == Callable::CallError::CALL_OK) {
if (ret.get_type() != Variant::STRING) {
if (r_valid) {
*r_valid = false;
}
- ERR_FAIL_V_MSG(String(), "Wrong type for " + CoreStringNames::get_singleton()->_to_string + ", must be a String.");
+ ERR_FAIL_V_MSG(String(), "Wrong type for " + CoreStringName(_to_string) + ", must be a String.");
}
if (r_valid) {
*r_valid = true;
@@ -2919,7 +2968,7 @@ String ResourceFormatLoaderGDScript::get_resource_type(const String &p_path) con
return "";
}
-void ResourceFormatLoaderGDScript::get_dependencies(const String &p_path, List<String> *r_dependencies, bool p_add_types) {
+void ResourceFormatLoaderGDScript::get_dependencies(const String &p_path, List<String> *p_dependencies, bool p_add_types) {
Ref<FileAccess> file = FileAccess::open(p_path, FileAccess::READ);
ERR_FAIL_COND_MSG(file.is_null(), "Cannot open file '" + p_path + "'.");
@@ -2933,13 +2982,8 @@ void ResourceFormatLoaderGDScript::get_dependencies(const String &p_path, List<S
return;
}
- GDScriptAnalyzer analyzer(&parser);
- if (OK != analyzer.analyze()) {
- return;
- }
-
for (const String &E : parser.get_dependencies()) {
- r_dependencies->push_back(E);
+ p_dependencies->push_back(E);
}
}
diff --git a/modules/gdscript/gdscript.h b/modules/gdscript/gdscript.h
index f63b0da745..728459de44 100644
--- a/modules/gdscript/gdscript.h
+++ b/modules/gdscript/gdscript.h
@@ -638,7 +638,7 @@ public:
virtual void get_recognized_extensions(List<String> *p_extensions) const override;
virtual bool handles_type(const String &p_type) const override;
virtual String get_resource_type(const String &p_path) const override;
- virtual void get_dependencies(const String &p_path, List<String> *r_dependencies, bool p_add_types = false) override;
+ virtual void get_dependencies(const String &p_path, List<String> *p_dependencies, bool p_add_types = false) override;
};
class ResourceFormatSaverGDScript : public ResourceFormatSaver {
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp
index 279be65f03..a2680c932f 100644
--- a/modules/gdscript/gdscript_analyzer.cpp
+++ b/modules/gdscript/gdscript_analyzer.cpp
@@ -37,7 +37,6 @@
#include "core/config/engine.h"
#include "core/config/project_settings.h"
#include "core/core_constants.h"
-#include "core/core_string_names.h"
#include "core/io/file_access.h"
#include "core/io/resource_loader.h"
#include "core/object/class_db.h"
@@ -231,7 +230,7 @@ bool GDScriptAnalyzer::has_member_name_conflict_in_native_type(const StringName
if (ClassDB::has_integer_constant(p_native_type_string, p_member_name)) {
return true;
}
- if (p_member_name == CoreStringNames::get_singleton()->_script) {
+ if (p_member_name == CoreStringName(script)) {
return true;
}
@@ -562,11 +561,6 @@ Error GDScriptAnalyzer::resolve_class_inheritance(GDScriptParser::ClassNode *p_c
class_type.native_type = result.native_type;
p_class->set_datatype(class_type);
- // Add base class to the list of dependencies.
- if (result.kind == GDScriptParser::DataType::CLASS) {
- parser->add_dependency(result.script_path);
- }
-
// Apply annotations.
for (GDScriptParser::AnnotationNode *&E : p_class->annotations) {
resolve_annotation(E);
@@ -873,11 +867,6 @@ GDScriptParser::DataType GDScriptAnalyzer::resolve_datatype(GDScriptParser::Type
}
p_type->set_datatype(result);
-
- if (result.kind == GDScriptParser::DataType::CLASS || result.kind == GDScriptParser::DataType::SCRIPT) {
- parser->add_dependency(result.script_path);
- }
-
return result;
}
@@ -2172,7 +2161,7 @@ void GDScriptAnalyzer::resolve_for(GDScriptParser::ForNode *p_for) {
List<GDScriptParser::DataType> par_types;
int default_arg_count = 0;
BitField<MethodFlags> method_flags;
- if (get_function_signature(p_for->list, false, list_type, CoreStringNames::get_singleton()->_iter_get, return_type, par_types, default_arg_count, method_flags)) {
+ if (get_function_signature(p_for->list, false, list_type, CoreStringName(_iter_get), return_type, par_types, default_arg_count, method_flags)) {
variable_type = return_type;
variable_type.type_source = list_type.type_source;
} else if (!list_type.is_hard_type()) {
@@ -3129,24 +3118,28 @@ void GDScriptAnalyzer::reduce_call(GDScriptParser::CallNode *p_call, bool p_is_a
bool types_match = true;
- for (int i = 0; i < p_call->arguments.size(); i++) {
- GDScriptParser::DataType par_type = type_from_property(info.arguments[i], true);
- GDScriptParser::DataType arg_type = p_call->arguments[i]->get_datatype();
- if (!is_type_compatible(par_type, arg_type, true)) {
- types_match = false;
- break;
+ {
+ List<PropertyInfo>::ConstIterator arg_itr = info.arguments.begin();
+ for (int i = 0; i < p_call->arguments.size(); ++arg_itr, ++i) {
+ GDScriptParser::DataType par_type = type_from_property(*arg_itr, true);
+ GDScriptParser::DataType arg_type = p_call->arguments[i]->get_datatype();
+ if (!is_type_compatible(par_type, arg_type, true)) {
+ types_match = false;
+ break;
#ifdef DEBUG_ENABLED
- } else {
- if (par_type.builtin_type == Variant::INT && arg_type.builtin_type == Variant::FLOAT && builtin_type != Variant::INT) {
- parser->push_warning(p_call, GDScriptWarning::NARROWING_CONVERSION, function_name);
- }
+ } else {
+ if (par_type.builtin_type == Variant::INT && arg_type.builtin_type == Variant::FLOAT && builtin_type != Variant::INT) {
+ parser->push_warning(p_call, GDScriptWarning::NARROWING_CONVERSION, function_name);
+ }
#endif
+ }
}
}
if (types_match) {
- for (int i = 0; i < p_call->arguments.size(); i++) {
- GDScriptParser::DataType par_type = type_from_property(info.arguments[i], true);
+ List<PropertyInfo>::ConstIterator arg_itr = info.arguments.begin();
+ for (int i = 0; i < p_call->arguments.size(); ++arg_itr, ++i) {
+ GDScriptParser::DataType par_type = type_from_property(*arg_itr, true);
if (p_call->arguments[i]->is_constant) {
update_const_expression_builtin_type(p_call->arguments[i], par_type, "pass");
}
@@ -3366,8 +3359,8 @@ void GDScriptAnalyzer::reduce_call(GDScriptParser::CallNode *p_call, bool p_is_a
// If the function requires typed arrays we must make literals be typed.
for (const KeyValue<int, GDScriptParser::ArrayNode *> &E : arrays) {
int index = E.key;
- if (index < par_types.size() && par_types[index].is_hard_type() && par_types[index].has_container_element_type(0)) {
- update_array_literal_element_type(E.value, par_types[index].get_container_element_type(0));
+ if (index < par_types.size() && par_types.get(index).is_hard_type() && par_types.get(index).has_container_element_type(0)) {
+ update_array_literal_element_type(E.value, par_types.get(index).get_container_element_type(0));
}
}
validate_call_arg(par_types, default_arg_count, method_flags.has_flag(METHOD_FLAG_VARARG), p_call);
@@ -3401,6 +3394,7 @@ void GDScriptAnalyzer::reduce_call(GDScriptParser::CallNode *p_call, bool p_is_a
}
#ifdef DEBUG_ENABLED
+ // FIXME: No warning for built-in constructors and utilities due to early return.
if (p_is_root && return_type.kind != GDScriptParser::DataType::UNRESOLVED && return_type.builtin_type != Variant::NIL &&
!(p_call->is_super && p_call->function_name == GDScriptLanguage::get_singleton()->strings._init)) {
parser->push_warning(p_call, GDScriptWarning::RETURN_VALUE_DISCARDED, p_call->function_name);
@@ -4108,7 +4102,6 @@ void GDScriptAnalyzer::reduce_identifier(GDScriptParser::IdentifierNode *p_ident
if (ScriptServer::is_global_class(name)) {
p_identifier->set_datatype(make_global_class_meta_type(name, p_identifier));
- parser->add_dependency(p_identifier->get_datatype().script_path);
return;
}
@@ -4151,7 +4144,6 @@ void GDScriptAnalyzer::reduce_identifier(GDScriptParser::IdentifierNode *p_ident
}
result.is_constant = true;
p_identifier->set_datatype(result);
- parser->add_dependency(autoload.path);
return;
}
}
@@ -4271,6 +4263,7 @@ void GDScriptAnalyzer::reduce_preload(GDScriptParser::PreloadNode *p_preload) {
push_error("Preloaded path must be a constant string.", p_preload->path);
} else {
p_preload->resolved_path = p_preload->path->reduced_value;
+ // TODO: Save this as script dependency.
if (p_preload->resolved_path.is_relative_path()) {
p_preload->resolved_path = parser->script_path.get_base_dir().path_join(p_preload->resolved_path);
}
@@ -4301,8 +4294,6 @@ void GDScriptAnalyzer::reduce_preload(GDScriptParser::PreloadNode *p_preload) {
push_error(vformat(R"(Could not preload resource file "%s".)", p_preload->resolved_path), p_preload->path);
}
}
-
- parser->add_dependency(p_preload->resolved_path);
}
}
@@ -5225,12 +5216,13 @@ void GDScriptAnalyzer::validate_call_arg(const List<GDScriptParser::DataType> &p
push_error(vformat(R"*(Too many arguments for "%s()" call. Expected at most %d but received %d.)*", p_call->function_name, p_par_types.size(), p_call->arguments.size()), p_call->arguments[p_par_types.size()]);
}
- for (int i = 0; i < p_call->arguments.size(); i++) {
+ List<GDScriptParser::DataType>::ConstIterator par_itr = p_par_types.begin();
+ for (int i = 0; i < p_call->arguments.size(); ++par_itr, ++i) {
if (i >= p_par_types.size()) {
// Already on vararg place.
break;
}
- GDScriptParser::DataType par_type = p_par_types[i];
+ GDScriptParser::DataType par_type = *par_itr;
if (par_type.is_hard_type() && p_call->arguments[i]->is_constant) {
update_const_expression_builtin_type(p_call->arguments[i], par_type, "pass");
diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp
index a8a7f3d9f7..eeffc13a10 100644
--- a/modules/gdscript/gdscript_compiler.cpp
+++ b/modules/gdscript/gdscript_compiler.cpp
@@ -37,7 +37,8 @@
#include "core/config/engine.h"
#include "core/config/project_settings.h"
-#include "core/core_string_names.h"
+
+#include "scene/scene_string_names.h"
bool GDScriptCompiler::_is_class_member_property(CodeGen &codegen, const StringName &p_name) {
if (codegen.function_node && codegen.function_node->is_static) {
@@ -241,9 +242,9 @@ static bool _can_use_validate_call(const MethodBind *p_method, const Vector<GDSc
}
MethodInfo info;
ClassDB::get_method_info(p_method->get_instance_class(), p_method->get_name(), &info);
- for (int i = 0; i < p_arguments.size(); i++) {
- const PropertyInfo &prop = info.arguments[i];
- if (!_is_exact_type(prop, p_arguments[i].type)) {
+ int i = 0;
+ for (List<PropertyInfo>::ConstIterator itr = info.arguments.begin(); itr != info.arguments.end(); ++itr, ++i) {
+ if (!_is_exact_type(*itr, p_arguments[i].type)) {
return false;
}
}
@@ -346,7 +347,7 @@ GDScriptCodeGenerator::Address GDScriptCompiler::_parse_expression(CodeGen &code
scr = scr->_base;
}
- if (nc && (identifier == CoreStringNames::get_singleton()->_free || ClassDB::has_signal(nc->get_name(), identifier) || ClassDB::has_method(nc->get_name(), identifier))) {
+ if (nc && (identifier == CoreStringName(free_) || ClassDB::has_signal(nc->get_name(), identifier) || ClassDB::has_method(nc->get_name(), identifier))) {
// Get like it was a property.
GDScriptCodeGenerator::Address temp = codegen.add_temporary(); // TODO: Get type here.
GDScriptCodeGenerator::Address self(GDScriptCodeGenerator::Address::SELF);
@@ -2235,7 +2236,7 @@ GDScriptFunction *GDScriptCompiler::_parse_function(Error &r_error, GDScript *p_
return_type = _gdtype_from_datatype(p_func->get_datatype(), p_script);
} else {
if (p_for_ready) {
- func_name = "_ready";
+ func_name = SceneStringName(_ready);
} else {
func_name = "@implicit_new";
}
@@ -2666,7 +2667,10 @@ Error GDScriptCompiler::_prepare_compilation(GDScript *p_script, const GDScriptP
GDScriptDataType base_type = _gdtype_from_datatype(p_class->base_type, p_script, false);
+ ERR_FAIL_COND_V_MSG(base_type.native_type == StringName(), ERR_BUG, vformat(R"(Failed to get base class for "%s")", p_script->path));
+
int native_idx = GDScriptLanguage::get_singleton()->get_global_map()[base_type.native_type];
+
p_script->native = GDScriptLanguage::get_singleton()->get_global_array()[native_idx];
ERR_FAIL_COND_V(p_script->native.is_null(), ERR_BUG);
@@ -3224,7 +3228,11 @@ Error GDScriptCompiler::compile(const GDScriptParser *p_parser, GDScript *p_scri
GDScriptCache::add_static_script(p_script);
}
- return GDScriptCache::finish_compiling(main_script->path);
+ err = GDScriptCache::finish_compiling(main_script->path);
+ if (err) {
+ main_script->valid = false;
+ }
+ return err;
}
String GDScriptCompiler::get_error() const {
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp
index 74d383c57f..4ae39d80cd 100644
--- a/modules/gdscript/gdscript_editor.cpp
+++ b/modules/gdscript/gdscript_editor.cpp
@@ -911,6 +911,29 @@ static void _find_annotation_arguments(const GDScriptParser::AnnotationNode *p_a
option.insert_text = option.display.quote(p_quote_style);
r_result.insert(option.display, option);
}
+ } else if (p_annotation->name == SNAME("@export_custom")) {
+ switch (p_argument) {
+ case 0: {
+ static HashMap<StringName, int64_t> items;
+ if (unlikely(items.is_empty())) {
+ CoreConstants::get_enum_values(SNAME("PropertyHint"), &items);
+ }
+ for (const KeyValue<StringName, int64_t> &item : items) {
+ ScriptLanguage::CodeCompletionOption option(item.key, ScriptLanguage::CODE_COMPLETION_KIND_CONSTANT);
+ r_result.insert(option.display, option);
+ }
+ } break;
+ case 2: {
+ static HashMap<StringName, int64_t> items;
+ if (unlikely(items.is_empty())) {
+ CoreConstants::get_enum_values(SNAME("PropertyUsageFlags"), &items);
+ }
+ for (const KeyValue<StringName, int64_t> &item : items) {
+ ScriptLanguage::CodeCompletionOption option(item.key, ScriptLanguage::CODE_COMPLETION_KIND_CONSTANT);
+ r_result.insert(option.display, option);
+ }
+ } break;
+ }
} else if (p_annotation->name == SNAME("@warning_ignore")) {
for (int warning_code = 0; warning_code < GDScriptWarning::WARNING_MAX; warning_code++) {
ScriptLanguage::CodeCompletionOption warning(GDScriptWarning::get_name_from_code((GDScriptWarning::Code)warning_code).to_lower(), ScriptLanguage::CODE_COMPLETION_KIND_PLAIN_TEXT);
@@ -1695,6 +1718,7 @@ static bool _guess_expression_type(GDScriptParser::CompletionContext &p_context,
if (full) {
// If not fully constant, setting this value is detrimental to the inference.
r_type.value = a;
+ r_type.type.is_constant = true;
}
r_type.type.type_source = GDScriptParser::DataType::ANNOTATED_EXPLICIT;
r_type.type.kind = GDScriptParser::DataType::BUILTIN;
@@ -2064,6 +2088,12 @@ static bool _guess_expression_type(GDScriptParser::CompletionContext &p_context,
found = false;
}
+ // If the found type was not fully analyzed we analyze it now.
+ if (found && r_type.type.kind == GDScriptParser::DataType::CLASS && !r_type.type.class_type->resolved_body) {
+ Error err;
+ Ref<GDScriptParserRef> r = GDScriptCache::get_parser(r_type.type.script_path, GDScriptParserRef::FULLY_SOLVED, err);
+ }
+
// Check type hint last. For collections we want chance to get the actual value first
// This way we can detect types from the content of dictionaries and arrays
if (!found && p_expression->get_datatype().is_hard_type()) {
@@ -2733,9 +2763,9 @@ static void _find_call_arguments(GDScriptParser::CompletionContext &p_context, c
// Handle user preference.
if (opt.is_quoted()) {
opt = opt.unquote().quote(quote_style);
- if (use_string_names && info.arguments[p_argidx].type == Variant::STRING_NAME) {
+ if (use_string_names && info.arguments.get(p_argidx).type == Variant::STRING_NAME) {
opt = opt.indent("&");
- } else if (use_node_paths && info.arguments[p_argidx].type == Variant::NODE_PATH) {
+ } else if (use_node_paths && info.arguments.get(p_argidx).type == Variant::NODE_PATH) {
opt = opt.indent("^");
}
}
@@ -2746,7 +2776,7 @@ static void _find_call_arguments(GDScriptParser::CompletionContext &p_context, c
}
if (p_argidx < method_args) {
- PropertyInfo arg_info = info.arguments[p_argidx];
+ const PropertyInfo &arg_info = info.arguments.get(p_argidx);
if (arg_info.usage & (PROPERTY_USAGE_CLASS_IS_ENUM | PROPERTY_USAGE_CLASS_IS_BITFIELD)) {
_find_enumeration_candidates(p_context, arg_info.class_name, r_result);
}
@@ -3334,19 +3364,17 @@ static void _find_call_arguments(GDScriptParser::CompletionContext &p_context, c
}
method_hint += "(";
- if (mi.arguments.size()) {
- for (int i = 0; i < mi.arguments.size(); i++) {
- if (i > 0) {
- method_hint += ", ";
- }
- String arg = mi.arguments[i].name;
- if (arg.contains(":")) {
- arg = arg.substr(0, arg.find(":"));
- }
- method_hint += arg;
- if (use_type_hint) {
- method_hint += ": " + _get_visual_datatype(mi.arguments[i], true, class_name);
- }
+ for (List<PropertyInfo>::ConstIterator arg_itr = mi.arguments.begin(); arg_itr != mi.arguments.end(); ++arg_itr) {
+ if (arg_itr != mi.arguments.begin()) {
+ method_hint += ", ";
+ }
+ String arg = arg_itr->name;
+ if (arg.contains(":")) {
+ arg = arg.substr(0, arg.find(":"));
+ }
+ method_hint += arg;
+ if (use_type_hint) {
+ method_hint += ": " + _get_visual_datatype(*arg_itr, true, class_name);
}
}
method_hint += ")";
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index 634d4fc867..9a4c92f601 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -101,7 +101,6 @@ GDScriptParser::GDScriptParser() {
register_annotation(MethodInfo("@onready"), AnnotationInfo::VARIABLE, &GDScriptParser::onready_annotation);
// Export annotations.
register_annotation(MethodInfo("@export"), AnnotationInfo::VARIABLE, &GDScriptParser::export_annotations<PROPERTY_HINT_NONE, Variant::NIL>);
- register_annotation(MethodInfo("@export_storage"), AnnotationInfo::VARIABLE, &GDScriptParser::export_annotations<PROPERTY_HINT_NONE, Variant::NIL>);
register_annotation(MethodInfo("@export_enum", PropertyInfo(Variant::STRING, "names")), AnnotationInfo::VARIABLE, &GDScriptParser::export_annotations<PROPERTY_HINT_ENUM, Variant::NIL>, varray(), true);
register_annotation(MethodInfo("@export_file", PropertyInfo(Variant::STRING, "filter")), AnnotationInfo::VARIABLE, &GDScriptParser::export_annotations<PROPERTY_HINT_FILE, Variant::STRING>, varray(""), true);
register_annotation(MethodInfo("@export_dir"), AnnotationInfo::VARIABLE, &GDScriptParser::export_annotations<PROPERTY_HINT_DIR, Variant::STRING>);
@@ -121,6 +120,7 @@ GDScriptParser::GDScriptParser() {
register_annotation(MethodInfo("@export_flags_3d_physics"), AnnotationInfo::VARIABLE, &GDScriptParser::export_annotations<PROPERTY_HINT_LAYERS_3D_PHYSICS, Variant::INT>);
register_annotation(MethodInfo("@export_flags_3d_navigation"), AnnotationInfo::VARIABLE, &GDScriptParser::export_annotations<PROPERTY_HINT_LAYERS_3D_NAVIGATION, Variant::INT>);
register_annotation(MethodInfo("@export_flags_avoidance"), AnnotationInfo::VARIABLE, &GDScriptParser::export_annotations<PROPERTY_HINT_LAYERS_AVOIDANCE, Variant::INT>);
+ register_annotation(MethodInfo("@export_storage"), AnnotationInfo::VARIABLE, &GDScriptParser::export_storage_annotation);
register_annotation(MethodInfo("@export_custom", PropertyInfo(Variant::INT, "hint", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_CLASS_IS_ENUM, "PropertyHint"), PropertyInfo(Variant::STRING, "hint_string"), PropertyInfo(Variant::INT, "usage", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_CLASS_IS_BITFIELD, "PropertyUsageFlags")), AnnotationInfo::VARIABLE, &GDScriptParser::export_custom_annotation, varray(PROPERTY_USAGE_DEFAULT));
// Export grouping annotations.
register_annotation(MethodInfo("@export_category", PropertyInfo(Variant::STRING, "name")), AnnotationInfo::STANDALONE, &GDScriptParser::export_group_annotations<PROPERTY_USAGE_CATEGORY>);
@@ -1877,6 +1877,10 @@ GDScriptParser::Node *GDScriptParser::parse_statement() {
case Node::CALL:
// Fine.
break;
+ case Node::PRELOAD:
+ // `preload` is a function-like keyword.
+ push_warning(expression, GDScriptWarning::RETURN_VALUE_DISCARDED, "preload");
+ break;
case Node::LAMBDA:
// Standalone lambdas can't be used, so make this an error.
push_error("Standalone lambdas cannot be accessed. Consider assigning it to a variable.", expression);
@@ -3199,6 +3203,9 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_call(ExpressionNode *p_pre
}
GDScriptParser::ExpressionNode *GDScriptParser::parse_get_node(ExpressionNode *p_previous_operand, bool p_can_assign) {
+ // We want code completion after a DOLLAR even if the current code is invalid.
+ make_completion_context(COMPLETION_GET_NODE, nullptr, -1, true);
+
if (!current.is_node_name() && !check(GDScriptTokenizer::Token::LITERAL) && !check(GDScriptTokenizer::Token::SLASH) && !check(GDScriptTokenizer::Token::PERCENT)) {
push_error(vformat(R"(Expected node path as string or identifier after "%s".)", previous.get_name()));
return nullptr;
@@ -3254,7 +3261,7 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_get_node(ExpressionNode *p
path_state = PATH_STATE_SLASH;
}
- make_completion_context(COMPLETION_GET_NODE, get_node, context_argument++);
+ make_completion_context(COMPLETION_GET_NODE, get_node, context_argument++, true);
if (match(GDScriptTokenizer::Token::LITERAL)) {
if (previous.literal.get_type() != Variant::STRING) {
@@ -4292,7 +4299,7 @@ bool GDScriptParser::export_annotations(const AnnotationNode *p_annotation, Node
case GDScriptParser::DataType::BUILTIN:
variable->export_info.type = export_type.builtin_type;
variable->export_info.hint = PROPERTY_HINT_NONE;
- variable->export_info.hint_string = Variant::get_type_name(export_type.builtin_type);
+ variable->export_info.hint_string = String();
break;
case GDScriptParser::DataType::NATIVE:
if (ClassDB::is_parent_class(export_type.native_type, SNAME("Resource"))) {
@@ -4393,12 +4400,6 @@ bool GDScriptParser::export_annotations(const AnnotationNode *p_annotation, Node
push_error(_get_annotation_error_string(p_annotation->name, expected_types, variable->get_datatype()), p_annotation);
return false;
}
- } else if (p_annotation->name == SNAME("@export_storage")) {
- use_default_variable_type_check = false; // Can be applied to a variable of any type.
-
- // Save the info because the compiler uses export info for overwriting member info.
- variable->export_info = export_type.to_property_info(variable->identifier->name);
- variable->export_info.usage |= PROPERTY_USAGE_STORAGE;
}
if (use_default_variable_type_check) {
@@ -4418,11 +4419,38 @@ bool GDScriptParser::export_annotations(const AnnotationNode *p_annotation, Node
if (variable->export_info.hint) {
hint_prefix += "/" + itos(variable->export_info.hint);
}
+ variable->export_info.type = original_export_type_builtin;
variable->export_info.hint = PROPERTY_HINT_TYPE_STRING;
variable->export_info.hint_string = hint_prefix + ":" + variable->export_info.hint_string;
- variable->export_info.type = original_export_type_builtin;
+ variable->export_info.usage = PROPERTY_USAGE_DEFAULT;
+ variable->export_info.class_name = StringName();
+ }
+
+ return true;
+}
+
+// For `@export_storage` and `@export_custom`, there is no need to check the variable type, argument values,
+// or handle array exports in a special way, so they are implemented as separate methods.
+
+bool GDScriptParser::export_storage_annotation(const AnnotationNode *p_annotation, Node *p_node, ClassNode *p_class) {
+ ERR_FAIL_COND_V_MSG(p_node->type != Node::VARIABLE, false, vformat(R"("%s" annotation can only be applied to variables.)", p_annotation->name));
+
+ VariableNode *variable = static_cast<VariableNode *>(p_node);
+ if (variable->is_static) {
+ push_error(vformat(R"(Annotation "%s" cannot be applied to a static variable.)", p_annotation->name), p_annotation);
+ return false;
+ }
+ if (variable->exported) {
+ push_error(vformat(R"(Annotation "%s" cannot be used with another "@export" annotation.)", p_annotation->name), p_annotation);
+ return false;
}
+ variable->exported = true;
+
+ // Save the info because the compiler uses export info for overwriting member info.
+ variable->export_info = variable->get_datatype().to_property_info(variable->identifier->name);
+ variable->export_info.usage |= PROPERTY_USAGE_STORAGE;
+
return true;
}
@@ -4431,6 +4459,10 @@ bool GDScriptParser::export_custom_annotation(const AnnotationNode *p_annotation
ERR_FAIL_COND_V_MSG(p_annotation->resolved_arguments.size() < 2, false, R"(Annotation "@export_custom" requires 2 arguments.)");
VariableNode *variable = static_cast<VariableNode *>(p_node);
+ if (variable->is_static) {
+ push_error(vformat(R"(Annotation "%s" cannot be applied to a static variable.)", p_annotation->name), p_annotation);
+ return false;
+ }
if (variable->exported) {
push_error(vformat(R"(Annotation "%s" cannot be used with another "@export" annotation.)", p_annotation->name), p_annotation);
return false;
diff --git a/modules/gdscript/gdscript_parser.h b/modules/gdscript/gdscript_parser.h
index 1e67e2d496..96358165c0 100644
--- a/modules/gdscript/gdscript_parser.h
+++ b/modules/gdscript/gdscript_parser.h
@@ -1432,8 +1432,6 @@ private:
void reset_extents(Node *p_node, GDScriptTokenizer::Token p_token);
void reset_extents(Node *p_node, Node *p_from);
- HashSet<String> dependencies;
-
template <typename T>
T *alloc_node() {
T *node = memnew(T);
@@ -1499,6 +1497,7 @@ private:
bool onready_annotation(const AnnotationNode *p_annotation, Node *p_target, ClassNode *p_class);
template <PropertyHint t_hint, Variant::Type t_type>
bool export_annotations(const AnnotationNode *p_annotation, Node *p_target, ClassNode *p_class);
+ bool export_storage_annotation(const AnnotationNode *p_annotation, Node *p_target, ClassNode *p_class);
bool export_custom_annotation(const AnnotationNode *p_annotation, Node *p_target, ClassNode *p_class);
template <PropertyUsageFlags t_usage>
bool export_group_annotations(const AnnotationNode *p_annotation, Node *p_target, ClassNode *p_class);
@@ -1577,11 +1576,9 @@ public:
bool annotation_exists(const String &p_annotation_name) const;
const List<ParserError> &get_errors() const { return errors; }
- const HashSet<String> &get_dependencies() const {
- return dependencies;
- }
- void add_dependency(const String &p_dependency) {
- dependencies.insert(p_dependency);
+ const List<String> get_dependencies() const {
+ // TODO: Keep track of deps.
+ return List<String>();
}
#ifdef DEBUG_ENABLED
const List<GDScriptWarning> &get_warnings() const { return warnings; }
diff --git a/modules/gdscript/gdscript_utility_functions.cpp b/modules/gdscript/gdscript_utility_functions.cpp
index f0816650b9..3e1de628d2 100644
--- a/modules/gdscript/gdscript_utility_functions.cpp
+++ b/modules/gdscript/gdscript_utility_functions.cpp
@@ -760,7 +760,7 @@ Variant::Type GDScriptUtilityFunctions::get_function_argument_type(const StringN
GDScriptUtilityFunctionInfo *info = utility_function_table.lookup_ptr(p_function);
ERR_FAIL_NULL_V(info, Variant::NIL);
ERR_FAIL_COND_V(p_arg >= info->info.arguments.size(), Variant::NIL);
- return info->info.arguments[p_arg].type;
+ return info->info.arguments.get(p_arg).type;
}
int GDScriptUtilityFunctions::get_function_argument_count(const StringName &p_function) {
diff --git a/modules/gdscript/gdscript_vm.cpp b/modules/gdscript/gdscript_vm.cpp
index 11bd1d224a..5d1805696d 100644
--- a/modules/gdscript/gdscript_vm.cpp
+++ b/modules/gdscript/gdscript_vm.cpp
@@ -32,7 +32,6 @@
#include "gdscript_function.h"
#include "gdscript_lambda_callable.h"
-#include "core/core_string_names.h"
#include "core/os/os.h"
#ifdef DEBUG_ENABLED
@@ -1741,7 +1740,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
if (base_type == Variant::OBJECT) {
if (base_obj) {
MethodBind *method = ClassDB::get_method(base_class, *methodname);
- if (*methodname == CoreStringNames::get_singleton()->_free || (method && !method->has_return())) {
+ if (*methodname == CoreStringName(free_) || (method && !method->has_return())) {
err_text = R"(Trying to get a return value of a method that returns "void")";
OPCODE_BREAK;
}
@@ -3097,7 +3096,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
const Variant *args[] = { &vref };
Callable::CallError ce;
- Variant has_next = obj->callp(CoreStringNames::get_singleton()->_iter_init, args, 1, ce);
+ Variant has_next = obj->callp(CoreStringName(_iter_init), args, 1, ce);
#ifdef DEBUG_ENABLED
if (ref.size() != 1 || ce.error != Callable::CallError::CALL_OK) {
@@ -3113,7 +3112,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
*counter = ref[0];
GET_VARIANT_PTR(iterator, 2);
- *iterator = obj->callp(CoreStringNames::get_singleton()->_iter_get, (const Variant **)&counter, 1, ce);
+ *iterator = obj->callp(CoreStringName(_iter_get), (const Variant **)&counter, 1, ce);
#ifdef DEBUG_ENABLED
if (ce.error != Callable::CallError::CALL_OK) {
err_text = vformat(R"(There was an error calling "_iter_get" on iterator object of type %s.)", *container);
@@ -3431,7 +3430,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
const Variant *args[] = { &vref };
Callable::CallError ce;
- Variant has_next = obj->callp(CoreStringNames::get_singleton()->_iter_next, args, 1, ce);
+ Variant has_next = obj->callp(CoreStringName(_iter_next), args, 1, ce);
#ifdef DEBUG_ENABLED
if (ref.size() != 1 || ce.error != Callable::CallError::CALL_OK) {
@@ -3447,7 +3446,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
*counter = ref[0];
GET_VARIANT_PTR(iterator, 2);
- *iterator = obj->callp(CoreStringNames::get_singleton()->_iter_get, (const Variant **)&counter, 1, ce);
+ *iterator = obj->callp(CoreStringName(_iter_get), (const Variant **)&counter, 1, ce);
#ifdef DEBUG_ENABLED
if (ce.error != Callable::CallError::CALL_OK) {
err_text = vformat(R"(There was an error calling "_iter_get" on iterator object of type %s.)", *container);
diff --git a/modules/gdscript/gdscript_warning.cpp b/modules/gdscript/gdscript_warning.cpp
index 48a0abe617..611a9ad2d9 100644
--- a/modules/gdscript/gdscript_warning.cpp
+++ b/modules/gdscript/gdscript_warning.cpp
@@ -74,7 +74,7 @@ String GDScriptWarning::get_message() const {
case UNREACHABLE_PATTERN:
return "Unreachable pattern (pattern after wildcard or bind).";
case STANDALONE_EXPRESSION:
- return "Standalone expression (the line has no effect).";
+ return "Standalone expression (the line may have no effect).";
case STANDALONE_TERNARY:
return "Standalone ternary operator: the return value is being discarded.";
case INCOMPATIBLE_TERNARY:
diff --git a/modules/gdscript/language_server/gdscript_extend_parser.cpp b/modules/gdscript/language_server/gdscript_extend_parser.cpp
index ad7af34bf1..2a3db4f508 100644
--- a/modules/gdscript/language_server/gdscript_extend_parser.cpp
+++ b/modules/gdscript/language_server/gdscript_extend_parser.cpp
@@ -510,7 +510,7 @@ void ExtendGDScriptParser::parse_function_symbol(const GDScriptParser::FunctionN
node_stack.push_back(p_func->body);
while (!node_stack.is_empty()) {
- GDScriptParser::Node *node = node_stack[0];
+ GDScriptParser::Node *node = node_stack.front()->get();
node_stack.pop_front();
switch (node->type) {
diff --git a/modules/gdscript/language_server/gdscript_workspace.cpp b/modules/gdscript/language_server/gdscript_workspace.cpp
index a63d32ef30..09defdf8cd 100644
--- a/modules/gdscript/language_server/gdscript_workspace.cpp
+++ b/modules/gdscript/language_server/gdscript_workspace.cpp
@@ -223,7 +223,7 @@ void GDScriptWorkspace::reload_all_workspace_scripts() {
HashMap<String, ExtendGDScriptParser *>::Iterator S = parse_results.find(path);
String err_msg = "Failed parse script " + path;
if (S) {
- err_msg += "\n" + S->value->get_errors()[0].message;
+ err_msg += "\n" + S->value->get_errors().front()->get().message;
}
ERR_CONTINUE_MSG(err != OK, err_msg);
}
@@ -619,8 +619,8 @@ Node *GDScriptWorkspace::_get_owner_scene_node(String p_path) {
_get_owners(EditorFileSystem::get_singleton()->get_filesystem(), p_path, owners);
- for (int i = 0; i < owners.size(); i++) {
- NodePath owner_path = owners[i];
+ for (const String &owner : owners) {
+ NodePath owner_path = owner;
Ref<Resource> owner_res = ResourceLoader::load(owner_path);
if (Object::cast_to<PackedScene>(owner_res.ptr())) {
Ref<PackedScene> owner_packed_scene = Ref<PackedScene>(Object::cast_to<PackedScene>(*owner_res));
@@ -695,7 +695,7 @@ const lsp::DocumentSymbol *GDScriptWorkspace::resolve_symbol(const lsp::TextDocu
} else {
ScriptLanguage::LookupResult ret;
- if (symbol_identifier == "new" && parser->get_lines()[p_doc_pos.position.line].replace(" ", "").replace("\t", "").find("new(") > -1) {
+ if (symbol_identifier == "new" && parser->get_lines()[p_doc_pos.position.line].replace(" ", "").replace("\t", "").contains("new(")) {
symbol_identifier = "_init";
}
if (OK == GDScriptLanguage::get_singleton()->lookup_code(parser->get_text_for_lookup_symbol(pos, symbol_identifier, p_func_required), symbol_identifier, path, nullptr, ret)) {
diff --git a/modules/gdscript/tests/gdscript_test_runner.cpp b/modules/gdscript/tests/gdscript_test_runner.cpp
index e3d16eaf42..fbfa4a0a79 100644
--- a/modules/gdscript/tests/gdscript_test_runner.cpp
+++ b/modules/gdscript/tests/gdscript_test_runner.cpp
@@ -38,7 +38,6 @@
#include "core/config/project_settings.h"
#include "core/core_globals.h"
-#include "core/core_string_names.h"
#include "core/io/dir_access.h"
#include "core/io/file_access_pack.h"
#include "core/os/os.h"
@@ -573,7 +572,7 @@ GDScriptTest::TestResult GDScriptTest::execute_test_code(bool p_is_generating) {
const List<GDScriptParser::ParserError> &errors = parser.get_errors();
if (!errors.is_empty()) {
// Only the first error since the following might be cascading.
- result.output += errors[0].message + "\n"; // TODO: line, column?
+ result.output += errors.front()->get().message + "\n"; // TODO: line, column?
}
if (!p_is_generating) {
result.passed = check_output(result.output);
@@ -592,7 +591,7 @@ GDScriptTest::TestResult GDScriptTest::execute_test_code(bool p_is_generating) {
const List<GDScriptParser::ParserError> &errors = parser.get_errors();
if (!errors.is_empty()) {
// Only the first error since the following might be cascading.
- result.output += errors[0].message + "\n"; // TODO: line, column?
+ result.output += errors.front()->get().message + "\n"; // TODO: line, column?
}
if (!p_is_generating) {
result.passed = check_output(result.output);
diff --git a/modules/gdscript/tests/gdscript_test_runner_suite.h b/modules/gdscript/tests/gdscript_test_runner_suite.h
index b2289ef9cc..d6befd2db3 100644
--- a/modules/gdscript/tests/gdscript_test_runner_suite.h
+++ b/modules/gdscript/tests/gdscript_test_runner_suite.h
@@ -81,11 +81,10 @@ TEST_CASE("[Modules][GDScript] Validate built-in API") {
SUBCASE("[Modules][GDScript] Validate built-in methods") {
for (const MethodInfo &mi : builtin_methods) {
- for (int j = 0; j < mi.arguments.size(); j++) {
- PropertyInfo arg = mi.arguments[j];
-
- TEST_COND((arg.name.is_empty() || arg.name.begins_with("_unnamed_arg")),
- vformat("Unnamed argument in position %d of built-in method '%s'.", j, mi.name));
+ int i = 0;
+ for (List<PropertyInfo>::ConstIterator itr = mi.arguments.begin(); itr != mi.arguments.end(); ++itr, ++i) {
+ TEST_COND((itr->name.is_empty() || itr->name.begins_with("_unnamed_arg")),
+ vformat("Unnamed argument in position %d of built-in method '%s'.", i, mi.name));
}
}
}
@@ -96,11 +95,10 @@ TEST_CASE("[Modules][GDScript] Validate built-in API") {
SUBCASE("[Modules][GDScript] Validate built-in annotations") {
for (const MethodInfo &ai : builtin_annotations) {
- for (int j = 0; j < ai.arguments.size(); j++) {
- PropertyInfo arg = ai.arguments[j];
-
- TEST_COND((arg.name.is_empty() || arg.name.begins_with("_unnamed_arg")),
- vformat("Unnamed argument in position %d of built-in annotation '%s'.", j, ai.name));
+ int i = 0;
+ for (List<PropertyInfo>::ConstIterator itr = ai.arguments.begin(); itr != ai.arguments.end(); ++itr, ++i) {
+ TEST_COND((itr->name.is_empty() || itr->name.begins_with("_unnamed_arg")),
+ vformat("Unnamed argument in position %d of built-in annotation '%s'.", i, ai.name));
}
}
}
diff --git a/modules/gdscript/tests/scripts/analyzer/features/cast_enum_to_int.gd b/modules/gdscript/tests/scripts/analyzer/features/cast_enum_to_int.gd
index 77ef9e2073..f861cadb5d 100644
--- a/modules/gdscript/tests/scripts/analyzer/features/cast_enum_to_int.gd
+++ b/modules/gdscript/tests/scripts/analyzer/features/cast_enum_to_int.gd
@@ -6,4 +6,3 @@ func test():
var a := Foo.A
var b := a as int + 1
print(b)
-
diff --git a/modules/gdscript/tests/scripts/analyzer/features/export_enum_as_dictionary.out b/modules/gdscript/tests/scripts/analyzer/features/export_enum_as_dictionary.out
index 505af5f1f3..0d96f8c021 100644
--- a/modules/gdscript/tests/scripts/analyzer/features/export_enum_as_dictionary.out
+++ b/modules/gdscript/tests/scripts/analyzer/features/export_enum_as_dictionary.out
@@ -1,11 +1,11 @@
GDTEST_OK
var test_1: Dictionary
- hint=NONE hint_string="" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=NONE hint_string="" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_2: TestExportEnumAsDictionary.MyEnum
- hint=ENUM hint_string="A:0,B:1,C:2" usage=DEFAULT|SCRIPT_VARIABLE|CLASS_IS_ENUM
+ hint=ENUM hint_string="A:0,B:1,C:2" usage=DEFAULT|SCRIPT_VARIABLE|CLASS_IS_ENUM class_name=&"TestExportEnumAsDictionary.MyEnum"
var test_3: Dictionary
- hint=NONE hint_string="" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=NONE hint_string="" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_4: TestExportEnumAsDictionary.MyEnum
- hint=ENUM hint_string="A:0,B:1,C:2" usage=DEFAULT|SCRIPT_VARIABLE|CLASS_IS_ENUM
+ hint=ENUM hint_string="A:0,B:1,C:2" usage=DEFAULT|SCRIPT_VARIABLE|CLASS_IS_ENUM class_name=&"TestExportEnumAsDictionary.MyEnum"
var test_5: TestExportEnumAsDictionary.MyEnum
- hint=ENUM hint_string="A:0,B:1,C:2" usage=DEFAULT|SCRIPT_VARIABLE|CLASS_IS_ENUM
+ hint=ENUM hint_string="A:0,B:1,C:2" usage=DEFAULT|SCRIPT_VARIABLE|CLASS_IS_ENUM class_name=&"TestExportEnumAsDictionary.MyEnum"
diff --git a/modules/gdscript/tests/scripts/analyzer/features/preload_constant_types_are_inferred.gd b/modules/gdscript/tests/scripts/analyzer/features/preload_constant_types_are_inferred.gd
index 9d0324ead8..738b5f7b3a 100644
--- a/modules/gdscript/tests/scripts/analyzer/features/preload_constant_types_are_inferred.gd
+++ b/modules/gdscript/tests/scripts/analyzer/features/preload_constant_types_are_inferred.gd
@@ -3,4 +3,3 @@ const Constants = preload("gdscript_to_preload.notest.gd")
func test():
var a := Constants.A
print(a)
-
diff --git a/modules/gdscript/tests/scripts/completion/get_node/literal_scene/dollar_class_scene.cfg b/modules/gdscript/tests/scripts/completion/get_node/literal_scene/dollar_class_scene.cfg
index 009ab9f9ce..9c580b711d 100644
--- a/modules/gdscript/tests/scripts/completion/get_node/literal_scene/dollar_class_scene.cfg
+++ b/modules/gdscript/tests/scripts/completion/get_node/literal_scene/dollar_class_scene.cfg
@@ -6,7 +6,7 @@ include=[
{"display": "add_child"},
{"display": "owner"},
{"display": "child_entered_tree"},
-
+
; GDScript: class_a.notest.gd
{"display": "property_of_a"},
{"display": "func_of_a"},
diff --git a/modules/gdscript/tests/scripts/completion/get_node/literal_scene/dollar_native_scene.cfg b/modules/gdscript/tests/scripts/completion/get_node/literal_scene/dollar_native_scene.cfg
index 0fb46a4704..446198dd35 100644
--- a/modules/gdscript/tests/scripts/completion/get_node/literal_scene/dollar_native_scene.cfg
+++ b/modules/gdscript/tests/scripts/completion/get_node/literal_scene/dollar_native_scene.cfg
@@ -6,7 +6,7 @@ include=[
{"display": "add_child"},
{"display": "owner"},
{"display": "child_entered_tree"},
-
+
; AnimationPlayer
{"display": "autoplay"},
{"display": "play"},
diff --git a/modules/gdscript/tests/scripts/completion/get_node/literal_scene/percent_class_scene.cfg b/modules/gdscript/tests/scripts/completion/get_node/literal_scene/percent_class_scene.cfg
index 009ab9f9ce..9c580b711d 100644
--- a/modules/gdscript/tests/scripts/completion/get_node/literal_scene/percent_class_scene.cfg
+++ b/modules/gdscript/tests/scripts/completion/get_node/literal_scene/percent_class_scene.cfg
@@ -6,7 +6,7 @@ include=[
{"display": "add_child"},
{"display": "owner"},
{"display": "child_entered_tree"},
-
+
; GDScript: class_a.notest.gd
{"display": "property_of_a"},
{"display": "func_of_a"},
diff --git a/modules/gdscript/tests/scripts/completion/get_node/literal_scene/percent_native_scene.cfg b/modules/gdscript/tests/scripts/completion/get_node/literal_scene/percent_native_scene.cfg
index 0fb46a4704..446198dd35 100644
--- a/modules/gdscript/tests/scripts/completion/get_node/literal_scene/percent_native_scene.cfg
+++ b/modules/gdscript/tests/scripts/completion/get_node/literal_scene/percent_native_scene.cfg
@@ -6,7 +6,7 @@ include=[
{"display": "add_child"},
{"display": "owner"},
{"display": "child_entered_tree"},
-
+
; AnimationPlayer
{"display": "autoplay"},
{"display": "play"},
diff --git a/modules/gdscript/tests/scripts/completion/get_node/local_interfered_scene/class_local_interfered_scene.cfg b/modules/gdscript/tests/scripts/completion/get_node/local_interfered_scene/class_local_interfered_scene.cfg
index 009ab9f9ce..9c580b711d 100644
--- a/modules/gdscript/tests/scripts/completion/get_node/local_interfered_scene/class_local_interfered_scene.cfg
+++ b/modules/gdscript/tests/scripts/completion/get_node/local_interfered_scene/class_local_interfered_scene.cfg
@@ -6,7 +6,7 @@ include=[
{"display": "add_child"},
{"display": "owner"},
{"display": "child_entered_tree"},
-
+
; GDScript: class_a.notest.gd
{"display": "property_of_a"},
{"display": "func_of_a"},
diff --git a/modules/gdscript/tests/scripts/completion/get_node/local_interfered_scene/native_local_interfered_scene.cfg b/modules/gdscript/tests/scripts/completion/get_node/local_interfered_scene/native_local_interfered_scene.cfg
index 0fb46a4704..446198dd35 100644
--- a/modules/gdscript/tests/scripts/completion/get_node/local_interfered_scene/native_local_interfered_scene.cfg
+++ b/modules/gdscript/tests/scripts/completion/get_node/local_interfered_scene/native_local_interfered_scene.cfg
@@ -6,7 +6,7 @@ include=[
{"display": "add_child"},
{"display": "owner"},
{"display": "child_entered_tree"},
-
+
; AnimationPlayer
{"display": "autoplay"},
{"display": "play"},
diff --git a/modules/gdscript/tests/scripts/completion/get_node/local_scene/class_local_scene.cfg b/modules/gdscript/tests/scripts/completion/get_node/local_scene/class_local_scene.cfg
index 009ab9f9ce..9c580b711d 100644
--- a/modules/gdscript/tests/scripts/completion/get_node/local_scene/class_local_scene.cfg
+++ b/modules/gdscript/tests/scripts/completion/get_node/local_scene/class_local_scene.cfg
@@ -6,7 +6,7 @@ include=[
{"display": "add_child"},
{"display": "owner"},
{"display": "child_entered_tree"},
-
+
; GDScript: class_a.notest.gd
{"display": "property_of_a"},
{"display": "func_of_a"},
diff --git a/modules/gdscript/tests/scripts/completion/get_node/local_scene/native_local_scene.cfg b/modules/gdscript/tests/scripts/completion/get_node/local_scene/native_local_scene.cfg
index 0fb46a4704..446198dd35 100644
--- a/modules/gdscript/tests/scripts/completion/get_node/local_scene/native_local_scene.cfg
+++ b/modules/gdscript/tests/scripts/completion/get_node/local_scene/native_local_scene.cfg
@@ -6,7 +6,7 @@ include=[
{"display": "add_child"},
{"display": "owner"},
{"display": "child_entered_tree"},
-
+
; AnimationPlayer
{"display": "autoplay"},
{"display": "play"},
diff --git a/modules/gdscript/tests/scripts/completion/get_node/local_typehint/class_local_typehint.cfg b/modules/gdscript/tests/scripts/completion/get_node/local_typehint/class_local_typehint.cfg
index a72b489be6..8b68d51a89 100644
--- a/modules/gdscript/tests/scripts/completion/get_node/local_typehint/class_local_typehint.cfg
+++ b/modules/gdscript/tests/scripts/completion/get_node/local_typehint/class_local_typehint.cfg
@@ -4,7 +4,7 @@ include=[
{"display": "add_child"},
{"display": "owner"},
{"display": "child_entered_tree"},
-
+
; GDScript: class_a.notest.gd
{"display": "property_of_a"},
{"display": "func_of_a"},
diff --git a/modules/gdscript/tests/scripts/completion/get_node/local_typehint/native_local_typehint.cfg b/modules/gdscript/tests/scripts/completion/get_node/local_typehint/native_local_typehint.cfg
index adf06c8707..72c0549d3b 100644
--- a/modules/gdscript/tests/scripts/completion/get_node/local_typehint/native_local_typehint.cfg
+++ b/modules/gdscript/tests/scripts/completion/get_node/local_typehint/native_local_typehint.cfg
@@ -4,7 +4,7 @@ include=[
{"display": "add_child"},
{"display": "owner"},
{"display": "child_entered_tree"},
-
+
; AnimationPlayer
{"display": "autoplay"},
{"display": "play"},
diff --git a/modules/gdscript/tests/scripts/completion/get_node/member_interfered_scene/class_member_interfered_scene.cfg b/modules/gdscript/tests/scripts/completion/get_node/member_interfered_scene/class_member_interfered_scene.cfg
index 009ab9f9ce..9c580b711d 100644
--- a/modules/gdscript/tests/scripts/completion/get_node/member_interfered_scene/class_member_interfered_scene.cfg
+++ b/modules/gdscript/tests/scripts/completion/get_node/member_interfered_scene/class_member_interfered_scene.cfg
@@ -6,7 +6,7 @@ include=[
{"display": "add_child"},
{"display": "owner"},
{"display": "child_entered_tree"},
-
+
; GDScript: class_a.notest.gd
{"display": "property_of_a"},
{"display": "func_of_a"},
diff --git a/modules/gdscript/tests/scripts/completion/get_node/member_interfered_scene/native_member_interfered_scene.cfg b/modules/gdscript/tests/scripts/completion/get_node/member_interfered_scene/native_member_interfered_scene.cfg
index 0fb46a4704..446198dd35 100644
--- a/modules/gdscript/tests/scripts/completion/get_node/member_interfered_scene/native_member_interfered_scene.cfg
+++ b/modules/gdscript/tests/scripts/completion/get_node/member_interfered_scene/native_member_interfered_scene.cfg
@@ -6,7 +6,7 @@ include=[
{"display": "add_child"},
{"display": "owner"},
{"display": "child_entered_tree"},
-
+
; AnimationPlayer
{"display": "autoplay"},
{"display": "play"},
diff --git a/modules/gdscript/tests/scripts/completion/get_node/member_scene/class_member_scene.cfg b/modules/gdscript/tests/scripts/completion/get_node/member_scene/class_member_scene.cfg
index 009ab9f9ce..9c580b711d 100644
--- a/modules/gdscript/tests/scripts/completion/get_node/member_scene/class_member_scene.cfg
+++ b/modules/gdscript/tests/scripts/completion/get_node/member_scene/class_member_scene.cfg
@@ -6,7 +6,7 @@ include=[
{"display": "add_child"},
{"display": "owner"},
{"display": "child_entered_tree"},
-
+
; GDScript: class_a.notest.gd
{"display": "property_of_a"},
{"display": "func_of_a"},
diff --git a/modules/gdscript/tests/scripts/completion/get_node/member_scene/native_member_scene.cfg b/modules/gdscript/tests/scripts/completion/get_node/member_scene/native_member_scene.cfg
index 0fb46a4704..446198dd35 100644
--- a/modules/gdscript/tests/scripts/completion/get_node/member_scene/native_member_scene.cfg
+++ b/modules/gdscript/tests/scripts/completion/get_node/member_scene/native_member_scene.cfg
@@ -6,7 +6,7 @@ include=[
{"display": "add_child"},
{"display": "owner"},
{"display": "child_entered_tree"},
-
+
; AnimationPlayer
{"display": "autoplay"},
{"display": "play"},
diff --git a/modules/gdscript/tests/scripts/completion/get_node/member_typehint/class_member_typehint.cfg b/modules/gdscript/tests/scripts/completion/get_node/member_typehint/class_member_typehint.cfg
index a72b489be6..8b68d51a89 100644
--- a/modules/gdscript/tests/scripts/completion/get_node/member_typehint/class_member_typehint.cfg
+++ b/modules/gdscript/tests/scripts/completion/get_node/member_typehint/class_member_typehint.cfg
@@ -4,7 +4,7 @@ include=[
{"display": "add_child"},
{"display": "owner"},
{"display": "child_entered_tree"},
-
+
; GDScript: class_a.notest.gd
{"display": "property_of_a"},
{"display": "func_of_a"},
diff --git a/modules/gdscript/tests/scripts/completion/get_node/member_typehint/native_member_typehint.cfg b/modules/gdscript/tests/scripts/completion/get_node/member_typehint/native_member_typehint.cfg
index adf06c8707..72c0549d3b 100644
--- a/modules/gdscript/tests/scripts/completion/get_node/member_typehint/native_member_typehint.cfg
+++ b/modules/gdscript/tests/scripts/completion/get_node/member_typehint/native_member_typehint.cfg
@@ -4,7 +4,7 @@ include=[
{"display": "add_child"},
{"display": "owner"},
{"display": "child_entered_tree"},
-
+
; AnimationPlayer
{"display": "autoplay"},
{"display": "play"},
diff --git a/modules/gdscript/tests/scripts/lsp/lambdas.gd b/modules/gdscript/tests/scripts/lsp/lambdas.gd
index 6f5d468eea..fbee264f3b 100644
--- a/modules/gdscript/tests/scripts/lsp/lambdas.gd
+++ b/modules/gdscript/tests/scripts/lsp/lambdas.gd
@@ -7,7 +7,7 @@ var lambda_member1 := func(alpha: int, beta): return alpha + beta
# | | ^^^^^ \1:alpha -> \1:alpha
# ^^^^^^^^^^^^^^ \1 -> \1
-var lambda_member2 := func(alpha, beta: int) -> int:
+var lambda_member2 := func(alpha, beta: int) -> int:
# | | | | | |
# | | | | | |
# | | | | ^^^^ \2:beta -> \2:beta
@@ -76,7 +76,7 @@ func _ready() -> void:
# | | | | ^^^^ \local:beta -> \local:beta
# | | ^^^^^ \local:alpha -> \local:alpha
# ^^^^^^^^^^^^ \local -> \local
-
+
var value := 42
# ^^^^^ local:value -> local:value
var lambda_capture = func(): return value + some_name.length()
diff --git a/modules/gdscript/tests/scripts/lsp/local_variables.gd b/modules/gdscript/tests/scripts/lsp/local_variables.gd
index b6cc46f7da..43e8937800 100644
--- a/modules/gdscript/tests/scripts/lsp/local_variables.gd
+++ b/modules/gdscript/tests/scripts/lsp/local_variables.gd
@@ -9,7 +9,7 @@ func test_member() -> void:
# ^^^^ test -> test
test += 3
#<^^ -> test
- member += 5
+ member += 5
#<^^^^ -> member
test = return_arg(test)
# | ^^^^ -> test
@@ -22,4 +22,4 @@ func return_arg(arg: int) -> int:
arg += 2
#<^ -> arg
return arg
- # ^^^ -> arg \ No newline at end of file
+ # ^^^ -> arg
diff --git a/modules/gdscript/tests/scripts/lsp/properties.gd b/modules/gdscript/tests/scripts/lsp/properties.gd
index 8dfaee2e5b..1acaddbe2c 100644
--- a/modules/gdscript/tests/scripts/lsp/properties.gd
+++ b/modules/gdscript/tests/scripts/lsp/properties.gd
@@ -16,7 +16,7 @@ var prop3 := 42:
#<^^^ -> prop3
var prop4: int:
# ^^^^^ prop4 -> prop4
- get:
+ get:
return 42
var prop5 := 42:
# ^^^^^ prop5 -> prop5
diff --git a/modules/gdscript/tests/scripts/lsp/scopes.gd b/modules/gdscript/tests/scripts/lsp/scopes.gd
index 20b8fb9bd7..9314ab427c 100644
--- a/modules/gdscript/tests/scripts/lsp/scopes.gd
+++ b/modules/gdscript/tests/scripts/lsp/scopes.gd
@@ -68,16 +68,16 @@ func m():
match value:
# ^^^^^ -> m:value
- 13:
+ 13:
print(value)
# ^^^^^ -> m:value
- [var start, _, var end]:
+ [var start, _, var end]:
# | | ^^^ m:match:array:end -> m:match:array:end
# ^^^^^ m:match:array:start -> m:match:array:start
print(start + end)
# | | ^^^ -> m:match:array:end
# ^^^^^ -> m:match:array:start
- { "name": var name }:
+ { "name": var name }:
# ^^^^ m:match:dict:var -> m:match:dict:var
print(name)
# ^^^^ -> m:match:dict:var
@@ -87,10 +87,10 @@ func m():
# ^^^^^^^^ -> m:match:var
func m2():
- var value = 42
+ var value = 42
# ^^^^^ m2:value -> m2:value
- match value:
+ match value:
# ^^^^^ -> m2:value
{ "name": var name }:
# ^^^^ m2:match:dict:var -> m2:match:dict:var
diff --git a/modules/gdscript/tests/scripts/parser/features/annotations.out b/modules/gdscript/tests/scripts/parser/features/annotations.out
index 2ba9dd7496..6516672820 100644
--- a/modules/gdscript/tests/scripts/parser/features/annotations.out
+++ b/modules/gdscript/tests/scripts/parser/features/annotations.out
@@ -1,25 +1,25 @@
GDTEST_OK
var test_1: int = null
- hint=ENUM hint_string="A,B,C" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=ENUM hint_string="A,B,C" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_2: int = null
- hint=ENUM hint_string="A,B,C" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=ENUM hint_string="A,B,C" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_3: int = null
- hint=ENUM hint_string="A,B,C" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=ENUM hint_string="A,B,C" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_4: int = null
- hint=ENUM hint_string="A,B,C" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=ENUM hint_string="A,B,C" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_5: int = 0
- hint=NONE hint_string="int" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=NONE hint_string="" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_6: int = 0
- hint=NONE hint_string="int" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=NONE hint_string="" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_7: int = 42
- hint=NONE hint_string="int" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=NONE hint_string="" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_8: int = 0
- hint=NONE hint_string="int" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=NONE hint_string="" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_9: int = 0
- hint=NONE hint_string="int" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=NONE hint_string="" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_10: int = 0
- hint=NONE hint_string="int" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=NONE hint_string="" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_11: int = 0
- hint=NONE hint_string="int" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=NONE hint_string="" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_12: int = 0
- hint=NONE hint_string="int" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=NONE hint_string="" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
diff --git a/modules/gdscript/tests/scripts/parser/features/export_arrays.out b/modules/gdscript/tests/scripts/parser/features/export_arrays.out
index acbf389645..f1522d096f 100644
--- a/modules/gdscript/tests/scripts/parser/features/export_arrays.out
+++ b/modules/gdscript/tests/scripts/parser/features/export_arrays.out
@@ -1,139 +1,139 @@
GDTEST_OK
var test_dir: Array
- hint=TYPE_STRING hint_string="String/DIR:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<String>/<DIR>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_dir_packed: PackedStringArray
- hint=TYPE_STRING hint_string="String/DIR:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<String>/<DIR>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_file: Array
- hint=TYPE_STRING hint_string="String/FILE:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<String>/<FILE>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_file_packed: PackedStringArray
- hint=TYPE_STRING hint_string="String/FILE:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<String>/<FILE>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_global_dir: Array
- hint=TYPE_STRING hint_string="String/GLOBAL_DIR:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<String>/<GLOBAL_DIR>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_global_dir_packed: PackedStringArray
- hint=TYPE_STRING hint_string="String/GLOBAL_DIR:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<String>/<GLOBAL_DIR>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_global_file: Array
- hint=TYPE_STRING hint_string="String/GLOBAL_FILE:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<String>/<GLOBAL_FILE>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_global_file_packed: PackedStringArray
- hint=TYPE_STRING hint_string="String/GLOBAL_FILE:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<String>/<GLOBAL_FILE>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_bit_flag: Array
- hint=TYPE_STRING hint_string="int/FLAGS:A,B,C" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<FLAGS>:A,B,C" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_bit_flag_packed_byte: PackedByteArray
- hint=TYPE_STRING hint_string="int/FLAGS:A,B,C" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<FLAGS>:A,B,C" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_bit_flag_packed32: PackedInt32Array
- hint=TYPE_STRING hint_string="int/FLAGS:A,B,C" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<FLAGS>:A,B,C" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_bit_flag_packed64: PackedInt64Array
- hint=TYPE_STRING hint_string="int/FLAGS:A,B,C" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<FLAGS>:A,B,C" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_bit_flag_2d_nav: Array
- hint=TYPE_STRING hint_string="int/LAYERS_2D_NAVIGATION:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<LAYERS_2D_NAVIGATION>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_bit_flag_2d_nav_packed_byte: PackedByteArray
- hint=TYPE_STRING hint_string="int/LAYERS_2D_NAVIGATION:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<LAYERS_2D_NAVIGATION>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_bit_flag_2d_nav_packed32: PackedInt32Array
- hint=TYPE_STRING hint_string="int/LAYERS_2D_NAVIGATION:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<LAYERS_2D_NAVIGATION>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_bit_flag_2d_nav_packed64: PackedInt64Array
- hint=TYPE_STRING hint_string="int/LAYERS_2D_NAVIGATION:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<LAYERS_2D_NAVIGATION>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_bit_flag_2d_phys: Array
- hint=TYPE_STRING hint_string="int/LAYERS_2D_PHYSICS:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<LAYERS_2D_PHYSICS>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_bit_flag_2d_phys_packed_byte: PackedByteArray
- hint=TYPE_STRING hint_string="int/LAYERS_2D_PHYSICS:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<LAYERS_2D_PHYSICS>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_bit_flag_2d_phys_packed32: PackedInt32Array
- hint=TYPE_STRING hint_string="int/LAYERS_2D_PHYSICS:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<LAYERS_2D_PHYSICS>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_bit_flag_2d_phys_packed64: PackedInt64Array
- hint=TYPE_STRING hint_string="int/LAYERS_2D_PHYSICS:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<LAYERS_2D_PHYSICS>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_bit_flag_2d_render: Array
- hint=TYPE_STRING hint_string="int/LAYERS_2D_RENDER:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<LAYERS_2D_RENDER>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_bit_flag_2d_render_packed_byte: PackedByteArray
- hint=TYPE_STRING hint_string="int/LAYERS_2D_RENDER:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<LAYERS_2D_RENDER>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_bit_flag_2d_render_packed32: PackedInt32Array
- hint=TYPE_STRING hint_string="int/LAYERS_2D_RENDER:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<LAYERS_2D_RENDER>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_bit_flag_2d_render_packed64: PackedInt64Array
- hint=TYPE_STRING hint_string="int/LAYERS_2D_RENDER:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<LAYERS_2D_RENDER>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_bit_flag_3d_nav: Array
- hint=TYPE_STRING hint_string="int/LAYERS_3D_NAVIGATION:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<LAYERS_3D_NAVIGATION>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_bit_flag_3d_nav_packed_byte: PackedByteArray
- hint=TYPE_STRING hint_string="int/LAYERS_3D_NAVIGATION:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<LAYERS_3D_NAVIGATION>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_bit_flag_3d_nav_packed32: PackedInt32Array
- hint=TYPE_STRING hint_string="int/LAYERS_3D_NAVIGATION:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<LAYERS_3D_NAVIGATION>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_bit_flag_3d_nav_packed64: PackedInt64Array
- hint=TYPE_STRING hint_string="int/LAYERS_3D_NAVIGATION:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<LAYERS_3D_NAVIGATION>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_bit_flag_3d_phys: Array
- hint=TYPE_STRING hint_string="int/LAYERS_3D_PHYSICS:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<LAYERS_3D_PHYSICS>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_bit_flag_3d_phys_packed_byte: PackedByteArray
- hint=TYPE_STRING hint_string="int/LAYERS_3D_PHYSICS:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<LAYERS_3D_PHYSICS>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_bit_flag_3d_phys_packed32: PackedInt32Array
- hint=TYPE_STRING hint_string="int/LAYERS_3D_PHYSICS:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<LAYERS_3D_PHYSICS>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_bit_flag_3d_phys_packed64: PackedInt64Array
- hint=TYPE_STRING hint_string="int/LAYERS_3D_PHYSICS:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<LAYERS_3D_PHYSICS>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_bit_flag_3d_render: Array
- hint=TYPE_STRING hint_string="int/LAYERS_3D_RENDER:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<LAYERS_3D_RENDER>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_bit_flag_3d_render_packed_byte: PackedByteArray
- hint=TYPE_STRING hint_string="int/LAYERS_3D_RENDER:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<LAYERS_3D_RENDER>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_bit_flag_3d_render_packed32: PackedInt32Array
- hint=TYPE_STRING hint_string="int/LAYERS_3D_RENDER:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<LAYERS_3D_RENDER>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_bit_flag_3d_render_packed64: PackedInt64Array
- hint=TYPE_STRING hint_string="int/LAYERS_3D_RENDER:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<LAYERS_3D_RENDER>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_multiline: Array
- hint=TYPE_STRING hint_string="String/MULTILINE_TEXT:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<String>/<MULTILINE_TEXT>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_multiline_packed: PackedStringArray
- hint=TYPE_STRING hint_string="String/MULTILINE_TEXT:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<String>/<MULTILINE_TEXT>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_placeholder: Array
- hint=TYPE_STRING hint_string="String/PLACEHOLDER_TEXT:Placeholder" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<String>/<PLACEHOLDER_TEXT>:Placeholder" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_placeholder_packed: PackedStringArray
- hint=TYPE_STRING hint_string="String/PLACEHOLDER_TEXT:Placeholder" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<String>/<PLACEHOLDER_TEXT>:Placeholder" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_range_int: Array
- hint=TYPE_STRING hint_string="int/RANGE:1,10" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<RANGE>:1,10" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_range_int_packed_byte: PackedByteArray
- hint=TYPE_STRING hint_string="int/RANGE:1,10" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<RANGE>:1,10" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_range_int_packed32: PackedInt32Array
- hint=TYPE_STRING hint_string="int/RANGE:1,10" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<RANGE>:1,10" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_range_int_packed64: PackedInt64Array
- hint=TYPE_STRING hint_string="int/RANGE:1,10" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<RANGE>:1,10" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_range_int_float_step: Array
- hint=TYPE_STRING hint_string="int/RANGE:1,10,0.01" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<RANGE>:1,10,0.01" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_range_float: Array
- hint=TYPE_STRING hint_string="float/RANGE:1,10" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<float>/<RANGE>:1,10" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_range_float_packed32: PackedFloat32Array
- hint=TYPE_STRING hint_string="float/RANGE:1,10" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<float>/<RANGE>:1,10" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_range_float_packed64: PackedFloat64Array
- hint=TYPE_STRING hint_string="float/RANGE:1,10" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<float>/<RANGE>:1,10" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_exp_easing: Array
- hint=TYPE_STRING hint_string="float/EXP_EASING:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<float>/<EXP_EASING>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_exp_easing_packed32: PackedFloat32Array
- hint=TYPE_STRING hint_string="float/EXP_EASING:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<float>/<EXP_EASING>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_exp_easing_packed64: PackedFloat64Array
- hint=TYPE_STRING hint_string="float/EXP_EASING:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<float>/<EXP_EASING>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_node_path: Array
- hint=TYPE_STRING hint_string="NodePath/NODE_PATH_VALID_TYPES:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<NodePath>/<NODE_PATH_VALID_TYPES>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_color: Array
- hint=TYPE_STRING hint_string="Color/COLOR_NO_ALPHA:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<Color>/<COLOR_NO_ALPHA>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_color_packed: PackedColorArray
- hint=TYPE_STRING hint_string="Color/COLOR_NO_ALPHA:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<Color>/<COLOR_NO_ALPHA>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_weak_packed_byte_array: PackedByteArray
- hint=TYPE_STRING hint_string="int:int" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_weak_packed_int32_array: PackedInt32Array
- hint=TYPE_STRING hint_string="int:int" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_weak_packed_int64_array: PackedInt64Array
- hint=TYPE_STRING hint_string="int:int" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_weak_packed_float32_array: PackedFloat32Array
- hint=TYPE_STRING hint_string="float:float" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<float>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_weak_packed_float64_array: PackedFloat64Array
- hint=TYPE_STRING hint_string="float:float" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<float>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_weak_packed_color_array: PackedColorArray
- hint=TYPE_STRING hint_string="Color:Color" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<Color>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_weak_packed_vector2_array: PackedVector2Array
- hint=TYPE_STRING hint_string="Vector2:Vector2" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<Vector2>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_weak_packed_vector3_array: PackedVector3Array
- hint=TYPE_STRING hint_string="Vector3:Vector3" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<Vector3>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_weak_packed_vector4_array: PackedVector4Array
- hint=TYPE_STRING hint_string="Vector4:Vector4" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<Vector4>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_range_weak_packed_byte_array: PackedByteArray
- hint=TYPE_STRING hint_string="int/RANGE:1,10" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<RANGE>:1,10" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_range_weak_packed_int32_array: PackedInt32Array
- hint=TYPE_STRING hint_string="int/RANGE:1,10" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<RANGE>:1,10" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_range_weak_packed_int64_array: PackedInt64Array
- hint=TYPE_STRING hint_string="int/RANGE:1,10" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<RANGE>:1,10" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_range_weak_packed_float32_array: PackedFloat32Array
- hint=TYPE_STRING hint_string="float/RANGE:1,10" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<float>/<RANGE>:1,10" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_range_weak_packed_float64_array: PackedFloat64Array
- hint=TYPE_STRING hint_string="float/RANGE:1,10" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<float>/<RANGE>:1,10" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_noalpha_weak_packed_color_array: PackedColorArray
- hint=TYPE_STRING hint_string="Color/COLOR_NO_ALPHA:" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<Color>/<COLOR_NO_ALPHA>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
diff --git a/modules/gdscript/tests/scripts/parser/features/export_enum.out b/modules/gdscript/tests/scripts/parser/features/export_enum.out
index c87f9b17f0..31d3fa8902 100644
--- a/modules/gdscript/tests/scripts/parser/features/export_enum.out
+++ b/modules/gdscript/tests/scripts/parser/features/export_enum.out
@@ -1,41 +1,41 @@
GDTEST_OK
var test_untyped: int = null
- hint=ENUM hint_string="Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=ENUM hint_string="Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_with_values: int = null
- hint=ENUM hint_string="Red:10,Green:20,Blue:30" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=ENUM hint_string="Red:10,Green:20,Blue:30" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_weak_variant: int = null
- hint=ENUM hint_string="Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=ENUM hint_string="Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_weak_int: int = 0
- hint=ENUM hint_string="Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=ENUM hint_string="Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_weak_string: String = ""
- hint=ENUM hint_string="Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=ENUM hint_string="Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_weak_array_int: Array = Array[int]([])
- hint=TYPE_STRING hint_string="int/ENUM:Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<ENUM>:Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_weak_array_string: Array = Array[String]([])
- hint=TYPE_STRING hint_string="String/ENUM:Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<String>/<ENUM>:Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_weak_packed_byte_array: PackedByteArray = PackedByteArray()
- hint=TYPE_STRING hint_string="int/ENUM:Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<ENUM>:Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_weak_packed_int32_array: PackedInt32Array = PackedInt32Array()
- hint=TYPE_STRING hint_string="int/ENUM:Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<ENUM>:Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_weak_packed_int64_array: PackedInt64Array = PackedInt64Array()
- hint=TYPE_STRING hint_string="int/ENUM:Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<ENUM>:Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_weak_packed_string_array: PackedStringArray = PackedStringArray()
- hint=TYPE_STRING hint_string="String/ENUM:Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<String>/<ENUM>:Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_hard_variant: int = null
- hint=ENUM hint_string="Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=ENUM hint_string="Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_hard_int: int = 0
- hint=ENUM hint_string="Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=ENUM hint_string="Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_hard_string: String = ""
- hint=ENUM hint_string="Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=ENUM hint_string="Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_hard_array_int: Array = Array[int]([])
- hint=TYPE_STRING hint_string="int/ENUM:Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<ENUM>:Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_hard_array_string: Array = Array[String]([])
- hint=TYPE_STRING hint_string="String/ENUM:Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<String>/<ENUM>:Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_variant_array_int: Array = Array[int]([])
- hint=TYPE_STRING hint_string="int/ENUM:Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<ENUM>:Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_variant_packed_int32_array: PackedInt32Array = PackedInt32Array()
- hint=TYPE_STRING hint_string="int/ENUM:Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<int>/<ENUM>:Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_variant_array_string: Array = Array[String]([])
- hint=TYPE_STRING hint_string="String/ENUM:Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<String>/<ENUM>:Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_variant_packed_string_array: PackedStringArray = PackedStringArray()
- hint=TYPE_STRING hint_string="String/ENUM:Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=TYPE_STRING hint_string="<String>/<ENUM>:Red,Green,Blue" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
diff --git a/modules/gdscript/tests/scripts/parser/features/export_variable.gd b/modules/gdscript/tests/scripts/parser/features/export_variable.gd
index 2a218774de..8b343de5ef 100644
--- a/modules/gdscript/tests/scripts/parser/features/export_variable.gd
+++ b/modules/gdscript/tests/scripts/parser/features/export_variable.gd
@@ -2,19 +2,43 @@ extends Node
const Utils = preload("../../utils.notest.gd")
+# Built-in types.
@export var test_weak_int = 1
@export var test_hard_int: int = 2
-@export_storage var test_storage_untyped
-@export_storage var test_storage_weak_int = 3 # Property info still `Variant`, unlike `@export`.
-@export_storage var test_storage_hard_int: int = 4
@export_range(0, 100) var test_range = 100
@export_range(0, 100, 1) var test_range_step = 101
@export_range(0, 100, 1, "or_greater") var test_range_step_or_greater = 102
@export var test_color: Color
@export_color_no_alpha var test_color_no_alpha: Color
@export_node_path("Sprite2D", "Sprite3D", "Control", "Node") var test_node_path := ^"hello"
-@export var test_node: Node
-@export var test_node_array: Array[Node]
+
+# Enums.
+@export var test_side: Side
+@export var test_atm: AutoTranslateMode
+
+# Resources and nodes.
+@export var test_image: Image
+@export var test_timer: Timer
+
+# Arrays.
+@export var test_array: Array
+@export var test_array_bool: Array[bool]
+@export var test_array_array: Array[Array]
+@export var test_array_side: Array[Side]
+@export var test_array_atm: Array[AutoTranslateMode]
+@export var test_array_image: Array[Image]
+@export var test_array_timer: Array[Timer]
+
+# `@export_storage`.
+@export_storage var test_storage_untyped
+@export_storage var test_storage_weak_int = 3 # Property info still `Variant`, unlike `@export`.
+@export_storage var test_storage_hard_int: int = 4
+
+# `@export_custom`.
+# NOTE: `PROPERTY_USAGE_NIL_IS_VARIANT` flag will be removed.
+@export_custom(PROPERTY_HINT_ENUM, "A,B,C") var test_export_custom_untyped
+@export_custom(PROPERTY_HINT_ENUM, "A,B,C") var test_export_custom_weak_int = 5
+@export_custom(PROPERTY_HINT_ENUM, "A,B,C") var test_export_custom_hard_int: int = 6
func test():
for property in get_property_list():
diff --git a/modules/gdscript/tests/scripts/parser/features/export_variable.out b/modules/gdscript/tests/scripts/parser/features/export_variable.out
index b3f9d0ca9c..99d7b27130 100644
--- a/modules/gdscript/tests/scripts/parser/features/export_variable.out
+++ b/modules/gdscript/tests/scripts/parser/features/export_variable.out
@@ -1,27 +1,51 @@
GDTEST_OK
var test_weak_int: int = 1
- hint=NONE hint_string="int" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=NONE hint_string="" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_hard_int: int = 2
- hint=NONE hint_string="int" usage=DEFAULT|SCRIPT_VARIABLE
-var test_storage_untyped: Variant = null
- hint=NONE hint_string="" usage=STORAGE|SCRIPT_VARIABLE|NIL_IS_VARIANT
-var test_storage_weak_int: Variant = 3
- hint=NONE hint_string="" usage=STORAGE|SCRIPT_VARIABLE|NIL_IS_VARIANT
-var test_storage_hard_int: int = 4
- hint=NONE hint_string="" usage=STORAGE|SCRIPT_VARIABLE
+ hint=NONE hint_string="" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_range: int = 100
- hint=RANGE hint_string="0,100" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=RANGE hint_string="0,100" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_range_step: int = 101
- hint=RANGE hint_string="0,100,1" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=RANGE hint_string="0,100,1" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_range_step_or_greater: int = 102
- hint=RANGE hint_string="0,100,1,or_greater" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=RANGE hint_string="0,100,1,or_greater" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_color: Color = Color(0, 0, 0, 1)
- hint=NONE hint_string="Color" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=NONE hint_string="" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_color_no_alpha: Color = Color(0, 0, 0, 1)
- hint=COLOR_NO_ALPHA hint_string="" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=COLOR_NO_ALPHA hint_string="" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
var test_node_path: NodePath = NodePath("hello")
- hint=NODE_PATH_VALID_TYPES hint_string="Sprite2D,Sprite3D,Control,Node" usage=DEFAULT|SCRIPT_VARIABLE
-var test_node: Node = null
- hint=NODE_TYPE hint_string="Node" usage=DEFAULT|SCRIPT_VARIABLE
-var test_node_array: Array = Array[Node]([])
- hint=TYPE_STRING hint_string="Object/NODE_TYPE:Node" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=NODE_PATH_VALID_TYPES hint_string="Sprite2D,Sprite3D,Control,Node" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
+var test_side: Side = 0
+ hint=ENUM hint_string="Side Left:0,Side Top:1,Side Right:2,Side Bottom:3" usage=DEFAULT|SCRIPT_VARIABLE|CLASS_IS_ENUM class_name=&"Side"
+var test_atm: Node.AutoTranslateMode = 0
+ hint=ENUM hint_string="Auto Translate Mode Inherit:0,Auto Translate Mode Always:1,Auto Translate Mode Disabled:2" usage=DEFAULT|SCRIPT_VARIABLE|CLASS_IS_ENUM class_name=&"Node.AutoTranslateMode"
+var test_image: Image = null
+ hint=RESOURCE_TYPE hint_string="Image" usage=DEFAULT|SCRIPT_VARIABLE class_name=&"Image"
+var test_timer: Timer = null
+ hint=NODE_TYPE hint_string="Timer" usage=DEFAULT|SCRIPT_VARIABLE class_name=&"Timer"
+var test_array: Array = []
+ hint=NONE hint_string="" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
+var test_array_bool: Array = Array[bool]([])
+ hint=TYPE_STRING hint_string="<bool>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
+var test_array_array: Array = Array[Array]([])
+ hint=TYPE_STRING hint_string="<Array>:" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
+var test_array_side: Array = Array[int]([])
+ hint=TYPE_STRING hint_string="<int>/<ENUM>:Side Left:0,Side Top:1,Side Right:2,Side Bottom:3" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
+var test_array_atm: Array = Array[int]([])
+ hint=TYPE_STRING hint_string="<int>/<ENUM>:Auto Translate Mode Inherit:0,Auto Translate Mode Always:1,Auto Translate Mode Disabled:2" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
+var test_array_image: Array = Array[Image]([])
+ hint=TYPE_STRING hint_string="<Object>/<RESOURCE_TYPE>:Image" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
+var test_array_timer: Array = Array[Timer]([])
+ hint=TYPE_STRING hint_string="<Object>/<NODE_TYPE>:Timer" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
+var test_storage_untyped: Variant = null
+ hint=NONE hint_string="" usage=STORAGE|SCRIPT_VARIABLE|NIL_IS_VARIANT class_name=&""
+var test_storage_weak_int: Variant = 3
+ hint=NONE hint_string="" usage=STORAGE|SCRIPT_VARIABLE|NIL_IS_VARIANT class_name=&""
+var test_storage_hard_int: int = 4
+ hint=NONE hint_string="" usage=STORAGE|SCRIPT_VARIABLE class_name=&""
+var test_export_custom_untyped: null = null
+ hint=ENUM hint_string="A,B,C" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
+var test_export_custom_weak_int: int = 5
+ hint=ENUM hint_string="A,B,C" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
+var test_export_custom_hard_int: int = 6
+ hint=ENUM hint_string="A,B,C" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
diff --git a/modules/gdscript/tests/scripts/parser/features/match_multiple_patterns_with_array.gd b/modules/gdscript/tests/scripts/parser/features/match_multiple_patterns_with_array.gd
index a278ea1154..24f4c14f50 100644
--- a/modules/gdscript/tests/scripts/parser/features/match_multiple_patterns_with_array.gd
+++ b/modules/gdscript/tests/scripts/parser/features/match_multiple_patterns_with_array.gd
@@ -23,4 +23,3 @@ func test():
bar([3])
bar([4])
bar([5])
-
diff --git a/modules/gdscript/tests/scripts/parser/warnings/return_value_discarded.gd b/modules/gdscript/tests/scripts/parser/warnings/return_value_discarded.gd
index 00598e4d50..f8f70b8cc3 100644
--- a/modules/gdscript/tests/scripts/parser/warnings/return_value_discarded.gd
+++ b/modules/gdscript/tests/scripts/parser/warnings/return_value_discarded.gd
@@ -4,3 +4,4 @@ func i_return_int() -> int:
func test():
i_return_int()
+ preload("../../utils.notest.gd") # `preload` is a function-like keyword.
diff --git a/modules/gdscript/tests/scripts/parser/warnings/return_value_discarded.out b/modules/gdscript/tests/scripts/parser/warnings/return_value_discarded.out
index f2db4e9307..107051df6c 100644
--- a/modules/gdscript/tests/scripts/parser/warnings/return_value_discarded.out
+++ b/modules/gdscript/tests/scripts/parser/warnings/return_value_discarded.out
@@ -3,3 +3,7 @@ GDTEST_OK
>> Line: 6
>> RETURN_VALUE_DISCARDED
>> The function "i_return_int()" returns a value that will be discarded if not used.
+>> WARNING
+>> Line: 7
+>> RETURN_VALUE_DISCARDED
+>> The function "preload()" returns a value that will be discarded if not used.
diff --git a/modules/gdscript/tests/scripts/parser/warnings/standalone_expression.gd b/modules/gdscript/tests/scripts/parser/warnings/standalone_expression.gd
index dc4223ec2d..74f42b012b 100644
--- a/modules/gdscript/tests/scripts/parser/warnings/standalone_expression.gd
+++ b/modules/gdscript/tests/scripts/parser/warnings/standalone_expression.gd
@@ -6,3 +6,16 @@ func test():
Vector3.ZERO
[true, false]
float(125)
+ # The following statements should not produce `STANDALONE_EXPRESSION`:
+ var _a = 1
+ _a = 2 # Assignment is a local (or global) side effect.
+ @warning_ignore("redundant_await")
+ await 3 # The `await` operand is usually a coroutine or a signal.
+ absi(4) # A call (in general) can have side effects.
+ @warning_ignore("return_value_discarded")
+ preload("../../utils.notest.gd") # A static initializer may have side effects.
+ """
+ Python-like "comment".
+ """
+ @warning_ignore("standalone_ternary")
+ 1 if 2 else 3 # Produces `STANDALONE_TERNARY` instead.
diff --git a/modules/gdscript/tests/scripts/parser/warnings/standalone_expression.out b/modules/gdscript/tests/scripts/parser/warnings/standalone_expression.out
index a2c67a6e51..72c659c952 100644
--- a/modules/gdscript/tests/scripts/parser/warnings/standalone_expression.out
+++ b/modules/gdscript/tests/scripts/parser/warnings/standalone_expression.out
@@ -2,16 +2,16 @@ GDTEST_OK
>> WARNING
>> Line: 3
>> STANDALONE_EXPRESSION
->> Standalone expression (the line has no effect).
+>> Standalone expression (the line may have no effect).
>> WARNING
>> Line: 4
>> STANDALONE_EXPRESSION
->> Standalone expression (the line has no effect).
+>> Standalone expression (the line may have no effect).
>> WARNING
>> Line: 6
>> STANDALONE_EXPRESSION
->> Standalone expression (the line has no effect).
+>> Standalone expression (the line may have no effect).
>> WARNING
>> Line: 7
>> STANDALONE_EXPRESSION
->> Standalone expression (the line has no effect).
+>> Standalone expression (the line may have no effect).
diff --git a/modules/gdscript/tests/scripts/runtime/features/argument_count.gd b/modules/gdscript/tests/scripts/runtime/features/argument_count.gd
index c67ce25cbe..104489cfe6 100644
--- a/modules/gdscript/tests/scripts/runtime/features/argument_count.gd
+++ b/modules/gdscript/tests/scripts/runtime/features/argument_count.gd
@@ -57,7 +57,7 @@ func test():
var lambda_callable_2 : Callable = func(_foo, _bar, _baz): pass
print(lambda_callable_2.get_argument_count()) # Should print 3.
- # Test lambas with self.
+ # Test lambdas with self.
var lambda_self_callable_1 : Callable = func(_foo, _bar): return self
print(lambda_self_callable_1.get_argument_count()) # Should print 2.
var lambda_self_callable_2 : Callable = func(_foo, _bar, _baz): return self
diff --git a/modules/gdscript/tests/scripts/runtime/features/call_native_static_method_validated.gd b/modules/gdscript/tests/scripts/runtime/features/call_native_static_method_validated.gd
index 35e4dbd6a0..a1a9e350b0 100644
--- a/modules/gdscript/tests/scripts/runtime/features/call_native_static_method_validated.gd
+++ b/modules/gdscript/tests/scripts/runtime/features/call_native_static_method_validated.gd
@@ -4,4 +4,3 @@ func test():
# Validated native static call without return value.
Node.print_orphan_nodes()
-
diff --git a/modules/gdscript/tests/scripts/runtime/features/export_group_no_name_conflict_with_properties.out b/modules/gdscript/tests/scripts/runtime/features/export_group_no_name_conflict_with_properties.out
index 9387ec50d7..a1e7233078 100644
--- a/modules/gdscript/tests/scripts/runtime/features/export_group_no_name_conflict_with_properties.out
+++ b/modules/gdscript/tests/scripts/runtime/features/export_group_no_name_conflict_with_properties.out
@@ -1,8 +1,8 @@
GDTEST_OK
Not shadowed: Resource
var test_1: int = 0
- hint=NONE hint_string="int" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=NONE hint_string="" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
@export_category("test_1")
- hint=NONE hint_string="" usage=CATEGORY
+ hint=NONE hint_string="" usage=CATEGORY class_name=&""
var test_2: int = 0
- hint=NONE hint_string="int" usage=DEFAULT|SCRIPT_VARIABLE
+ hint=NONE hint_string="" usage=DEFAULT|SCRIPT_VARIABLE class_name=&""
diff --git a/modules/gdscript/tests/scripts/utils.notest.gd b/modules/gdscript/tests/scripts/utils.notest.gd
index 1cf46c179e..7fdd6556ec 100644
--- a/modules/gdscript/tests/scripts/utils.notest.gd
+++ b/modules/gdscript/tests/scripts/utils.notest.gd
@@ -55,18 +55,18 @@ static func get_human_readable_hint_string(property: Dictionary) -> String:
if elem_type_hint.is_valid_int():
elem_type = elem_type_hint.to_int()
- type_hint_prefixes += type_string(elem_type) + ":"
+ type_hint_prefixes += "<%s>:" % type_string(elem_type)
else:
if elem_type_hint.count("/") != 1:
push_error("Invalid PROPERTY_HINT_TYPE_STRING format.")
elem_type = elem_type_hint.get_slice("/", 0).to_int()
elem_hint = elem_type_hint.get_slice("/", 1).to_int()
- type_hint_prefixes += "%s/%s:" % [
- type_string(elem_type),
- get_property_hint_name(elem_hint).trim_prefix("PROPERTY_HINT_"),
+ type_hint_prefixes += "<%s>/<%s>:" % [
+ type_string(elem_type),
+ get_property_hint_name(elem_hint).trim_prefix("PROPERTY_HINT_"),
]
- if elem_type < TYPE_ARRAY:
+ if elem_type < TYPE_ARRAY or hint_string.is_empty():
break
return type_hint_prefixes + hint_string
@@ -76,10 +76,11 @@ static func get_human_readable_hint_string(property: Dictionary) -> String:
static func print_property_extended_info(property: Dictionary, base: Object = null, is_static: bool = false) -> void:
print(get_property_signature(property, base, is_static))
- print(' hint=%s hint_string="%s" usage=%s' % [
+ print(' hint=%s hint_string="%s" usage=%s class_name=&"%s"' % [
get_property_hint_name(property.hint).trim_prefix("PROPERTY_HINT_"),
- get_human_readable_hint_string(property),
+ get_human_readable_hint_string(property).c_escape(),
get_property_usage_string(property.usage).replace("PROPERTY_USAGE_", ""),
+ property.class_name.c_escape(),
])
diff --git a/modules/gdscript/tests/test_gdscript.cpp b/modules/gdscript/tests/test_gdscript.cpp
index f6965cf7cf..fbc72a0508 100644
--- a/modules/gdscript/tests/test_gdscript.cpp
+++ b/modules/gdscript/tests/test_gdscript.cpp
@@ -188,11 +188,11 @@ static void recursively_disassemble_functions(const Ref<GDScript> script, const
const MethodInfo &mi = func->get_method_info();
String signature = "Disassembling " + mi.name + "(";
- for (int i = 0; i < mi.arguments.size(); i++) {
- if (i > 0) {
+ for (List<PropertyInfo>::ConstIterator arg_itr = mi.arguments.begin(); arg_itr != mi.arguments.end(); ++arg_itr) {
+ if (arg_itr != mi.arguments.begin()) {
signature += ", ";
}
- signature += mi.arguments[i].name;
+ signature += arg_itr->name;
}
print_line(signature + ")");
#ifdef TOOLS_ENABLED
diff --git a/modules/gdscript/tests/test_lsp.h b/modules/gdscript/tests/test_lsp.h
index 6192272f80..b85c727bc5 100644
--- a/modules/gdscript/tests/test_lsp.h
+++ b/modules/gdscript/tests/test_lsp.h
@@ -227,7 +227,7 @@ Vector<InlineTestData> read_tests(const String &p_path) {
if (InlineTestData::try_parse(lines, i, d)) {
if (!d.name.is_empty()) {
// Safety check: names must be unique.
- if (names.find(d.name) != -1) {
+ if (names.has(d.name)) {
FAIL(vformat("Duplicated name '%s' in '%s'. Names must be unique!", d.name, p_path));
}
names.append(d.name);
diff --git a/modules/gltf/editor/editor_scene_exporter_gltf_settings.cpp b/modules/gltf/editor/editor_scene_exporter_gltf_settings.cpp
index d11300343a..16f32af903 100644
--- a/modules/gltf/editor/editor_scene_exporter_gltf_settings.cpp
+++ b/modules/gltf/editor/editor_scene_exporter_gltf_settings.cpp
@@ -39,7 +39,7 @@ bool EditorSceneExporterGLTFSettings::_set(const StringName &p_name, const Varia
}
if (p_name == StringName("image_format")) {
_document->set_image_format(p_value);
- emit_signal("property_list_changed");
+ emit_signal(CoreStringName(property_list_changed));
return true;
}
if (p_name == StringName("lossy_quality")) {
@@ -77,7 +77,7 @@ void EditorSceneExporterGLTFSettings::_get_property_list(List<PropertyInfo> *p_l
for (PropertyInfo prop : _property_list) {
if (prop.name == "lossy_quality") {
String image_format = get("image_format");
- bool is_image_format_lossy = image_format == "JPEG" || image_format.findn("Lossy") != -1;
+ bool is_image_format_lossy = image_format == "JPEG" || image_format.containsn("Lossy");
prop.usage = is_image_format_lossy ? PROPERTY_USAGE_DEFAULT : PROPERTY_USAGE_STORAGE;
}
p_list->push_back(prop);
@@ -86,7 +86,7 @@ void EditorSceneExporterGLTFSettings::_get_property_list(List<PropertyInfo> *p_l
void EditorSceneExporterGLTFSettings::_on_extension_property_list_changed() {
generate_property_list(_document);
- emit_signal("property_list_changed");
+ emit_signal(CoreStringName(property_list_changed));
}
bool EditorSceneExporterGLTFSettings::_set_extension_setting(const String &p_name_str, const Variant &p_value) {
@@ -136,8 +136,8 @@ void EditorSceneExporterGLTFSettings::generate_property_list(Ref<GLTFDocument> p
// Add properties from all document extensions.
for (Ref<GLTFDocumentExtension> &extension : GLTFDocument::get_all_gltf_document_extensions()) {
const Callable on_prop_changed = callable_mp(this, &EditorSceneExporterGLTFSettings::_on_extension_property_list_changed);
- if (!extension->is_connected("property_list_changed", on_prop_changed)) {
- extension->connect("property_list_changed", on_prop_changed);
+ if (!extension->is_connected(CoreStringName(property_list_changed), on_prop_changed)) {
+ extension->connect(CoreStringName(property_list_changed), on_prop_changed);
}
const String config_prefix = get_friendly_config_prefix(extension);
_config_name_to_extension_map[config_prefix] = extension;
diff --git a/modules/gltf/editor/editor_scene_importer_blend.cpp b/modules/gltf/editor/editor_scene_importer_blend.cpp
index 42c3ecc7cb..ccf347e03e 100644
--- a/modules/gltf/editor/editor_scene_importer_blend.cpp
+++ b/modules/gltf/editor/editor_scene_importer_blend.cpp
@@ -493,7 +493,7 @@ bool EditorFileSystemImportFormatSupportQueryBlend::query() {
blender_path_browse = memnew(Button);
blender_path_browse->set_text(TTR("Browse"));
- blender_path_browse->connect("pressed", callable_mp(this, &EditorFileSystemImportFormatSupportQueryBlend::_browse_install));
+ blender_path_browse->connect(SceneStringName(pressed), callable_mp(this, &EditorFileSystemImportFormatSupportQueryBlend::_browse_install));
hb->add_child(blender_path_browse);
hb->set_h_size_flags(Control::SIZE_EXPAND_FILL);
diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp
index 4c32a29ce0..b92176a63a 100644
--- a/modules/gltf/gltf_document.cpp
+++ b/modules/gltf/gltf_document.cpp
@@ -105,10 +105,6 @@ static Ref<ImporterMesh> _mesh_to_importer_mesh(Ref<Mesh> p_mesh) {
}
Error GLTFDocument::_serialize(Ref<GLTFState> p_state) {
- if (!p_state->buffers.size()) {
- p_state->buffers.push_back(Vector<uint8_t>());
- }
-
for (Ref<GLTFDocumentExtension> ext : document_extensions) {
ERR_CONTINUE(ext.is_null());
Error err = ext->export_preserialize(p_state);
@@ -243,7 +239,6 @@ Error GLTFDocument::_serialize_gltf_extensions(Ref<GLTFState> p_state) const {
}
Error GLTFDocument::_serialize_scenes(Ref<GLTFState> p_state) {
- ERR_FAIL_COND_V_MSG(p_state->root_nodes.is_empty(), ERR_INVALID_DATA, "GLTF export: The scene must have at least one root node.");
// Godot only supports one scene per glTF file.
Array scenes;
Dictionary scene_dict;
@@ -251,7 +246,9 @@ Error GLTFDocument::_serialize_scenes(Ref<GLTFState> p_state) {
p_state->json["scenes"] = scenes;
p_state->json["scene"] = 0;
// Add nodes to the scene dict.
- scene_dict["nodes"] = p_state->root_nodes;
+ if (!p_state->root_nodes.is_empty()) {
+ scene_dict["nodes"] = p_state->root_nodes;
+ }
if (!p_state->scene_name.is_empty()) {
scene_dict["name"] = p_state->scene_name;
}
@@ -458,9 +455,15 @@ Error GLTFDocument::_serialize_nodes(Ref<GLTFState> p_state) {
ERR_CONTINUE(err != OK);
}
+ if (extensions.is_empty()) {
+ node.erase("extensions");
+ }
+
nodes.push_back(node);
}
- p_state->json["nodes"] = nodes;
+ if (!nodes.is_empty()) {
+ p_state->json["nodes"] = nodes;
+ }
return OK;
}
@@ -691,11 +694,11 @@ static Vector<uint8_t> _parse_base64_uri(const String &p_uri) {
Error GLTFDocument::_encode_buffer_glb(Ref<GLTFState> p_state, const String &p_path) {
print_verbose("glTF: Total buffers: " + itos(p_state->buffers.size()));
- if (!p_state->buffers.size()) {
+ if (p_state->buffers.is_empty()) {
return OK;
}
Array buffers;
- if (p_state->buffers.size()) {
+ if (!p_state->buffers.is_empty()) {
Vector<uint8_t> buffer_data = p_state->buffers[0];
Dictionary gltf_buffer;
@@ -730,7 +733,7 @@ Error GLTFDocument::_encode_buffer_glb(Ref<GLTFState> p_state, const String &p_p
Error GLTFDocument::_encode_buffer_bins(Ref<GLTFState> p_state, const String &p_path) {
print_verbose("glTF: Total buffers: " + itos(p_state->buffers.size()));
- if (!p_state->buffers.size()) {
+ if (p_state->buffers.is_empty()) {
return OK;
}
Array buffers;
@@ -1543,6 +1546,9 @@ GLTFAccessorIndex GLTFDocument::_encode_accessor_as_ints(Ref<GLTFState> p_state,
Ref<GLTFAccessor> accessor;
accessor.instantiate();
GLTFBufferIndex buffer_view_i;
+ if (p_state->buffers.is_empty()) {
+ p_state->buffers.push_back(Vector<uint8_t>());
+ }
int64_t size = p_state->buffers[0].size();
const GLTFType type = GLTFType::TYPE_SCALAR;
int component_type;
@@ -1654,6 +1660,9 @@ GLTFAccessorIndex GLTFDocument::_encode_accessor_as_vec2(Ref<GLTFState> p_state,
Ref<GLTFAccessor> accessor;
accessor.instantiate();
GLTFBufferIndex buffer_view_i;
+ if (p_state->buffers.is_empty()) {
+ p_state->buffers.push_back(Vector<uint8_t>());
+ }
int64_t size = p_state->buffers[0].size();
const GLTFType type = GLTFType::TYPE_VEC2;
const int component_type = GLTFDocument::COMPONENT_TYPE_FLOAT;
@@ -1704,6 +1713,9 @@ GLTFAccessorIndex GLTFDocument::_encode_accessor_as_color(Ref<GLTFState> p_state
Ref<GLTFAccessor> accessor;
accessor.instantiate();
GLTFBufferIndex buffer_view_i;
+ if (p_state->buffers.is_empty()) {
+ p_state->buffers.push_back(Vector<uint8_t>());
+ }
int64_t size = p_state->buffers[0].size();
const GLTFType type = GLTFType::TYPE_VEC4;
const int component_type = GLTFDocument::COMPONENT_TYPE_FLOAT;
@@ -1768,6 +1780,9 @@ GLTFAccessorIndex GLTFDocument::_encode_accessor_as_weights(Ref<GLTFState> p_sta
Ref<GLTFAccessor> accessor;
accessor.instantiate();
GLTFBufferIndex buffer_view_i;
+ if (p_state->buffers.is_empty()) {
+ p_state->buffers.push_back(Vector<uint8_t>());
+ }
int64_t size = p_state->buffers[0].size();
const GLTFType type = GLTFType::TYPE_VEC4;
const int component_type = GLTFDocument::COMPONENT_TYPE_FLOAT;
@@ -1816,6 +1831,9 @@ GLTFAccessorIndex GLTFDocument::_encode_accessor_as_joints(Ref<GLTFState> p_stat
Ref<GLTFAccessor> accessor;
accessor.instantiate();
GLTFBufferIndex buffer_view_i;
+ if (p_state->buffers.is_empty()) {
+ p_state->buffers.push_back(Vector<uint8_t>());
+ }
int64_t size = p_state->buffers[0].size();
const GLTFType type = GLTFType::TYPE_VEC4;
const int component_type = GLTFDocument::COMPONENT_TYPE_UNSIGNED_SHORT;
@@ -1866,6 +1884,9 @@ GLTFAccessorIndex GLTFDocument::_encode_accessor_as_quaternions(Ref<GLTFState> p
Ref<GLTFAccessor> accessor;
accessor.instantiate();
GLTFBufferIndex buffer_view_i;
+ if (p_state->buffers.is_empty()) {
+ p_state->buffers.push_back(Vector<uint8_t>());
+ }
int64_t size = p_state->buffers[0].size();
const GLTFType type = GLTFType::TYPE_VEC4;
const int component_type = GLTFDocument::COMPONENT_TYPE_FLOAT;
@@ -1938,6 +1959,9 @@ GLTFAccessorIndex GLTFDocument::_encode_accessor_as_floats(Ref<GLTFState> p_stat
Ref<GLTFAccessor> accessor;
accessor.instantiate();
GLTFBufferIndex buffer_view_i;
+ if (p_state->buffers.is_empty()) {
+ p_state->buffers.push_back(Vector<uint8_t>());
+ }
int64_t size = p_state->buffers[0].size();
const GLTFType type = GLTFType::TYPE_SCALAR;
const int component_type = GLTFDocument::COMPONENT_TYPE_FLOAT;
@@ -1985,6 +2009,9 @@ GLTFAccessorIndex GLTFDocument::_encode_accessor_as_vec3(Ref<GLTFState> p_state,
Ref<GLTFAccessor> accessor;
accessor.instantiate();
GLTFBufferIndex buffer_view_i;
+ if (p_state->buffers.is_empty()) {
+ p_state->buffers.push_back(Vector<uint8_t>());
+ }
int64_t size = p_state->buffers[0].size();
const GLTFType type = GLTFType::TYPE_VEC3;
const int component_type = GLTFDocument::COMPONENT_TYPE_FLOAT;
@@ -2058,6 +2085,9 @@ GLTFAccessorIndex GLTFDocument::_encode_sparse_accessor_as_vec3(Ref<GLTFState> p
Ref<GLTFAccessor> sparse_accessor;
sparse_accessor.instantiate();
+ if (p_state->buffers.is_empty()) {
+ p_state->buffers.push_back(Vector<uint8_t>());
+ }
int64_t size = p_state->buffers[0].size();
const GLTFType type = GLTFType::TYPE_VEC3;
const int component_type = GLTFDocument::COMPONENT_TYPE_FLOAT;
@@ -2160,6 +2190,9 @@ GLTFAccessorIndex GLTFDocument::_encode_accessor_as_xform(Ref<GLTFState> p_state
Ref<GLTFAccessor> accessor;
accessor.instantiate();
GLTFBufferIndex buffer_view_i;
+ if (p_state->buffers.is_empty()) {
+ p_state->buffers.push_back(Vector<uint8_t>());
+ }
int64_t size = p_state->buffers[0].size();
const GLTFType type = GLTFType::TYPE_MAT4;
const int component_type = GLTFDocument::COMPONENT_TYPE_FLOAT;
@@ -6944,7 +6977,7 @@ Error GLTFDocument::_serialize_file(Ref<GLTFState> p_state, const String p_path)
const uint32_t text_chunk_type = 0x4E4F534A; //JSON
uint32_t binary_data_length = 0;
- if (p_state->buffers.size()) {
+ if (p_state->buffers.size() > 0) {
binary_data_length = p_state->buffers[0].size();
}
const uint32_t binary_chunk_length = ((binary_data_length + 3) & (~3));
@@ -6953,20 +6986,28 @@ Error GLTFDocument::_serialize_file(Ref<GLTFState> p_state, const String p_path)
file->create(FileAccess::ACCESS_RESOURCES);
file->store_32(magic);
file->store_32(p_state->major_version); // version
- file->store_32(header_size + chunk_header_size + text_chunk_length + chunk_header_size + binary_chunk_length); // length
+ uint32_t total_length = header_size + chunk_header_size + text_chunk_length;
+ if (binary_chunk_length) {
+ total_length += chunk_header_size + binary_chunk_length;
+ }
+ file->store_32(total_length);
+
+ // Write the JSON text chunk.
file->store_32(text_chunk_length);
file->store_32(text_chunk_type);
file->store_buffer((uint8_t *)&cs[0], cs.length());
for (uint32_t pad_i = text_data_length; pad_i < text_chunk_length; pad_i++) {
file->store_8(' ');
}
+
+ // Write a single binary chunk.
if (binary_chunk_length) {
file->store_32(binary_chunk_length);
file->store_32(binary_chunk_type);
file->store_buffer(p_state->buffers[0].ptr(), binary_data_length);
- }
- for (uint32_t pad_i = binary_data_length; pad_i < binary_chunk_length; pad_i++) {
- file->store_8(0);
+ for (uint32_t pad_i = binary_data_length; pad_i < binary_chunk_length; pad_i++) {
+ file->store_8(0);
+ }
}
} else {
err = _encode_buffer_bins(p_state, p_path);
@@ -7032,7 +7073,7 @@ void GLTFDocument::_build_parent_hierachy(Ref<GLTFState> p_state) {
Vector<Ref<GLTFDocumentExtension>> GLTFDocument::all_document_extensions;
void GLTFDocument::register_gltf_document_extension(Ref<GLTFDocumentExtension> p_extension, bool p_first_priority) {
- if (all_document_extensions.find(p_extension) == -1) {
+ if (!all_document_extensions.has(p_extension)) {
if (p_first_priority) {
all_document_extensions.insert(0, p_extension);
} else {
@@ -7073,7 +7114,7 @@ PackedByteArray GLTFDocument::_serialize_glb_buffer(Ref<GLTFState> p_state, Erro
const uint32_t text_chunk_type = 0x4E4F534A; //JSON
int32_t binary_data_length = 0;
- if (p_state->buffers.size()) {
+ if (p_state->buffers.size() > 0) {
binary_data_length = p_state->buffers[0].size();
}
const int32_t binary_chunk_length = binary_data_length;
diff --git a/modules/gltf/skin_tool.cpp b/modules/gltf/skin_tool.cpp
index 2fb55a5f9e..a344334d93 100644
--- a/modules/gltf/skin_tool.cpp
+++ b/modules/gltf/skin_tool.cpp
@@ -57,9 +57,9 @@ bool SkinTool::_capture_nodes_in_skin(const Vector<Ref<GLTFNode>> &nodes, Ref<GL
if (found_joint) {
// Mark it if we happen to find another skins joint...
- if (current_node->joint && p_skin->joints.find(p_node_index) < 0) {
+ if (current_node->joint && !p_skin->joints.has(p_node_index)) {
p_skin->joints.push_back(p_node_index);
- } else if (p_skin->non_joints.find(p_node_index) < 0) {
+ } else if (!p_skin->non_joints.has(p_node_index)) {
p_skin->non_joints.push_back(p_node_index);
}
}
@@ -79,7 +79,7 @@ void SkinTool::_capture_nodes_for_multirooted_skin(Vector<Ref<GLTFNode>> &r_node
const SkinNodeIndex parent = r_nodes[node_index]->parent;
disjoint_set.insert(node_index);
- if (p_skin->joints.find(parent) >= 0) {
+ if (p_skin->joints.has(parent)) {
disjoint_set.create_union(parent, node_index);
}
}
@@ -109,9 +109,9 @@ void SkinTool::_capture_nodes_for_multirooted_skin(Vector<Ref<GLTFNode>> &r_node
while (r_nodes[current_node]->height > maxHeight) {
SkinNodeIndex parent = r_nodes[current_node]->parent;
- if (r_nodes[parent]->joint && p_skin->joints.find(parent) < 0) {
+ if (r_nodes[parent]->joint && !p_skin->joints.has(parent)) {
p_skin->joints.push_back(parent);
- } else if (p_skin->non_joints.find(parent) < 0) {
+ } else if (!p_skin->non_joints.has(parent)) {
p_skin->non_joints.push_back(parent);
}
@@ -138,9 +138,9 @@ void SkinTool::_capture_nodes_for_multirooted_skin(Vector<Ref<GLTFNode>> &r_node
const SkinNodeIndex current_node = roots[i];
const SkinNodeIndex parent = r_nodes[current_node]->parent;
- if (r_nodes[parent]->joint && p_skin->joints.find(parent) < 0) {
+ if (r_nodes[parent]->joint && !p_skin->joints.has(parent)) {
p_skin->joints.push_back(parent);
- } else if (p_skin->non_joints.find(parent) < 0) {
+ } else if (!p_skin->non_joints.has(parent)) {
p_skin->non_joints.push_back(parent);
}
@@ -166,7 +166,7 @@ Error SkinTool::_expand_skin(Vector<Ref<GLTFNode>> &r_nodes, Ref<GLTFSkin> p_ski
const SkinNodeIndex parent = r_nodes[node_index]->parent;
disjoint_set.insert(node_index);
- if (all_skin_nodes.find(parent) >= 0) {
+ if (all_skin_nodes.has(parent)) {
disjoint_set.create_union(parent, node_index);
}
}
@@ -216,7 +216,7 @@ Error SkinTool::_verify_skin(Vector<Ref<GLTFNode>> &r_nodes, Ref<GLTFSkin> p_ski
const SkinNodeIndex parent = r_nodes[node_index]->parent;
disjoint_set.insert(node_index);
- if (all_skin_nodes.find(parent) >= 0) {
+ if (all_skin_nodes.has(parent)) {
disjoint_set.create_union(parent, node_index);
}
}
@@ -365,7 +365,7 @@ Error SkinTool::_determine_skeletons(
for (int j = 0; j < groups.size() && i != j; ++j) {
const Vector<SkinNodeIndex> &group = groups[j];
- if (group.find(node_i_parent) >= 0) {
+ if (group.has(node_i_parent)) {
const SkinNodeIndex node_j = highest_group_members[j];
skeleton_sets.create_union(node_i, node_j);
}
@@ -393,7 +393,7 @@ Error SkinTool::_determine_skeletons(
// If any of the the skeletons nodes exist in a skin, that skin now maps to the skeleton
for (int i = 0; i < skeleton_nodes.size(); ++i) {
SkinNodeIndex skel_node_i = skeleton_nodes[i];
- if (skin->joints.find(skel_node_i) >= 0 || skin->non_joints.find(skel_node_i) >= 0) {
+ if (skin->joints.has(skel_node_i) || skin->non_joints.has(skel_node_i)) {
skin->skeleton = skel_i;
continue;
}
@@ -454,7 +454,7 @@ Error SkinTool::_reparent_non_joint_skeleton_subtrees(
subtree_set.insert(node_i);
const SkinNodeIndex parent_i = nodes[node_i]->parent;
- if (parent_i >= 0 && p_non_joints.find(parent_i) >= 0 && !nodes[parent_i]->joint) {
+ if (parent_i >= 0 && p_non_joints.has(parent_i) && !nodes[parent_i]->joint) {
subtree_set.create_union(parent_i, node_i);
}
}
diff --git a/modules/gridmap/doc_classes/GridMap.xml b/modules/gridmap/doc_classes/GridMap.xml
index ef7276f493..cf13068efa 100644
--- a/modules/gridmap/doc_classes/GridMap.xml
+++ b/modules/gridmap/doc_classes/GridMap.xml
@@ -135,7 +135,7 @@
<return type="Vector3" />
<param index="0" name="map_position" type="Vector3i" />
<description>
- Returns the position of a grid cell in the GridMap's local coordinate space. To convert the returned value into global coordinates, use [method Node3D.to_global]. See also [method map_to_local].
+ Returns the position of a grid cell in the GridMap's local coordinate space. To convert the returned value into global coordinates, use [method Node3D.to_global]. See also [method local_to_map].
</description>
</method>
<method name="resource_changed" deprecated="Use [signal Resource.changed] instead.">
diff --git a/modules/gridmap/editor/grid_map_editor_plugin.cpp b/modules/gridmap/editor/grid_map_editor_plugin.cpp
index d53bf7f7ec..27c74421db 100644
--- a/modules/gridmap/editor/grid_map_editor_plugin.cpp
+++ b/modules/gridmap/editor/grid_map_editor_plugin.cpp
@@ -32,7 +32,6 @@
#ifdef TOOLS_ENABLED
-#include "core/core_string_names.h"
#include "core/input/input.h"
#include "core/os/keyboard.h"
#include "editor/editor_node.h"
@@ -949,7 +948,7 @@ void GridMapEditor::_update_mesh_library() {
void GridMapEditor::edit(GridMap *p_gridmap) {
if (node) {
node->disconnect(SNAME("cell_size_changed"), callable_mp(this, &GridMapEditor::_draw_grids));
- node->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &GridMapEditor::_update_mesh_library));
+ node->disconnect(CoreStringName(changed), callable_mp(this, &GridMapEditor::_update_mesh_library));
if (mesh_library.is_valid()) {
mesh_library->disconnect_changed(callable_mp(this, &GridMapEditor::update_palette));
mesh_library = Ref<MeshLibrary>();
@@ -987,7 +986,7 @@ void GridMapEditor::edit(GridMap *p_gridmap) {
update_grid();
node->connect(SNAME("cell_size_changed"), callable_mp(this, &GridMapEditor::_draw_grids));
- node->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &GridMapEditor::_update_mesh_library));
+ node->connect(CoreStringName(changed), callable_mp(this, &GridMapEditor::_update_mesh_library));
_update_mesh_library();
}
@@ -1225,8 +1224,8 @@ GridMapEditor::GridMapEditor() {
spatial_editor_hb->add_child(floor);
floor->connect("value_changed", callable_mp(this, &GridMapEditor::_floor_changed));
- floor->connect("mouse_exited", callable_mp(this, &GridMapEditor::_floor_mouse_exited));
- floor->get_line_edit()->connect("mouse_exited", callable_mp(this, &GridMapEditor::_floor_mouse_exited));
+ floor->connect(SceneStringName(mouse_exited), callable_mp(this, &GridMapEditor::_floor_mouse_exited));
+ floor->get_line_edit()->connect(SceneStringName(mouse_exited), callable_mp(this, &GridMapEditor::_floor_mouse_exited));
spatial_editor_hb->add_child(memnew(VSeparator));
@@ -1288,21 +1287,21 @@ GridMapEditor::GridMapEditor() {
search_box->set_clear_button_enabled(true);
hb->add_child(search_box);
search_box->connect("text_changed", callable_mp(this, &GridMapEditor::_text_changed));
- search_box->connect("gui_input", callable_mp(this, &GridMapEditor::_sbox_input));
+ search_box->connect(SceneStringName(gui_input), callable_mp(this, &GridMapEditor::_sbox_input));
mode_thumbnail = memnew(Button);
mode_thumbnail->set_theme_type_variation("FlatButton");
mode_thumbnail->set_toggle_mode(true);
mode_thumbnail->set_pressed(true);
hb->add_child(mode_thumbnail);
- mode_thumbnail->connect("pressed", callable_mp(this, &GridMapEditor::_set_display_mode).bind(DISPLAY_THUMBNAIL));
+ mode_thumbnail->connect(SceneStringName(pressed), callable_mp(this, &GridMapEditor::_set_display_mode).bind(DISPLAY_THUMBNAIL));
mode_list = memnew(Button);
mode_list->set_theme_type_variation("FlatButton");
mode_list->set_toggle_mode(true);
mode_list->set_pressed(false);
hb->add_child(mode_list);
- mode_list->connect("pressed", callable_mp(this, &GridMapEditor::_set_display_mode).bind(DISPLAY_LIST));
+ mode_list->connect(SceneStringName(pressed), callable_mp(this, &GridMapEditor::_set_display_mode).bind(DISPLAY_LIST));
size_slider = memnew(HSlider);
size_slider->set_h_size_flags(SIZE_EXPAND_FILL);
@@ -1319,7 +1318,7 @@ GridMapEditor::GridMapEditor() {
mesh_library_palette->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
add_child(mesh_library_palette);
mesh_library_palette->set_v_size_flags(SIZE_EXPAND_FILL);
- mesh_library_palette->connect("gui_input", callable_mp(this, &GridMapEditor::_mesh_library_palette_input));
+ mesh_library_palette->connect(SceneStringName(gui_input), callable_mp(this, &GridMapEditor::_mesh_library_palette_input));
info_message = memnew(Label);
info_message->set_text(TTR("Give a MeshLibrary resource to this GridMap to use its meshes."));
diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp
index 25519c6e3c..71171be3f1 100644
--- a/modules/gridmap/grid_map.cpp
+++ b/modules/gridmap/grid_map.cpp
@@ -30,14 +30,12 @@
#include "grid_map.h"
-#include "core/core_string_names.h"
#include "core/io/marshalls.h"
#include "scene/3d/light_3d.h"
#include "scene/resources/3d/mesh_library.h"
#include "scene/resources/3d/primitive_meshes.h"
#include "scene/resources/physics_material.h"
#include "scene/resources/surface_tool.h"
-#include "scene/scene_string_names.h"
#include "servers/navigation_server_3d.h"
#include "servers/rendering_server.h"
@@ -266,7 +264,7 @@ void GridMap::set_mesh_library(const Ref<MeshLibrary> &p_mesh_library) {
}
_recreate_octant_data();
- emit_signal(CoreStringNames::get_singleton()->changed);
+ emit_signal(CoreStringName(changed));
}
Ref<MeshLibrary> GridMap::get_mesh_library() const {
@@ -1136,7 +1134,7 @@ void GridMap::_bind_methods() {
BIND_CONSTANT(INVALID_CELL_ITEM);
ADD_SIGNAL(MethodInfo("cell_size_changed", PropertyInfo(Variant::VECTOR3, "cell_size")));
- ADD_SIGNAL(MethodInfo(CoreStringNames::get_singleton()->changed));
+ ADD_SIGNAL(MethodInfo(CoreStringName(changed)));
}
void GridMap::set_cell_scale(float p_scale) {
diff --git a/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp b/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp
index 9960c4e07c..cd3814879a 100644
--- a/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp
+++ b/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp
@@ -31,13 +31,9 @@
#include "audio_stream_interactive_editor_plugin.h"
#include "../audio_stream_interactive.h"
-#include "core/input/input.h"
-#include "core/os/keyboard.h"
#include "editor/editor_node.h"
-#include "editor/editor_settings.h"
#include "editor/editor_string_names.h"
#include "editor/editor_undo_redo_manager.h"
-#include "editor/themes/editor_scale.h"
#include "scene/gui/check_box.h"
#include "scene/gui/option_button.h"
#include "scene/gui/spin_box.h"
@@ -73,7 +69,7 @@ void AudioStreamInteractiveTransitionEditor::_edited() {
int filler = use_filler ? filler_clip->get_selected() - 1 : 0;
bool hold = hold_previous->is_pressed();
- EditorUndoRedoManager::get_singleton()->create_action("Edit Transitions");
+ EditorUndoRedoManager::get_singleton()->create_action(TTR("Edit Transitions"));
for (int i = 0; i < selected.size(); i++) {
if (!enabled) {
if (audio_stream_interactive->has_transition(selected[i].x, selected[i].y)) {
@@ -177,7 +173,6 @@ void AudioStreamInteractiveTransitionEditor::_update_transitions() {
};
for (int i = 0; i <= clip_count; i++) {
for (int j = 0; j <= clip_count; j++) {
- String txt;
int from = i == clip_count ? AudioStreamInteractive::CLIP_ANY : i;
int to = j == clip_count ? AudioStreamInteractive::CLIP_ANY : j;
@@ -187,32 +182,34 @@ void AudioStreamInteractiveTransitionEditor::_update_transitions() {
if (!exists) {
if (audio_stream_interactive->has_transition(AudioStreamInteractive::CLIP_ANY, to)) {
from = AudioStreamInteractive::CLIP_ANY;
- tooltip = "Using Any Clip -> " + audio_stream_interactive->get_clip_name(to) + ".";
+ tooltip = vformat(TTR("Using Any Clip -> %s."), audio_stream_interactive->get_clip_name(to));
} else if (audio_stream_interactive->has_transition(from, AudioStreamInteractive::CLIP_ANY)) {
to = AudioStreamInteractive::CLIP_ANY;
- tooltip = "Using " + audio_stream_interactive->get_clip_name(from) + " -> Any Clip.";
+ tooltip = vformat(TTR("Using %s -> Any Clip."), audio_stream_interactive->get_clip_name(from));
} else if (audio_stream_interactive->has_transition(AudioStreamInteractive::CLIP_ANY, AudioStreamInteractive::CLIP_ANY)) {
from = to = AudioStreamInteractive::CLIP_ANY;
- tooltip = "Using All CLips -> Any Clip.";
+ tooltip = TTR("Using All Clips -> Any Clip.");
} else {
- tooltip = "No transition available.";
+ tooltip = TTR("No transition available.");
}
}
+ String from_time;
+ String to_time;
if (audio_stream_interactive->has_transition(from, to)) {
icon = fade_icons[audio_stream_interactive->get_transition_fade_mode(from, to)];
switch (audio_stream_interactive->get_transition_from_time(from, to)) {
case AudioStreamInteractive::TRANSITION_FROM_TIME_IMMEDIATE: {
- txt += TTR("Immediate");
+ from_time = TTR("Immediate");
} break;
case AudioStreamInteractive::TRANSITION_FROM_TIME_NEXT_BEAT: {
- txt += TTR("Next Beat");
+ from_time = TTR("Next Beat");
} break;
case AudioStreamInteractive::TRANSITION_FROM_TIME_NEXT_BAR: {
- txt += TTR("Next Bar");
+ from_time = TTR("Next Bar");
} break;
case AudioStreamInteractive::TRANSITION_FROM_TIME_END: {
- txt += TTR("Clip End");
+ from_time = TTR("Clip End");
} break;
default: {
}
@@ -220,13 +217,13 @@ void AudioStreamInteractiveTransitionEditor::_update_transitions() {
switch (audio_stream_interactive->get_transition_to_time(from, to)) {
case AudioStreamInteractive::TRANSITION_TO_TIME_SAME_POSITION: {
- txt += TTR(L"⮕ Same");
+ to_time = TTR("Same", "Transition Time Position");
} break;
case AudioStreamInteractive::TRANSITION_TO_TIME_START: {
- txt += TTR(L"⮕ Start");
+ to_time = TTR("Start", "Transition Time Position");
} break;
case AudioStreamInteractive::TRANSITION_TO_TIME_PREVIOUS_POSITION: {
- txt += TTR(L"⮕ Prev");
+ to_time = TTR("Prev", "Transition Time Position");
} break;
default: {
}
@@ -234,7 +231,7 @@ void AudioStreamInteractiveTransitionEditor::_update_transitions() {
}
rows[j]->set_icon(i, icon);
- rows[j]->set_text(i, txt);
+ rows[j]->set_text(i, to_time.is_empty() ? from_time : vformat(U"%s ⮕ %s", from_time, to_time));
rows[j]->set_tooltip_text(i, tooltip);
if (exists) {
rows[j]->set_custom_color(i, font_color);
@@ -253,8 +250,8 @@ void AudioStreamInteractiveTransitionEditor::edit(Object *p_obj) {
return;
}
- Ref<Font> header_font = get_theme_font("bold", "EditorFonts");
- int header_font_size = get_theme_font_size("bold_size", "EditorFonts");
+ Ref<Font> header_font = get_theme_font("bold", EditorStringName(EditorFonts));
+ int header_font_size = get_theme_font_size("bold_size", EditorStringName(EditorFonts));
tree->clear();
rows.clear();
@@ -267,10 +264,10 @@ void AudioStreamInteractiveTransitionEditor::edit(Object *p_obj) {
TreeItem *header = tree->create_item(root); // Header
int header_index = clip_count + 1;
header->set_text(header_index, TTR("From / To"));
- header->set_editable(0, false);
+ header->set_selectable(header_index, false);
filler_clip->clear();
- filler_clip->add_item("Disabled", -1);
+ filler_clip->add_item(TTR("Disabled"), -1);
Color header_color = get_theme_color(SNAME("prop_subsection"), EditorStringName(Editor));
@@ -280,7 +277,6 @@ void AudioStreamInteractiveTransitionEditor::edit(Object *p_obj) {
for (int i = 0; i <= clip_count; i++) {
int cell_index = i;
int clip_i = i == clip_count ? AudioStreamInteractive::CLIP_ANY : i;
- header->set_editable(cell_index, false);
header->set_selectable(cell_index, false);
header->set_custom_font(cell_index, header_font);
header->set_custom_font_size(cell_index, header_font_size);
@@ -332,6 +328,7 @@ AudioStreamInteractiveTransitionEditor::AudioStreamInteractiveTransitionEditor()
split = memnew(HSplitContainer);
add_child(split);
tree = memnew(Tree);
+ tree->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
tree->set_hide_root(true);
tree->add_theme_constant_override("draw_guides", 1);
tree->set_select_mode(Tree::SELECT_MULTI);
@@ -343,9 +340,9 @@ AudioStreamInteractiveTransitionEditor::AudioStreamInteractiveTransitionEditor()
split->add_child(edit_vb);
transition_enabled = memnew(CheckBox);
- transition_enabled->set_text(TTR("Use Transition"));
- edit_vb->add_margin_child(TTR("Transition Enabled:"), transition_enabled);
- transition_enabled->connect("pressed", callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited));
+ transition_enabled->set_text(TTR("Enabled"));
+ edit_vb->add_margin_child(TTR("Use Transition:"), transition_enabled);
+ transition_enabled->connect(SceneStringName(pressed), callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited));
transition_from = memnew(OptionButton);
edit_vb->add_margin_child(TTR("Transition From:"), transition_from);
@@ -375,11 +372,12 @@ AudioStreamInteractiveTransitionEditor::AudioStreamInteractiveTransitionEditor()
filler_clip = memnew(OptionButton);
edit_vb->add_margin_child(TTR("Filler Clip:"), filler_clip);
+ filler_clip->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
filler_clip->connect("item_selected", callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited).unbind(1));
hold_previous = memnew(CheckBox);
hold_previous->set_text(TTR("Enabled"));
- hold_previous->connect("pressed", callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited));
+ hold_previous->connect(SceneStringName(pressed), callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited));
edit_vb->add_margin_child(TTR("Hold Previous:"), hold_previous);
set_exclusive(true);
@@ -399,7 +397,7 @@ void EditorInspectorPluginAudioStreamInteractive::parse_end(Object *p_object) {
if (Object::cast_to<AudioStreamInteractive>(p_object)) {
Button *button = EditorInspector::create_inspector_action_button(TTR("Edit Transitions"));
button->set_icon(audio_stream_interactive_transition_editor->get_editor_theme_icon(SNAME("Blend")));
- button->connect("pressed", callable_mp(this, &EditorInspectorPluginAudioStreamInteractive::_edit).bind(p_object));
+ button->connect(SceneStringName(pressed), callable_mp(this, &EditorInspectorPluginAudioStreamInteractive::_edit).bind(p_object));
add_custom_control(button);
}
}
diff --git a/modules/lightmapper_rd/lightmapper_rd.cpp b/modules/lightmapper_rd/lightmapper_rd.cpp
index 835fb3e59d..7ac7bd8088 100644
--- a/modules/lightmapper_rd/lightmapper_rd.cpp
+++ b/modules/lightmapper_rd/lightmapper_rd.cpp
@@ -226,7 +226,7 @@ void LightmapperRD::_sort_triangle_clusters(uint32_t p_cluster_size, uint32_t p_
}
}
-Lightmapper::BakeError LightmapperRD::_blit_meshes_into_atlas(int p_max_texture_size, Vector<Ref<Image>> &albedo_images, Vector<Ref<Image>> &emission_images, AABB &bounds, Size2i &atlas_size, int &atlas_slices, BakeStepFunc p_step_function, void *p_bake_userdata) {
+Lightmapper::BakeError LightmapperRD::_blit_meshes_into_atlas(int p_max_texture_size, int p_denoiser_range, Vector<Ref<Image>> &albedo_images, Vector<Ref<Image>> &emission_images, AABB &bounds, Size2i &atlas_size, int &atlas_slices, BakeStepFunc p_step_function, void *p_bake_userdata) {
Vector<Size2i> sizes;
for (int m_i = 0; m_i < mesh_instances.size(); m_i++) {
@@ -261,7 +261,7 @@ Lightmapper::BakeError LightmapperRD::_blit_meshes_into_atlas(int p_max_texture_
source_sizes.resize(sizes.size());
source_indices.resize(sizes.size());
for (int i = 0; i < source_indices.size(); i++) {
- source_sizes.write[i] = sizes[i] + Vector2i(2, 2); // Add padding between lightmaps
+ source_sizes.write[i] = sizes[i] + Vector2i(2, 2).maxi(p_denoiser_range); // Add padding between lightmaps
source_indices.write[i] = i;
}
Vector<Vector3i> atlas_offsets;
@@ -428,6 +428,7 @@ void LightmapperRD::_create_acceleration_structures(RenderingDevice *rd, Size2i
SWAP(edge.a, edge.b);
SWAP(edge.na, edge.nb);
SWAP(uv2.a, uv2.b);
+ SWAP(uv2.indices.x, uv2.indices.y);
SWAP(edge_indices.x, edge_indices.y);
}
@@ -906,7 +907,7 @@ LightmapperRD::BakeError LightmapperRD::_denoise_oidn(RenderingDevice *p_rd, RID
return BAKE_OK;
}
-LightmapperRD::BakeError LightmapperRD::_denoise(RenderingDevice *p_rd, Ref<RDShaderFile> &p_compute_shader, const RID &p_compute_base_uniform_set, PushConstant &p_push_constant, RID p_source_light_tex, RID p_source_normal_tex, RID p_dest_light_tex, float p_denoiser_strength, const Size2i &p_atlas_size, int p_atlas_slices, bool p_bake_sh, BakeStepFunc p_step_function) {
+LightmapperRD::BakeError LightmapperRD::_denoise(RenderingDevice *p_rd, Ref<RDShaderFile> &p_compute_shader, const RID &p_compute_base_uniform_set, PushConstant &p_push_constant, RID p_source_light_tex, RID p_source_normal_tex, RID p_dest_light_tex, float p_denoiser_strength, int p_denoiser_range, const Size2i &p_atlas_size, int p_atlas_slices, bool p_bake_sh, BakeStepFunc p_step_function) {
RID denoise_params_buffer = p_rd->uniform_buffer_create(sizeof(DenoiseParams));
DenoiseParams denoise_params;
denoise_params.spatial_bandwidth = 5.0f;
@@ -914,6 +915,7 @@ LightmapperRD::BakeError LightmapperRD::_denoise(RenderingDevice *p_rd, Ref<RDSh
denoise_params.albedo_bandwidth = 1.0f;
denoise_params.normal_bandwidth = 0.1f;
denoise_params.filter_strength = 10.0f;
+ denoise_params.half_search_window = p_denoiser_range;
p_rd->buffer_update(denoise_params_buffer, 0, sizeof(DenoiseParams), &denoise_params);
Vector<RD::Uniform> uniforms = dilate_or_denoise_common_uniforms(p_source_light_tex, p_dest_light_tex);
@@ -976,7 +978,7 @@ LightmapperRD::BakeError LightmapperRD::_denoise(RenderingDevice *p_rd, Ref<RDSh
return BAKE_OK;
}
-LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_denoiser, float p_denoiser_strength, int p_bounces, float p_bounce_indirect_energy, float p_bias, int p_max_texture_size, bool p_bake_sh, bool p_texture_for_bounces, GenerateProbes p_generate_probes, const Ref<Image> &p_environment_panorama, const Basis &p_environment_transform, BakeStepFunc p_step_function, void *p_bake_userdata, float p_exposure_normalization) {
+LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_denoiser, float p_denoiser_strength, int p_denoiser_range, int p_bounces, float p_bounce_indirect_energy, float p_bias, int p_max_texture_size, bool p_bake_sh, bool p_texture_for_bounces, GenerateProbes p_generate_probes, const Ref<Image> &p_environment_panorama, const Basis &p_environment_transform, BakeStepFunc p_step_function, void *p_bake_userdata, float p_exposure_normalization) {
int denoiser = GLOBAL_GET("rendering/lightmapping/denoising/denoiser");
String oidn_path = EDITOR_GET("filesystem/tools/oidn/oidn_denoise_path");
@@ -1008,7 +1010,7 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d
Vector<Ref<Image>> albedo_images;
Vector<Ref<Image>> emission_images;
- BakeError bake_error = _blit_meshes_into_atlas(p_max_texture_size, albedo_images, emission_images, bounds, atlas_size, atlas_slices, p_step_function, p_bake_userdata);
+ BakeError bake_error = _blit_meshes_into_atlas(p_max_texture_size, p_denoiser_range, albedo_images, emission_images, bounds, atlas_size, atlas_slices, p_step_function, p_bake_userdata);
if (bake_error != BAKE_OK) {
return bake_error;
}
@@ -1793,7 +1795,7 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d
} else {
// JNLM (built-in).
SWAP(light_accum_tex, light_accum_tex2);
- error = _denoise(rd, compute_shader, compute_base_uniform_set, push_constant, light_accum_tex2, normal_tex, light_accum_tex, p_denoiser_strength, atlas_size, atlas_slices, p_bake_sh, p_step_function);
+ error = _denoise(rd, compute_shader, compute_base_uniform_set, push_constant, light_accum_tex2, normal_tex, light_accum_tex, p_denoiser_strength, p_denoiser_range, atlas_size, atlas_slices, p_bake_sh, p_step_function);
}
if (unlikely(error != BAKE_OK)) {
return error;
diff --git a/modules/lightmapper_rd/lightmapper_rd.h b/modules/lightmapper_rd/lightmapper_rd.h
index 5414048ddc..487c44a480 100644
--- a/modules/lightmapper_rd/lightmapper_rd.h
+++ b/modules/lightmapper_rd/lightmapper_rd.h
@@ -262,16 +262,17 @@ class LightmapperRD : public Lightmapper {
float albedo_bandwidth;
float normal_bandwidth;
+ int half_search_window;
float filter_strength;
- float pad[3];
+ float pad[2];
};
- BakeError _blit_meshes_into_atlas(int p_max_texture_size, Vector<Ref<Image>> &albedo_images, Vector<Ref<Image>> &emission_images, AABB &bounds, Size2i &atlas_size, int &atlas_slices, BakeStepFunc p_step_function, void *p_bake_userdata);
+ BakeError _blit_meshes_into_atlas(int p_max_texture_size, int p_denoiser_range, Vector<Ref<Image>> &albedo_images, Vector<Ref<Image>> &emission_images, AABB &bounds, Size2i &atlas_size, int &atlas_slices, BakeStepFunc p_step_function, void *p_bake_userdata);
void _create_acceleration_structures(RenderingDevice *rd, Size2i atlas_size, int atlas_slices, AABB &bounds, int grid_size, uint32_t p_cluster_size, Vector<Probe> &probe_positions, GenerateProbes p_generate_probes, Vector<int> &slice_triangle_count, Vector<int> &slice_seam_count, RID &vertex_buffer, RID &triangle_buffer, RID &lights_buffer, RID &r_triangle_indices_buffer, RID &r_cluster_indices_buffer, RID &r_cluster_aabbs_buffer, RID &probe_positions_buffer, RID &grid_texture, RID &seams_buffer, BakeStepFunc p_step_function, void *p_bake_userdata);
void _raster_geometry(RenderingDevice *rd, Size2i atlas_size, int atlas_slices, int grid_size, AABB bounds, float p_bias, Vector<int> slice_triangle_count, RID position_tex, RID unocclude_tex, RID normal_tex, RID raster_depth_buffer, RID rasterize_shader, RID raster_base_uniform);
BakeError _dilate(RenderingDevice *rd, Ref<RDShaderFile> &compute_shader, RID &compute_base_uniform_set, PushConstant &push_constant, RID &source_light_tex, RID &dest_light_tex, const Size2i &atlas_size, int atlas_slices);
- BakeError _denoise(RenderingDevice *p_rd, Ref<RDShaderFile> &p_compute_shader, const RID &p_compute_base_uniform_set, PushConstant &p_push_constant, RID p_source_light_tex, RID p_source_normal_tex, RID p_dest_light_tex, float p_denoiser_strength, const Size2i &p_atlas_size, int p_atlas_slices, bool p_bake_sh, BakeStepFunc p_step_function);
+ BakeError _denoise(RenderingDevice *p_rd, Ref<RDShaderFile> &p_compute_shader, const RID &p_compute_base_uniform_set, PushConstant &p_push_constant, RID p_source_light_tex, RID p_source_normal_tex, RID p_dest_light_tex, float p_denoiser_strength, int p_denoiser_range, const Size2i &p_atlas_size, int p_atlas_slices, bool p_bake_sh, BakeStepFunc p_step_function);
Error _store_pfm(RenderingDevice *p_rd, RID p_atlas_tex, int p_index, const Size2i &p_atlas_size, const String &p_name);
Ref<Image> _read_pfm(const String &p_name);
@@ -283,7 +284,7 @@ public:
virtual void add_omni_light(bool p_static, const Vector3 &p_position, const Color &p_color, float p_energy, float p_indirect_energy, float p_range, float p_attenuation, float p_size, float p_shadow_blur) override;
virtual void add_spot_light(bool p_static, const Vector3 &p_position, const Vector3 p_direction, const Color &p_color, float p_energy, float p_indirect_energy, float p_range, float p_attenuation, float p_spot_angle, float p_spot_attenuation, float p_size, float p_shadow_blur) override;
virtual void add_probe(const Vector3 &p_position) override;
- virtual BakeError bake(BakeQuality p_quality, bool p_use_denoiser, float p_denoiser_strength, int p_bounces, float p_bounce_indirect_energy, float p_bias, int p_max_texture_size, bool p_bake_sh, bool p_texture_for_bounces, GenerateProbes p_generate_probes, const Ref<Image> &p_environment_panorama, const Basis &p_environment_transform, BakeStepFunc p_step_function = nullptr, void *p_bake_userdata = nullptr, float p_exposure_normalization = 1.0) override;
+ virtual BakeError bake(BakeQuality p_quality, bool p_use_denoiser, float p_denoiser_strength, int p_denoiser_range, int p_bounces, float p_bounce_indirect_energy, float p_bias, int p_max_texture_size, bool p_bake_sh, bool p_texture_for_bounces, GenerateProbes p_generate_probes, const Ref<Image> &p_environment_panorama, const Basis &p_environment_transform, BakeStepFunc p_step_function = nullptr, void *p_bake_userdata = nullptr, float p_exposure_normalization = 1.0) override;
int get_bake_texture_count() const override;
Ref<Image> get_bake_texture(int p_index) const override;
diff --git a/modules/lightmapper_rd/lm_compute.glsl b/modules/lightmapper_rd/lm_compute.glsl
index 1d088450e9..9424d5a4c1 100644
--- a/modules/lightmapper_rd/lm_compute.glsl
+++ b/modules/lightmapper_rd/lm_compute.glsl
@@ -76,6 +76,7 @@ layout(set = 1, binding = 3) uniform DenoiseParams {
float albedo_bandwidth;
float normal_bandwidth;
+ int half_search_window;
float filter_strength;
}
denoise_params;
@@ -849,10 +850,10 @@ void main() {
// Half the size of the patch window around each pixel that is weighted to compute the denoised pixel.
// A value of 1 represents a 3x3 window, a value of 2 a 5x5 window, etc.
- const int HALF_PATCH_WINDOW = 4;
+ const int HALF_PATCH_WINDOW = 3;
// Half the size of the search window around each pixel that is denoised and weighted to compute the denoised pixel.
- const int HALF_SEARCH_WINDOW = 10;
+ const int HALF_SEARCH_WINDOW = denoise_params.half_search_window;
// For all of the following sigma values, smaller values will give less weight to pixels that have a bigger distance
// in the feature being evaluated. Therefore, smaller values are likely to cause more noise to appear, but will also
diff --git a/modules/modules_builders.py b/modules/modules_builders.py
deleted file mode 100644
index 5db7c88a90..0000000000
--- a/modules/modules_builders.py
+++ /dev/null
@@ -1,15 +0,0 @@
-"""Functions used to generate source files during build time"""
-
-
-def generate_modules_enabled(target, source, env):
- with open(target[0].path, "w", encoding="utf-8", newline="\n") as f:
- for module in env.module_list:
- f.write("#define %s\n" % ("MODULE_" + module.upper() + "_ENABLED"))
-
-
-def generate_modules_tests(target, source, env):
- import os
-
- with open(target[0].path, "w", encoding="utf-8", newline="\n") as f:
- for header in source:
- f.write('#include "%s"\n' % (os.path.normpath(header.path)))
diff --git a/modules/mono/class_db_api_json.cpp b/modules/mono/class_db_api_json.cpp
index c4aba577db..04af60e22f 100644
--- a/modules/mono/class_db_api_json.cpp
+++ b/modules/mono/class_db_api_json.cpp
@@ -166,10 +166,10 @@ void class_db_api_to_json(const String &p_output_file, ClassDB::APIType p_api) {
Array arguments;
signal_dict["arguments"] = arguments;
- for (int i = 0; i < mi.arguments.size(); i++) {
+ for (const PropertyInfo &pi : mi.arguments) {
Dictionary argument_dict;
arguments.push_back(argument_dict);
- argument_dict["type"] = mi.arguments[i].type;
+ argument_dict["type"] = pi.type;
}
}
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp
index ff2ca9f0ce..36c8a40ed9 100644
--- a/modules/mono/csharp_script.cpp
+++ b/modules/mono/csharp_script.cpp
@@ -1596,14 +1596,7 @@ void CSharpInstance::get_method_list(List<MethodInfo> *p_list) const {
return;
}
- const CSharpScript *top = script.ptr();
- while (top != nullptr) {
- for (const CSharpScript::CSharpMethodInfo &E : top->methods) {
- p_list->push_back(E.method_info);
- }
-
- top = top->base_script.ptr();
- }
+ script->get_script_method_list(p_list);
}
bool CSharpInstance::has_method(const StringName &p_method) const {
@@ -1771,16 +1764,19 @@ void CSharpInstance::mono_object_disposed_baseref(GCHandleIntPtr p_gchandle_to_f
}
void CSharpInstance::connect_event_signals() {
- // The script signals list includes the signals declared in base scripts.
- for (CSharpScript::EventSignalInfo &signal : script->get_script_event_signals()) {
- String signal_name = signal.name;
+ const CSharpScript *top = script.ptr();
+ while (top != nullptr && top->valid) {
+ for (const CSharpScript::EventSignalInfo &signal : top->event_signals) {
+ String signal_name = signal.name;
- // TODO: Use pooling for ManagedCallable instances.
- EventSignalCallable *event_signal_callable = memnew(EventSignalCallable(owner, signal_name));
+ // TODO: Use pooling for ManagedCallable instances.
+ EventSignalCallable *event_signal_callable = memnew(EventSignalCallable(owner, signal_name));
- Callable callable(event_signal_callable);
- connected_event_signals.push_back(callable);
- owner->connect(signal_name, callable);
+ Callable callable(event_signal_callable);
+ connected_event_signals.push_back(callable);
+ owner->connect(signal_name, callable);
+ }
+ top = top->base_script.ptr();
}
}
@@ -2624,25 +2620,33 @@ bool CSharpScript::has_script_signal(const StringName &p_signal) const {
}
}
+ if (base_script.is_valid()) {
+ return base_script->has_script_signal(p_signal);
+ }
+
return false;
}
-void CSharpScript::get_script_signal_list(List<MethodInfo> *r_signals) const {
+void CSharpScript::_get_script_signal_list(List<MethodInfo> *r_signals, bool p_include_base) const {
if (!valid) {
return;
}
- for (const EventSignalInfo &signal : get_script_event_signals()) {
+ for (const EventSignalInfo &signal : event_signals) {
r_signals->push_back(signal.method_info);
}
-}
-Vector<CSharpScript::EventSignalInfo> CSharpScript::get_script_event_signals() const {
- if (!valid) {
- return Vector<EventSignalInfo>();
+ if (!p_include_base) {
+ return;
+ }
+
+ if (base_script.is_valid()) {
+ base_script->get_script_signal_list(r_signals);
}
+}
- return event_signals;
+void CSharpScript::get_script_signal_list(List<MethodInfo> *r_signals) const {
+ _get_script_signal_list(r_signals, true);
}
bool CSharpScript::inherits_script(const Ref<Script> &p_script) const {
diff --git a/modules/mono/csharp_script.h b/modules/mono/csharp_script.h
index 17df3988ee..c48e1a95c9 100644
--- a/modules/mono/csharp_script.h
+++ b/modules/mono/csharp_script.h
@@ -215,6 +215,8 @@ private:
// Do not use unless you know what you are doing
static void update_script_class_info(Ref<CSharpScript> p_script);
+ void _get_script_signal_list(List<MethodInfo> *r_signals, bool p_include_base) const;
+
protected:
static void _bind_methods();
@@ -251,8 +253,6 @@ public:
bool has_script_signal(const StringName &p_signal) const override;
void get_script_signal_list(List<MethodInfo> *r_signals) const override;
- Vector<EventSignalInfo> get_script_event_signals() const;
-
bool get_property_default_value(const StringName &p_property, Variant &r_value) const override;
void get_script_property_list(List<PropertyInfo> *r_list) const override;
void update_exports() override;
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Sdk/Sdk.props b/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Sdk/Sdk.props
index 5c3af17e77..c4034f1f9f 100644
--- a/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Sdk/Sdk.props
+++ b/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Sdk/Sdk.props
@@ -71,7 +71,7 @@
<GodotTargetPlatform Condition=" '$(GodotTargetPlatform)' == '' and $(RuntimeIdentifier.StartsWith('osx')) ">macos</GodotTargetPlatform>
<GodotTargetPlatform Condition=" '$(GodotTargetPlatform)' == '' and $(RuntimeIdentifier.StartsWith('win')) ">windows</GodotTargetPlatform>
</PropertyGroup>
-
+
<!-- Auto-detect the target Godot platform if it was not specified and there's no runtime identifier information. -->
<PropertyGroup Condition=" '$(GodotTargetPlatform)' == '' ">
<GodotTargetPlatform Condition=" '$([MSBuild]::IsOsPlatform(Linux))' ">linuxbsd</GodotTargetPlatform>
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Sdk/iOSNativeAOT.targets b/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Sdk/iOSNativeAOT.targets
index b51ce5cb8c..0391e9f829 100644
--- a/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Sdk/iOSNativeAOT.targets
+++ b/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Sdk/iOSNativeAOT.targets
@@ -11,10 +11,10 @@
<XCodePath Condition=" '$(XCodePath)' == '' ">/Applications/Xcode.app/Contents/Developer</XCodePath>
<XCodePath>$([MSBuild]::EnsureTrailingSlash('$(XCodePath)'))</XCodePath>
</PropertyGroup>
-
+
<Target Name="PrepareBeforeIlcCompile"
BeforeTargets="IlcCompile">
-
+
<Copy SourceFiles="%(ResolvedRuntimePack.PackageDirectory)/runtimes/$(RuntimeIdentifier)/native/icudt.dat" DestinationFolder="$(PublishDir)"/>
<!-- We need to find the path to Xcode so we can set manual linker args to the correct SDKs
@@ -29,9 +29,9 @@
<XCodePath>$(XcodeSelect)</XCodePath>
<XCodePath>$([MSBuild]::EnsureTrailingSlash('$(XCodePath)'))</XCodePath>
</PropertyGroup>
-
+
<Message Importance="normal" Text="Found XCode at $(XcodeSelect)" Condition=" '$(FindXCode)' == 'true' "/>
-
+
<ItemGroup>
<LinkerArg Include="-mios-simulator-version-min=12.0 -isysroot %22$(XCodePath)Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk%22"
Condition=" $(RuntimeIdentifier.Contains('simulator')) "/>
@@ -54,5 +54,5 @@
</ItemGroup>
<Copy SourceFiles="@(SymbolFiles)" DestinationFolder="$(PublishDir)$(TargetName).framework.dSYM"/>
</Target>
-
+
</Project>
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/AllReadOnly_ScriptProperties.generated.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/AllReadOnly_ScriptProperties.generated.cs
index 96ff0f75e9..825daffe80 100644
--- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/AllReadOnly_ScriptProperties.generated.cs
+++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/AllReadOnly_ScriptProperties.generated.cs
@@ -33,15 +33,15 @@ partial class AllReadOnly
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.ReadOnlyAutoProperty);
return true;
}
- else if (name == PropertyName.ReadOnlyProperty) {
+ if (name == PropertyName.ReadOnlyProperty) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.ReadOnlyProperty);
return true;
}
- else if (name == PropertyName.InitOnlyAutoProperty) {
+ if (name == PropertyName.InitOnlyAutoProperty) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.InitOnlyAutoProperty);
return true;
}
- else if (name == PropertyName.ReadOnlyField) {
+ if (name == PropertyName.ReadOnlyField) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.ReadOnlyField);
return true;
}
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/AllWriteOnly_ScriptProperties.generated.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/AllWriteOnly_ScriptProperties.generated.cs
index 91dd282b99..615450efe8 100644
--- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/AllWriteOnly_ScriptProperties.generated.cs
+++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/AllWriteOnly_ScriptProperties.generated.cs
@@ -25,7 +25,7 @@ partial class AllWriteOnly
this.WriteOnlyProperty = global::Godot.NativeInterop.VariantUtils.ConvertTo<bool>(value);
return true;
}
- else if (name == PropertyName._writeOnlyBackingField) {
+ if (name == PropertyName._writeOnlyBackingField) {
this._writeOnlyBackingField = global::Godot.NativeInterop.VariantUtils.ConvertTo<bool>(value);
return true;
}
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ClassPartialModifier.GD0001.fixed.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ClassPartialModifier.GD0001.fixed.cs
index 6ba6439d70..f5046bf34c 100644
--- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ClassPartialModifier.GD0001.fixed.cs
+++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ClassPartialModifier.GD0001.fixed.cs
@@ -2,5 +2,5 @@ using Godot;
public partial class ClassPartialModifier : Node
{
-
+
}
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ExportedFields_ScriptProperties.generated.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ExportedFields_ScriptProperties.generated.cs
index 334adc1243..67ec4fa883 100644
--- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ExportedFields_ScriptProperties.generated.cs
+++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ExportedFields_ScriptProperties.generated.cs
@@ -257,239 +257,239 @@ partial class ExportedFields
this._fieldBoolean = global::Godot.NativeInterop.VariantUtils.ConvertTo<bool>(value);
return true;
}
- else if (name == PropertyName._fieldChar) {
+ if (name == PropertyName._fieldChar) {
this._fieldChar = global::Godot.NativeInterop.VariantUtils.ConvertTo<char>(value);
return true;
}
- else if (name == PropertyName._fieldSByte) {
+ if (name == PropertyName._fieldSByte) {
this._fieldSByte = global::Godot.NativeInterop.VariantUtils.ConvertTo<sbyte>(value);
return true;
}
- else if (name == PropertyName._fieldInt16) {
+ if (name == PropertyName._fieldInt16) {
this._fieldInt16 = global::Godot.NativeInterop.VariantUtils.ConvertTo<short>(value);
return true;
}
- else if (name == PropertyName._fieldInt32) {
+ if (name == PropertyName._fieldInt32) {
this._fieldInt32 = global::Godot.NativeInterop.VariantUtils.ConvertTo<int>(value);
return true;
}
- else if (name == PropertyName._fieldInt64) {
+ if (name == PropertyName._fieldInt64) {
this._fieldInt64 = global::Godot.NativeInterop.VariantUtils.ConvertTo<long>(value);
return true;
}
- else if (name == PropertyName._fieldByte) {
+ if (name == PropertyName._fieldByte) {
this._fieldByte = global::Godot.NativeInterop.VariantUtils.ConvertTo<byte>(value);
return true;
}
- else if (name == PropertyName._fieldUInt16) {
+ if (name == PropertyName._fieldUInt16) {
this._fieldUInt16 = global::Godot.NativeInterop.VariantUtils.ConvertTo<ushort>(value);
return true;
}
- else if (name == PropertyName._fieldUInt32) {
+ if (name == PropertyName._fieldUInt32) {
this._fieldUInt32 = global::Godot.NativeInterop.VariantUtils.ConvertTo<uint>(value);
return true;
}
- else if (name == PropertyName._fieldUInt64) {
+ if (name == PropertyName._fieldUInt64) {
this._fieldUInt64 = global::Godot.NativeInterop.VariantUtils.ConvertTo<ulong>(value);
return true;
}
- else if (name == PropertyName._fieldSingle) {
+ if (name == PropertyName._fieldSingle) {
this._fieldSingle = global::Godot.NativeInterop.VariantUtils.ConvertTo<float>(value);
return true;
}
- else if (name == PropertyName._fieldDouble) {
+ if (name == PropertyName._fieldDouble) {
this._fieldDouble = global::Godot.NativeInterop.VariantUtils.ConvertTo<double>(value);
return true;
}
- else if (name == PropertyName._fieldString) {
+ if (name == PropertyName._fieldString) {
this._fieldString = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value);
return true;
}
- else if (name == PropertyName._fieldVector2) {
+ if (name == PropertyName._fieldVector2) {
this._fieldVector2 = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector2>(value);
return true;
}
- else if (name == PropertyName._fieldVector2I) {
+ if (name == PropertyName._fieldVector2I) {
this._fieldVector2I = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector2I>(value);
return true;
}
- else if (name == PropertyName._fieldRect2) {
+ if (name == PropertyName._fieldRect2) {
this._fieldRect2 = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Rect2>(value);
return true;
}
- else if (name == PropertyName._fieldRect2I) {
+ if (name == PropertyName._fieldRect2I) {
this._fieldRect2I = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Rect2I>(value);
return true;
}
- else if (name == PropertyName._fieldTransform2D) {
+ if (name == PropertyName._fieldTransform2D) {
this._fieldTransform2D = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Transform2D>(value);
return true;
}
- else if (name == PropertyName._fieldVector3) {
+ if (name == PropertyName._fieldVector3) {
this._fieldVector3 = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector3>(value);
return true;
}
- else if (name == PropertyName._fieldVector3I) {
+ if (name == PropertyName._fieldVector3I) {
this._fieldVector3I = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector3I>(value);
return true;
}
- else if (name == PropertyName._fieldBasis) {
+ if (name == PropertyName._fieldBasis) {
this._fieldBasis = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Basis>(value);
return true;
}
- else if (name == PropertyName._fieldQuaternion) {
+ if (name == PropertyName._fieldQuaternion) {
this._fieldQuaternion = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Quaternion>(value);
return true;
}
- else if (name == PropertyName._fieldTransform3D) {
+ if (name == PropertyName._fieldTransform3D) {
this._fieldTransform3D = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Transform3D>(value);
return true;
}
- else if (name == PropertyName._fieldVector4) {
+ if (name == PropertyName._fieldVector4) {
this._fieldVector4 = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector4>(value);
return true;
}
- else if (name == PropertyName._fieldVector4I) {
+ if (name == PropertyName._fieldVector4I) {
this._fieldVector4I = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector4I>(value);
return true;
}
- else if (name == PropertyName._fieldProjection) {
+ if (name == PropertyName._fieldProjection) {
this._fieldProjection = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Projection>(value);
return true;
}
- else if (name == PropertyName._fieldAabb) {
+ if (name == PropertyName._fieldAabb) {
this._fieldAabb = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Aabb>(value);
return true;
}
- else if (name == PropertyName._fieldColor) {
+ if (name == PropertyName._fieldColor) {
this._fieldColor = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Color>(value);
return true;
}
- else if (name == PropertyName._fieldPlane) {
+ if (name == PropertyName._fieldPlane) {
this._fieldPlane = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Plane>(value);
return true;
}
- else if (name == PropertyName._fieldCallable) {
+ if (name == PropertyName._fieldCallable) {
this._fieldCallable = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Callable>(value);
return true;
}
- else if (name == PropertyName._fieldSignal) {
+ if (name == PropertyName._fieldSignal) {
this._fieldSignal = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Signal>(value);
return true;
}
- else if (name == PropertyName._fieldEnum) {
+ if (name == PropertyName._fieldEnum) {
this._fieldEnum = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::ExportedFields.MyEnum>(value);
return true;
}
- else if (name == PropertyName._fieldFlagsEnum) {
+ if (name == PropertyName._fieldFlagsEnum) {
this._fieldFlagsEnum = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::ExportedFields.MyFlagsEnum>(value);
return true;
}
- else if (name == PropertyName._fieldByteArray) {
+ if (name == PropertyName._fieldByteArray) {
this._fieldByteArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<byte[]>(value);
return true;
}
- else if (name == PropertyName._fieldInt32Array) {
+ if (name == PropertyName._fieldInt32Array) {
this._fieldInt32Array = global::Godot.NativeInterop.VariantUtils.ConvertTo<int[]>(value);
return true;
}
- else if (name == PropertyName._fieldInt64Array) {
+ if (name == PropertyName._fieldInt64Array) {
this._fieldInt64Array = global::Godot.NativeInterop.VariantUtils.ConvertTo<long[]>(value);
return true;
}
- else if (name == PropertyName._fieldSingleArray) {
+ if (name == PropertyName._fieldSingleArray) {
this._fieldSingleArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<float[]>(value);
return true;
}
- else if (name == PropertyName._fieldDoubleArray) {
+ if (name == PropertyName._fieldDoubleArray) {
this._fieldDoubleArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<double[]>(value);
return true;
}
- else if (name == PropertyName._fieldStringArray) {
+ if (name == PropertyName._fieldStringArray) {
this._fieldStringArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<string[]>(value);
return true;
}
- else if (name == PropertyName._fieldStringArrayEnum) {
+ if (name == PropertyName._fieldStringArrayEnum) {
this._fieldStringArrayEnum = global::Godot.NativeInterop.VariantUtils.ConvertTo<string[]>(value);
return true;
}
- else if (name == PropertyName._fieldVector2Array) {
+ if (name == PropertyName._fieldVector2Array) {
this._fieldVector2Array = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector2[]>(value);
return true;
}
- else if (name == PropertyName._fieldVector3Array) {
+ if (name == PropertyName._fieldVector3Array) {
this._fieldVector3Array = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector3[]>(value);
return true;
}
- else if (name == PropertyName._fieldColorArray) {
+ if (name == PropertyName._fieldColorArray) {
this._fieldColorArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Color[]>(value);
return true;
}
- else if (name == PropertyName._fieldGodotObjectOrDerivedArray) {
+ if (name == PropertyName._fieldGodotObjectOrDerivedArray) {
this._fieldGodotObjectOrDerivedArray = global::Godot.NativeInterop.VariantUtils.ConvertToSystemArrayOfGodotObject<global::Godot.GodotObject>(value);
return true;
}
- else if (name == PropertyName._fieldStringNameArray) {
+ if (name == PropertyName._fieldStringNameArray) {
this._fieldStringNameArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.StringName[]>(value);
return true;
}
- else if (name == PropertyName._fieldNodePathArray) {
+ if (name == PropertyName._fieldNodePathArray) {
this._fieldNodePathArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.NodePath[]>(value);
return true;
}
- else if (name == PropertyName._fieldRidArray) {
+ if (name == PropertyName._fieldRidArray) {
this._fieldRidArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Rid[]>(value);
return true;
}
- else if (name == PropertyName._fieldEmptyInt32Array) {
+ if (name == PropertyName._fieldEmptyInt32Array) {
this._fieldEmptyInt32Array = global::Godot.NativeInterop.VariantUtils.ConvertTo<int[]>(value);
return true;
}
- else if (name == PropertyName._fieldArrayFromList) {
+ if (name == PropertyName._fieldArrayFromList) {
this._fieldArrayFromList = global::Godot.NativeInterop.VariantUtils.ConvertTo<int[]>(value);
return true;
}
- else if (name == PropertyName._fieldVariant) {
+ if (name == PropertyName._fieldVariant) {
this._fieldVariant = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Variant>(value);
return true;
}
- else if (name == PropertyName._fieldGodotObjectOrDerived) {
+ if (name == PropertyName._fieldGodotObjectOrDerived) {
this._fieldGodotObjectOrDerived = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.GodotObject>(value);
return true;
}
- else if (name == PropertyName._fieldGodotResourceTexture) {
+ if (name == PropertyName._fieldGodotResourceTexture) {
this._fieldGodotResourceTexture = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Texture>(value);
return true;
}
- else if (name == PropertyName._fieldStringName) {
+ if (name == PropertyName._fieldStringName) {
this._fieldStringName = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.StringName>(value);
return true;
}
- else if (name == PropertyName._fieldNodePath) {
+ if (name == PropertyName._fieldNodePath) {
this._fieldNodePath = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.NodePath>(value);
return true;
}
- else if (name == PropertyName._fieldRid) {
+ if (name == PropertyName._fieldRid) {
this._fieldRid = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Rid>(value);
return true;
}
- else if (name == PropertyName._fieldGodotDictionary) {
+ if (name == PropertyName._fieldGodotDictionary) {
this._fieldGodotDictionary = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Collections.Dictionary>(value);
return true;
}
- else if (name == PropertyName._fieldGodotArray) {
+ if (name == PropertyName._fieldGodotArray) {
this._fieldGodotArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Collections.Array>(value);
return true;
}
- else if (name == PropertyName._fieldGodotGenericDictionary) {
+ if (name == PropertyName._fieldGodotGenericDictionary) {
this._fieldGodotGenericDictionary = global::Godot.NativeInterop.VariantUtils.ConvertToDictionary<string, bool>(value);
return true;
}
- else if (name == PropertyName._fieldGodotGenericArray) {
+ if (name == PropertyName._fieldGodotGenericArray) {
this._fieldGodotGenericArray = global::Godot.NativeInterop.VariantUtils.ConvertToArray<int>(value);
return true;
}
- else if (name == PropertyName._fieldEmptyInt64Array) {
+ if (name == PropertyName._fieldEmptyInt64Array) {
this._fieldEmptyInt64Array = global::Godot.NativeInterop.VariantUtils.ConvertTo<long[]>(value);
return true;
}
@@ -503,239 +503,239 @@ partial class ExportedFields
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<bool>(this._fieldBoolean);
return true;
}
- else if (name == PropertyName._fieldChar) {
+ if (name == PropertyName._fieldChar) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<char>(this._fieldChar);
return true;
}
- else if (name == PropertyName._fieldSByte) {
+ if (name == PropertyName._fieldSByte) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<sbyte>(this._fieldSByte);
return true;
}
- else if (name == PropertyName._fieldInt16) {
+ if (name == PropertyName._fieldInt16) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<short>(this._fieldInt16);
return true;
}
- else if (name == PropertyName._fieldInt32) {
+ if (name == PropertyName._fieldInt32) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<int>(this._fieldInt32);
return true;
}
- else if (name == PropertyName._fieldInt64) {
+ if (name == PropertyName._fieldInt64) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<long>(this._fieldInt64);
return true;
}
- else if (name == PropertyName._fieldByte) {
+ if (name == PropertyName._fieldByte) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<byte>(this._fieldByte);
return true;
}
- else if (name == PropertyName._fieldUInt16) {
+ if (name == PropertyName._fieldUInt16) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<ushort>(this._fieldUInt16);
return true;
}
- else if (name == PropertyName._fieldUInt32) {
+ if (name == PropertyName._fieldUInt32) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<uint>(this._fieldUInt32);
return true;
}
- else if (name == PropertyName._fieldUInt64) {
+ if (name == PropertyName._fieldUInt64) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<ulong>(this._fieldUInt64);
return true;
}
- else if (name == PropertyName._fieldSingle) {
+ if (name == PropertyName._fieldSingle) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<float>(this._fieldSingle);
return true;
}
- else if (name == PropertyName._fieldDouble) {
+ if (name == PropertyName._fieldDouble) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<double>(this._fieldDouble);
return true;
}
- else if (name == PropertyName._fieldString) {
+ if (name == PropertyName._fieldString) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this._fieldString);
return true;
}
- else if (name == PropertyName._fieldVector2) {
+ if (name == PropertyName._fieldVector2) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector2>(this._fieldVector2);
return true;
}
- else if (name == PropertyName._fieldVector2I) {
+ if (name == PropertyName._fieldVector2I) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector2I>(this._fieldVector2I);
return true;
}
- else if (name == PropertyName._fieldRect2) {
+ if (name == PropertyName._fieldRect2) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Rect2>(this._fieldRect2);
return true;
}
- else if (name == PropertyName._fieldRect2I) {
+ if (name == PropertyName._fieldRect2I) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Rect2I>(this._fieldRect2I);
return true;
}
- else if (name == PropertyName._fieldTransform2D) {
+ if (name == PropertyName._fieldTransform2D) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Transform2D>(this._fieldTransform2D);
return true;
}
- else if (name == PropertyName._fieldVector3) {
+ if (name == PropertyName._fieldVector3) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector3>(this._fieldVector3);
return true;
}
- else if (name == PropertyName._fieldVector3I) {
+ if (name == PropertyName._fieldVector3I) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector3I>(this._fieldVector3I);
return true;
}
- else if (name == PropertyName._fieldBasis) {
+ if (name == PropertyName._fieldBasis) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Basis>(this._fieldBasis);
return true;
}
- else if (name == PropertyName._fieldQuaternion) {
+ if (name == PropertyName._fieldQuaternion) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Quaternion>(this._fieldQuaternion);
return true;
}
- else if (name == PropertyName._fieldTransform3D) {
+ if (name == PropertyName._fieldTransform3D) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Transform3D>(this._fieldTransform3D);
return true;
}
- else if (name == PropertyName._fieldVector4) {
+ if (name == PropertyName._fieldVector4) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector4>(this._fieldVector4);
return true;
}
- else if (name == PropertyName._fieldVector4I) {
+ if (name == PropertyName._fieldVector4I) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector4I>(this._fieldVector4I);
return true;
}
- else if (name == PropertyName._fieldProjection) {
+ if (name == PropertyName._fieldProjection) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Projection>(this._fieldProjection);
return true;
}
- else if (name == PropertyName._fieldAabb) {
+ if (name == PropertyName._fieldAabb) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Aabb>(this._fieldAabb);
return true;
}
- else if (name == PropertyName._fieldColor) {
+ if (name == PropertyName._fieldColor) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Color>(this._fieldColor);
return true;
}
- else if (name == PropertyName._fieldPlane) {
+ if (name == PropertyName._fieldPlane) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Plane>(this._fieldPlane);
return true;
}
- else if (name == PropertyName._fieldCallable) {
+ if (name == PropertyName._fieldCallable) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Callable>(this._fieldCallable);
return true;
}
- else if (name == PropertyName._fieldSignal) {
+ if (name == PropertyName._fieldSignal) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Signal>(this._fieldSignal);
return true;
}
- else if (name == PropertyName._fieldEnum) {
+ if (name == PropertyName._fieldEnum) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::ExportedFields.MyEnum>(this._fieldEnum);
return true;
}
- else if (name == PropertyName._fieldFlagsEnum) {
+ if (name == PropertyName._fieldFlagsEnum) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::ExportedFields.MyFlagsEnum>(this._fieldFlagsEnum);
return true;
}
- else if (name == PropertyName._fieldByteArray) {
+ if (name == PropertyName._fieldByteArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<byte[]>(this._fieldByteArray);
return true;
}
- else if (name == PropertyName._fieldInt32Array) {
+ if (name == PropertyName._fieldInt32Array) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<int[]>(this._fieldInt32Array);
return true;
}
- else if (name == PropertyName._fieldInt64Array) {
+ if (name == PropertyName._fieldInt64Array) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<long[]>(this._fieldInt64Array);
return true;
}
- else if (name == PropertyName._fieldSingleArray) {
+ if (name == PropertyName._fieldSingleArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<float[]>(this._fieldSingleArray);
return true;
}
- else if (name == PropertyName._fieldDoubleArray) {
+ if (name == PropertyName._fieldDoubleArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<double[]>(this._fieldDoubleArray);
return true;
}
- else if (name == PropertyName._fieldStringArray) {
+ if (name == PropertyName._fieldStringArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string[]>(this._fieldStringArray);
return true;
}
- else if (name == PropertyName._fieldStringArrayEnum) {
+ if (name == PropertyName._fieldStringArrayEnum) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string[]>(this._fieldStringArrayEnum);
return true;
}
- else if (name == PropertyName._fieldVector2Array) {
+ if (name == PropertyName._fieldVector2Array) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector2[]>(this._fieldVector2Array);
return true;
}
- else if (name == PropertyName._fieldVector3Array) {
+ if (name == PropertyName._fieldVector3Array) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector3[]>(this._fieldVector3Array);
return true;
}
- else if (name == PropertyName._fieldColorArray) {
+ if (name == PropertyName._fieldColorArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Color[]>(this._fieldColorArray);
return true;
}
- else if (name == PropertyName._fieldGodotObjectOrDerivedArray) {
+ if (name == PropertyName._fieldGodotObjectOrDerivedArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFromSystemArrayOfGodotObject(this._fieldGodotObjectOrDerivedArray);
return true;
}
- else if (name == PropertyName._fieldStringNameArray) {
+ if (name == PropertyName._fieldStringNameArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.StringName[]>(this._fieldStringNameArray);
return true;
}
- else if (name == PropertyName._fieldNodePathArray) {
+ if (name == PropertyName._fieldNodePathArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.NodePath[]>(this._fieldNodePathArray);
return true;
}
- else if (name == PropertyName._fieldRidArray) {
+ if (name == PropertyName._fieldRidArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Rid[]>(this._fieldRidArray);
return true;
}
- else if (name == PropertyName._fieldEmptyInt32Array) {
+ if (name == PropertyName._fieldEmptyInt32Array) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<int[]>(this._fieldEmptyInt32Array);
return true;
}
- else if (name == PropertyName._fieldArrayFromList) {
+ if (name == PropertyName._fieldArrayFromList) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<int[]>(this._fieldArrayFromList);
return true;
}
- else if (name == PropertyName._fieldVariant) {
+ if (name == PropertyName._fieldVariant) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Variant>(this._fieldVariant);
return true;
}
- else if (name == PropertyName._fieldGodotObjectOrDerived) {
+ if (name == PropertyName._fieldGodotObjectOrDerived) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.GodotObject>(this._fieldGodotObjectOrDerived);
return true;
}
- else if (name == PropertyName._fieldGodotResourceTexture) {
+ if (name == PropertyName._fieldGodotResourceTexture) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Texture>(this._fieldGodotResourceTexture);
return true;
}
- else if (name == PropertyName._fieldStringName) {
+ if (name == PropertyName._fieldStringName) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.StringName>(this._fieldStringName);
return true;
}
- else if (name == PropertyName._fieldNodePath) {
+ if (name == PropertyName._fieldNodePath) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.NodePath>(this._fieldNodePath);
return true;
}
- else if (name == PropertyName._fieldRid) {
+ if (name == PropertyName._fieldRid) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Rid>(this._fieldRid);
return true;
}
- else if (name == PropertyName._fieldGodotDictionary) {
+ if (name == PropertyName._fieldGodotDictionary) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Collections.Dictionary>(this._fieldGodotDictionary);
return true;
}
- else if (name == PropertyName._fieldGodotArray) {
+ if (name == PropertyName._fieldGodotArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Collections.Array>(this._fieldGodotArray);
return true;
}
- else if (name == PropertyName._fieldGodotGenericDictionary) {
+ if (name == PropertyName._fieldGodotGenericDictionary) {
value = global::Godot.NativeInterop.VariantUtils.CreateFromDictionary(this._fieldGodotGenericDictionary);
return true;
}
- else if (name == PropertyName._fieldGodotGenericArray) {
+ if (name == PropertyName._fieldGodotGenericArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFromArray(this._fieldGodotGenericArray);
return true;
}
- else if (name == PropertyName._fieldEmptyInt64Array) {
+ if (name == PropertyName._fieldEmptyInt64Array) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<long[]>(this._fieldEmptyInt64Array);
return true;
}
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ExportedProperties_ScriptProperties.generated.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ExportedProperties_ScriptProperties.generated.cs
index 6e0e9fffbe..aa876d8d7d 100644
--- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ExportedProperties_ScriptProperties.generated.cs
+++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ExportedProperties_ScriptProperties.generated.cs
@@ -293,275 +293,275 @@ partial class ExportedProperties
this.NotGenerateComplexLamdaProperty = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value);
return true;
}
- else if (name == PropertyName.NotGenerateLamdaNoFieldProperty) {
+ if (name == PropertyName.NotGenerateLamdaNoFieldProperty) {
this.NotGenerateLamdaNoFieldProperty = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value);
return true;
}
- else if (name == PropertyName.NotGenerateComplexReturnProperty) {
+ if (name == PropertyName.NotGenerateComplexReturnProperty) {
this.NotGenerateComplexReturnProperty = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value);
return true;
}
- else if (name == PropertyName.NotGenerateReturnsProperty) {
+ if (name == PropertyName.NotGenerateReturnsProperty) {
this.NotGenerateReturnsProperty = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value);
return true;
}
- else if (name == PropertyName.FullPropertyString) {
+ if (name == PropertyName.FullPropertyString) {
this.FullPropertyString = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value);
return true;
}
- else if (name == PropertyName.FullPropertyString_Complex) {
+ if (name == PropertyName.FullPropertyString_Complex) {
this.FullPropertyString_Complex = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value);
return true;
}
- else if (name == PropertyName.LamdaPropertyString) {
+ if (name == PropertyName.LamdaPropertyString) {
this.LamdaPropertyString = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value);
return true;
}
- else if (name == PropertyName.PropertyBoolean) {
+ if (name == PropertyName.PropertyBoolean) {
this.PropertyBoolean = global::Godot.NativeInterop.VariantUtils.ConvertTo<bool>(value);
return true;
}
- else if (name == PropertyName.PropertyChar) {
+ if (name == PropertyName.PropertyChar) {
this.PropertyChar = global::Godot.NativeInterop.VariantUtils.ConvertTo<char>(value);
return true;
}
- else if (name == PropertyName.PropertySByte) {
+ if (name == PropertyName.PropertySByte) {
this.PropertySByte = global::Godot.NativeInterop.VariantUtils.ConvertTo<sbyte>(value);
return true;
}
- else if (name == PropertyName.PropertyInt16) {
+ if (name == PropertyName.PropertyInt16) {
this.PropertyInt16 = global::Godot.NativeInterop.VariantUtils.ConvertTo<short>(value);
return true;
}
- else if (name == PropertyName.PropertyInt32) {
+ if (name == PropertyName.PropertyInt32) {
this.PropertyInt32 = global::Godot.NativeInterop.VariantUtils.ConvertTo<int>(value);
return true;
}
- else if (name == PropertyName.PropertyInt64) {
+ if (name == PropertyName.PropertyInt64) {
this.PropertyInt64 = global::Godot.NativeInterop.VariantUtils.ConvertTo<long>(value);
return true;
}
- else if (name == PropertyName.PropertyByte) {
+ if (name == PropertyName.PropertyByte) {
this.PropertyByte = global::Godot.NativeInterop.VariantUtils.ConvertTo<byte>(value);
return true;
}
- else if (name == PropertyName.PropertyUInt16) {
+ if (name == PropertyName.PropertyUInt16) {
this.PropertyUInt16 = global::Godot.NativeInterop.VariantUtils.ConvertTo<ushort>(value);
return true;
}
- else if (name == PropertyName.PropertyUInt32) {
+ if (name == PropertyName.PropertyUInt32) {
this.PropertyUInt32 = global::Godot.NativeInterop.VariantUtils.ConvertTo<uint>(value);
return true;
}
- else if (name == PropertyName.PropertyUInt64) {
+ if (name == PropertyName.PropertyUInt64) {
this.PropertyUInt64 = global::Godot.NativeInterop.VariantUtils.ConvertTo<ulong>(value);
return true;
}
- else if (name == PropertyName.PropertySingle) {
+ if (name == PropertyName.PropertySingle) {
this.PropertySingle = global::Godot.NativeInterop.VariantUtils.ConvertTo<float>(value);
return true;
}
- else if (name == PropertyName.PropertyDouble) {
+ if (name == PropertyName.PropertyDouble) {
this.PropertyDouble = global::Godot.NativeInterop.VariantUtils.ConvertTo<double>(value);
return true;
}
- else if (name == PropertyName.PropertyString) {
+ if (name == PropertyName.PropertyString) {
this.PropertyString = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value);
return true;
}
- else if (name == PropertyName.PropertyVector2) {
+ if (name == PropertyName.PropertyVector2) {
this.PropertyVector2 = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector2>(value);
return true;
}
- else if (name == PropertyName.PropertyVector2I) {
+ if (name == PropertyName.PropertyVector2I) {
this.PropertyVector2I = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector2I>(value);
return true;
}
- else if (name == PropertyName.PropertyRect2) {
+ if (name == PropertyName.PropertyRect2) {
this.PropertyRect2 = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Rect2>(value);
return true;
}
- else if (name == PropertyName.PropertyRect2I) {
+ if (name == PropertyName.PropertyRect2I) {
this.PropertyRect2I = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Rect2I>(value);
return true;
}
- else if (name == PropertyName.PropertyTransform2D) {
+ if (name == PropertyName.PropertyTransform2D) {
this.PropertyTransform2D = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Transform2D>(value);
return true;
}
- else if (name == PropertyName.PropertyVector3) {
+ if (name == PropertyName.PropertyVector3) {
this.PropertyVector3 = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector3>(value);
return true;
}
- else if (name == PropertyName.PropertyVector3I) {
+ if (name == PropertyName.PropertyVector3I) {
this.PropertyVector3I = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector3I>(value);
return true;
}
- else if (name == PropertyName.PropertyBasis) {
+ if (name == PropertyName.PropertyBasis) {
this.PropertyBasis = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Basis>(value);
return true;
}
- else if (name == PropertyName.PropertyQuaternion) {
+ if (name == PropertyName.PropertyQuaternion) {
this.PropertyQuaternion = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Quaternion>(value);
return true;
}
- else if (name == PropertyName.PropertyTransform3D) {
+ if (name == PropertyName.PropertyTransform3D) {
this.PropertyTransform3D = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Transform3D>(value);
return true;
}
- else if (name == PropertyName.PropertyVector4) {
+ if (name == PropertyName.PropertyVector4) {
this.PropertyVector4 = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector4>(value);
return true;
}
- else if (name == PropertyName.PropertyVector4I) {
+ if (name == PropertyName.PropertyVector4I) {
this.PropertyVector4I = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector4I>(value);
return true;
}
- else if (name == PropertyName.PropertyProjection) {
+ if (name == PropertyName.PropertyProjection) {
this.PropertyProjection = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Projection>(value);
return true;
}
- else if (name == PropertyName.PropertyAabb) {
+ if (name == PropertyName.PropertyAabb) {
this.PropertyAabb = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Aabb>(value);
return true;
}
- else if (name == PropertyName.PropertyColor) {
+ if (name == PropertyName.PropertyColor) {
this.PropertyColor = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Color>(value);
return true;
}
- else if (name == PropertyName.PropertyPlane) {
+ if (name == PropertyName.PropertyPlane) {
this.PropertyPlane = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Plane>(value);
return true;
}
- else if (name == PropertyName.PropertyCallable) {
+ if (name == PropertyName.PropertyCallable) {
this.PropertyCallable = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Callable>(value);
return true;
}
- else if (name == PropertyName.PropertySignal) {
+ if (name == PropertyName.PropertySignal) {
this.PropertySignal = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Signal>(value);
return true;
}
- else if (name == PropertyName.PropertyEnum) {
+ if (name == PropertyName.PropertyEnum) {
this.PropertyEnum = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::ExportedProperties.MyEnum>(value);
return true;
}
- else if (name == PropertyName.PropertyFlagsEnum) {
+ if (name == PropertyName.PropertyFlagsEnum) {
this.PropertyFlagsEnum = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::ExportedProperties.MyFlagsEnum>(value);
return true;
}
- else if (name == PropertyName.PropertyByteArray) {
+ if (name == PropertyName.PropertyByteArray) {
this.PropertyByteArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<byte[]>(value);
return true;
}
- else if (name == PropertyName.PropertyInt32Array) {
+ if (name == PropertyName.PropertyInt32Array) {
this.PropertyInt32Array = global::Godot.NativeInterop.VariantUtils.ConvertTo<int[]>(value);
return true;
}
- else if (name == PropertyName.PropertyInt64Array) {
+ if (name == PropertyName.PropertyInt64Array) {
this.PropertyInt64Array = global::Godot.NativeInterop.VariantUtils.ConvertTo<long[]>(value);
return true;
}
- else if (name == PropertyName.PropertySingleArray) {
+ if (name == PropertyName.PropertySingleArray) {
this.PropertySingleArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<float[]>(value);
return true;
}
- else if (name == PropertyName.PropertyDoubleArray) {
+ if (name == PropertyName.PropertyDoubleArray) {
this.PropertyDoubleArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<double[]>(value);
return true;
}
- else if (name == PropertyName.PropertyStringArray) {
+ if (name == PropertyName.PropertyStringArray) {
this.PropertyStringArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<string[]>(value);
return true;
}
- else if (name == PropertyName.PropertyStringArrayEnum) {
+ if (name == PropertyName.PropertyStringArrayEnum) {
this.PropertyStringArrayEnum = global::Godot.NativeInterop.VariantUtils.ConvertTo<string[]>(value);
return true;
}
- else if (name == PropertyName.PropertyVector2Array) {
+ if (name == PropertyName.PropertyVector2Array) {
this.PropertyVector2Array = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector2[]>(value);
return true;
}
- else if (name == PropertyName.PropertyVector3Array) {
+ if (name == PropertyName.PropertyVector3Array) {
this.PropertyVector3Array = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector3[]>(value);
return true;
}
- else if (name == PropertyName.PropertyColorArray) {
+ if (name == PropertyName.PropertyColorArray) {
this.PropertyColorArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Color[]>(value);
return true;
}
- else if (name == PropertyName.PropertyGodotObjectOrDerivedArray) {
+ if (name == PropertyName.PropertyGodotObjectOrDerivedArray) {
this.PropertyGodotObjectOrDerivedArray = global::Godot.NativeInterop.VariantUtils.ConvertToSystemArrayOfGodotObject<global::Godot.GodotObject>(value);
return true;
}
- else if (name == PropertyName.field_StringNameArray) {
+ if (name == PropertyName.field_StringNameArray) {
this.field_StringNameArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.StringName[]>(value);
return true;
}
- else if (name == PropertyName.field_NodePathArray) {
+ if (name == PropertyName.field_NodePathArray) {
this.field_NodePathArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.NodePath[]>(value);
return true;
}
- else if (name == PropertyName.field_RidArray) {
+ if (name == PropertyName.field_RidArray) {
this.field_RidArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Rid[]>(value);
return true;
}
- else if (name == PropertyName.PropertyVariant) {
+ if (name == PropertyName.PropertyVariant) {
this.PropertyVariant = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Variant>(value);
return true;
}
- else if (name == PropertyName.PropertyGodotObjectOrDerived) {
+ if (name == PropertyName.PropertyGodotObjectOrDerived) {
this.PropertyGodotObjectOrDerived = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.GodotObject>(value);
return true;
}
- else if (name == PropertyName.PropertyGodotResourceTexture) {
+ if (name == PropertyName.PropertyGodotResourceTexture) {
this.PropertyGodotResourceTexture = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Texture>(value);
return true;
}
- else if (name == PropertyName.PropertyStringName) {
+ if (name == PropertyName.PropertyStringName) {
this.PropertyStringName = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.StringName>(value);
return true;
}
- else if (name == PropertyName.PropertyNodePath) {
+ if (name == PropertyName.PropertyNodePath) {
this.PropertyNodePath = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.NodePath>(value);
return true;
}
- else if (name == PropertyName.PropertyRid) {
+ if (name == PropertyName.PropertyRid) {
this.PropertyRid = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Rid>(value);
return true;
}
- else if (name == PropertyName.PropertyGodotDictionary) {
+ if (name == PropertyName.PropertyGodotDictionary) {
this.PropertyGodotDictionary = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Collections.Dictionary>(value);
return true;
}
- else if (name == PropertyName.PropertyGodotArray) {
+ if (name == PropertyName.PropertyGodotArray) {
this.PropertyGodotArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Collections.Array>(value);
return true;
}
- else if (name == PropertyName.PropertyGodotGenericDictionary) {
+ if (name == PropertyName.PropertyGodotGenericDictionary) {
this.PropertyGodotGenericDictionary = global::Godot.NativeInterop.VariantUtils.ConvertToDictionary<string, bool>(value);
return true;
}
- else if (name == PropertyName.PropertyGodotGenericArray) {
+ if (name == PropertyName.PropertyGodotGenericArray) {
this.PropertyGodotGenericArray = global::Godot.NativeInterop.VariantUtils.ConvertToArray<int>(value);
return true;
}
- else if (name == PropertyName._notGeneratePropertyString) {
+ if (name == PropertyName._notGeneratePropertyString) {
this._notGeneratePropertyString = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value);
return true;
}
- else if (name == PropertyName._notGeneratePropertyInt) {
+ if (name == PropertyName._notGeneratePropertyInt) {
this._notGeneratePropertyInt = global::Godot.NativeInterop.VariantUtils.ConvertTo<int>(value);
return true;
}
- else if (name == PropertyName._fullPropertyString) {
+ if (name == PropertyName._fullPropertyString) {
this._fullPropertyString = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value);
return true;
}
- else if (name == PropertyName._fullPropertyStringComplex) {
+ if (name == PropertyName._fullPropertyStringComplex) {
this._fullPropertyStringComplex = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value);
return true;
}
- else if (name == PropertyName._lamdaPropertyString) {
+ if (name == PropertyName._lamdaPropertyString) {
this._lamdaPropertyString = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value);
return true;
}
@@ -575,275 +575,275 @@ partial class ExportedProperties
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.NotGenerateComplexLamdaProperty);
return true;
}
- else if (name == PropertyName.NotGenerateLamdaNoFieldProperty) {
+ if (name == PropertyName.NotGenerateLamdaNoFieldProperty) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.NotGenerateLamdaNoFieldProperty);
return true;
}
- else if (name == PropertyName.NotGenerateComplexReturnProperty) {
+ if (name == PropertyName.NotGenerateComplexReturnProperty) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.NotGenerateComplexReturnProperty);
return true;
}
- else if (name == PropertyName.NotGenerateReturnsProperty) {
+ if (name == PropertyName.NotGenerateReturnsProperty) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.NotGenerateReturnsProperty);
return true;
}
- else if (name == PropertyName.FullPropertyString) {
+ if (name == PropertyName.FullPropertyString) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.FullPropertyString);
return true;
}
- else if (name == PropertyName.FullPropertyString_Complex) {
+ if (name == PropertyName.FullPropertyString_Complex) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.FullPropertyString_Complex);
return true;
}
- else if (name == PropertyName.LamdaPropertyString) {
+ if (name == PropertyName.LamdaPropertyString) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.LamdaPropertyString);
return true;
}
- else if (name == PropertyName.PropertyBoolean) {
+ if (name == PropertyName.PropertyBoolean) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<bool>(this.PropertyBoolean);
return true;
}
- else if (name == PropertyName.PropertyChar) {
+ if (name == PropertyName.PropertyChar) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<char>(this.PropertyChar);
return true;
}
- else if (name == PropertyName.PropertySByte) {
+ if (name == PropertyName.PropertySByte) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<sbyte>(this.PropertySByte);
return true;
}
- else if (name == PropertyName.PropertyInt16) {
+ if (name == PropertyName.PropertyInt16) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<short>(this.PropertyInt16);
return true;
}
- else if (name == PropertyName.PropertyInt32) {
+ if (name == PropertyName.PropertyInt32) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<int>(this.PropertyInt32);
return true;
}
- else if (name == PropertyName.PropertyInt64) {
+ if (name == PropertyName.PropertyInt64) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<long>(this.PropertyInt64);
return true;
}
- else if (name == PropertyName.PropertyByte) {
+ if (name == PropertyName.PropertyByte) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<byte>(this.PropertyByte);
return true;
}
- else if (name == PropertyName.PropertyUInt16) {
+ if (name == PropertyName.PropertyUInt16) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<ushort>(this.PropertyUInt16);
return true;
}
- else if (name == PropertyName.PropertyUInt32) {
+ if (name == PropertyName.PropertyUInt32) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<uint>(this.PropertyUInt32);
return true;
}
- else if (name == PropertyName.PropertyUInt64) {
+ if (name == PropertyName.PropertyUInt64) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<ulong>(this.PropertyUInt64);
return true;
}
- else if (name == PropertyName.PropertySingle) {
+ if (name == PropertyName.PropertySingle) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<float>(this.PropertySingle);
return true;
}
- else if (name == PropertyName.PropertyDouble) {
+ if (name == PropertyName.PropertyDouble) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<double>(this.PropertyDouble);
return true;
}
- else if (name == PropertyName.PropertyString) {
+ if (name == PropertyName.PropertyString) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.PropertyString);
return true;
}
- else if (name == PropertyName.PropertyVector2) {
+ if (name == PropertyName.PropertyVector2) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector2>(this.PropertyVector2);
return true;
}
- else if (name == PropertyName.PropertyVector2I) {
+ if (name == PropertyName.PropertyVector2I) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector2I>(this.PropertyVector2I);
return true;
}
- else if (name == PropertyName.PropertyRect2) {
+ if (name == PropertyName.PropertyRect2) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Rect2>(this.PropertyRect2);
return true;
}
- else if (name == PropertyName.PropertyRect2I) {
+ if (name == PropertyName.PropertyRect2I) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Rect2I>(this.PropertyRect2I);
return true;
}
- else if (name == PropertyName.PropertyTransform2D) {
+ if (name == PropertyName.PropertyTransform2D) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Transform2D>(this.PropertyTransform2D);
return true;
}
- else if (name == PropertyName.PropertyVector3) {
+ if (name == PropertyName.PropertyVector3) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector3>(this.PropertyVector3);
return true;
}
- else if (name == PropertyName.PropertyVector3I) {
+ if (name == PropertyName.PropertyVector3I) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector3I>(this.PropertyVector3I);
return true;
}
- else if (name == PropertyName.PropertyBasis) {
+ if (name == PropertyName.PropertyBasis) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Basis>(this.PropertyBasis);
return true;
}
- else if (name == PropertyName.PropertyQuaternion) {
+ if (name == PropertyName.PropertyQuaternion) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Quaternion>(this.PropertyQuaternion);
return true;
}
- else if (name == PropertyName.PropertyTransform3D) {
+ if (name == PropertyName.PropertyTransform3D) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Transform3D>(this.PropertyTransform3D);
return true;
}
- else if (name == PropertyName.PropertyVector4) {
+ if (name == PropertyName.PropertyVector4) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector4>(this.PropertyVector4);
return true;
}
- else if (name == PropertyName.PropertyVector4I) {
+ if (name == PropertyName.PropertyVector4I) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector4I>(this.PropertyVector4I);
return true;
}
- else if (name == PropertyName.PropertyProjection) {
+ if (name == PropertyName.PropertyProjection) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Projection>(this.PropertyProjection);
return true;
}
- else if (name == PropertyName.PropertyAabb) {
+ if (name == PropertyName.PropertyAabb) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Aabb>(this.PropertyAabb);
return true;
}
- else if (name == PropertyName.PropertyColor) {
+ if (name == PropertyName.PropertyColor) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Color>(this.PropertyColor);
return true;
}
- else if (name == PropertyName.PropertyPlane) {
+ if (name == PropertyName.PropertyPlane) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Plane>(this.PropertyPlane);
return true;
}
- else if (name == PropertyName.PropertyCallable) {
+ if (name == PropertyName.PropertyCallable) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Callable>(this.PropertyCallable);
return true;
}
- else if (name == PropertyName.PropertySignal) {
+ if (name == PropertyName.PropertySignal) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Signal>(this.PropertySignal);
return true;
}
- else if (name == PropertyName.PropertyEnum) {
+ if (name == PropertyName.PropertyEnum) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::ExportedProperties.MyEnum>(this.PropertyEnum);
return true;
}
- else if (name == PropertyName.PropertyFlagsEnum) {
+ if (name == PropertyName.PropertyFlagsEnum) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::ExportedProperties.MyFlagsEnum>(this.PropertyFlagsEnum);
return true;
}
- else if (name == PropertyName.PropertyByteArray) {
+ if (name == PropertyName.PropertyByteArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<byte[]>(this.PropertyByteArray);
return true;
}
- else if (name == PropertyName.PropertyInt32Array) {
+ if (name == PropertyName.PropertyInt32Array) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<int[]>(this.PropertyInt32Array);
return true;
}
- else if (name == PropertyName.PropertyInt64Array) {
+ if (name == PropertyName.PropertyInt64Array) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<long[]>(this.PropertyInt64Array);
return true;
}
- else if (name == PropertyName.PropertySingleArray) {
+ if (name == PropertyName.PropertySingleArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<float[]>(this.PropertySingleArray);
return true;
}
- else if (name == PropertyName.PropertyDoubleArray) {
+ if (name == PropertyName.PropertyDoubleArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<double[]>(this.PropertyDoubleArray);
return true;
}
- else if (name == PropertyName.PropertyStringArray) {
+ if (name == PropertyName.PropertyStringArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string[]>(this.PropertyStringArray);
return true;
}
- else if (name == PropertyName.PropertyStringArrayEnum) {
+ if (name == PropertyName.PropertyStringArrayEnum) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string[]>(this.PropertyStringArrayEnum);
return true;
}
- else if (name == PropertyName.PropertyVector2Array) {
+ if (name == PropertyName.PropertyVector2Array) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector2[]>(this.PropertyVector2Array);
return true;
}
- else if (name == PropertyName.PropertyVector3Array) {
+ if (name == PropertyName.PropertyVector3Array) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector3[]>(this.PropertyVector3Array);
return true;
}
- else if (name == PropertyName.PropertyColorArray) {
+ if (name == PropertyName.PropertyColorArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Color[]>(this.PropertyColorArray);
return true;
}
- else if (name == PropertyName.PropertyGodotObjectOrDerivedArray) {
+ if (name == PropertyName.PropertyGodotObjectOrDerivedArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFromSystemArrayOfGodotObject(this.PropertyGodotObjectOrDerivedArray);
return true;
}
- else if (name == PropertyName.field_StringNameArray) {
+ if (name == PropertyName.field_StringNameArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.StringName[]>(this.field_StringNameArray);
return true;
}
- else if (name == PropertyName.field_NodePathArray) {
+ if (name == PropertyName.field_NodePathArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.NodePath[]>(this.field_NodePathArray);
return true;
}
- else if (name == PropertyName.field_RidArray) {
+ if (name == PropertyName.field_RidArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Rid[]>(this.field_RidArray);
return true;
}
- else if (name == PropertyName.PropertyVariant) {
+ if (name == PropertyName.PropertyVariant) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Variant>(this.PropertyVariant);
return true;
}
- else if (name == PropertyName.PropertyGodotObjectOrDerived) {
+ if (name == PropertyName.PropertyGodotObjectOrDerived) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.GodotObject>(this.PropertyGodotObjectOrDerived);
return true;
}
- else if (name == PropertyName.PropertyGodotResourceTexture) {
+ if (name == PropertyName.PropertyGodotResourceTexture) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Texture>(this.PropertyGodotResourceTexture);
return true;
}
- else if (name == PropertyName.PropertyStringName) {
+ if (name == PropertyName.PropertyStringName) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.StringName>(this.PropertyStringName);
return true;
}
- else if (name == PropertyName.PropertyNodePath) {
+ if (name == PropertyName.PropertyNodePath) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.NodePath>(this.PropertyNodePath);
return true;
}
- else if (name == PropertyName.PropertyRid) {
+ if (name == PropertyName.PropertyRid) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Rid>(this.PropertyRid);
return true;
}
- else if (name == PropertyName.PropertyGodotDictionary) {
+ if (name == PropertyName.PropertyGodotDictionary) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Collections.Dictionary>(this.PropertyGodotDictionary);
return true;
}
- else if (name == PropertyName.PropertyGodotArray) {
+ if (name == PropertyName.PropertyGodotArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Collections.Array>(this.PropertyGodotArray);
return true;
}
- else if (name == PropertyName.PropertyGodotGenericDictionary) {
+ if (name == PropertyName.PropertyGodotGenericDictionary) {
value = global::Godot.NativeInterop.VariantUtils.CreateFromDictionary(this.PropertyGodotGenericDictionary);
return true;
}
- else if (name == PropertyName.PropertyGodotGenericArray) {
+ if (name == PropertyName.PropertyGodotGenericArray) {
value = global::Godot.NativeInterop.VariantUtils.CreateFromArray(this.PropertyGodotGenericArray);
return true;
}
- else if (name == PropertyName._notGeneratePropertyString) {
+ if (name == PropertyName._notGeneratePropertyString) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this._notGeneratePropertyString);
return true;
}
- else if (name == PropertyName._notGeneratePropertyInt) {
+ if (name == PropertyName._notGeneratePropertyInt) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<int>(this._notGeneratePropertyInt);
return true;
}
- else if (name == PropertyName._fullPropertyString) {
+ if (name == PropertyName._fullPropertyString) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this._fullPropertyString);
return true;
}
- else if (name == PropertyName._fullPropertyStringComplex) {
+ if (name == PropertyName._fullPropertyStringComplex) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this._fullPropertyStringComplex);
return true;
}
- else if (name == PropertyName._lamdaPropertyString) {
+ if (name == PropertyName._lamdaPropertyString) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this._lamdaPropertyString);
return true;
}
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/MixedReadOnlyWriteOnly_ScriptProperties.generated.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/MixedReadOnlyWriteOnly_ScriptProperties.generated.cs
index 91f808f55e..cabdbe8d99 100644
--- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/MixedReadOnlyWriteOnly_ScriptProperties.generated.cs
+++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/MixedReadOnlyWriteOnly_ScriptProperties.generated.cs
@@ -41,7 +41,7 @@ partial class MixedReadOnlyWriteOnly
this.WriteOnlyProperty = global::Godot.NativeInterop.VariantUtils.ConvertTo<bool>(value);
return true;
}
- else if (name == PropertyName._writeOnlyBackingField) {
+ if (name == PropertyName._writeOnlyBackingField) {
this._writeOnlyBackingField = global::Godot.NativeInterop.VariantUtils.ConvertTo<bool>(value);
return true;
}
@@ -55,19 +55,19 @@ partial class MixedReadOnlyWriteOnly
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.ReadOnlyAutoProperty);
return true;
}
- else if (name == PropertyName.ReadOnlyProperty) {
+ if (name == PropertyName.ReadOnlyProperty) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.ReadOnlyProperty);
return true;
}
- else if (name == PropertyName.InitOnlyAutoProperty) {
+ if (name == PropertyName.InitOnlyAutoProperty) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.InitOnlyAutoProperty);
return true;
}
- else if (name == PropertyName.ReadOnlyField) {
+ if (name == PropertyName.ReadOnlyField) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.ReadOnlyField);
return true;
}
- else if (name == PropertyName._writeOnlyBackingField) {
+ if (name == PropertyName._writeOnlyBackingField) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<bool>(this._writeOnlyBackingField);
return true;
}
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ScriptBoilerplate_ScriptMethods.generated.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ScriptBoilerplate_ScriptMethods.generated.cs
index 8656f4617e..a6e58bf27d 100644
--- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ScriptBoilerplate_ScriptMethods.generated.cs
+++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ScriptBoilerplate_ScriptMethods.generated.cs
@@ -54,7 +54,7 @@ partial class ScriptBoilerplate
if (method == MethodName._Process) {
return true;
}
- else if (method == MethodName.Bazz) {
+ if (method == MethodName.Bazz) {
return true;
}
return base.HasGodotClassMethod(method);
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ScriptBoilerplate_ScriptProperties.generated.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ScriptBoilerplate_ScriptProperties.generated.cs
index 09368b7ab6..81cc27502f 100644
--- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ScriptBoilerplate_ScriptProperties.generated.cs
+++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ScriptBoilerplate_ScriptProperties.generated.cs
@@ -25,7 +25,7 @@ partial class ScriptBoilerplate
this._nodePath = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.NodePath>(value);
return true;
}
- else if (name == PropertyName._velocity) {
+ if (name == PropertyName._velocity) {
this._velocity = global::Godot.NativeInterop.VariantUtils.ConvertTo<int>(value);
return true;
}
@@ -39,7 +39,7 @@ partial class ScriptBoilerplate
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.NodePath>(this._nodePath);
return true;
}
- else if (name == PropertyName._velocity) {
+ if (name == PropertyName._velocity) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<int>(this._velocity);
return true;
}
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/ClassPartialModifier.GD0001.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/ClassPartialModifier.GD0001.cs
index c8ff673b76..fb70f104aa 100644
--- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/ClassPartialModifier.GD0001.cs
+++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/ClassPartialModifier.GD0001.cs
@@ -2,5 +2,5 @@ using Godot;
public class {|GD0001:ClassPartialModifier|} : Node
{
-
+
}
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/GlobalClass.GD0401.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/GlobalClass.GD0401.cs
index 1908703a71..91a376462b 100644
--- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/GlobalClass.GD0401.cs
+++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/GlobalClass.GD0401.cs
@@ -2,7 +2,7 @@ using Godot;
// This works because it inherits from GodotObject.
[GlobalClass]
-public partial class CustomGlobalClass1 : GodotObject
+public partial class CustomGlobalClass1 : GodotObject
{
}
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/GlobalClass.GD0402.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/GlobalClass.GD0402.cs
index 4f7885cf37..0685d0b34a 100644
--- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/GlobalClass.GD0402.cs
+++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/GlobalClass.GD0402.cs
@@ -2,7 +2,7 @@ using Godot;
// This works because it inherits from GodotObject and it doesn't have any generic type parameter.
[GlobalClass]
-public partial class CustomGlobalClass : GodotObject
+public partial class CustomGlobalClass : GodotObject
{
}
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/MustBeVariant.GD0301.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/MustBeVariant.GD0301.cs
index 2b5eecab8a..053ae36ae7 100644
--- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/MustBeVariant.GD0301.cs
+++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/Sources/MustBeVariant.GD0301.cs
@@ -10,7 +10,7 @@ public class MustBeVariantGD0301
// This raises a GD0301 diagnostic error: object is not Variant (and Method<T> requires a variant generic type).
Method<{|GD0301:object|}>();
}
-
+
public void MethodCallsOk()
{
// All these calls are valid because they are Variant types.
@@ -75,7 +75,7 @@ public class MustBeVariantGD0301
public void Method<[MustBeVariant] T>()
{
}
-
+
public void MustBeVariantClasses()
{
new ClassWithGenericVariant<bool>();
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptMethodsGenerator.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptMethodsGenerator.cs
index f314f7dada..39d3a6f94e 100644
--- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptMethodsGenerator.cs
+++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptMethodsGenerator.cs
@@ -253,11 +253,9 @@ namespace Godot.SourceGenerators
source.Append(" [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]\n");
source.Append(" protected override bool HasGodotClassMethod(in godot_string_name method)\n {\n");
- bool isFirstEntry = true;
foreach (string methodName in distinctMethodNames)
{
- GenerateHasMethodEntry(methodName, source, isFirstEntry);
- isFirstEntry = false;
+ GenerateHasMethodEntry(methodName, source);
}
source.Append(" return base.HasGodotClassMethod(method);\n");
@@ -412,13 +410,10 @@ namespace Godot.SourceGenerators
private static void GenerateHasMethodEntry(
string methodName,
- StringBuilder source,
- bool isFirstEntry
+ StringBuilder source
)
{
source.Append(" ");
- if (!isFirstEntry)
- source.Append("else ");
source.Append("if (method == MethodName.");
source.Append(methodName);
source.Append(") {\n return true;\n }\n");
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs
index 21223654f3..02c2cd4034 100644
--- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs
+++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs
@@ -172,7 +172,6 @@ namespace Godot.SourceGenerators
if (godotClassProperties.Length > 0 || godotClassFields.Length > 0)
{
- bool isFirstEntry;
// Generate SetGodotClassPropertyValue
@@ -186,15 +185,13 @@ namespace Godot.SourceGenerators
source.Append(" protected override bool SetGodotClassPropertyValue(in godot_string_name name, ");
source.Append("in godot_variant value)\n {\n");
- isFirstEntry = true;
foreach (var property in godotClassProperties)
{
if (property.PropertySymbol.IsReadOnly || property.PropertySymbol.SetMethod!.IsInitOnly)
continue;
GeneratePropertySetter(property.PropertySymbol.Name,
- property.PropertySymbol.Type, property.Type, source, isFirstEntry);
- isFirstEntry = false;
+ property.PropertySymbol.Type, property.Type, source);
}
foreach (var field in godotClassFields)
@@ -203,8 +200,7 @@ namespace Godot.SourceGenerators
continue;
GeneratePropertySetter(field.FieldSymbol.Name,
- field.FieldSymbol.Type, field.Type, source, isFirstEntry);
- isFirstEntry = false;
+ field.FieldSymbol.Type, field.Type, source);
}
source.Append(" return base.SetGodotClassPropertyValue(name, value);\n");
@@ -222,22 +218,19 @@ namespace Godot.SourceGenerators
source.Append(" protected override bool GetGodotClassPropertyValue(in godot_string_name name, ");
source.Append("out godot_variant value)\n {\n");
- isFirstEntry = true;
foreach (var property in godotClassProperties)
{
if (property.PropertySymbol.IsWriteOnly)
continue;
GeneratePropertyGetter(property.PropertySymbol.Name,
- property.PropertySymbol.Type, property.Type, source, isFirstEntry);
- isFirstEntry = false;
+ property.PropertySymbol.Type, property.Type, source);
}
foreach (var field in godotClassFields)
{
GeneratePropertyGetter(field.FieldSymbol.Name,
- field.FieldSymbol.Type, field.Type, source, isFirstEntry);
- isFirstEntry = false;
+ field.FieldSymbol.Type, field.Type, source);
}
source.Append(" return base.GetGodotClassPropertyValue(name, out value);\n");
@@ -318,15 +311,11 @@ namespace Godot.SourceGenerators
string propertyMemberName,
ITypeSymbol propertyTypeSymbol,
MarshalType propertyMarshalType,
- StringBuilder source,
- bool isFirstEntry
+ StringBuilder source
)
{
source.Append(" ");
- if (!isFirstEntry)
- source.Append("else ");
-
source.Append("if (name == PropertyName.")
.Append(propertyMemberName)
.Append(") {\n")
@@ -343,15 +332,11 @@ namespace Godot.SourceGenerators
string propertyMemberName,
ITypeSymbol propertyTypeSymbol,
MarshalType propertyMarshalType,
- StringBuilder source,
- bool isFirstEntry
+ StringBuilder source
)
{
source.Append(" ");
- if (!isFirstEntry)
- source.Append("else ");
-
source.Append("if (name == PropertyName.")
.Append(propertyMemberName)
.Append(") {\n")
@@ -590,6 +575,11 @@ namespace Godot.SourceGenerators
if (variantType == VariantType.Object && type is INamedTypeSymbol memberNamedType)
{
+ if (TryGetNodeOrResourceType(exportAttr, out hint, out hintString))
+ {
+ return true;
+ }
+
if (memberNamedType.InheritsFrom("GodotSharp", "Godot.Resource"))
{
hint = PropertyHint.ResourceType;
@@ -607,6 +597,37 @@ namespace Godot.SourceGenerators
}
}
+ static bool TryGetNodeOrResourceType(AttributeData exportAttr, out PropertyHint hint, out string? hintString)
+ {
+ hint = PropertyHint.None;
+ hintString = null;
+
+ if (exportAttr.ConstructorArguments.Length <= 1) return false;
+
+ var hintValue = exportAttr.ConstructorArguments[0].Value;
+
+ var hintEnum = hintValue switch
+ {
+ null => PropertyHint.None,
+ int intValue => (PropertyHint)intValue,
+ _ => (PropertyHint)(long)hintValue
+ };
+
+ if (!hintEnum.HasFlag(PropertyHint.NodeType) && !hintEnum.HasFlag(PropertyHint.ResourceType))
+ return false;
+
+ var hintStringValue = exportAttr.ConstructorArguments[1].Value?.ToString();
+ if (string.IsNullOrWhiteSpace(hintStringValue))
+ {
+ return false;
+ }
+
+ hint = hintEnum;
+ hintString = hintStringValue;
+
+ return true;
+ }
+
static string GetTypeName(INamedTypeSymbol memberSymbol)
{
if (memberSymbol.GetAttributes()
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptSignalsGenerator.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptSignalsGenerator.cs
index 107bd93faa..deac5f2bcf 100644
--- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptSignalsGenerator.cs
+++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptSignalsGenerator.cs
@@ -319,11 +319,9 @@ namespace Godot.SourceGenerators
source.Append(
" protected override bool HasGodotClassSignal(in godot_string_name signal)\n {\n");
- bool isFirstEntry = true;
foreach (var signal in godotSignalDelegates)
{
- GenerateHasSignalEntry(signal.Name, source, isFirstEntry);
- isFirstEntry = false;
+ GenerateHasSignalEntry(signal.Name, source);
}
source.Append(" return base.HasGodotClassSignal(signal);\n");
@@ -473,13 +471,10 @@ namespace Godot.SourceGenerators
private static void GenerateHasSignalEntry(
string signalName,
- StringBuilder source,
- bool isFirstEntry
+ StringBuilder source
)
{
source.Append(" ");
- if (!isFirstEntry)
- source.Append("else ");
source.Append("if (signal == SignalName.");
source.Append(signalName);
source.Append(") {\n return true;\n }\n");
diff --git a/modules/mono/editor/GodotTools/GodotTools.OpenVisualStudio/GodotTools.OpenVisualStudio.csproj b/modules/mono/editor/GodotTools/GodotTools.OpenVisualStudio/GodotTools.OpenVisualStudio.csproj
index 7360118ee4..f23f2b9a8c 100644
--- a/modules/mono/editor/GodotTools/GodotTools.OpenVisualStudio/GodotTools.OpenVisualStudio.csproj
+++ b/modules/mono/editor/GodotTools/GodotTools.OpenVisualStudio/GodotTools.OpenVisualStudio.csproj
@@ -7,6 +7,7 @@
<Nullable>enable</Nullable>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
<SelfContained>False</SelfContained>
+ <RollForward>LatestMajor</RollForward>
</PropertyGroup>
<PropertyGroup Condition="Exists('$(SolutionDir)/../../../../bin/GodotSharp/Api/Debug/GodotSharp.dll') And ('$(GodotPlatform)' == 'windows' Or ('$(GodotPlatform)' == '' And '$(OS)' == 'Windows_NT'))">
<OutputPath>$(SolutionDir)/../../../../bin/GodotSharp/Tools</OutputPath>
diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/BuildProblemsView.cs b/modules/mono/editor/GodotTools/GodotTools/Build/BuildProblemsView.cs
index b6d6d9ebf8..35a62a0eab 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Build/BuildProblemsView.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Build/BuildProblemsView.cs
@@ -280,7 +280,7 @@ namespace GodotTools.Build
if (_problemsContextMenu.ItemCount > 0)
{
- _problemsContextMenu.Position = (Vector2I)(_problemsTree.GlobalPosition + position);
+ _problemsContextMenu.Position = (Vector2I)(GetScreenPosition() + position);
_problemsContextMenu.Popup();
}
}
diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp
index d46160127d..9a76a25639 100644
--- a/modules/mono/editor/bindings_generator.cpp
+++ b/modules/mono/editor/bindings_generator.cpp
@@ -873,7 +873,7 @@ void BindingsGenerator::_append_text_method(StringBuilder &p_output, const TypeI
}
void BindingsGenerator::_append_text_member(StringBuilder &p_output, const TypeInterface *p_target_itype, const StringName &p_target_cname, const String &p_link_target, const Vector<String> &p_link_target_parts) {
- if (p_link_target.find("/") >= 0) {
+ if (p_link_target.contains("/")) {
// Properties with '/' (slash) in the name are not declared in C#, so there is nothing to reference.
_append_text_undeclared(p_output, p_link_target);
} else if (!p_target_itype || !p_target_itype->is_object_type) {
@@ -1154,7 +1154,7 @@ void BindingsGenerator::_append_xml_method(StringBuilder &p_xml_output, const Ty
}
void BindingsGenerator::_append_xml_member(StringBuilder &p_xml_output, const TypeInterface *p_target_itype, const StringName &p_target_cname, const String &p_link_target, const Vector<String> &p_link_target_parts) {
- if (p_link_target.find("/") >= 0) {
+ if (p_link_target.contains("/")) {
// Properties with '/' (slash) in the name are not declared in C#, so there is nothing to reference.
_append_xml_undeclared(p_xml_output, p_link_target);
} else if (!p_target_itype || !p_target_itype->is_object_type) {
@@ -2308,8 +2308,9 @@ Error BindingsGenerator::_generate_cs_type(const TypeInterface &itype, const Str
output << imethod.proxy_name << "(";
- for (int i = 0; i < imethod.arguments.size(); i++) {
- const ArgumentInterface &iarg = imethod.arguments[i];
+ int i = 0;
+ for (List<BindingsGenerator::ArgumentInterface>::ConstIterator itr = imethod.arguments.begin(); itr != imethod.arguments.end(); ++itr, ++i) {
+ const ArgumentInterface &iarg = *itr;
const TypeInterface *arg_type = _get_type_or_null(iarg.type);
ERR_FAIL_NULL_V(arg_type, ERR_BUG); // Argument type not found
@@ -3653,7 +3654,7 @@ bool BindingsGenerator::_populate_object_type_interfaces() {
continue;
}
- if (property.name.find("/") >= 0) {
+ if (property.name.contains("/")) {
// Ignore properties with '/' (slash) in the name. These are only meant for use in the inspector.
continue;
}
@@ -3727,8 +3728,6 @@ bool BindingsGenerator::_populate_object_type_interfaces() {
const MethodInfo &method_info = E.first;
const uint32_t hash = E.second;
- int argc = method_info.arguments.size();
-
if (method_info.name.is_empty()) {
continue;
}
@@ -3820,8 +3819,9 @@ bool BindingsGenerator::_populate_object_type_interfaces() {
imethod.return_type.cname = _get_type_name_from_meta(return_info.type, m ? m->get_argument_meta(-1) : (GodotTypeInfo::Metadata)method_info.return_val_metadata);
}
- for (int i = 0; i < argc; i++) {
- PropertyInfo arginfo = method_info.arguments[i];
+ int idx = 0;
+ for (List<PropertyInfo>::ConstIterator itr = method_info.arguments.begin(); itr != method_info.arguments.end(); ++itr, ++idx) {
+ const PropertyInfo &arginfo = *itr;
String orig_arg_name = arginfo.name;
@@ -3841,13 +3841,13 @@ bool BindingsGenerator::_populate_object_type_interfaces() {
} else if (arginfo.type == Variant::NIL) {
iarg.type.cname = name_cache.type_Variant;
} else {
- iarg.type.cname = _get_type_name_from_meta(arginfo.type, m ? m->get_argument_meta(i) : (GodotTypeInfo::Metadata)method_info.get_argument_meta(i));
+ iarg.type.cname = _get_type_name_from_meta(arginfo.type, m ? m->get_argument_meta(idx) : (GodotTypeInfo::Metadata)method_info.get_argument_meta(idx));
}
iarg.name = escape_csharp_keyword(snake_to_camel_case(iarg.name));
- if (m && m->has_default_argument(i)) {
- bool defval_ok = _arg_default_value_from_variant(m->get_default_argument(i), iarg);
+ if (m && m->has_default_argument(idx)) {
+ bool defval_ok = _arg_default_value_from_variant(m->get_default_argument(idx), iarg);
ERR_FAIL_COND_V_MSG(!defval_ok, false,
"Cannot determine default value for argument '" + orig_arg_name + "' of method '" + itype.name + "." + imethod.name + "'.");
}
@@ -3946,10 +3946,9 @@ bool BindingsGenerator::_populate_object_type_interfaces() {
isignal.name = method_info.name;
isignal.cname = method_info.name;
- int argc = method_info.arguments.size();
-
- for (int i = 0; i < argc; i++) {
- PropertyInfo arginfo = method_info.arguments[i];
+ int idx = 0;
+ for (List<PropertyInfo>::ConstIterator itr = method_info.arguments.begin(); itr != method_info.arguments.end(); ++itr, ++idx) {
+ const PropertyInfo &arginfo = *itr;
String orig_arg_name = arginfo.name;
@@ -3969,7 +3968,7 @@ bool BindingsGenerator::_populate_object_type_interfaces() {
} else if (arginfo.type == Variant::NIL) {
iarg.type.cname = name_cache.type_Variant;
} else {
- iarg.type.cname = _get_type_name_from_meta(arginfo.type, (GodotTypeInfo::Metadata)method_info.get_argument_meta(i));
+ iarg.type.cname = _get_type_name_from_meta(arginfo.type, (GodotTypeInfo::Metadata)method_info.get_argument_meta(idx));
}
iarg.name = escape_csharp_keyword(snake_to_camel_case(iarg.name));
@@ -4770,9 +4769,11 @@ bool BindingsGenerator::_method_has_conflicting_signature(const MethodInterface
return false;
}
- for (int i = 0; i < p_imethod_left.arguments.size(); i++) {
- const ArgumentInterface &iarg_left = p_imethod_left.arguments[i];
- const ArgumentInterface &iarg_right = p_imethod_right.arguments[i];
+ List<BindingsGenerator::ArgumentInterface>::ConstIterator left_itr = p_imethod_left.arguments.begin();
+ List<BindingsGenerator::ArgumentInterface>::ConstIterator right_itr = p_imethod_right.arguments.begin();
+ for (; left_itr != p_imethod_left.arguments.end(); ++left_itr, ++right_itr) {
+ const ArgumentInterface &iarg_left = *left_itr;
+ const ArgumentInterface &iarg_right = *right_itr;
if (iarg_left.type.cname != iarg_right.type.cname) {
// Different types for arguments in the same position, so no conflict.
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Aabb.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Aabb.cs
index ab7f8ede44..33f0850a8d 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Aabb.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Aabb.cs
@@ -318,9 +318,9 @@ namespace Godot
Vector3 ofs = _position + halfExtents;
return ofs + new Vector3(
- dir.X > 0f ? -halfExtents.X : halfExtents.X,
- dir.Y > 0f ? -halfExtents.Y : halfExtents.Y,
- dir.Z > 0f ? -halfExtents.Z : halfExtents.Z);
+ dir.X > 0f ? halfExtents.X : -halfExtents.X,
+ dir.Y > 0f ? halfExtents.Y : -halfExtents.Y,
+ dir.Z > 0f ? halfExtents.Z : -halfExtents.Z);
}
/// <summary>
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/ScriptManagerBridge.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/ScriptManagerBridge.cs
index 1b23276bbd..eef26cdd4e 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/ScriptManagerBridge.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/ScriptManagerBridge.cs
@@ -798,17 +798,17 @@ namespace Godot.Bridge
GetScriptTypeInfo(scriptType, outTypeInfo);
+ Type native = GodotObject.InternalGetClassNativeBase(scriptType);
+
// Methods
// Performance is not critical here as this will be replaced with source generators.
using var methods = new Collections.Array();
Type? top = scriptType;
- Type native = GodotObject.InternalGetClassNativeBase(top);
-
- while (top != null && top != native)
+ if (scriptType != native)
{
- var methodList = GetMethodListForType(top);
+ var methodList = GetMethodListForType(scriptType);
if (methodList != null)
{
@@ -859,8 +859,6 @@ namespace Godot.Bridge
methods.Add(methodInfo);
}
}
-
- top = top.BaseType;
}
*outMethodsDest = NativeFuncs.godotsharp_array_new_copy(
@@ -912,11 +910,9 @@ namespace Godot.Bridge
// Performance is not critical here as this will be replaced with source generators.
using var signals = new Collections.Dictionary();
- top = scriptType;
-
- while (top != null && top != native)
+ if (scriptType != native)
{
- var signalList = GetSignalListForType(top);
+ var signalList = GetSignalListForType(scriptType);
if (signalList != null)
{
@@ -951,8 +947,6 @@ namespace Godot.Bridge
signals.Add(signalName, signalParams);
}
}
-
- top = top.BaseType;
}
*outEventSignalsDest = NativeFuncs.godotsharp_dictionary_new_copy(
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/StringExtensions.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/StringExtensions.cs
index d8a3e91699..ad75195f0f 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/StringExtensions.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/StringExtensions.cs
@@ -426,7 +426,9 @@ namespace Godot
/// <returns>An integer that indicates the lexical relationship between the two comparands.</returns>
public static int CasecmpTo(this string instance, string to)
{
- return instance.CompareTo(to, caseSensitive: true);
+#pragma warning disable CA1309 // Use ordinal string comparison
+ return string.Compare(instance, to, ignoreCase: false, null);
+#pragma warning restore CA1309
}
/// <summary>
@@ -441,7 +443,9 @@ namespace Godot
[Obsolete("Use string.Compare instead.")]
public static int CompareTo(this string instance, string to, bool caseSensitive = true)
{
- return string.Compare(instance, to, !caseSensitive);
+#pragma warning disable CA1309 // Use ordinal string comparison
+ return string.Compare(instance, to, ignoreCase: !caseSensitive, null);
+#pragma warning restore CA1309
}
/// <summary>
@@ -1261,7 +1265,9 @@ namespace Godot
/// <returns>An integer that indicates the lexical relationship between the two comparands.</returns>
public static int NocasecmpTo(this string instance, string to)
{
- return instance.CompareTo(to, caseSensitive: false);
+#pragma warning disable CA1309 // Use ordinal string comparison
+ return string.Compare(instance, to, ignoreCase: true, null);
+#pragma warning restore CA1309
}
/// <summary>
@@ -1694,7 +1700,7 @@ namespace Godot
}
/// <summary>
- /// Converts the string (which is an array of characters) to an UTF-16 encoded array of bytes.
+ /// Converts the string (which is an array of characters) to a UTF-16 encoded array of bytes.
/// </summary>
/// <seealso cref="ToAsciiBuffer(string)"/>
/// <seealso cref="ToUtf32Buffer(string)"/>
@@ -1707,7 +1713,7 @@ namespace Godot
}
/// <summary>
- /// Converts the string (which is an array of characters) to an UTF-32 encoded array of bytes.
+ /// Converts the string (which is an array of characters) to a UTF-32 encoded array of bytes.
/// </summary>
/// <seealso cref="ToAsciiBuffer(string)"/>
/// <seealso cref="ToUtf16Buffer(string)"/>
@@ -1720,7 +1726,7 @@ namespace Godot
}
/// <summary>
- /// Converts the string (which is an array of characters) to an UTF-8 encoded array of bytes.
+ /// Converts the string (which is an array of characters) to a UTF-8 encoded array of bytes.
/// The conversion is a bit slower than <see cref="ToAsciiBuffer(string)"/>,
/// but supports all UTF-8 characters. Therefore, you should prefer this function
/// over <see cref="ToAsciiBuffer(string)"/>.
diff --git a/modules/multiplayer/editor/editor_network_profiler.cpp b/modules/multiplayer/editor/editor_network_profiler.cpp
index a45e5ffdc0..75941207c7 100644
--- a/modules/multiplayer/editor/editor_network_profiler.cpp
+++ b/modules/multiplayer/editor/editor_network_profiler.cpp
@@ -260,12 +260,12 @@ EditorNetworkProfiler::EditorNetworkProfiler() {
activate = memnew(Button);
activate->set_toggle_mode(true);
activate->set_text(TTR("Start"));
- activate->connect("pressed", callable_mp(this, &EditorNetworkProfiler::_activate_pressed));
+ activate->connect(SceneStringName(pressed), callable_mp(this, &EditorNetworkProfiler::_activate_pressed));
hb->add_child(activate);
clear_button = memnew(Button);
clear_button->set_text(TTR("Clear"));
- clear_button->connect("pressed", callable_mp(this, &EditorNetworkProfiler::_clear_pressed));
+ clear_button->connect(SceneStringName(pressed), callable_mp(this, &EditorNetworkProfiler::_clear_pressed));
hb->add_child(clear_button);
hb->add_spacer();
diff --git a/modules/multiplayer/editor/multiplayer_editor_plugin.cpp b/modules/multiplayer/editor/multiplayer_editor_plugin.cpp
index 29ebc38edf..a496f5dfa2 100644
--- a/modules/multiplayer/editor/multiplayer_editor_plugin.cpp
+++ b/modules/multiplayer/editor/multiplayer_editor_plugin.cpp
@@ -116,7 +116,7 @@ MultiplayerEditorPlugin::MultiplayerEditorPlugin() {
repl_editor = memnew(ReplicationEditor);
button = EditorNode::get_bottom_panel()->add_item(TTR("Replication"), repl_editor, ED_SHORTCUT_AND_COMMAND("bottom_panels/toggle_replication_bottom_panel", TTR("Toggle Replication Bottom Panel")));
button->hide();
- repl_editor->get_pin()->connect("pressed", callable_mp(this, &MultiplayerEditorPlugin::_pinned));
+ repl_editor->get_pin()->connect(SceneStringName(pressed), callable_mp(this, &MultiplayerEditorPlugin::_pinned));
debugger.instantiate();
debugger->connect("open_request", callable_mp(this, &MultiplayerEditorPlugin::_open_request));
}
diff --git a/modules/multiplayer/editor/replication_editor.cpp b/modules/multiplayer/editor/replication_editor.cpp
index 73e53a6a07..3cc0a5ae53 100644
--- a/modules/multiplayer/editor/replication_editor.cpp
+++ b/modules/multiplayer/editor/replication_editor.cpp
@@ -81,7 +81,7 @@ void ReplicationEditor::_pick_node_select_recursive(TreeItem *p_item, const Stri
NodePath np = p_item->get_metadata(0);
Node *node = get_node(np);
- if (!p_filter.is_empty() && ((String)node->get_name()).findn(p_filter) != -1) {
+ if (!p_filter.is_empty() && ((String)node->get_name()).containsn(p_filter)) {
p_select_candidates.push_back(node);
}
@@ -244,7 +244,7 @@ ReplicationEditor::ReplicationEditor() {
vb->add_child(hb);
add_pick_button = memnew(Button);
- add_pick_button->connect("pressed", callable_mp(this, &ReplicationEditor::_pick_new_property));
+ add_pick_button->connect(SceneStringName(pressed), callable_mp(this, &ReplicationEditor::_pick_new_property));
add_pick_button->set_text(TTR("Add property to sync..."));
hb->add_child(add_pick_button);
@@ -260,7 +260,7 @@ ReplicationEditor::ReplicationEditor() {
hb->add_child(np_line_edit);
add_from_path_button = memnew(Button);
- add_from_path_button->connect("pressed", callable_mp(this, &ReplicationEditor::_add_pressed));
+ add_from_path_button->connect(SceneStringName(pressed), callable_mp(this, &ReplicationEditor::_add_pressed));
add_from_path_button->set_text(TTR("Add from path"));
hb->add_child(add_from_path_button);
diff --git a/modules/multiplayer/multiplayer_spawner.cpp b/modules/multiplayer/multiplayer_spawner.cpp
index 6c0669b2f3..2408d7231b 100644
--- a/modules/multiplayer/multiplayer_spawner.cpp
+++ b/modules/multiplayer/multiplayer_spawner.cpp
@@ -33,7 +33,6 @@
#include "core/io/marshalls.h"
#include "scene/main/multiplayer_api.h"
#include "scene/main/window.h"
-#include "scene/scene_string_names.h"
#ifdef TOOLS_ENABLED
/* This is editor only */
@@ -216,7 +215,7 @@ void MultiplayerSpawner::_notification(int p_what) {
for (const KeyValue<ObjectID, SpawnInfo> &E : tracked_nodes) {
Node *node = Object::cast_to<Node>(ObjectDB::get_instance(E.key));
ERR_CONTINUE(!node);
- node->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &MultiplayerSpawner::_node_exit));
+ node->disconnect(SceneStringName(tree_exiting), callable_mp(this, &MultiplayerSpawner::_node_exit));
get_multiplayer()->object_configuration_remove(node, this);
}
tracked_nodes.clear();
@@ -258,7 +257,7 @@ void MultiplayerSpawner::_track(Node *p_node, const Variant &p_argument, int p_s
ObjectID oid = p_node->get_instance_id();
if (!tracked_nodes.has(oid)) {
tracked_nodes[oid] = SpawnInfo(p_argument.duplicate(true), p_scene_id);
- p_node->connect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &MultiplayerSpawner::_node_exit).bind(p_node->get_instance_id()), CONNECT_ONE_SHOT);
+ p_node->connect(SceneStringName(tree_exiting), callable_mp(this, &MultiplayerSpawner::_node_exit).bind(p_node->get_instance_id()), CONNECT_ONE_SHOT);
_spawn_notify(p_node->get_instance_id());
}
}
diff --git a/modules/multiplayer/multiplayer_synchronizer.cpp b/modules/multiplayer/multiplayer_synchronizer.cpp
index c2ce500af8..ca3fa43207 100644
--- a/modules/multiplayer/multiplayer_synchronizer.cpp
+++ b/modules/multiplayer/multiplayer_synchronizer.cpp
@@ -343,7 +343,7 @@ void MultiplayerSynchronizer::update_visibility(int p_for_peer) {
#endif
Node *node = is_inside_tree() ? get_node_or_null(root_path) : nullptr;
if (node && get_multiplayer()->has_multiplayer_peer() && is_multiplayer_authority()) {
- emit_signal(SNAME("visibility_changed"), p_for_peer);
+ emit_signal(SceneStringName(visibility_changed), p_for_peer);
}
}
diff --git a/modules/multiplayer/scene_cache_interface.cpp b/modules/multiplayer/scene_cache_interface.cpp
index c08ccbe4cc..2ea9ce8819 100644
--- a/modules/multiplayer/scene_cache_interface.cpp
+++ b/modules/multiplayer/scene_cache_interface.cpp
@@ -35,14 +35,13 @@
#include "core/io/marshalls.h"
#include "scene/main/node.h"
#include "scene/main/window.h"
-#include "scene/scene_string_names.h"
SceneCacheInterface::NodeCache &SceneCacheInterface::_track(Node *p_node) {
const ObjectID oid = p_node->get_instance_id();
NodeCache *nc = nodes_cache.getptr(oid);
if (!nc) {
nodes_cache[oid] = NodeCache();
- p_node->connect(SceneStringNames::get_singleton()->tree_exited, callable_mp(this, &SceneCacheInterface::_remove_node_cache).bind(oid), Object::CONNECT_ONE_SHOT);
+ p_node->connect(SceneStringName(tree_exited), callable_mp(this, &SceneCacheInterface::_remove_node_cache).bind(oid), Object::CONNECT_ONE_SHOT);
}
return nodes_cache[oid];
}
@@ -286,7 +285,7 @@ void SceneCacheInterface::clear() {
for (KeyValue<ObjectID, NodeCache> &E : nodes_cache) {
Object *obj = ObjectDB::get_instance(E.key);
ERR_CONTINUE(!obj);
- obj->disconnect(SceneStringNames::get_singleton()->tree_exited, callable_mp(this, &SceneCacheInterface::_remove_node_cache));
+ obj->disconnect(SceneStringName(tree_exited), callable_mp(this, &SceneCacheInterface::_remove_node_cache));
}
peers_info.clear();
nodes_cache.clear();
diff --git a/modules/multiplayer/scene_replication_config.cpp b/modules/multiplayer/scene_replication_config.cpp
index 733540a0e4..ab92f7d90f 100644
--- a/modules/multiplayer/scene_replication_config.cpp
+++ b/modules/multiplayer/scene_replication_config.cpp
@@ -48,7 +48,7 @@ bool SceneReplicationConfig::_set(const StringName &p_name, const Variant &p_val
return true;
}
ERR_FAIL_INDEX_V(idx, properties.size(), false);
- ReplicationProperty &prop = properties[idx];
+ const ReplicationProperty &prop = properties.get(idx);
if (what == "replication_mode") {
ERR_FAIL_COND_V(p_value.get_type() != Variant::INT, false);
ReplicationMode mode = (ReplicationMode)p_value.operator int();
@@ -80,7 +80,7 @@ bool SceneReplicationConfig::_get(const StringName &p_name, Variant &r_ret) cons
int idx = prop_name.get_slicec('/', 1).to_int();
String what = prop_name.get_slicec('/', 2);
ERR_FAIL_INDEX_V(idx, properties.size(), false);
- const ReplicationProperty &prop = properties[idx];
+ const ReplicationProperty &prop = properties.get(idx);
if (what == "path") {
r_ret = prop.name;
return true;
@@ -147,8 +147,8 @@ void SceneReplicationConfig::remove_property(const NodePath &p_path) {
}
bool SceneReplicationConfig::has_property(const NodePath &p_path) const {
- for (int i = 0; i < properties.size(); i++) {
- if (properties[i].name == p_path) {
+ for (const ReplicationProperty &property : properties) {
+ if (property.name == p_path) {
return true;
}
}
@@ -156,8 +156,9 @@ bool SceneReplicationConfig::has_property(const NodePath &p_path) const {
}
int SceneReplicationConfig::property_get_index(const NodePath &p_path) const {
- for (int i = 0; i < properties.size(); i++) {
- if (properties[i].name == p_path) {
+ int i = 0;
+ for (List<ReplicationProperty>::ConstIterator itr = properties.begin(); itr != properties.end(); ++itr, ++i) {
+ if (itr->name == p_path) {
return i;
}
}
diff --git a/modules/multiplayer/scene_replication_interface.cpp b/modules/multiplayer/scene_replication_interface.cpp
index bb32eed1a9..edc66c876c 100644
--- a/modules/multiplayer/scene_replication_interface.cpp
+++ b/modules/multiplayer/scene_replication_interface.cpp
@@ -35,7 +35,6 @@
#include "core/debugger/engine_debugger.h"
#include "core/io/marshalls.h"
#include "scene/main/node.h"
-#include "scene/scene_string_names.h"
#define MAKE_ROOM(m_amount) \
if (packet_cache.size() < m_amount) \
@@ -57,7 +56,7 @@ SceneReplicationInterface::TrackedNode &SceneReplicationInterface::_track(const
if (!tracked_nodes.has(p_id)) {
tracked_nodes[p_id] = TrackedNode(p_id);
Node *node = get_id_as<Node>(p_id);
- node->connect(SceneStringNames::get_singleton()->tree_exited, callable_mp(this, &SceneReplicationInterface::_untrack).bind(p_id), Node::CONNECT_ONE_SHOT);
+ node->connect(SceneStringName(tree_exited), callable_mp(this, &SceneReplicationInterface::_untrack).bind(p_id), Node::CONNECT_ONE_SHOT);
}
return tracked_nodes[p_id];
}
@@ -135,8 +134,8 @@ void SceneReplicationInterface::on_network_process() {
for (const ObjectID &oid : spawn_queue) {
Node *node = get_id_as<Node>(oid);
ERR_CONTINUE(!node);
- if (node->is_connected(SceneStringNames::get_singleton()->ready, callable_mp(this, &SceneReplicationInterface::_node_ready))) {
- node->disconnect(SceneStringNames::get_singleton()->ready, callable_mp(this, &SceneReplicationInterface::_node_ready));
+ if (node->is_connected(SceneStringName(ready), callable_mp(this, &SceneReplicationInterface::_node_ready))) {
+ node->disconnect(SceneStringName(ready), callable_mp(this, &SceneReplicationInterface::_node_ready));
}
}
spawn_queue.clear();
@@ -168,7 +167,7 @@ Error SceneReplicationInterface::on_spawn(Object *p_obj, Variant p_config) {
ERR_FAIL_COND_V(tobj.spawner != ObjectID(), ERR_ALREADY_IN_USE);
tobj.spawner = spawner->get_instance_id();
spawn_queue.insert(oid);
- node->connect(SceneStringNames::get_singleton()->ready, callable_mp(this, &SceneReplicationInterface::_node_ready).bind(oid), Node::CONNECT_ONE_SHOT);
+ node->connect(SceneStringName(ready), callable_mp(this, &SceneReplicationInterface::_node_ready).bind(oid), Node::CONNECT_ONE_SHOT);
return OK;
}
@@ -236,14 +235,14 @@ Error SceneReplicationInterface::on_replication_start(Object *p_obj, Variant p_c
sync_nodes.insert(sid);
// Update visibility.
- sync->connect("visibility_changed", callable_mp(this, &SceneReplicationInterface::_visibility_changed).bind(sync->get_instance_id()));
+ sync->connect(SceneStringName(visibility_changed), callable_mp(this, &SceneReplicationInterface::_visibility_changed).bind(sync->get_instance_id()));
_update_sync_visibility(0, sync);
if (pending_spawn == p_obj->get_instance_id() && sync->get_multiplayer_authority() == pending_spawn_remote) {
// Try to apply synchronizer Net ID
ERR_FAIL_COND_V_MSG(pending_sync_net_ids.is_empty(), ERR_INVALID_DATA, vformat("The MultiplayerSynchronizer at path \"%s\" is unable to process the pending spawn since it has no network ID. This might happen when changing the multiplayer authority during the \"_ready\" callback. Make sure to only change the authority of multiplayer synchronizers during \"_enter_tree\" or the \"_spawn_custom\" callback of their multiplayer spawner.", sync->get_path()));
ERR_FAIL_COND_V(!peers_info.has(pending_spawn_remote), ERR_INVALID_DATA);
- uint32_t net_id = pending_sync_net_ids[0];
+ uint32_t net_id = pending_sync_net_ids.front()->get();
pending_sync_net_ids.pop_front();
peers_info[pending_spawn_remote].recv_sync_ids[net_id] = sync->get_instance_id();
sync->set_net_id(net_id);
@@ -273,7 +272,7 @@ Error SceneReplicationInterface::on_replication_stop(Object *p_obj, Variant p_co
ERR_FAIL_COND_V(!node || p_config.get_type() != Variant::OBJECT, ERR_INVALID_PARAMETER);
MultiplayerSynchronizer *sync = Object::cast_to<MultiplayerSynchronizer>(p_config.get_validated_object());
ERR_FAIL_NULL_V(sync, ERR_INVALID_PARAMETER);
- sync->disconnect("visibility_changed", callable_mp(this, &SceneReplicationInterface::_visibility_changed));
+ sync->disconnect(SceneStringName(visibility_changed), callable_mp(this, &SceneReplicationInterface::_visibility_changed));
// Untrack synchronizer.
const ObjectID oid = node->get_instance_id();
const ObjectID sid = sync->get_instance_id();
diff --git a/modules/navigation/3d/godot_navigation_server_3d.cpp b/modules/navigation/3d/godot_navigation_server_3d.cpp
index 61a128e004..6cbfd93088 100644
--- a/modules/navigation/3d/godot_navigation_server_3d.cpp
+++ b/modules/navigation/3d/godot_navigation_server_3d.cpp
@@ -136,7 +136,7 @@ bool GodotNavigationServer3D::map_is_active(RID p_map) const {
NavMap *map = map_owner.get_or_null(p_map);
ERR_FAIL_NULL_V(map, false);
- return active_maps.find(map) >= 0;
+ return active_maps.has(map);
}
COMMAND_2(map_set_up, RID, p_map, Vector3, p_up) {
diff --git a/modules/navigation/editor/navigation_mesh_editor_plugin.cpp b/modules/navigation/editor/navigation_mesh_editor_plugin.cpp
index d7bf1cdd38..d07d3cdff5 100644
--- a/modules/navigation/editor/navigation_mesh_editor_plugin.cpp
+++ b/modules/navigation/editor/navigation_mesh_editor_plugin.cpp
@@ -138,14 +138,14 @@ NavigationMeshEditor::NavigationMeshEditor() {
button_bake->set_toggle_mode(true);
button_bake->set_text(TTR("Bake NavigationMesh"));
button_bake->set_tooltip_text(TTR("Bakes the NavigationMesh by first parsing the scene for source geometry and then creating the navigation mesh vertices and polygons."));
- button_bake->connect("pressed", callable_mp(this, &NavigationMeshEditor::_bake_pressed));
+ button_bake->connect(SceneStringName(pressed), callable_mp(this, &NavigationMeshEditor::_bake_pressed));
button_reset = memnew(Button);
button_reset->set_theme_type_variation("FlatButton");
bake_hbox->add_child(button_reset);
button_reset->set_text(TTR("Clear NavigationMesh"));
button_reset->set_tooltip_text(TTR("Clears the internal NavigationMesh vertices and polygons."));
- button_reset->connect("pressed", callable_mp(this, &NavigationMeshEditor::_clear_pressed));
+ button_reset->connect(SceneStringName(pressed), callable_mp(this, &NavigationMeshEditor::_clear_pressed));
bake_info = memnew(Label);
bake_hbox->add_child(bake_info);
diff --git a/modules/navigation/nav_map.cpp b/modules/navigation/nav_map.cpp
index a3f2ee2e61..dfbc92a919 100644
--- a/modules/navigation/nav_map.cpp
+++ b/modules/navigation/nav_map.cpp
@@ -734,7 +734,7 @@ void NavMap::remove_link(NavLink *p_link) {
}
bool NavMap::has_agent(NavAgent *agent) const {
- return (agents.find(agent) >= 0);
+ return agents.has(agent);
}
void NavMap::add_agent(NavAgent *agent) {
@@ -754,7 +754,7 @@ void NavMap::remove_agent(NavAgent *agent) {
}
bool NavMap::has_obstacle(NavObstacle *obstacle) const {
- return (obstacles.find(obstacle) >= 0);
+ return obstacles.has(obstacle);
}
void NavMap::add_obstacle(NavObstacle *obstacle) {
diff --git a/modules/noise/editor/noise_editor_plugin.cpp b/modules/noise/editor/noise_editor_plugin.cpp
index 917fa0cd15..200f31cca1 100644
--- a/modules/noise/editor/noise_editor_plugin.cpp
+++ b/modules/noise/editor/noise_editor_plugin.cpp
@@ -67,7 +67,7 @@ public:
_3d_space_switch->set_toggle_mode(true);
_3d_space_switch->set_offset(SIDE_LEFT, PADDING_3D_SPACE_SWITCH);
_3d_space_switch->set_offset(SIDE_TOP, PADDING_3D_SPACE_SWITCH);
- _3d_space_switch->connect("pressed", callable_mp(this, &NoisePreview::_on_3d_button_pressed));
+ _3d_space_switch->connect(SceneStringName(pressed), callable_mp(this, &NoisePreview::_on_3d_button_pressed));
add_child(_3d_space_switch);
}
diff --git a/modules/noise/noise_texture_2d.cpp b/modules/noise/noise_texture_2d.cpp
index 0443fec4a0..0960b2ad36 100644
--- a/modules/noise/noise_texture_2d.cpp
+++ b/modules/noise/noise_texture_2d.cpp
@@ -119,6 +119,7 @@ void NoiseTexture2D::_set_texture_image(const Ref<Image> &p_image) {
} else {
texture = RS::get_singleton()->texture_2d_create(p_image);
}
+ RS::get_singleton()->texture_set_path(texture, get_path());
}
emit_changed();
}
diff --git a/modules/openxr/action_map/openxr_action_map.cpp b/modules/openxr/action_map/openxr_action_map.cpp
index ba0e4f6cdd..5430a41d6d 100644
--- a/modules/openxr/action_map/openxr_action_map.cpp
+++ b/modules/openxr/action_map/openxr_action_map.cpp
@@ -59,7 +59,7 @@ void OpenXRActionMap::set_action_sets(Array p_action_sets) {
for (int i = 0; i < p_action_sets.size(); i++) {
Ref<OpenXRActionSet> action_set = p_action_sets[i];
- if (action_set.is_valid() && action_sets.find(action_set) == -1) {
+ if (action_set.is_valid() && !action_sets.has(action_set)) {
action_sets.push_back(action_set);
}
}
@@ -93,7 +93,7 @@ Ref<OpenXRActionSet> OpenXRActionMap::get_action_set(int p_idx) const {
void OpenXRActionMap::add_action_set(Ref<OpenXRActionSet> p_action_set) {
ERR_FAIL_COND(p_action_set.is_null());
- if (action_sets.find(p_action_set) == -1) {
+ if (!action_sets.has(p_action_set)) {
action_sets.push_back(p_action_set);
emit_changed();
}
@@ -112,7 +112,7 @@ void OpenXRActionMap::set_interaction_profiles(Array p_interaction_profiles) {
for (int i = 0; i < p_interaction_profiles.size(); i++) {
Ref<OpenXRInteractionProfile> interaction_profile = p_interaction_profiles[i];
- if (interaction_profile.is_valid() && interaction_profiles.find(interaction_profile) == -1) {
+ if (interaction_profile.is_valid() && !interaction_profiles.has(interaction_profile)) {
interaction_profiles.push_back(interaction_profile);
}
}
@@ -146,7 +146,7 @@ Ref<OpenXRInteractionProfile> OpenXRActionMap::get_interaction_profile(int p_idx
void OpenXRActionMap::add_interaction_profile(Ref<OpenXRInteractionProfile> p_interaction_profile) {
ERR_FAIL_COND(p_interaction_profile.is_null());
- if (interaction_profiles.find(p_interaction_profile) == -1) {
+ if (!interaction_profiles.has(p_interaction_profile)) {
interaction_profiles.push_back(p_interaction_profile);
emit_changed();
}
diff --git a/modules/openxr/action_map/openxr_action_set.cpp b/modules/openxr/action_map/openxr_action_set.cpp
index 4855f9e4b7..d583af2b2f 100644
--- a/modules/openxr/action_map/openxr_action_set.cpp
+++ b/modules/openxr/action_map/openxr_action_set.cpp
@@ -124,7 +124,7 @@ Ref<OpenXRAction> OpenXRActionSet::get_action(const String p_name) const {
void OpenXRActionSet::add_action(Ref<OpenXRAction> p_action) {
ERR_FAIL_COND(p_action.is_null());
- if (actions.find(p_action) == -1) {
+ if (!actions.has(p_action)) {
if (p_action->action_set && p_action->action_set != this) {
// action should only relate to our action set
p_action->action_set->remove_action(p_action);
diff --git a/modules/openxr/action_map/openxr_interaction_profile.cpp b/modules/openxr/action_map/openxr_interaction_profile.cpp
index 65ee652732..2579697d05 100644
--- a/modules/openxr/action_map/openxr_interaction_profile.cpp
+++ b/modules/openxr/action_map/openxr_interaction_profile.cpp
@@ -172,7 +172,7 @@ Ref<OpenXRIPBinding> OpenXRInteractionProfile::get_binding_for_action(const Ref<
void OpenXRInteractionProfile::add_binding(Ref<OpenXRIPBinding> p_binding) {
ERR_FAIL_COND(p_binding.is_null());
- if (bindings.find(p_binding) == -1) {
+ if (!bindings.has(p_binding)) {
ERR_FAIL_COND_MSG(get_binding_for_action(p_binding->get_action()).is_valid(), "There is already a binding for this action in this interaction profile");
bindings.push_back(p_binding);
diff --git a/modules/openxr/doc_classes/OpenXRCompositionLayer.xml b/modules/openxr/doc_classes/OpenXRCompositionLayer.xml
index b9c69075e1..6f4ac00f3e 100644
--- a/modules/openxr/doc_classes/OpenXRCompositionLayer.xml
+++ b/modules/openxr/doc_classes/OpenXRCompositionLayer.xml
@@ -32,6 +32,10 @@
Enables the blending the layer using its alpha channel.
Can be combined with [member Viewport.transparent_bg] to give the layer a transparent background.
</member>
+ <member name="enable_hole_punch" type="bool" setter="set_enable_hole_punch" getter="get_enable_hole_punch" default="false">
+ Enables a technique called "hole punching", which allows putting the composition layer behind the main projection layer (i.e. setting [member sort_order] to a negative value) while "punching a hole" through everything rendered by Godot so that the layer is still visible.
+ This can be used to create the illusion that the composition layer exists in the same 3D space as everything rendered by Godot, allowing objects to appear to pass both behind or in front of the composition layer.
+ </member>
<member name="layer_viewport" type="SubViewport" setter="set_layer_viewport" getter="get_layer_viewport">
The [SubViewport] to render on the composition layer.
</member>
diff --git a/modules/openxr/editor/openxr_action_editor.cpp b/modules/openxr/editor/openxr_action_editor.cpp
index 4b188471a0..06d2e8dcc9 100644
--- a/modules/openxr/editor/openxr_action_editor.cpp
+++ b/modules/openxr/editor/openxr_action_editor.cpp
@@ -159,7 +159,7 @@ OpenXRActionEditor::OpenXRActionEditor(Ref<OpenXRAction> p_action) {
rem_action = memnew(Button);
rem_action->set_tooltip_text(TTR("Remove action"));
- rem_action->connect("pressed", callable_mp(this, &OpenXRActionEditor::_on_remove_action));
+ rem_action->connect(SceneStringName(pressed), callable_mp(this, &OpenXRActionEditor::_on_remove_action));
rem_action->set_flat(true);
add_child(rem_action);
}
diff --git a/modules/openxr/editor/openxr_action_map_editor.cpp b/modules/openxr/editor/openxr_action_map_editor.cpp
index 5dd737756a..62b4a427b9 100644
--- a/modules/openxr/editor/openxr_action_map_editor.cpp
+++ b/modules/openxr/editor/openxr_action_map_editor.cpp
@@ -402,13 +402,13 @@ OpenXRActionMapEditor::OpenXRActionMapEditor() {
add_action_set = memnew(Button);
add_action_set->set_text(TTR("Add Action Set"));
add_action_set->set_tooltip_text(TTR("Add an action set."));
- add_action_set->connect("pressed", callable_mp(this, &OpenXRActionMapEditor::_on_add_action_set));
+ add_action_set->connect(SceneStringName(pressed), callable_mp(this, &OpenXRActionMapEditor::_on_add_action_set));
top_hb->add_child(add_action_set);
add_interaction_profile = memnew(Button);
add_interaction_profile->set_text(TTR("Add profile"));
add_interaction_profile->set_tooltip_text(TTR("Add an interaction profile."));
- add_interaction_profile->connect("pressed", callable_mp(this, &OpenXRActionMapEditor::_on_add_interaction_profile));
+ add_interaction_profile->connect(SceneStringName(pressed), callable_mp(this, &OpenXRActionMapEditor::_on_add_interaction_profile));
top_hb->add_child(add_interaction_profile);
VSeparator *vseparator = memnew(VSeparator);
@@ -417,13 +417,13 @@ OpenXRActionMapEditor::OpenXRActionMapEditor() {
save_as = memnew(Button);
save_as->set_text(TTR("Save"));
save_as->set_tooltip_text(TTR("Save this OpenXR action map."));
- save_as->connect("pressed", callable_mp(this, &OpenXRActionMapEditor::_on_save_action_map));
+ save_as->connect(SceneStringName(pressed), callable_mp(this, &OpenXRActionMapEditor::_on_save_action_map));
top_hb->add_child(save_as);
_default = memnew(Button);
_default->set_text(TTR("Reset to Default"));
_default->set_tooltip_text(TTR("Reset to default OpenXR action map."));
- _default->connect("pressed", callable_mp(this, &OpenXRActionMapEditor::_on_reset_to_default_layout));
+ _default->connect(SceneStringName(pressed), callable_mp(this, &OpenXRActionMapEditor::_on_reset_to_default_layout));
top_hb->add_child(_default);
tabs = memnew(TabContainer);
diff --git a/modules/openxr/editor/openxr_action_set_editor.cpp b/modules/openxr/editor/openxr_action_set_editor.cpp
index 8b4a0e989c..5d9a3155fb 100644
--- a/modules/openxr/editor/openxr_action_set_editor.cpp
+++ b/modules/openxr/editor/openxr_action_set_editor.cpp
@@ -229,7 +229,7 @@ OpenXRActionSetEditor::OpenXRActionSetEditor(Ref<OpenXRActionMap> p_action_map,
fold_btn = memnew(Button);
fold_btn->set_v_size_flags(Control::SIZE_SHRINK_BEGIN);
- fold_btn->connect("pressed", callable_mp(this, &OpenXRActionSetEditor::_on_toggle_expand));
+ fold_btn->connect(SceneStringName(pressed), callable_mp(this, &OpenXRActionSetEditor::_on_toggle_expand));
fold_btn->set_flat(true);
panel_hb->add_child(fold_btn);
@@ -262,13 +262,13 @@ OpenXRActionSetEditor::OpenXRActionSetEditor(Ref<OpenXRActionMap> p_action_map,
add_action = memnew(Button);
add_action->set_tooltip_text(TTR("Add action."));
- add_action->connect("pressed", callable_mp(this, &OpenXRActionSetEditor::_on_add_action));
+ add_action->connect(SceneStringName(pressed), callable_mp(this, &OpenXRActionSetEditor::_on_add_action));
add_action->set_flat(true);
action_set_hb->add_child(add_action);
rem_action_set = memnew(Button);
rem_action_set->set_tooltip_text(TTR("Remove action set."));
- rem_action_set->connect("pressed", callable_mp(this, &OpenXRActionSetEditor::_on_remove_action_set));
+ rem_action_set->connect(SceneStringName(pressed), callable_mp(this, &OpenXRActionSetEditor::_on_remove_action_set));
rem_action_set->set_flat(true);
action_set_hb->add_child(rem_action_set);
diff --git a/modules/openxr/editor/openxr_interaction_profile_editor.cpp b/modules/openxr/editor/openxr_interaction_profile_editor.cpp
index da6a9eed70..ab36c0744e 100644
--- a/modules/openxr/editor/openxr_interaction_profile_editor.cpp
+++ b/modules/openxr/editor/openxr_interaction_profile_editor.cpp
@@ -222,7 +222,7 @@ void OpenXRInteractionProfileEditor::_add_io_path(VBoxContainer *p_container, co
Button *path_add = memnew(Button);
path_add->set_icon(get_theme_icon(SNAME("Add"), EditorStringName(EditorIcons)));
path_add->set_flat(true);
- path_add->connect("pressed", callable_mp(this, &OpenXRInteractionProfileEditor::select_action_for).bind(String(p_io_path->openxr_path)));
+ path_add->connect(SceneStringName(pressed), callable_mp(this, &OpenXRInteractionProfileEditor::select_action_for).bind(String(p_io_path->openxr_path)));
path_hb->add_child(path_add);
if (interaction_profile.is_valid()) {
@@ -249,7 +249,7 @@ void OpenXRInteractionProfileEditor::_add_io_path(VBoxContainer *p_container, co
Button *action_rem = memnew(Button);
action_rem->set_flat(true);
action_rem->set_icon(get_theme_icon(SNAME("Remove"), EditorStringName(EditorIcons)));
- action_rem->connect("pressed", callable_mp((OpenXRInteractionProfileEditor *)this, &OpenXRInteractionProfileEditor::_on_remove_pressed).bind(action->get_name_with_set(), String(p_io_path->openxr_path)));
+ action_rem->connect(SceneStringName(pressed), callable_mp((OpenXRInteractionProfileEditor *)this, &OpenXRInteractionProfileEditor::_on_remove_pressed).bind(action->get_name_with_set(), String(p_io_path->openxr_path)));
action_hb->add_child(action_rem);
}
}
diff --git a/modules/openxr/editor/openxr_select_action_dialog.cpp b/modules/openxr/editor/openxr_select_action_dialog.cpp
index 8eec54be63..de0ab40f9e 100644
--- a/modules/openxr/editor/openxr_select_action_dialog.cpp
+++ b/modules/openxr/editor/openxr_select_action_dialog.cpp
@@ -97,7 +97,7 @@ void OpenXRSelectActionDialog::open() {
String action_name = action->get_name_with_set();
action_button->set_flat(true);
action_button->set_text(action->get_name() + ": " + action->get_localized_name());
- action_button->connect("pressed", callable_mp(this, &OpenXRSelectActionDialog::_on_select_action).bind(action_name));
+ action_button->connect(SceneStringName(pressed), callable_mp(this, &OpenXRSelectActionDialog::_on_select_action).bind(action_name));
action_hb->add_child(action_button);
action_buttons[action_name] = action_button->get_path();
diff --git a/modules/openxr/editor/openxr_select_interaction_profile_dialog.cpp b/modules/openxr/editor/openxr_select_interaction_profile_dialog.cpp
index 8fd66fac04..e6705d5c82 100644
--- a/modules/openxr/editor/openxr_select_interaction_profile_dialog.cpp
+++ b/modules/openxr/editor/openxr_select_interaction_profile_dialog.cpp
@@ -82,7 +82,7 @@ void OpenXRSelectInteractionProfileDialog::open(PackedStringArray p_do_not_inclu
Button *ip_button = memnew(Button);
ip_button->set_flat(true);
ip_button->set_text(OpenXRInteractionProfileMetadata::get_singleton()->get_profile(path)->display_name);
- ip_button->connect("pressed", callable_mp(this, &OpenXRSelectInteractionProfileDialog::_on_select_interaction_profile).bind(path));
+ ip_button->connect(SceneStringName(pressed), callable_mp(this, &OpenXRSelectInteractionProfileDialog::_on_select_interaction_profile).bind(path));
main_vb->add_child(ip_button);
ip_buttons[path] = ip_button->get_path();
diff --git a/modules/openxr/extensions/openxr_composition_layer_extension.cpp b/modules/openxr/extensions/openxr_composition_layer_extension.cpp
index 51f4a03d52..994b08af53 100644
--- a/modules/openxr/extensions/openxr_composition_layer_extension.cpp
+++ b/modules/openxr/extensions/openxr_composition_layer_extension.cpp
@@ -187,7 +187,7 @@ void OpenXRViewportCompositionLayerProvider::on_pre_render() {
XrCompositionLayerBaseHeader *OpenXRViewportCompositionLayerProvider::get_composition_layer() {
if (openxr_api == nullptr || composition_layer_extension == nullptr) {
- // OpenXR not initialised or we're in the editor?
+ // OpenXR not initialized or we're in the editor?
return nullptr;
}
@@ -209,6 +209,7 @@ XrCompositionLayerBaseHeader *OpenXRViewportCompositionLayerProvider::get_compos
switch (composition_layer->type) {
case XR_TYPE_COMPOSITION_LAYER_QUAD: {
XrCompositionLayerQuad *quad_layer = (XrCompositionLayerQuad *)composition_layer;
+ quad_layer->space = openxr_api->get_play_space();
quad_layer->subImage.swapchain = swapchain_info.get_swapchain();
quad_layer->subImage.imageArrayIndex = 0;
quad_layer->subImage.imageRect.offset.x = 0;
@@ -219,6 +220,7 @@ XrCompositionLayerBaseHeader *OpenXRViewportCompositionLayerProvider::get_compos
case XR_TYPE_COMPOSITION_LAYER_CYLINDER_KHR: {
XrCompositionLayerCylinderKHR *cylinder_layer = (XrCompositionLayerCylinderKHR *)composition_layer;
+ cylinder_layer->space = openxr_api->get_play_space();
cylinder_layer->subImage.swapchain = swapchain_info.get_swapchain();
cylinder_layer->subImage.imageArrayIndex = 0;
cylinder_layer->subImage.imageRect.offset.x = 0;
@@ -229,6 +231,7 @@ XrCompositionLayerBaseHeader *OpenXRViewportCompositionLayerProvider::get_compos
case XR_TYPE_COMPOSITION_LAYER_EQUIRECT2_KHR: {
XrCompositionLayerEquirect2KHR *equirect_layer = (XrCompositionLayerEquirect2KHR *)composition_layer;
+ equirect_layer->space = openxr_api->get_play_space();
equirect_layer->subImage.swapchain = swapchain_info.get_swapchain();
equirect_layer->subImage.imageArrayIndex = 0;
equirect_layer->subImage.imageRect.offset.x = 0;
@@ -260,7 +263,7 @@ XrCompositionLayerBaseHeader *OpenXRViewportCompositionLayerProvider::get_compos
bool OpenXRViewportCompositionLayerProvider::update_and_acquire_swapchain(bool p_static_image) {
if (openxr_api == nullptr || composition_layer_extension == nullptr) {
- // OpenXR not initialised or we're in the editor?
+ // OpenXR not initialized or we're in the editor?
return false;
}
if (!composition_layer_extension->is_available(composition_layer->type)) {
@@ -283,7 +286,7 @@ bool OpenXRViewportCompositionLayerProvider::update_and_acquire_swapchain(bool p
// Create our new swap chain
int64_t swapchain_format = openxr_api->get_color_swapchain_format();
- const uint32_t sample_count = 3;
+ const uint32_t sample_count = 1;
const uint32_t array_size = 1;
XrSwapchainCreateFlags create_flags = 0;
if (p_static_image) {
diff --git a/modules/openxr/openxr_api.cpp b/modules/openxr/openxr_api.cpp
index 8731a36865..32512070d6 100644
--- a/modules/openxr/openxr_api.cpp
+++ b/modules/openxr/openxr_api.cpp
@@ -1335,8 +1335,8 @@ bool OpenXRAPI::on_state_synchronized() {
// Just in case, see if we already have active trackers...
List<RID> trackers;
tracker_owner.get_owned_list(&trackers);
- for (int i = 0; i < trackers.size(); i++) {
- tracker_check_profile(trackers[i]);
+ for (const RID &tracker : trackers) {
+ tracker_check_profile(tracker);
}
for (OpenXRExtensionWrapper *wrapper : registered_extension_wrappers) {
@@ -1963,8 +1963,8 @@ bool OpenXRAPI::poll_events() {
List<RID> trackers;
tracker_owner.get_owned_list(&trackers);
- for (int i = 0; i < trackers.size(); i++) {
- tracker_check_profile(trackers[i], event->session);
+ for (const RID &tracker : trackers) {
+ tracker_check_profile(tracker, event->session);
}
} break;
@@ -2302,7 +2302,7 @@ void OpenXRAPI::end_frame() {
};
result = xrEndFrame(session, &frame_end_info);
if (XR_FAILED(result)) {
- print_line("OpenXR: failed to end frame! [", get_error_string(result), "]");
+ print_line("OpenXR: rendering skipped and failed to end frame! [", get_error_string(result), "]");
return;
}
diff --git a/modules/openxr/openxr_interface.cpp b/modules/openxr/openxr_interface.cpp
index b92d1edb90..fbbc61a91c 100644
--- a/modules/openxr/openxr_interface.cpp
+++ b/modules/openxr/openxr_interface.cpp
@@ -391,7 +391,7 @@ OpenXRInterface::Action *OpenXRInterface::create_action(ActionSet *p_action_set,
// we link our actions back to our trackers so we know which actions to check when we're processing our trackers
for (int i = 0; i < p_trackers.size(); i++) {
- if (p_trackers[i]->actions.find(action) == -1) {
+ if (!p_trackers[i]->actions.has(action)) {
p_trackers[i]->actions.push_back(action);
}
}
diff --git a/modules/openxr/scene/openxr_composition_layer.cpp b/modules/openxr/scene/openxr_composition_layer.cpp
index ce883b79b3..50cc7b9e7b 100644
--- a/modules/openxr/scene/openxr_composition_layer.cpp
+++ b/modules/openxr/scene/openxr_composition_layer.cpp
@@ -38,7 +38,14 @@
#include "scene/3d/xr_nodes.h"
#include "scene/main/viewport.h"
-HashSet<SubViewport *> OpenXRCompositionLayer::viewports_in_use;
+Vector<OpenXRCompositionLayer *> OpenXRCompositionLayer::composition_layer_nodes;
+
+static const char *HOLE_PUNCH_SHADER_CODE =
+ "shader_type spatial;\n"
+ "render_mode blend_mix, depth_draw_opaque, cull_back, shadow_to_opacity, shadows_disabled;\n"
+ "void fragment() {\n"
+ "\tALBEDO = vec3(0.0, 0.0, 0.0);\n"
+ "}\n";
OpenXRCompositionLayer::OpenXRCompositionLayer() {
openxr_api = OpenXRAPI::get_singleton();
@@ -66,9 +73,7 @@ OpenXRCompositionLayer::~OpenXRCompositionLayer() {
openxr_interface->disconnect("session_stopping", callable_mp(this, &OpenXRCompositionLayer::_on_openxr_session_stopping));
}
- if (layer_viewport) {
- viewports_in_use.erase(layer_viewport);
- }
+ composition_layer_nodes.erase(this);
if (openxr_layer_provider != nullptr) {
memdelete(openxr_layer_provider);
@@ -80,6 +85,9 @@ void OpenXRCompositionLayer::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_layer_viewport", "viewport"), &OpenXRCompositionLayer::set_layer_viewport);
ClassDB::bind_method(D_METHOD("get_layer_viewport"), &OpenXRCompositionLayer::get_layer_viewport);
+ ClassDB::bind_method(D_METHOD("set_enable_hole_punch", "enable"), &OpenXRCompositionLayer::set_enable_hole_punch);
+ ClassDB::bind_method(D_METHOD("get_enable_hole_punch"), &OpenXRCompositionLayer::get_enable_hole_punch);
+
ClassDB::bind_method(D_METHOD("set_sort_order", "order"), &OpenXRCompositionLayer::set_sort_order);
ClassDB::bind_method(D_METHOD("get_sort_order"), &OpenXRCompositionLayer::get_sort_order);
@@ -93,6 +101,16 @@ void OpenXRCompositionLayer::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "layer_viewport", PROPERTY_HINT_NODE_TYPE, "SubViewport"), "set_layer_viewport", "get_layer_viewport");
ADD_PROPERTY(PropertyInfo(Variant::INT, "sort_order", PROPERTY_HINT_NONE, ""), "set_sort_order", "get_sort_order");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "alpha_blend", PROPERTY_HINT_NONE, ""), "set_alpha_blend", "get_alpha_blend");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "enable_hole_punch", PROPERTY_HINT_NONE, ""), "set_enable_hole_punch", "get_enable_hole_punch");
+}
+
+bool OpenXRCompositionLayer::_should_use_fallback_node() {
+ if (Engine::get_singleton()->is_editor_hint()) {
+ return true;
+ } else if (openxr_session_running) {
+ return enable_hole_punch || !is_natively_supported();
+ }
+ return false;
}
void OpenXRCompositionLayer::_create_fallback_node() {
@@ -103,21 +121,27 @@ void OpenXRCompositionLayer::_create_fallback_node() {
should_update_fallback_mesh = true;
}
+void OpenXRCompositionLayer::_remove_fallback_node() {
+ ERR_FAIL_COND(fallback != nullptr);
+ remove_child(fallback);
+ fallback->queue_free();
+ fallback = nullptr;
+}
+
void OpenXRCompositionLayer::_on_openxr_session_begun() {
- if (!is_natively_supported()) {
- if (!fallback) {
- _create_fallback_node();
- }
- } else if (layer_viewport && is_visible() && is_inside_tree()) {
+ openxr_session_running = true;
+ if (layer_viewport && is_natively_supported() && is_visible() && is_inside_tree()) {
openxr_layer_provider->set_viewport(layer_viewport->get_viewport_rid(), layer_viewport->get_size());
}
+ if (!fallback && _should_use_fallback_node()) {
+ _create_fallback_node();
+ }
}
void OpenXRCompositionLayer::_on_openxr_session_stopping() {
- if (fallback && !Engine::get_singleton()->is_editor_hint()) {
- fallback->queue_free();
- remove_child(fallback);
- fallback = nullptr;
+ openxr_session_running = false;
+ if (fallback && !_should_use_fallback_node()) {
+ _remove_fallback_node();
} else {
openxr_layer_provider->set_viewport(RID(), Size2i());
}
@@ -127,22 +151,25 @@ void OpenXRCompositionLayer::update_fallback_mesh() {
should_update_fallback_mesh = true;
}
+bool OpenXRCompositionLayer::is_viewport_in_use(SubViewport *p_viewport) {
+ for (const OpenXRCompositionLayer *other_composition_layer : composition_layer_nodes) {
+ if (other_composition_layer != this && other_composition_layer->is_inside_tree() && other_composition_layer->get_layer_viewport() == p_viewport) {
+ return true;
+ }
+ }
+ return false;
+}
+
void OpenXRCompositionLayer::set_layer_viewport(SubViewport *p_viewport) {
if (layer_viewport == p_viewport) {
return;
}
- ERR_FAIL_COND_EDMSG(viewports_in_use.has(p_viewport), RTR("Cannot use the same SubViewport with multiple OpenXR composition layers. Clear it from its current layer first."));
-
- if (layer_viewport) {
- viewports_in_use.erase(layer_viewport);
- }
+ ERR_FAIL_COND_EDMSG(is_viewport_in_use(p_viewport), RTR("Cannot use the same SubViewport with multiple OpenXR composition layers. Clear it from its current layer first."));
layer_viewport = p_viewport;
if (layer_viewport) {
- viewports_in_use.insert(layer_viewport);
-
SubViewport::UpdateMode update_mode = layer_viewport->get_update_mode();
if (update_mode == SubViewport::UPDATE_WHEN_VISIBLE || update_mode == SubViewport::UPDATE_WHEN_PARENT_VISIBLE) {
WARN_PRINT_ONCE("OpenXR composition layers cannot use SubViewports with UPDATE_WHEN_VISIBLE or UPDATE_WHEN_PARENT_VISIBLE. Switching to UPDATE_ALWAYS.");
@@ -152,7 +179,7 @@ void OpenXRCompositionLayer::set_layer_viewport(SubViewport *p_viewport) {
if (fallback) {
_reset_fallback_material();
- } else if (openxr_api && openxr_api->is_running() && is_visible() && is_inside_tree()) {
+ } else if (openxr_session_running && is_visible() && is_inside_tree()) {
if (layer_viewport) {
openxr_layer_provider->set_viewport(layer_viewport->get_viewport_rid(), layer_viewport->get_size());
} else {
@@ -165,9 +192,33 @@ SubViewport *OpenXRCompositionLayer::get_layer_viewport() const {
return layer_viewport;
}
+void OpenXRCompositionLayer::set_enable_hole_punch(bool p_enable) {
+ if (enable_hole_punch == p_enable) {
+ return;
+ }
+
+ enable_hole_punch = p_enable;
+ if (_should_use_fallback_node()) {
+ if (fallback) {
+ _reset_fallback_material();
+ } else {
+ _create_fallback_node();
+ }
+ } else if (fallback) {
+ _remove_fallback_node();
+ }
+
+ update_configuration_warnings();
+}
+
+bool OpenXRCompositionLayer::get_enable_hole_punch() const {
+ return enable_hole_punch;
+}
+
void OpenXRCompositionLayer::set_sort_order(int p_order) {
if (openxr_layer_provider) {
openxr_layer_provider->set_sort_order(p_order);
+ update_configuration_warnings();
}
}
@@ -212,15 +263,28 @@ void OpenXRCompositionLayer::_reset_fallback_material() {
return;
}
- if (layer_viewport) {
+ if (enable_hole_punch && !Engine::get_singleton()->is_editor_hint() && is_natively_supported()) {
+ Ref<ShaderMaterial> material = fallback->get_surface_override_material(0);
+ if (material.is_null()) {
+ Ref<Shader> shader;
+ shader.instantiate();
+ shader->set_code(HOLE_PUNCH_SHADER_CODE);
+
+ material.instantiate();
+ material->set_shader(shader);
+
+ fallback->set_surface_override_material(0, material);
+ }
+ } else if (layer_viewport) {
Ref<StandardMaterial3D> material = fallback->get_surface_override_material(0);
if (material.is_null()) {
material.instantiate();
material->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
- material->set_flag(StandardMaterial3D::FLAG_DISABLE_DEPTH_TEST, true);
material->set_local_to_scene(true);
fallback->set_surface_override_material(0, material);
}
+
+ material->set_flag(StandardMaterial3D::FLAG_DISABLE_DEPTH_TEST, !enable_hole_punch);
material->set_transparency(get_alpha_blend() ? StandardMaterial3D::TRANSPARENCY_ALPHA : StandardMaterial3D::TRANSPARENCY_DISABLED);
Ref<ViewportTexture> texture = material->get_texture(StandardMaterial3D::TEXTURE_ALBEDO);
@@ -243,6 +307,8 @@ void OpenXRCompositionLayer::_reset_fallback_material() {
void OpenXRCompositionLayer::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_POSTINITIALIZE: {
+ composition_layer_nodes.push_back(this);
+
if (openxr_layer_provider) {
for (OpenXRExtensionWrapper *extension : OpenXRAPI::get_registered_extension_wrappers()) {
extension_property_values.merge(extension->get_viewport_composition_layer_extension_property_defaults());
@@ -260,7 +326,7 @@ void OpenXRCompositionLayer::_notification(int p_what) {
}
} break;
case NOTIFICATION_VISIBILITY_CHANGED: {
- if (!fallback && openxr_api && openxr_api->is_running() && is_inside_tree()) {
+ if (!fallback && openxr_session_running && is_inside_tree()) {
if (layer_viewport && is_visible()) {
openxr_layer_provider->set_viewport(layer_viewport->get_viewport_rid(), layer_viewport->get_size());
} else {
@@ -277,7 +343,9 @@ void OpenXRCompositionLayer::_notification(int p_what) {
composition_layer_extension->register_viewport_composition_layer_provider(openxr_layer_provider);
}
- if (!fallback && layer_viewport && openxr_api && openxr_api->is_running() && is_visible()) {
+ if (is_viewport_in_use(layer_viewport)) {
+ set_layer_viewport(nullptr);
+ } else if (!fallback && layer_viewport && openxr_session_running && is_visible()) {
openxr_layer_provider->set_viewport(layer_viewport->get_viewport_rid(), layer_viewport->get_size());
}
} break;
@@ -286,12 +354,7 @@ void OpenXRCompositionLayer::_notification(int p_what) {
composition_layer_extension->unregister_viewport_composition_layer_provider(openxr_layer_provider);
}
- // When a node is removed in the editor, we need to clear the layer viewport, because otherwise
- // there will be issues with the tracking in viewports_in_use, since nodes deleted in the editor
- // aren't really deleted in order to support undo.
- if (Engine::get_singleton()->is_editor_hint() && layer_viewport) {
- set_layer_viewport(nullptr);
- } else if (!fallback) {
+ if (!fallback) {
// This will clean up existing resources.
openxr_layer_provider->set_viewport(RID(), Size2i());
}
@@ -347,5 +410,9 @@ PackedStringArray OpenXRCompositionLayer::get_configuration_warnings() const {
warnings.push_back(RTR("OpenXR composition layers must have orthonormalized transforms (ie. no scale or shearing)."));
}
+ if (enable_hole_punch && get_sort_order() >= 0) {
+ warnings.push_back(RTR("Hole punching won't work as expected unless the sort order is less than zero."));
+ }
+
return warnings;
}
diff --git a/modules/openxr/scene/openxr_composition_layer.h b/modules/openxr/scene/openxr_composition_layer.h
index 9f064379d3..6792364295 100644
--- a/modules/openxr/scene/openxr_composition_layer.h
+++ b/modules/openxr/scene/openxr_composition_layer.h
@@ -46,13 +46,17 @@ class OpenXRCompositionLayer : public Node3D {
GDCLASS(OpenXRCompositionLayer, Node3D);
SubViewport *layer_viewport = nullptr;
+ bool enable_hole_punch = false;
MeshInstance3D *fallback = nullptr;
bool should_update_fallback_mesh = false;
+ bool openxr_session_running = false;
Dictionary extension_property_values;
+ bool _should_use_fallback_node();
void _create_fallback_node();
void _reset_fallback_material();
+ void _remove_fallback_node();
protected:
OpenXRAPI *openxr_api = nullptr;
@@ -73,12 +77,16 @@ protected:
void update_fallback_mesh();
- static HashSet<SubViewport *> viewports_in_use;
+ static Vector<OpenXRCompositionLayer *> composition_layer_nodes;
+ bool is_viewport_in_use(SubViewport *p_viewport);
public:
void set_layer_viewport(SubViewport *p_viewport);
SubViewport *get_layer_viewport() const;
+ void set_enable_hole_punch(bool p_enable);
+ bool get_enable_hole_punch() const;
+
void set_sort_order(int p_order);
int get_sort_order() const;
diff --git a/modules/openxr/scene/openxr_composition_layer_cylinder.cpp b/modules/openxr/scene/openxr_composition_layer_cylinder.cpp
index ae5a8da5f3..728ba71006 100644
--- a/modules/openxr/scene/openxr_composition_layer_cylinder.cpp
+++ b/modules/openxr/scene/openxr_composition_layer_cylinder.cpp
@@ -76,13 +76,6 @@ void OpenXRCompositionLayerCylinder::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "fallback_segments", PROPERTY_HINT_NONE, ""), "set_fallback_segments", "get_fallback_segments");
}
-void OpenXRCompositionLayerCylinder::_on_openxr_session_begun() {
- OpenXRCompositionLayer::_on_openxr_session_begun();
- if (openxr_api) {
- composition_layer.space = openxr_api->get_play_space();
- }
-}
-
Ref<Mesh> OpenXRCompositionLayerCylinder::_create_fallback_mesh() {
Ref<ArrayMesh> mesh;
mesh.instantiate();
diff --git a/modules/openxr/scene/openxr_composition_layer_cylinder.h b/modules/openxr/scene/openxr_composition_layer_cylinder.h
index aed0fabd78..bb1d242267 100644
--- a/modules/openxr/scene/openxr_composition_layer_cylinder.h
+++ b/modules/openxr/scene/openxr_composition_layer_cylinder.h
@@ -50,7 +50,6 @@ protected:
void _notification(int p_what);
- virtual void _on_openxr_session_begun() override;
virtual Ref<Mesh> _create_fallback_mesh() override;
public:
diff --git a/modules/openxr/scene/openxr_composition_layer_equirect.cpp b/modules/openxr/scene/openxr_composition_layer_equirect.cpp
index d67e71443c..14cfea8da6 100644
--- a/modules/openxr/scene/openxr_composition_layer_equirect.cpp
+++ b/modules/openxr/scene/openxr_composition_layer_equirect.cpp
@@ -81,13 +81,6 @@ void OpenXRCompositionLayerEquirect::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "fallback_segments", PROPERTY_HINT_NONE, ""), "set_fallback_segments", "get_fallback_segments");
}
-void OpenXRCompositionLayerEquirect::_on_openxr_session_begun() {
- OpenXRCompositionLayer::_on_openxr_session_begun();
- if (openxr_api) {
- composition_layer.space = openxr_api->get_play_space();
- }
-}
-
Ref<Mesh> OpenXRCompositionLayerEquirect::_create_fallback_mesh() {
Ref<ArrayMesh> mesh;
mesh.instantiate();
diff --git a/modules/openxr/scene/openxr_composition_layer_equirect.h b/modules/openxr/scene/openxr_composition_layer_equirect.h
index 7a002a48dc..66f8b0a91c 100644
--- a/modules/openxr/scene/openxr_composition_layer_equirect.h
+++ b/modules/openxr/scene/openxr_composition_layer_equirect.h
@@ -51,7 +51,6 @@ protected:
void _notification(int p_what);
- virtual void _on_openxr_session_begun() override;
virtual Ref<Mesh> _create_fallback_mesh() override;
public:
diff --git a/modules/openxr/scene/openxr_composition_layer_quad.cpp b/modules/openxr/scene/openxr_composition_layer_quad.cpp
index 17d57851e4..8c5b8ec26b 100644
--- a/modules/openxr/scene/openxr_composition_layer_quad.cpp
+++ b/modules/openxr/scene/openxr_composition_layer_quad.cpp
@@ -62,13 +62,6 @@ void OpenXRCompositionLayerQuad::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "quad_size", PROPERTY_HINT_NONE, ""), "set_quad_size", "get_quad_size");
}
-void OpenXRCompositionLayerQuad::_on_openxr_session_begun() {
- OpenXRCompositionLayer::_on_openxr_session_begun();
- if (openxr_api) {
- composition_layer.space = openxr_api->get_play_space();
- }
-}
-
Ref<Mesh> OpenXRCompositionLayerQuad::_create_fallback_mesh() {
Ref<QuadMesh> mesh;
mesh.instantiate();
diff --git a/modules/openxr/scene/openxr_composition_layer_quad.h b/modules/openxr/scene/openxr_composition_layer_quad.h
index d88b596984..21bb9b2d85 100644
--- a/modules/openxr/scene/openxr_composition_layer_quad.h
+++ b/modules/openxr/scene/openxr_composition_layer_quad.h
@@ -47,7 +47,6 @@ protected:
void _notification(int p_what);
- virtual void _on_openxr_session_begun() override;
virtual Ref<Mesh> _create_fallback_mesh() override;
public:
diff --git a/modules/regex/regex.cpp b/modules/regex/regex.cpp
index 4a1037431a..9f34a6ca6a 100644
--- a/modules/regex/regex.cpp
+++ b/modules/regex/regex.cpp
@@ -370,7 +370,7 @@ PackedStringArray RegEx::get_names() const {
for (uint32_t i = 0; i < count; i++) {
String name = &table[i * entry_size + 1];
- if (result.find(name) < 0) {
+ if (!result.has(name)) {
result.append(name);
}
}
diff --git a/modules/svg/SCsub b/modules/svg/SCsub
index ff0c3c9141..a32be0e41a 100644
--- a/modules/svg/SCsub
+++ b/modules/svg/SCsub
@@ -12,8 +12,8 @@ thirdparty_obj = []
thirdparty_dir = "#thirdparty/thorvg/"
thirdparty_sources = [
# common
- "src/common/tvgBezier.cpp",
"src/common/tvgCompressor.cpp",
+ "src/common/tvgLines.cpp",
"src/common/tvgMath.cpp",
"src/common/tvgStr.cpp",
# SVG parser
@@ -24,6 +24,7 @@ thirdparty_sources = [
"src/loaders/svg/tvgSvgUtil.cpp",
"src/loaders/svg/tvgXmlParser.cpp",
"src/loaders/raw/tvgRawLoader.cpp",
+ # image loaders
"src/loaders/external_png/tvgPngLoader.cpp",
"src/loaders/jpg/tvgJpgd.cpp",
"src/loaders/jpg/tvgJpgLoader.cpp",
@@ -57,6 +58,10 @@ thirdparty_sources = [
"src/renderer/sw_engine/tvgSwStroke.cpp",
]
+if env["module_webp_enabled"]:
+ thirdparty_sources += ["src/loaders/external_webp/tvgWebpLoader.cpp"]
+ env_svg.Append(CPPDEFINES=["THORVG_WEBP_LOADER_SUPPORT"])
+
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_svg.Prepend(CPPPATH=[thirdparty_dir + "inc"])
@@ -77,6 +82,12 @@ env_thirdparty.Prepend(
thirdparty_dir + "src/loaders/jpg",
]
)
+if env["builtin_libpng"]:
+ env_thirdparty.Prepend(CPPPATH=["#thirdparty/libpng"])
+if env["module_webp_enabled"]:
+ env_thirdparty.Prepend(CPPPATH=[thirdparty_dir + "src/loaders/external_webp"])
+ if env["builtin_libwebp"]:
+ env_thirdparty.Prepend(CPPPATH=["#thirdparty/libwebp/src"])
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj
diff --git a/modules/text_server_adv/SCsub b/modules/text_server_adv/SCsub
index 15695476de..68a5d499d4 100644
--- a/modules/text_server_adv/SCsub
+++ b/modules/text_server_adv/SCsub
@@ -468,7 +468,7 @@ if env["builtin_icu4c"]:
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
- icu_data_name = "icudt74l.dat"
+ icu_data_name = "icudt75l.dat"
if env.editor_build:
env_icu.Depends("#thirdparty/icu4c/icudata.gen.h", "#thirdparty/icu4c/" + icu_data_name)
diff --git a/modules/text_server_adv/gdextension_build/SConstruct b/modules/text_server_adv/gdextension_build/SConstruct
index fcf3f64315..58e1868e31 100644
--- a/modules/text_server_adv/gdextension_build/SConstruct
+++ b/modules/text_server_adv/gdextension_build/SConstruct
@@ -6,14 +6,21 @@ import time
# Enable ANSI escape code support on Windows 10 and later (for colored console output).
# <https://github.com/python/cpython/issues/73245>
-if sys.platform == "win32":
- from ctypes import windll, c_int, byref
-
- stdout_handle = windll.kernel32.GetStdHandle(c_int(-11))
- mode = c_int(0)
- windll.kernel32.GetConsoleMode(c_int(stdout_handle), byref(mode))
- mode = c_int(mode.value | 4)
- windll.kernel32.SetConsoleMode(c_int(stdout_handle), mode)
+if sys.stdout.isatty() and sys.platform == "win32":
+ try:
+ from ctypes import windll, byref, WinError # type: ignore
+ from ctypes.wintypes import DWORD # type: ignore
+
+ stdout_handle = windll.kernel32.GetStdHandle(DWORD(-11))
+ mode = DWORD(0)
+ if not windll.kernel32.GetConsoleMode(stdout_handle, byref(mode)):
+ raise WinError()
+ mode = DWORD(mode.value | 4)
+ if not windll.kernel32.SetConsoleMode(stdout_handle, mode):
+ raise WinError()
+ except Exception as e:
+ methods._colorize = False
+ methods.print_error(f"Failed to enable ANSI escape code support, disabling color output.\n{e}")
# For the reference:
# - CCFLAGS are compilation flags shared between C and C++
@@ -703,7 +710,7 @@ thirdparty_icu_sources = [
]
thirdparty_icu_sources = [thirdparty_icu_dir + file for file in thirdparty_icu_sources]
-icu_data_name = "icudt74l.dat"
+icu_data_name = "icudt75l.dat"
if env["static_icu_data"]:
env_icu.Depends("../../../thirdparty/icu4c/icudata.gen.h", "../../../thirdparty/icu4c/" + icu_data_name)
diff --git a/modules/text_server_adv/text_server_adv.h b/modules/text_server_adv/text_server_adv.h
index 7e29f984c1..8895a83089 100644
--- a/modules/text_server_adv/text_server_adv.h
+++ b/modules/text_server_adv/text_server_adv.h
@@ -389,54 +389,54 @@ class TextServerAdvanced : public TextServerExtension {
_FORCE_INLINE_ bool _get_tag_hidden(int64_t p_tag) const;
_FORCE_INLINE_ int _font_get_weight_by_name(const String &p_sty_name) const {
String sty_name = p_sty_name.replace(" ", "").replace("-", "");
- if (sty_name.find("thin") >= 0 || sty_name.find("hairline") >= 0) {
+ if (sty_name.contains("thin") || sty_name.contains("hairline")) {
return 100;
- } else if (sty_name.find("extralight") >= 0 || sty_name.find("ultralight") >= 0) {
+ } else if (sty_name.contains("extralight") || sty_name.contains("ultralight")) {
return 200;
- } else if (sty_name.find("light") >= 0) {
+ } else if (sty_name.contains("light")) {
return 300;
- } else if (sty_name.find("semilight") >= 0) {
+ } else if (sty_name.contains("semilight")) {
return 350;
- } else if (sty_name.find("regular") >= 0) {
+ } else if (sty_name.contains("regular")) {
return 400;
- } else if (sty_name.find("medium") >= 0) {
+ } else if (sty_name.contains("medium")) {
return 500;
- } else if (sty_name.find("semibold") >= 0 || sty_name.find("demibold") >= 0) {
+ } else if (sty_name.contains("semibold") || sty_name.contains("demibold")) {
return 600;
- } else if (sty_name.find("bold") >= 0) {
+ } else if (sty_name.contains("bold")) {
return 700;
- } else if (sty_name.find("extrabold") >= 0 || sty_name.find("ultrabold") >= 0) {
+ } else if (sty_name.contains("extrabold") || sty_name.contains("ultrabold")) {
return 800;
- } else if (sty_name.find("black") >= 0 || sty_name.find("heavy") >= 0) {
+ } else if (sty_name.contains("black") || sty_name.contains("heavy")) {
return 900;
- } else if (sty_name.find("extrablack") >= 0 || sty_name.find("ultrablack") >= 0) {
+ } else if (sty_name.contains("extrablack") || sty_name.contains("ultrablack")) {
return 950;
}
return 400;
}
_FORCE_INLINE_ int _font_get_stretch_by_name(const String &p_sty_name) const {
String sty_name = p_sty_name.replace(" ", "").replace("-", "");
- if (sty_name.find("ultracondensed") >= 0) {
+ if (sty_name.contains("ultracondensed")) {
return 50;
- } else if (sty_name.find("extracondensed") >= 0) {
+ } else if (sty_name.contains("extracondensed")) {
return 63;
- } else if (sty_name.find("condensed") >= 0) {
+ } else if (sty_name.contains("condensed")) {
return 75;
- } else if (sty_name.find("semicondensed") >= 0) {
+ } else if (sty_name.contains("semicondensed")) {
return 87;
- } else if (sty_name.find("semiexpanded") >= 0) {
+ } else if (sty_name.contains("semiexpanded")) {
return 113;
- } else if (sty_name.find("expanded") >= 0) {
+ } else if (sty_name.contains("expanded")) {
return 125;
- } else if (sty_name.find("extraexpanded") >= 0) {
+ } else if (sty_name.contains("extraexpanded")) {
return 150;
- } else if (sty_name.find("ultraexpanded") >= 0) {
+ } else if (sty_name.contains("ultraexpanded")) {
return 200;
}
return 100;
}
_FORCE_INLINE_ bool _is_ital_style(const String &p_sty_name) const {
- return (p_sty_name.find("italic") >= 0) || (p_sty_name.find("oblique") >= 0);
+ return p_sty_name.contains("italic") || p_sty_name.contains("oblique");
}
// Shaped text cache data.
diff --git a/modules/text_server_fb/gdextension_build/SConstruct b/modules/text_server_fb/gdextension_build/SConstruct
index 07940719eb..9326a53026 100644
--- a/modules/text_server_fb/gdextension_build/SConstruct
+++ b/modules/text_server_fb/gdextension_build/SConstruct
@@ -6,14 +6,21 @@ import time
# Enable ANSI escape code support on Windows 10 and later (for colored console output).
# <https://github.com/python/cpython/issues/73245>
-if sys.platform == "win32":
- from ctypes import windll, c_int, byref
-
- stdout_handle = windll.kernel32.GetStdHandle(c_int(-11))
- mode = c_int(0)
- windll.kernel32.GetConsoleMode(c_int(stdout_handle), byref(mode))
- mode = c_int(mode.value | 4)
- windll.kernel32.SetConsoleMode(c_int(stdout_handle), mode)
+if sys.stdout.isatty() and sys.platform == "win32":
+ try:
+ from ctypes import windll, byref, WinError # type: ignore
+ from ctypes.wintypes import DWORD # type: ignore
+
+ stdout_handle = windll.kernel32.GetStdHandle(DWORD(-11))
+ mode = DWORD(0)
+ if not windll.kernel32.GetConsoleMode(stdout_handle, byref(mode)):
+ raise WinError()
+ mode = DWORD(mode.value | 4)
+ if not windll.kernel32.SetConsoleMode(stdout_handle, mode):
+ raise WinError()
+ except Exception as e:
+ methods._colorize = False
+ methods.print_error(f"Failed to enable ANSI escape code support, disabling color output.\n{e}")
# For the reference:
# - CCFLAGS are compilation flags shared between C and C++
diff --git a/modules/text_server_fb/text_server_fb.h b/modules/text_server_fb/text_server_fb.h
index 31370c7da7..9ad20c7b26 100644
--- a/modules/text_server_fb/text_server_fb.h
+++ b/modules/text_server_fb/text_server_fb.h
@@ -335,54 +335,54 @@ class TextServerFallback : public TextServerExtension {
_FORCE_INLINE_ int _font_get_weight_by_name(const String &p_sty_name) const {
String sty_name = p_sty_name.replace(" ", "").replace("-", "");
- if (sty_name.find("thin") >= 0 || sty_name.find("hairline") >= 0) {
+ if (sty_name.contains("thin") || sty_name.contains("hairline")) {
return 100;
- } else if (sty_name.find("extralight") >= 0 || sty_name.find("ultralight") >= 0) {
+ } else if (sty_name.contains("extralight") || sty_name.contains("ultralight")) {
return 200;
- } else if (sty_name.find("light") >= 0) {
+ } else if (sty_name.contains("light")) {
return 300;
- } else if (sty_name.find("semilight") >= 0) {
+ } else if (sty_name.contains("semilight")) {
return 350;
- } else if (sty_name.find("regular") >= 0) {
+ } else if (sty_name.contains("regular")) {
return 400;
- } else if (sty_name.find("medium") >= 0) {
+ } else if (sty_name.contains("medium")) {
return 500;
- } else if (sty_name.find("semibold") >= 0 || sty_name.find("demibold") >= 0) {
+ } else if (sty_name.contains("semibold") || sty_name.contains("demibold")) {
return 600;
- } else if (sty_name.find("bold") >= 0) {
+ } else if (sty_name.contains("bold")) {
return 700;
- } else if (sty_name.find("extrabold") >= 0 || sty_name.find("ultrabold") >= 0) {
+ } else if (sty_name.contains("extrabold") || sty_name.contains("ultrabold")) {
return 800;
- } else if (sty_name.find("black") >= 0 || sty_name.find("heavy") >= 0) {
+ } else if (sty_name.contains("black") || sty_name.contains("heavy")) {
return 900;
- } else if (sty_name.find("extrablack") >= 0 || sty_name.find("ultrablack") >= 0) {
+ } else if (sty_name.contains("extrablack") || sty_name.contains("ultrablack")) {
return 950;
}
return 400;
}
_FORCE_INLINE_ int _font_get_stretch_by_name(const String &p_sty_name) const {
String sty_name = p_sty_name.replace(" ", "").replace("-", "");
- if (sty_name.find("ultracondensed") >= 0) {
+ if (sty_name.contains("ultracondensed")) {
return 50;
- } else if (sty_name.find("extracondensed") >= 0) {
+ } else if (sty_name.contains("extracondensed")) {
return 63;
- } else if (sty_name.find("condensed") >= 0) {
+ } else if (sty_name.contains("condensed")) {
return 75;
- } else if (sty_name.find("semicondensed") >= 0) {
+ } else if (sty_name.contains("semicondensed")) {
return 87;
- } else if (sty_name.find("semiexpanded") >= 0) {
+ } else if (sty_name.contains("semiexpanded")) {
return 113;
- } else if (sty_name.find("expanded") >= 0) {
+ } else if (sty_name.contains("expanded")) {
return 125;
- } else if (sty_name.find("extraexpanded") >= 0) {
+ } else if (sty_name.contains("extraexpanded")) {
return 150;
- } else if (sty_name.find("ultraexpanded") >= 0) {
+ } else if (sty_name.contains("ultraexpanded")) {
return 200;
}
return 100;
}
_FORCE_INLINE_ bool _is_ital_style(const String &p_sty_name) const {
- return (p_sty_name.find("italic") >= 0) || (p_sty_name.find("oblique") >= 0);
+ return p_sty_name.contains("italic") || p_sty_name.contains("oblique");
}
// Shaped text cache data.
diff --git a/modules/upnp/SCsub b/modules/upnp/SCsub
index 4b385b820d..98c03e9ee9 100644
--- a/modules/upnp/SCsub
+++ b/modules/upnp/SCsub
@@ -30,7 +30,8 @@ if env["builtin_miniupnpc"]:
env_upnp.Prepend(CPPPATH=[thirdparty_dir + "include"])
env_upnp.Append(CPPDEFINES=["MINIUPNP_STATICLIB"])
- env_upnp.Append(CPPDEFINES=["MINIUPNPC_SET_SOCKET_TIMEOUT"])
+ if env["platform"] != "windows":
+ env_upnp.Append(CPPDEFINES=["MINIUPNPC_SET_SOCKET_TIMEOUT"])
env_thirdparty = env_upnp.Clone()
env_thirdparty.disable_warnings()
diff --git a/modules/upnp/upnp.cpp b/modules/upnp/upnp.cpp
index 95453c1ecd..70f0ea346b 100644
--- a/modules/upnp/upnp.cpp
+++ b/modules/upnp/upnp.cpp
@@ -37,10 +37,10 @@
bool UPNP::is_common_device(const String &dev) const {
return dev.is_empty() ||
- dev.find("InternetGatewayDevice") >= 0 ||
- dev.find("WANIPConnection") >= 0 ||
- dev.find("WANPPPConnection") >= 0 ||
- dev.find("rootdevice") >= 0;
+ dev.contains("InternetGatewayDevice") ||
+ dev.contains("WANIPConnection") ||
+ dev.contains("WANPPPConnection") ||
+ dev.contains("rootdevice");
}
int UPNP::discover(int timeout, int ttl, const String &device_filter) {
diff --git a/modules/webp/SCsub b/modules/webp/SCsub
index e78236a60b..dde4450c23 100644
--- a/modules/webp/SCsub
+++ b/modules/webp/SCsub
@@ -128,6 +128,7 @@ if env["builtin_libwebp"]:
"src/utils/filters_utils.c",
"src/utils/huffman_encode_utils.c",
"src/utils/huffman_utils.c",
+ "src/utils/palette.c",
"src/utils/quant_levels_dec_utils.c",
"src/utils/quant_levels_utils.c",
"src/utils/random_utils.c",
diff --git a/modules/webrtc/webrtc_multiplayer_peer.cpp b/modules/webrtc/webrtc_multiplayer_peer.cpp
index 9224760c5b..45fa9f46ca 100644
--- a/modules/webrtc/webrtc_multiplayer_peer.cpp
+++ b/modules/webrtc/webrtc_multiplayer_peer.cpp
@@ -59,7 +59,7 @@ int WebRTCMultiplayerPeer::get_packet_channel() const {
MultiplayerPeer::TransferMode WebRTCMultiplayerPeer::get_packet_mode() const {
ERR_FAIL_INDEX_V(next_packet_channel, channels_modes.size(), TRANSFER_MODE_RELIABLE);
- return channels_modes[next_packet_channel];
+ return channels_modes.get(next_packet_channel);
}
bool WebRTCMultiplayerPeer::is_server() const {
@@ -308,18 +308,18 @@ Error WebRTCMultiplayerPeer::add_peer(Ref<WebRTCPeerConnection> p_peer, int p_pe
cfg["ordered"] = true;
cfg["id"] = 1;
- peer->channels[CH_RELIABLE] = p_peer->create_data_channel("reliable", cfg);
- ERR_FAIL_COND_V(peer->channels[CH_RELIABLE].is_null(), FAILED);
+ peer->channels.get(CH_RELIABLE) = p_peer->create_data_channel("reliable", cfg);
+ ERR_FAIL_COND_V(peer->channels.get(CH_RELIABLE).is_null(), FAILED);
cfg["id"] = 2;
cfg["maxPacketLifetime"] = p_unreliable_lifetime;
- peer->channels[CH_ORDERED] = p_peer->create_data_channel("ordered", cfg);
- ERR_FAIL_COND_V(peer->channels[CH_ORDERED].is_null(), FAILED);
+ peer->channels.get(CH_ORDERED) = p_peer->create_data_channel("ordered", cfg);
+ ERR_FAIL_COND_V(peer->channels.get(CH_ORDERED).is_null(), FAILED);
cfg["id"] = 3;
cfg["ordered"] = false;
- peer->channels[CH_UNRELIABLE] = p_peer->create_data_channel("unreliable", cfg);
- ERR_FAIL_COND_V(peer->channels[CH_UNRELIABLE].is_null(), FAILED);
+ peer->channels.get(CH_UNRELIABLE) = p_peer->create_data_channel("unreliable", cfg);
+ ERR_FAIL_COND_V(peer->channels.get(CH_UNRELIABLE).is_null(), FAILED);
for (const Dictionary &dict : channels_config) {
Ref<WebRTCDataChannel> ch = p_peer->create_data_channel(String::num_int64(dict["id"]), dict);
@@ -400,8 +400,8 @@ Error WebRTCMultiplayerPeer::put_packet(const uint8_t *p_buffer, int p_buffer_si
ERR_FAIL_COND_V_MSG(!E, ERR_INVALID_PARAMETER, "Invalid target peer: " + itos(target_peer) + ".");
ERR_FAIL_COND_V_MSG(E->value->channels.size() <= ch, ERR_INVALID_PARAMETER, vformat("Unable to send packet on channel %d, max channels: %d", ch, E->value->channels.size()));
- ERR_FAIL_COND_V(E->value->channels[ch].is_null(), ERR_BUG);
- return E->value->channels[ch]->put_packet(p_buffer, p_buffer_size);
+ ERR_FAIL_COND_V(E->value->channels.get(ch).is_null(), ERR_BUG);
+ return E->value->channels.get(ch)->put_packet(p_buffer, p_buffer_size);
} else {
int exclude = -target_peer;
@@ -413,8 +413,8 @@ Error WebRTCMultiplayerPeer::put_packet(const uint8_t *p_buffer, int p_buffer_si
}
ERR_CONTINUE_MSG(F.value->channels.size() <= ch, vformat("Unable to send packet on channel %d, max channels: %d", ch, F.value->channels.size()));
- ERR_CONTINUE(F.value->channels[ch].is_null());
- F.value->channels[ch]->put_packet(p_buffer, p_buffer_size);
+ ERR_CONTINUE(F.value->channels.get(ch).is_null());
+ F.value->channels.get(ch)->put_packet(p_buffer, p_buffer_size);
}
}
return OK;
diff --git a/modules/websocket/remote_debugger_peer_websocket.cpp b/modules/websocket/remote_debugger_peer_websocket.cpp
index dc6833e8c3..a40ea0205e 100644
--- a/modules/websocket/remote_debugger_peer_websocket.cpp
+++ b/modules/websocket/remote_debugger_peer_websocket.cpp
@@ -74,7 +74,7 @@ void RemoteDebuggerPeerWebSocket::poll() {
}
while (ws_peer->get_ready_state() == WebSocketPeer::STATE_OPEN && out_queue.size() > 0) {
- Array var = out_queue[0];
+ Array var = out_queue.front()->get();
Error err = ws_peer->put_var(var);
ERR_BREAK(err != OK); // Peer buffer full?
out_queue.pop_front();
@@ -92,7 +92,7 @@ bool RemoteDebuggerPeerWebSocket::has_message() {
Array RemoteDebuggerPeerWebSocket::get_message() {
ERR_FAIL_COND_V(in_queue.is_empty(), Array());
- Array msg = in_queue[0];
+ Array msg = in_queue.front()->get();
in_queue.pop_front();
return msg;
}
diff --git a/modules/webxr/webxr_interface_js.cpp b/modules/webxr/webxr_interface_js.cpp
index 45c1d8ec06..916566fc1b 100644
--- a/modules/webxr/webxr_interface_js.cpp
+++ b/modules/webxr/webxr_interface_js.cpp
@@ -39,6 +39,7 @@
#include "drivers/gles3/storage/texture_storage.h"
#include "scene/main/scene_tree.h"
#include "scene/main/window.h"
+#include "scene/scene_string_names.h"
#include "servers/rendering/renderer_compositor.h"
#include "servers/rendering/rendering_server_globals.h"
#include "servers/xr/xr_hand_tracker.h"
@@ -641,7 +642,7 @@ void WebXRInterfaceJS::_update_input_source(int p_input_source_id) {
}
Transform3D aim_transform = _js_matrix_to_transform(target_pose);
- tracker->set_pose(SNAME("default"), aim_transform, Vector3(), Vector3());
+ tracker->set_pose(SceneStringName(default_), aim_transform, Vector3(), Vector3());
tracker->set_pose(SNAME("aim"), aim_transform, Vector3(), Vector3());
if (has_grip_pose) {
tracker->set_pose(SNAME("grip"), _js_matrix_to_transform(grip_pose), Vector3(), Vector3());