summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.pre-commit-config.yaml3
-rw-r--r--COPYRIGHT.txt2
-rw-r--r--SConstruct26
-rw-r--r--core/config/project_settings.cpp6
-rw-r--r--core/core_string_names.cpp7
-rw-r--r--core/core_string_names.h5
-rw-r--r--core/variant/variant.h8
-rw-r--r--doc/classes/LightmapGI.xml3
-rw-r--r--doc/classes/ProjectSettings.xml4
-rw-r--r--doc/classes/TextServer.xml10
-rw-r--r--drivers/gles3/storage/mesh_storage.cpp19
-rw-r--r--editor/action_map_editor.cpp6
-rw-r--r--editor/animation_track_editor.cpp20
-rw-r--r--editor/code_editor.cpp16
-rw-r--r--editor/connections_dialog.cpp16
-rw-r--r--editor/create_dialog.cpp107
-rw-r--r--editor/create_dialog.h7
-rw-r--r--editor/debugger/debug_adapter/debug_adapter_protocol.cpp2
-rw-r--r--editor/debugger/editor_debugger_node.cpp2
-rw-r--r--editor/debugger/editor_profiler.cpp6
-rw-r--r--editor/debugger/editor_visual_profiler.cpp8
-rw-r--r--editor/debugger/script_editor_debugger.cpp28
-rw-r--r--editor/dependency_editor.cpp2
-rw-r--r--editor/editor_about.cpp2
-rw-r--r--editor/editor_asset_installer.cpp4
-rw-r--r--editor/editor_audio_buses.cpp24
-rw-r--r--editor/editor_autoload_settings.cpp4
-rw-r--r--editor/editor_build_profile.cpp12
-rw-r--r--editor/editor_dock_manager.cpp43
-rw-r--r--editor/editor_feature_profile.cpp12
-rw-r--r--editor/editor_help.cpp8
-rw-r--r--editor/editor_help_search.cpp4
-rw-r--r--editor/editor_inspector.cpp18
-rw-r--r--editor/editor_log.cpp4
-rw-r--r--editor/editor_node.cpp17
-rw-r--r--editor/editor_properties.cpp30
-rw-r--r--editor/editor_properties_array_dict.cpp20
-rw-r--r--editor/editor_properties_vector.cpp2
-rw-r--r--editor/editor_resource_picker.cpp4
-rw-r--r--editor/editor_settings_dialog.cpp8
-rw-r--r--editor/export/export_template_manager.cpp10
-rw-r--r--editor/export/project_export.cpp18
-rw-r--r--editor/fbx_importer_manager.cpp4
-rw-r--r--editor/filesystem_dock.cpp14
-rw-r--r--editor/find_in_files.cpp10
-rw-r--r--editor/group_settings_editor.cpp2
-rw-r--r--editor/groups_editor.cpp2
-rw-r--r--editor/gui/editor_bottom_panel.cpp2
-rw-r--r--editor/gui/editor_dir_dialog.cpp4
-rw-r--r--editor/gui/editor_file_dialog.cpp20
-rw-r--r--editor/gui/editor_object_selector.cpp2
-rw-r--r--editor/gui/editor_run_bar.cpp8
-rw-r--r--editor/gui/editor_scene_tabs.cpp2
-rw-r--r--editor/gui/editor_toaster.cpp8
-rw-r--r--editor/gui/editor_zoom_widget.cpp8
-rw-r--r--editor/import/3d/scene_import_settings.cpp12
-rw-r--r--editor/import/audio_stream_import_settings.cpp10
-rw-r--r--editor/import/dynamic_font_import_settings.cpp8
-rw-r--r--editor/import_defaults_editor.cpp4
-rw-r--r--editor/import_dock.cpp4
-rw-r--r--editor/inspector_dock.cpp12
-rw-r--r--editor/localization_editor.cpp12
-rw-r--r--editor/node_dock.cpp4
-rw-r--r--editor/plugins/abstract_polygon_2d_editor.cpp6
-rw-r--r--editor/plugins/animation_blend_space_1d_editor.cpp12
-rw-r--r--editor/plugins/animation_blend_space_2d_editor.cpp16
-rw-r--r--editor/plugins/animation_blend_tree_editor_plugin.cpp14
-rw-r--r--editor/plugins/animation_library_editor.cpp5
-rw-r--r--editor/plugins/animation_player_editor_plugin.cpp16
-rw-r--r--editor/plugins/animation_state_machine_editor.cpp12
-rw-r--r--editor/plugins/animation_tree_editor_plugin.cpp4
-rw-r--r--editor/plugins/asset_library_editor_plugin.cpp36
-rw-r--r--editor/plugins/audio_stream_editor_plugin.cpp4
-rw-r--r--editor/plugins/bone_map_editor_plugin.cpp6
-rw-r--r--editor/plugins/camera_3d_editor_plugin.cpp2
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp34
-rw-r--r--editor/plugins/control_editor_plugin.cpp10
-rw-r--r--editor/plugins/editor_plugin_settings.cpp2
-rw-r--r--editor/plugins/font_config_plugin.cpp14
-rw-r--r--editor/plugins/gpu_particles_collision_sdf_editor_plugin.cpp2
-rw-r--r--editor/plugins/gradient_editor_plugin.cpp2
-rw-r--r--editor/plugins/gradient_texture_2d_editor_plugin.cpp2
-rw-r--r--editor/plugins/input_event_editor_plugin.cpp2
-rw-r--r--editor/plugins/lightmap_gi_editor_plugin.cpp2
-rw-r--r--editor/plugins/material_editor_plugin.cpp8
-rw-r--r--editor/plugins/mesh_editor_plugin.cpp4
-rw-r--r--editor/plugins/mesh_library_editor_plugin.cpp6
-rw-r--r--editor/plugins/multimesh_editor_plugin.cpp6
-rw-r--r--editor/plugins/navigation_obstacle_2d_editor_plugin.cpp8
-rw-r--r--editor/plugins/navigation_obstacle_2d_editor_plugin.h3
-rw-r--r--editor/plugins/navigation_obstacle_3d_editor_plugin.cpp4
-rw-r--r--editor/plugins/navigation_polygon_editor_plugin.cpp4
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp42
-rw-r--r--editor/plugins/occluder_instance_3d_editor_plugin.cpp2
-rw-r--r--editor/plugins/packed_scene_editor_plugin.cpp2
-rw-r--r--editor/plugins/path_2d_editor_plugin.cpp12
-rw-r--r--editor/plugins/path_3d_editor_plugin.cpp24
-rw-r--r--editor/plugins/plugin_config_dialog.cpp2
-rw-r--r--editor/plugins/polygon_2d_editor_plugin.cpp16
-rw-r--r--editor/plugins/polygon_3d_editor_plugin.cpp4
-rw-r--r--editor/plugins/resource_preloader_editor_plugin.cpp4
-rw-r--r--editor/plugins/root_motion_editor_plugin.cpp4
-rw-r--r--editor/plugins/script_editor_plugin.cpp8
-rw-r--r--editor/plugins/shader_file_editor_plugin.cpp2
-rw-r--r--editor/plugins/skeleton_3d_editor_plugin.cpp4
-rw-r--r--editor/plugins/skeleton_ik_3d_editor_plugin.cpp2
-rw-r--r--editor/plugins/sprite_2d_editor_plugin.cpp2
-rw-r--r--editor/plugins/sprite_frames_editor_plugin.cpp54
-rw-r--r--editor/plugins/texture_region_editor_plugin.cpp8
-rw-r--r--editor/plugins/theme_editor_plugin.cpp74
-rw-r--r--editor/plugins/theme_editor_preview.cpp4
-rw-r--r--editor/plugins/tiles/tile_atlas_view.cpp2
-rw-r--r--editor/plugins/tiles/tile_data_editors.cpp2
-rw-r--r--editor/plugins/tiles/tile_map_layer_editor.cpp42
-rw-r--r--editor/plugins/tiles/tile_proxies_manager_dialog.cpp6
-rw-r--r--editor/plugins/tiles/tile_set_atlas_source_editor.cpp22
-rw-r--r--editor/plugins/tiles/tile_set_editor.cpp4
-rw-r--r--editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp4
-rw-r--r--editor/plugins/version_control_editor_plugin.cpp44
-rw-r--r--editor/plugins/visual_shader_editor_plugin.cpp26
-rw-r--r--editor/plugins/voxel_gi_editor_plugin.cpp2
-rw-r--r--editor/progress_dialog.cpp2
-rw-r--r--editor/project_manager.cpp50
-rw-r--r--editor/project_manager/project_dialog.cpp12
-rw-r--r--editor/project_manager/project_list.cpp4
-rw-r--r--editor/project_manager/project_tag.cpp2
-rw-r--r--editor/project_manager/quick_settings_dialog.cpp2
-rw-r--r--editor/project_settings_editor.cpp8
-rw-r--r--editor/rename_dialog.cpp20
-rw-r--r--editor/run_instances_dialog.cpp2
-rw-r--r--editor/scene_create_dialog.cpp4
-rw-r--r--editor/scene_tree_dock.cpp39
-rw-r--r--editor/script_create_dialog.cpp10
-rw-r--r--editor/shader_create_dialog.cpp2
-rw-r--r--editor/shader_globals_editor.cpp2
-rw-r--r--editor/themes/editor_theme_manager.cpp34
-rw-r--r--editor/window_wrapper.cpp6
-rw-r--r--misc/dist/macos_template.app/Contents/Resources/PrivacyInfo.xcprivacy8
-rwxr-xr-x[-rw-r--r--]misc/scripts/install_d3d12_sdk_windows.py38
-rw-r--r--misc/scripts/mypy.ini13
-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/gltf/editor/editor_scene_importer_blend.cpp2
-rw-r--r--modules/gridmap/editor/grid_map_editor_plugin.cpp4
-rw-r--r--modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp6
-rw-r--r--modules/lightmapper_rd/lightmapper_rd.cpp13
-rw-r--r--modules/lightmapper_rd/lightmapper_rd.h9
-rw-r--r--modules/lightmapper_rd/lm_compute.glsl5
-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/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/ScriptMethodsGenerator.cs9
-rw-r--r--modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs27
-rw-r--r--modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptSignalsGenerator.cs9
-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.cpp4
-rw-r--r--modules/navigation/editor/navigation_mesh_editor_plugin.cpp4
-rw-r--r--modules/noise/editor/noise_editor_plugin.cpp2
-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.cpp2
-rw-r--r--platform/linuxbsd/x11/display_server_x11.cpp67
-rw-r--r--platform/macos/doc_classes/EditorExportPlatformMacOS.xml426
-rw-r--r--platform/macos/export/export_plugin.cpp159
-rw-r--r--platform/macos/export/export_plugin.h1
-rw-r--r--pyproject.toml16
-rw-r--r--scene/2d/physics/joints/joint_2d.cpp8
-rw-r--r--scene/2d/touch_screen_button.cpp4
-rw-r--r--scene/3d/cpu_particles_3d.cpp2
-rw-r--r--scene/3d/lightmap_gi.cpp17
-rw-r--r--scene/3d/lightmap_gi.h4
-rw-r--r--scene/3d/lightmapper.h2
-rw-r--r--scene/3d/node_3d.cpp8
-rw-r--r--scene/3d/physics/joints/joint_3d.cpp8
-rw-r--r--scene/3d/visual_instance_3d.cpp4
-rw-r--r--scene/gui/base_button.cpp8
-rw-r--r--scene/gui/color_picker.cpp12
-rw-r--r--scene/gui/dialogs.cpp14
-rw-r--r--scene/gui/file_dialog.cpp10
-rw-r--r--scene/gui/graph_edit.cpp14
-rw-r--r--scene/gui/split_container.cpp22
-rw-r--r--scene/gui/split_container.h3
-rw-r--r--scene/main/node.cpp6
-rw-r--r--scene/main/status_indicator.cpp2
-rw-r--r--scene/resources/particle_process_material.cpp18
-rw-r--r--scene/scene_string_names.cpp82
-rw-r--r--scene/scene_string_names.h77
-rw-r--r--scene/theme/default_theme.cpp18
-rw-r--r--thirdparty/README.md6
-rw-r--r--thirdparty/astcenc/astcenc_entry.cpp2
-rw-r--r--thirdparty/astcenc/astcenc_integer_sequence.cpp8
-rw-r--r--thirdparty/astcenc/astcenc_internal.h32
-rw-r--r--thirdparty/astcenc/astcenc_internal_entry.h1
-rw-r--r--thirdparty/astcenc/astcenc_symbolic_physical.cpp21
-rw-r--r--thirdparty/astcenc/astcenc_vecmathlib_none_4.h17
-rw-r--r--thirdparty/enet/LICENSE2
-rw-r--r--thirdparty/enet/enet/enet.h2
-rw-r--r--thirdparty/harfbuzz/src/OT/Color/COLR/COLR.hh308
-rw-r--r--thirdparty/harfbuzz/src/OT/Color/COLR/colrv1-closure.hh50
-rw-r--r--thirdparty/harfbuzz/src/OT/Layout/GDEF/GDEF.hh41
-rw-r--r--thirdparty/harfbuzz/src/OT/Layout/GSUB/Ligature.hh15
-rw-r--r--thirdparty/harfbuzz/src/hb-aat-layout-common.hh203
-rw-r--r--thirdparty/harfbuzz/src/hb-aat-layout-kerx-table.hh183
-rw-r--r--thirdparty/harfbuzz/src/hb-aat-layout-morx-table.hh262
-rw-r--r--thirdparty/harfbuzz/src/hb-aat-layout.cc53
-rw-r--r--thirdparty/harfbuzz/src/hb-algs.hh4
-rw-r--r--thirdparty/harfbuzz/src/hb-cff2-interp-cs.hh8
-rw-r--r--thirdparty/harfbuzz/src/hb-cplusplus.hh3
-rw-r--r--thirdparty/harfbuzz/src/hb-ot-face-table-list.hh8
-rw-r--r--thirdparty/harfbuzz/src/hb-ot-face.cc2
-rw-r--r--thirdparty/harfbuzz/src/hb-ot-hmtx-table.hh3
-rw-r--r--thirdparty/harfbuzz/src/hb-ot-kern-table.hh71
-rw-r--r--thirdparty/harfbuzz/src/hb-ot-layout-base-table.hh75
-rw-r--r--thirdparty/harfbuzz/src/hb-ot-layout-common.hh14
-rw-r--r--thirdparty/harfbuzz/src/hb-ot-layout-gsubgpos.hh83
-rw-r--r--thirdparty/harfbuzz/src/hb-ot-layout.cc8
-rw-r--r--thirdparty/harfbuzz/src/hb-ot-os2-table.hh2
-rw-r--r--thirdparty/harfbuzz/src/hb-ot-post-table.hh2
-rw-r--r--thirdparty/harfbuzz/src/hb-ot-stat-table.hh3
-rw-r--r--thirdparty/harfbuzz/src/hb-ot-tag-table.hh45
-rw-r--r--thirdparty/harfbuzz/src/hb-ot-var-avar-table.hh8
-rw-r--r--thirdparty/harfbuzz/src/hb-ot-var-common.hh94
-rw-r--r--thirdparty/harfbuzz/src/hb-ot-var-fvar-table.hh7
-rw-r--r--thirdparty/harfbuzz/src/hb-ot-var-gvar-table.hh5
-rw-r--r--thirdparty/harfbuzz/src/hb-repacker.hh18
-rw-r--r--thirdparty/harfbuzz/src/hb-set-digest.hh20
-rw-r--r--thirdparty/harfbuzz/src/hb-set.hh2
-rw-r--r--thirdparty/harfbuzz/src/hb-subset-cff-common.hh57
-rw-r--r--thirdparty/harfbuzz/src/hb-subset-cff2.cc3
-rw-r--r--thirdparty/harfbuzz/src/hb-subset-input.cc15
-rw-r--r--thirdparty/harfbuzz/src/hb-subset-instancer-iup.cc68
-rw-r--r--thirdparty/harfbuzz/src/hb-subset-instancer-iup.hh2
-rw-r--r--thirdparty/harfbuzz/src/hb-subset-instancer-solver.cc94
-rw-r--r--thirdparty/harfbuzz/src/hb-subset-instancer-solver.hh32
-rw-r--r--thirdparty/harfbuzz/src/hb-subset-plan-member-list.hh8
-rw-r--r--thirdparty/harfbuzz/src/hb-subset-plan.cc185
-rw-r--r--thirdparty/harfbuzz/src/hb-subset.h11
-rw-r--r--thirdparty/harfbuzz/src/hb-version.h4
247 files changed, 3512 insertions, 1975 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index e59419ac08..5c0c0b6917 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -23,8 +23,6 @@ repos:
- id: black
files: (\.py$|SConstruct|SCsub)
types_or: [text]
- args:
- - --line-length=120
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.971
@@ -32,7 +30,6 @@ repos:
- id: mypy
files: \.py$
types_or: [text]
- args: [--config-file=./misc/scripts/mypy.ini]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
diff --git a/COPYRIGHT.txt b/COPYRIGHT.txt
index a7406da0fa..0438327106 100644
--- a/COPYRIGHT.txt
+++ b/COPYRIGHT.txt
@@ -216,7 +216,7 @@ License: Apache-2.0
Files: ./thirdparty/enet/
Comment: ENet
-Copyright: 2002-2020, Lee Salzman
+Copyright: 2002-2024, Lee Salzman
License: Expat
Files: ./thirdparty/etcpak/
diff --git a/SConstruct b/SConstruct
index f7c40416c7..07ec014cf9 100644
--- a/SConstruct
+++ b/SConstruct
@@ -287,6 +287,9 @@ opts.Add("ccflags", "Custom flags for both the C and C++ compilers")
opts.Add("cxxflags", "Custom flags for the C++ compiler")
opts.Add("cflags", "Custom flags for the C compiler")
opts.Add("linkflags", "Custom flags for the linker")
+opts.Add("asflags", "Custom flags for the assembler")
+opts.Add("arflags", "Custom flags for the archive tool")
+opts.Add("rcflags", "Custom flags for Windows resource compiler")
# Update the environment to have all above options defined
# in following code (especially platform and custom_modules).
@@ -533,6 +536,9 @@ env.Append(CCFLAGS=env.get("ccflags", "").split())
env.Append(CXXFLAGS=env.get("cxxflags", "").split())
env.Append(CFLAGS=env.get("cflags", "").split())
env.Append(LINKFLAGS=env.get("linkflags", "").split())
+env.Append(ASFLAGS=env.get("asflags", "").split())
+env.Append(ARFLAGS=env.get("arflags", "").split())
+env.Append(RCFLAGS=env.get("rcflags", "").split())
# Feature build profile
env.disabled_classes = []
@@ -614,22 +620,12 @@ if methods.using_gcc(env):
"Couldn't detect compiler version, skipping version checks. "
"Build may fail if the compiler doesn't support C++17 fully."
)
- # GCC 8 before 8.4 has a regression in the support of guaranteed copy elision
- # which causes a build failure: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86521
- elif cc_version_major == 8 and cc_version_minor < 4:
+ elif cc_version_major < 9:
print_error(
- "Detected GCC 8 version < 8.4, which is not supported due to a "
- "regression in its C++17 guaranteed copy elision support. Use a "
- 'newer GCC version, or Clang 6 or later by passing "use_llvm=yes" '
- "to the SCons command line."
- )
- Exit(255)
- elif cc_version_major < 7:
- print_error(
- "Detected GCC version older than 7, which does not fully support "
- "C++17. Supported versions are GCC 7, 9 and later. Use a newer GCC "
- 'version, or Clang 6 or later by passing "use_llvm=yes" to the '
- "SCons command line."
+ "Detected GCC version older than 9, which does not fully support "
+ "C++17, or has bugs when compiling Godot. Supported versions are 9 "
+ "and later. Use a newer GCC version, or Clang 6 or later by passing "
+ '"use_llvm=yes" to the SCons command line.'
)
Exit(255)
elif cc_version_metadata1 == "win32":
diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp
index 91d2f5d0c0..10cdf5b2e7 100644
--- a/core/config/project_settings.cpp
+++ b/core/config/project_settings.cpp
@@ -1556,7 +1556,11 @@ ProjectSettings::ProjectSettings() {
GLOBAL_DEF_RST("rendering/rendering_device/d3d12/max_misc_descriptors_per_frame", 512);
custom_prop_info["rendering/rendering_device/d3d12/max_misc_descriptors_per_frame"] = PropertyInfo(Variant::INT, "rendering/rendering_device/d3d12/max_misc_descriptors_per_frame", PROPERTY_HINT_RANGE, "32,4096");
- GLOBAL_DEF_RST(PropertyInfo(Variant::INT, "rendering/rendering_device/d3d12/agility_sdk_version"), 610);
+ // The default value must match the minor part of the Agility SDK version
+ // installed by the scripts provided in the repository
+ // (check `misc/scripts/install_d3d12_sdk_windows.py`).
+ // For example, if the script installs 1.613.3, the default value must be 613.
+ GLOBAL_DEF_RST(PropertyInfo(Variant::INT, "rendering/rendering_device/d3d12/agility_sdk_version"), 613);
GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "rendering/textures/canvas_textures/default_texture_filter", PROPERTY_HINT_ENUM, "Nearest,Linear,Linear Mipmap,Nearest Mipmap"), 1);
GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "rendering/textures/canvas_textures/default_texture_repeat", PROPERTY_HINT_ENUM, "Disable,Enable,Mirror"), 0);
diff --git a/core/core_string_names.cpp b/core/core_string_names.cpp
index 1ffe76495d..9bf625cc15 100644
--- a/core/core_string_names.cpp
+++ b/core/core_string_names.cpp
@@ -42,10 +42,8 @@ CoreStringNames::CoreStringNames() :
_iter_get(StaticCString::create("_iter_get")),
get_rid(StaticCString::create("get_rid")),
_to_string(StaticCString::create("_to_string")),
-#ifdef TOOLS_ENABLED
- _sections_unfolded(StaticCString::create("_sections_unfolded")),
-#endif
_custom_features(StaticCString::create("_custom_features")),
+
x(StaticCString::create("x")),
y(StaticCString::create("y")),
z(StaticCString::create("z")),
@@ -68,11 +66,10 @@ CoreStringNames::CoreStringNames() :
g8(StaticCString::create("g8")),
b8(StaticCString::create("b8")),
a8(StaticCString::create("a8")),
+
call(StaticCString::create("call")),
call_deferred(StaticCString::create("call_deferred")),
bind(StaticCString::create("bind")),
- unbind(StaticCString::create("unbind")),
- emit(StaticCString::create("emit")),
notification(StaticCString::create("notification")),
property_list_changed(StaticCString::create("property_list_changed")) {
}
diff --git a/core/core_string_names.h b/core/core_string_names.h
index d7ddc39f5e..d4ba9110c3 100644
--- a/core/core_string_names.h
+++ b/core/core_string_names.h
@@ -59,9 +59,6 @@ public:
StringName _iter_get;
StringName get_rid;
StringName _to_string;
-#ifdef TOOLS_ENABLED
- StringName _sections_unfolded;
-#endif
StringName _custom_features;
StringName x;
@@ -90,8 +87,6 @@ public:
StringName call;
StringName call_deferred;
StringName bind;
- StringName unbind;
- StringName emit;
StringName notification;
StringName property_list_changed;
};
diff --git a/core/variant/variant.h b/core/variant/variant.h
index 6494313722..f352af24da 100644
--- a/core/variant/variant.h
+++ b/core/variant/variant.h
@@ -165,10 +165,12 @@ private:
friend struct _VariantCall;
friend class VariantInternal;
- // Variant takes 20 bytes when real_t is float, and 36 if double
- // it only allocates extra memory for aabb/matrix.
+ // Variant takes 24 bytes when real_t is float, and 40 bytes if double.
+ // It only allocates extra memory for AABB/Transform2D (24, 48 if double),
+ // Basis/Transform3D (48, 96 if double), Projection (64, 128 if double),
+ // and PackedArray/Array/Dictionary (platform-dependent).
- Type type;
+ Type type = NIL;
struct ObjData {
ObjectID id;
diff --git a/doc/classes/LightmapGI.xml b/doc/classes/LightmapGI.xml
index 13d48d8650..6fb15e4d21 100644
--- a/doc/classes/LightmapGI.xml
+++ b/doc/classes/LightmapGI.xml
@@ -28,6 +28,9 @@
<member name="camera_attributes" type="CameraAttributes" setter="set_camera_attributes" getter="get_camera_attributes">
The [CameraAttributes] resource that specifies exposure levels to bake at. Auto-exposure and non exposure properties will be ignored. Exposure settings should be used to reduce the dynamic range present when baking. If exposure is too high, the [LightmapGI] will have banding artifacts or may have over-exposure artifacts.
</member>
+ <member name="denoiser_range" type="int" setter="set_denoiser_range" getter="get_denoiser_range" default="10">
+ The distance in pixels from which the denoiser samples. Lower values preserve more details, but may give blotchy results if the lightmap quality is not high enough. Only effective if [member use_denoiser] is [code]true[/code] and [member ProjectSettings.rendering/lightmapping/denoising/denoiser] is set to JNLM.
+ </member>
<member name="denoiser_strength" type="float" setter="set_denoiser_strength" getter="get_denoiser_strength" default="0.1">
The strength of denoising step applied to the generated lightmaps. Only effective if [member use_denoiser] is [code]true[/code] and [member ProjectSettings.rendering/lightmapping/denoising/denoiser] is set to JNLM.
</member>
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index e8d7dfb913..926d981f68 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -2713,8 +2713,8 @@
<member name="rendering/renderer/rendering_method.web" type="String" setter="" getter="" default="&quot;gl_compatibility&quot;">
Override for [member rendering/renderer/rendering_method] on web.
</member>
- <member name="rendering/rendering_device/d3d12/agility_sdk_version" type="int" setter="" getter="" default="610">
- Version code of the Direct3D 12 Agility SDK to use ([code]D3D12SDKVersion[/code]).
+ <member name="rendering/rendering_device/d3d12/agility_sdk_version" type="int" setter="" getter="" default="613">
+ Version code of the [url=https://devblogs.microsoft.com/directx/directx12agility/]Direct3D 12 Agility SDK[/url] to use ([code]D3D12SDKVersion[/code]). This must match the [i]minor[/i] version that is installed next to the editor binary and in the export templates directory for the current editor version. For example, if you have [code]1.613.3[/code] installed, you need to input [code]613[/code] here.
</member>
<member name="rendering/rendering_device/d3d12/max_misc_descriptors_per_frame" type="int" setter="" getter="" default="512">
The number of entries in the miscellaneous descriptors heap the Direct3D 12 rendering driver uses each frame, used for various operations like clearing a texture.
diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml
index 7579a3938f..34137a18ef 100644
--- a/doc/classes/TextServer.xml
+++ b/doc/classes/TextServer.xml
@@ -5,6 +5,16 @@
</brief_description>
<description>
[TextServer] is the API backend for managing fonts and rendering text.
+ [b]Note:[/b] This is a low-level API, consider using [TextLine], [TextParagraph], and [Font] classes instead.
+ This is an abstract class, so to get the currently active [TextServer] instance, use the following code:
+ [codeblocks]
+ [gdscript]
+ var ts = TextServerManager.get_primary_interface()
+ [/gdscript]
+ [csharp]
+ var ts = TextServerManager.GetPrimaryInterface();
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
</tutorials>
diff --git a/drivers/gles3/storage/mesh_storage.cpp b/drivers/gles3/storage/mesh_storage.cpp
index e073db3cfd..d8a5b960b8 100644
--- a/drivers/gles3/storage/mesh_storage.cpp
+++ b/drivers/gles3/storage/mesh_storage.cpp
@@ -1936,6 +1936,11 @@ void MeshStorage::multimesh_set_buffer(RID p_multimesh, const Vector<float> &p_b
glBindBuffer(GL_ARRAY_BUFFER, 0);
} else {
+ // If we have a data cache, just update it.
+ if (multimesh->data_cache.size()) {
+ multimesh->data_cache = p_buffer;
+ }
+
// Only Transform is being used, so we can upload directly.
ERR_FAIL_COND(p_buffer.size() != (multimesh->instances * (int)multimesh->stride_cache));
const float *r = p_buffer.ptr();
@@ -1947,16 +1952,12 @@ void MeshStorage::multimesh_set_buffer(RID p_multimesh, const Vector<float> &p_b
multimesh->buffer_set = true;
if (multimesh->data_cache.size() || multimesh->uses_colors || multimesh->uses_custom_data) {
- //if we have a data cache, just update it
- multimesh->data_cache = multimesh->data_cache;
- {
- //clear dirty since nothing will be dirty anymore
- uint32_t data_cache_dirty_region_count = Math::division_round_up(multimesh->instances, MULTIMESH_DIRTY_REGION_SIZE);
- for (uint32_t i = 0; i < data_cache_dirty_region_count; i++) {
- multimesh->data_cache_dirty_regions[i] = false;
- }
- multimesh->data_cache_used_dirty_regions = 0;
+ // Clear dirty since nothing will be dirty anymore.
+ uint32_t data_cache_dirty_region_count = Math::division_round_up(multimesh->instances, MULTIMESH_DIRTY_REGION_SIZE);
+ for (uint32_t i = 0; i < data_cache_dirty_region_count; i++) {
+ multimesh->data_cache_dirty_regions[i] = false;
}
+ multimesh->data_cache_used_dirty_regions = 0;
_multimesh_mark_all_dirty(multimesh, false, true); //update AABB
} else if (multimesh->mesh.is_valid()) {
diff --git a/editor/action_map_editor.cpp b/editor/action_map_editor.cpp
index bc3db3f7fa..6ff0520ab6 100644
--- a/editor/action_map_editor.cpp
+++ b/editor/action_map_editor.cpp
@@ -552,8 +552,8 @@ ActionMapEditor::ActionMapEditor() {
Button *clear_all_search = memnew(Button);
clear_all_search->set_text(TTR("Clear All"));
- clear_all_search->connect("pressed", callable_mp(action_list_search_by_event, &EventListenerLineEdit::clear_event));
- clear_all_search->connect("pressed", callable_mp(action_list_search, &LineEdit::clear));
+ clear_all_search->connect(SceneStringName(pressed), callable_mp(action_list_search_by_event, &EventListenerLineEdit::clear_event));
+ clear_all_search->connect(SceneStringName(pressed), callable_mp(action_list_search, &LineEdit::clear));
top_hbox->add_child(clear_all_search);
// Adding Action line edit + button
@@ -570,7 +570,7 @@ ActionMapEditor::ActionMapEditor() {
add_button = memnew(Button);
add_button->set_text(TTR("Add"));
- add_button->connect("pressed", callable_mp(this, &ActionMapEditor::_add_action_pressed));
+ add_button->connect(SceneStringName(pressed), callable_mp(this, &ActionMapEditor::_add_action_pressed));
add_hbox->add_child(add_button);
// Disable the button and set its tooltip.
_add_edit_text_changed(add_edit->get_text());
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index e6de641d3c..ebb63dd57c 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -1924,7 +1924,7 @@ AnimationTimelineEdit::AnimationTimelineEdit() {
loop = memnew(Button);
loop->set_flat(true);
loop->set_tooltip_text(TTR("Animation Looping"));
- loop->connect("pressed", callable_mp(this, &AnimationTimelineEdit::_anim_loop_pressed));
+ loop->connect(SceneStringName(pressed), callable_mp(this, &AnimationTimelineEdit::_anim_loop_pressed));
loop->set_toggle_mode(true);
len_hb->add_child(loop);
add_child(len_hb);
@@ -7226,21 +7226,21 @@ AnimationTrackEditor::AnimationTrackEditor() {
imported_anim_warning->hide();
imported_anim_warning->set_text(TTR("Imported Scene"));
imported_anim_warning->set_tooltip_text(TTR("Warning: Editing imported animation"));
- imported_anim_warning->connect("pressed", callable_mp(this, &AnimationTrackEditor::_show_imported_anim_warning));
+ imported_anim_warning->connect(SceneStringName(pressed), callable_mp(this, &AnimationTrackEditor::_show_imported_anim_warning));
bottom_hb->add_child(imported_anim_warning);
dummy_player_warning = memnew(Button);
dummy_player_warning->hide();
dummy_player_warning->set_text(TTR("Dummy Player"));
dummy_player_warning->set_tooltip_text(TTR("Warning: Editing dummy AnimationPlayer"));
- dummy_player_warning->connect("pressed", callable_mp(this, &AnimationTrackEditor::_show_dummy_player_warning));
+ dummy_player_warning->connect(SceneStringName(pressed), callable_mp(this, &AnimationTrackEditor::_show_dummy_player_warning));
bottom_hb->add_child(dummy_player_warning);
inactive_player_warning = memnew(Button);
inactive_player_warning->hide();
inactive_player_warning->set_text(TTR("Inactive Player"));
inactive_player_warning->set_tooltip_text(TTR("Warning: AnimationPlayer is inactive"));
- inactive_player_warning->connect("pressed", callable_mp(this, &AnimationTrackEditor::_show_inactive_player_warning));
+ inactive_player_warning->connect(SceneStringName(pressed), callable_mp(this, &AnimationTrackEditor::_show_inactive_player_warning));
bottom_hb->add_child(inactive_player_warning);
bottom_hb->add_spacer();
@@ -7249,14 +7249,14 @@ AnimationTrackEditor::AnimationTrackEditor() {
bezier_edit_icon->set_flat(true);
bezier_edit_icon->set_disabled(true);
bezier_edit_icon->set_toggle_mode(true);
- bezier_edit_icon->connect("pressed", callable_mp(this, &AnimationTrackEditor::_toggle_bezier_edit));
+ bezier_edit_icon->connect(SceneStringName(pressed), callable_mp(this, &AnimationTrackEditor::_toggle_bezier_edit));
bezier_edit_icon->set_tooltip_text(TTR("Toggle between the bezier curve editor and track editor."));
bottom_hb->add_child(bezier_edit_icon);
selected_filter = memnew(Button);
selected_filter->set_flat(true);
- selected_filter->connect("pressed", callable_mp(this, &AnimationTrackEditor::_view_group_toggle)); // Same function works the same.
+ selected_filter->connect(SceneStringName(pressed), callable_mp(this, &AnimationTrackEditor::_view_group_toggle)); // Same function works the same.
selected_filter->set_toggle_mode(true);
selected_filter->set_tooltip_text(TTR("Only show tracks from nodes selected in tree."));
@@ -7264,7 +7264,7 @@ AnimationTrackEditor::AnimationTrackEditor() {
view_group = memnew(Button);
view_group->set_flat(true);
- view_group->connect("pressed", callable_mp(this, &AnimationTrackEditor::_view_group_toggle));
+ view_group->connect(SceneStringName(pressed), callable_mp(this, &AnimationTrackEditor::_view_group_toggle));
view_group->set_toggle_mode(true);
view_group->set_tooltip_text(TTR("Group tracks by node or display them as plain list."));
@@ -7314,14 +7314,14 @@ AnimationTrackEditor::AnimationTrackEditor() {
auto_fit = memnew(Button);
auto_fit->set_flat(true);
- auto_fit->connect("pressed", callable_mp(this, &AnimationTrackEditor::_auto_fit));
+ auto_fit->connect(SceneStringName(pressed), callable_mp(this, &AnimationTrackEditor::_auto_fit));
auto_fit->set_shortcut(ED_SHORTCUT("animation_editor/auto_fit", TTR("Fit to panel"), KeyModifierMask::ALT | Key::F));
bottom_hb->add_child(auto_fit);
auto_fit_bezier = memnew(Button);
auto_fit_bezier->set_flat(true);
auto_fit_bezier->set_visible(false);
- auto_fit_bezier->connect("pressed", callable_mp(this, &AnimationTrackEditor::_auto_fit_bezier));
+ auto_fit_bezier->connect(SceneStringName(pressed), callable_mp(this, &AnimationTrackEditor::_auto_fit_bezier));
auto_fit_bezier->set_shortcut(ED_SHORTCUT("animation_editor/auto_fit", TTR("Fit to panel"), KeyModifierMask::ALT | Key::F));
bottom_hb->add_child(auto_fit_bezier);
@@ -7572,7 +7572,7 @@ AnimationTrackEditor::AnimationTrackEditor() {
Button *select_all_button = memnew(Button);
select_all_button->set_text(TTR("Select All/None"));
- select_all_button->connect("pressed", callable_mp(this, &AnimationTrackEditor::_select_all_tracks_for_copy));
+ select_all_button->connect(SceneStringName(pressed), callable_mp(this, &AnimationTrackEditor::_select_all_tracks_for_copy));
track_copy_vbox->add_child(select_all_button);
track_copy_select = memnew(Tree);
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index 2a398c65d8..ee0108df8e 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -721,14 +721,14 @@ FindReplaceBar::FindReplaceBar() {
find_prev->set_tooltip_text(TTR("Previous Match"));
hbc_button_search->add_child(find_prev);
find_prev->set_focus_mode(FOCUS_NONE);
- find_prev->connect("pressed", callable_mp(this, &FindReplaceBar::search_prev));
+ find_prev->connect(SceneStringName(pressed), callable_mp(this, &FindReplaceBar::search_prev));
find_next = memnew(Button);
find_next->set_flat(true);
find_next->set_tooltip_text(TTR("Next Match"));
hbc_button_search->add_child(find_next);
find_next->set_focus_mode(FOCUS_NONE);
- find_next->connect("pressed", callable_mp(this, &FindReplaceBar::search_next));
+ find_next->connect(SceneStringName(pressed), callable_mp(this, &FindReplaceBar::search_next));
case_sensitive = memnew(CheckBox);
hbc_option_search->add_child(case_sensitive);
@@ -754,12 +754,12 @@ FindReplaceBar::FindReplaceBar() {
replace = memnew(Button);
hbc_button_replace->add_child(replace);
replace->set_text(TTR("Replace"));
- replace->connect("pressed", callable_mp(this, &FindReplaceBar::_replace));
+ replace->connect(SceneStringName(pressed), callable_mp(this, &FindReplaceBar::_replace));
replace_all = memnew(Button);
hbc_button_replace->add_child(replace_all);
replace_all->set_text(TTR("Replace All"));
- replace_all->connect("pressed", callable_mp(this, &FindReplaceBar::_replace_all));
+ replace_all->connect(SceneStringName(pressed), callable_mp(this, &FindReplaceBar::_replace_all));
selection_only = memnew(CheckBox);
hbc_option_replace->add_child(selection_only);
@@ -771,7 +771,7 @@ FindReplaceBar::FindReplaceBar() {
add_child(hide_button);
hide_button->set_tooltip_text(TTR("Hide"));
hide_button->set_focus_mode(FOCUS_NONE);
- hide_button->connect("pressed", callable_mp(this, &FindReplaceBar::_hide_bar).bind(false));
+ hide_button->connect(SceneStringName(pressed), callable_mp(this, &FindReplaceBar::_hide_bar).bind(false));
hide_button->set_v_size_flags(SIZE_SHRINK_CENTER);
}
@@ -1713,7 +1713,7 @@ CodeTextEditor::CodeTextEditor() {
toggle_scripts_button = memnew(Button);
toggle_scripts_button->set_flat(true);
toggle_scripts_button->set_v_size_flags(SIZE_EXPAND | SIZE_SHRINK_CENTER);
- toggle_scripts_button->connect("pressed", callable_mp(this, &CodeTextEditor::_toggle_scripts_pressed));
+ toggle_scripts_button->connect(SceneStringName(pressed), callable_mp(this, &CodeTextEditor::_toggle_scripts_pressed));
status_bar->add_child(toggle_scripts_button);
toggle_scripts_button->hide();
@@ -1736,7 +1736,7 @@ CodeTextEditor::CodeTextEditor() {
status_bar->add_child(error_button);
error_button->set_v_size_flags(SIZE_EXPAND | SIZE_SHRINK_CENTER);
error_button->set_default_cursor_shape(CURSOR_POINTING_HAND);
- error_button->connect("pressed", callable_mp(this, &CodeTextEditor::_error_button_pressed));
+ error_button->connect(SceneStringName(pressed), callable_mp(this, &CodeTextEditor::_error_button_pressed));
error_button->set_tooltip_text(TTR("Errors"));
set_error_count(0);
@@ -1746,7 +1746,7 @@ CodeTextEditor::CodeTextEditor() {
status_bar->add_child(warning_button);
warning_button->set_v_size_flags(SIZE_EXPAND | SIZE_SHRINK_CENTER);
warning_button->set_default_cursor_shape(CURSOR_POINTING_HAND);
- warning_button->connect("pressed", callable_mp(this, &CodeTextEditor::_warning_button_pressed));
+ warning_button->connect(SceneStringName(pressed), callable_mp(this, &CodeTextEditor::_warning_button_pressed));
warning_button->set_tooltip_text(TTR("Warnings"));
set_warning_count(0);
diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp
index 187e6b7298..cb775a67e7 100644
--- a/editor/connections_dialog.cpp
+++ b/editor/connections_dialog.cpp
@@ -721,7 +721,7 @@ ConnectDialog::ConnectDialog() {
Button *focus_current = memnew(Button);
hbc_filter->add_child(focus_current);
focus_current->set_text(TTR("Go to Source"));
- focus_current->connect("pressed", callable_mp(this, &ConnectDialog::_focus_currently_connected));
+ focus_current->connect(SceneStringName(pressed), callable_mp(this, &ConnectDialog::_focus_currently_connected));
Node *mc = vbc_left->add_margin_child(TTR("Connect to Script:"), hbc_filter, false);
connect_to_label = Object::cast_to<Label>(vbc_left->get_child(mc->get_index() - 1));
@@ -768,13 +768,13 @@ ConnectDialog::ConnectDialog() {
method_vbc->add_child(script_methods_only);
script_methods_only->set_h_size_flags(Control::SIZE_SHRINK_END);
script_methods_only->set_pressed(EditorSettings::get_singleton()->get_project_metadata("editor_metadata", "show_script_methods_only", true));
- script_methods_only->connect("pressed", callable_mp(this, &ConnectDialog::_method_check_button_pressed).bind(script_methods_only));
+ script_methods_only->connect(SceneStringName(pressed), callable_mp(this, &ConnectDialog::_method_check_button_pressed).bind(script_methods_only));
compatible_methods_only = memnew(CheckButton(TTR("Compatible Methods Only")));
method_vbc->add_child(compatible_methods_only);
compatible_methods_only->set_h_size_flags(Control::SIZE_SHRINK_END);
compatible_methods_only->set_pressed(EditorSettings::get_singleton()->get_project_metadata("editor_metadata", "show_compatible_methods_only", true));
- compatible_methods_only->connect("pressed", callable_mp(this, &ConnectDialog::_method_check_button_pressed).bind(compatible_methods_only));
+ compatible_methods_only->connect(SceneStringName(pressed), callable_mp(this, &ConnectDialog::_method_check_button_pressed).bind(compatible_methods_only));
vbc_right = memnew(VBoxContainer);
main_hb->add_child(vbc_right);
@@ -800,13 +800,13 @@ ConnectDialog::ConnectDialog() {
Button *add_bind = memnew(Button);
add_bind->set_text(TTR("Add"));
add_bind_hb->add_child(add_bind);
- add_bind->connect("pressed", callable_mp(this, &ConnectDialog::_add_bind));
+ add_bind->connect(SceneStringName(pressed), callable_mp(this, &ConnectDialog::_add_bind));
bind_controls.push_back(add_bind);
Button *del_bind = memnew(Button);
del_bind->set_text(TTR("Remove"));
add_bind_hb->add_child(del_bind);
- del_bind->connect("pressed", callable_mp(this, &ConnectDialog::_remove_bind));
+ del_bind->connect(SceneStringName(pressed), callable_mp(this, &ConnectDialog::_remove_bind));
bind_controls.push_back(del_bind);
vbc_right->add_margin_child(TTR("Add Extra Call Argument:"), add_bind_hb);
@@ -834,13 +834,13 @@ ConnectDialog::ConnectDialog() {
open_method_tree = memnew(Button);
hbc_method->add_child(open_method_tree);
open_method_tree->set_text("Pick");
- open_method_tree->connect("pressed", callable_mp(this, &ConnectDialog::_open_method_popup));
+ open_method_tree->connect(SceneStringName(pressed), callable_mp(this, &ConnectDialog::_open_method_popup));
advanced = memnew(CheckButton(TTR("Advanced")));
vbc_left->add_child(advanced);
advanced->set_h_size_flags(Control::SIZE_SHRINK_BEGIN | Control::SIZE_EXPAND);
advanced->set_pressed(EditorSettings::get_singleton()->get_project_metadata("editor_metadata", "use_advanced_connections", false));
- advanced->connect("pressed", callable_mp(this, &ConnectDialog::_advanced_pressed));
+ advanced->connect(SceneStringName(pressed), callable_mp(this, &ConnectDialog::_advanced_pressed));
HBoxContainer *hbox = memnew(HBoxContainer);
vbc_right->add_child(hbox);
@@ -1583,7 +1583,7 @@ ConnectionsDock::ConnectionsDock() {
vbc->add_child(hb);
hb->add_spacer();
hb->add_child(connect_button);
- connect_button->connect("pressed", callable_mp(this, &ConnectionsDock::_connect_pressed));
+ connect_button->connect(SceneStringName(pressed), callable_mp(this, &ConnectionsDock::_connect_pressed));
connect_dialog = memnew(ConnectDialog);
connect_dialog->connect("connected", callable_mp(NodeDock::get_singleton(), &NodeDock::restore_last_valid_node), CONNECT_DEFERRED);
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp
index 2980054413..2b36b9254c 100644
--- a/editor/create_dialog.cpp
+++ b/editor/create_dialog.cpp
@@ -85,7 +85,7 @@ void CreateDialog::_fill_type_list() {
EditorData &ed = EditorNode::get_editor_data();
for (List<StringName>::Element *I = complete_type_list.front(); I; I = I->next()) {
- String type = I->get();
+ StringName type = I->get();
if (!_should_hide_type(type)) {
type_list.push_back(type);
@@ -118,12 +118,12 @@ bool CreateDialog::_is_class_disabled_by_feature_profile(const StringName &p_cla
return !profile.is_null() && profile->is_class_disabled(p_class);
}
-bool CreateDialog::_should_hide_type(const String &p_type) const {
+bool CreateDialog::_should_hide_type(const StringName &p_type) const {
if (_is_class_disabled_by_feature_profile(p_type)) {
return true;
}
- if (is_base_type_node && p_type.begins_with("Editor")) {
+ if (is_base_type_node && p_type.operator String().begins_with("Editor")) {
return true; // Do not show editor nodes.
}
@@ -146,12 +146,12 @@ bool CreateDialog::_should_hide_type(const String &p_type) const {
}
}
} else {
- if (!EditorNode::get_editor_data().script_class_is_parent(p_type, base_type)) {
- return true; // Wrong inheritance.
- }
if (!ScriptServer::is_global_class(p_type)) {
return true;
}
+ if (!EditorNode::get_editor_data().script_class_is_parent(p_type, base_type)) {
+ return true; // Wrong inheritance.
+ }
StringName native_type = ScriptServer::get_global_class_native_base(p_type);
if (ClassDB::class_exists(native_type) && !ClassDB::can_instantiate(native_type)) {
@@ -182,24 +182,30 @@ void CreateDialog::_update_search() {
const String search_text = search_box->get_text();
bool empty_search = search_text.is_empty();
- // Filter all candidate results.
- Vector<String> candidates;
+ float highest_score = 0.0f;
+ StringName best_match;
+
for (List<StringName>::Element *I = type_list.front(); I; I = I->next()) {
- if (empty_search || search_text.is_subsequence_ofn(I->get())) {
- candidates.push_back(I->get());
+ StringName candidate = I->get();
+ if (empty_search || search_text.is_subsequence_ofn(candidate)) {
+ _add_type(candidate, ClassDB::class_exists(candidate) ? TypeCategory::CPP_TYPE : TypeCategory::OTHER_TYPE);
+
+ // Determine the best match for an non-empty search.
+ if (!empty_search) {
+ float score = _score_type(candidate.operator String().get_slicec(' ', 0), search_text);
+ if (score > highest_score) {
+ highest_score = score;
+ best_match = candidate;
+ }
+ }
}
}
- // Build the type tree.
- for (int i = 0; i < candidates.size(); i++) {
- _add_type(candidates[i], ClassDB::class_exists(candidates[i]) ? TypeCategory::CPP_TYPE : TypeCategory::OTHER_TYPE);
- }
-
// Select the best result.
if (empty_search) {
select_type(base_type);
- } else if (candidates.size() > 0) {
- select_type(_top_result(candidates, search_text));
+ } else if (best_match != StringName()) {
+ select_type(best_match);
} else {
favorite->set_disabled(true);
help_bit->set_custom_text(String(), String(), vformat(TTR("No results for \"%s\"."), search_text.replace("[", "[lb]")));
@@ -208,52 +214,43 @@ void CreateDialog::_update_search() {
}
}
-void CreateDialog::_add_type(const String &p_type, const TypeCategory p_type_category) {
+void CreateDialog::_add_type(const StringName &p_type, TypeCategory p_type_category) {
if (search_options_types.has(p_type)) {
return;
}
- String inherits;
-
TypeCategory inherited_type = TypeCategory::OTHER_TYPE;
+ StringName inherits;
if (p_type_category == TypeCategory::CPP_TYPE) {
inherits = ClassDB::get_parent_class(p_type);
inherited_type = TypeCategory::CPP_TYPE;
- } else if (p_type_category == TypeCategory::PATH_TYPE) {
- ERR_FAIL_COND(!ResourceLoader::exists(p_type, "Script"));
- Ref<Script> scr = ResourceLoader::load(p_type, "Script");
- ERR_FAIL_COND(scr.is_null());
-
- Ref<Script> base = scr->get_base_script();
- if (base.is_null()) {
- String extends;
- scr->get_language()->get_global_class_name(scr->get_path(), &extends);
-
- inherits = extends;
- inherited_type = TypeCategory::CPP_TYPE;
- } else {
- inherits = scr->get_language()->get_global_class_name(base->get_path());
- if (inherits.is_empty()) {
- inherits = base->get_path();
- inherited_type = TypeCategory::PATH_TYPE;
- }
- }
} else {
- if (ScriptServer::is_global_class(p_type)) {
- Ref<Script> scr = EditorNode::get_editor_data().script_class_load_script(p_type);
+ if (p_type_category == TypeCategory::PATH_TYPE || ScriptServer::is_global_class(p_type)) {
+ Ref<Script> scr;
+ if (p_type_category == TypeCategory::PATH_TYPE) {
+ ERR_FAIL_COND(!ResourceLoader::exists(p_type, "Script"));
+ scr = ResourceLoader::load(p_type, "Script");
+ } else {
+ scr = EditorNode::get_editor_data().script_class_load_script(p_type);
+ }
ERR_FAIL_COND(scr.is_null());
Ref<Script> base = scr->get_base_script();
if (base.is_null()) {
- String extends;
- scr->get_language()->get_global_class_name(scr->get_path(), &extends);
+ // Must be a native base type.
+ StringName extends = scr->get_instance_base_type();
+ if (extends == StringName()) {
+ // Not a valid script (has compile errors), we therefore ignore it as it can not be instantiated anyway (when selected).
+ return;
+ }
inherits = extends;
inherited_type = TypeCategory::CPP_TYPE;
} else {
- inherits = scr->get_language()->get_global_class_name(base->get_path());
- if (inherits.is_empty()) {
+ inherits = base->get_global_name();
+
+ if (inherits == StringName()) {
inherits = base->get_path();
inherited_type = TypeCategory::PATH_TYPE;
}
@@ -267,7 +264,7 @@ void CreateDialog::_add_type(const String &p_type, const TypeCategory p_type_cat
}
// Should never happen, but just in case...
- ERR_FAIL_COND(inherits.is_empty());
+ ERR_FAIL_COND(inherits == StringName());
_add_type(inherits, inherited_type);
@@ -276,7 +273,7 @@ void CreateDialog::_add_type(const String &p_type, const TypeCategory p_type_cat
_configure_search_option_item(item, p_type, p_type_category);
}
-void CreateDialog::_configure_search_option_item(TreeItem *r_item, const String &p_type, const TypeCategory p_type_category) {
+void CreateDialog::_configure_search_option_item(TreeItem *r_item, const StringName &p_type, TypeCategory p_type_category) {
bool script_type = ScriptServer::is_global_class(p_type);
bool is_abstract = false;
if (p_type_category == TypeCategory::CPP_TYPE) {
@@ -342,20 +339,6 @@ void CreateDialog::_configure_search_option_item(TreeItem *r_item, const String
}
}
-String CreateDialog::_top_result(const Vector<String> &p_candidates, const String &p_search_text) const {
- float highest_score = 0;
- int highest_index = 0;
- for (int i = 0; i < p_candidates.size(); i++) {
- float score = _score_type(p_candidates[i].get_slicec(' ', 0), p_search_text);
- if (score > highest_score) {
- highest_score = score;
- highest_index = i;
- }
- }
-
- return p_candidates[highest_index];
-}
-
float CreateDialog::_score_type(const String &p_type, const String &p_search) const {
if (p_type == p_search) {
// Always favor an exact match (case-sensitive), since clicking a favorite will set the search text to the type.
@@ -815,7 +798,7 @@ CreateDialog::CreateDialog() {
favorite = memnew(Button);
favorite->set_toggle_mode(true);
favorite->set_tooltip_text(TTR("(Un)favorite selected item."));
- favorite->connect("pressed", callable_mp(this, &CreateDialog::_favorite_toggled));
+ favorite->connect(SceneStringName(pressed), callable_mp(this, &CreateDialog::_favorite_toggled));
search_hb->add_child(favorite);
vbc->add_margin_child(TTR("Search:"), search_hb);
diff --git a/editor/create_dialog.h b/editor/create_dialog.h
index 12385747c2..d2866e9f04 100644
--- a/editor/create_dialog.h
+++ b/editor/create_dialog.h
@@ -68,10 +68,9 @@ class CreateDialog : public ConfirmationDialog {
HashSet<StringName> type_blacklist;
void _update_search();
- bool _should_hide_type(const String &p_type) const;
- void _add_type(const String &p_type, const TypeCategory p_type_category);
- void _configure_search_option_item(TreeItem *r_item, const String &p_type, const TypeCategory p_type_category);
- String _top_result(const Vector<String> &p_candidates, const String &p_search_text) const;
+ bool _should_hide_type(const StringName &p_type) const;
+ void _add_type(const StringName &p_type, TypeCategory p_type_category);
+ void _configure_search_option_item(TreeItem *r_item, const StringName &p_type, TypeCategory p_type_category);
float _score_type(const String &p_type, const String &p_search) const;
bool _is_type_preferred(const String &p_type) const;
diff --git a/editor/debugger/debug_adapter/debug_adapter_protocol.cpp b/editor/debugger/debug_adapter/debug_adapter_protocol.cpp
index 56cb3b6c73..4febb8bf04 100644
--- a/editor/debugger/debug_adapter/debug_adapter_protocol.cpp
+++ b/editor/debugger/debug_adapter/debug_adapter_protocol.cpp
@@ -1043,7 +1043,7 @@ DebugAdapterProtocol::DebugAdapterProtocol() {
reset_ids();
- EditorRunBar::get_singleton()->get_pause_button()->connect("pressed", callable_mp(this, &DebugAdapterProtocol::on_debug_paused));
+ EditorRunBar::get_singleton()->get_pause_button()->connect(SceneStringName(pressed), callable_mp(this, &DebugAdapterProtocol::on_debug_paused));
EditorDebuggerNode *debugger_node = EditorDebuggerNode::get_singleton();
debugger_node->connect("breakpoint_toggled", callable_mp(this, &DebugAdapterProtocol::on_debug_breakpoint_toggled));
diff --git a/editor/debugger/editor_debugger_node.cpp b/editor/debugger/editor_debugger_node.cpp
index 931e360a34..1d3c7aec3f 100644
--- a/editor/debugger/editor_debugger_node.cpp
+++ b/editor/debugger/editor_debugger_node.cpp
@@ -91,7 +91,7 @@ EditorDebuggerNode::EditorDebuggerNode() {
remote_scene_tree_timeout = EDITOR_GET("debugger/remote_scene_tree_refresh_interval");
inspect_edited_object_timeout = EDITOR_GET("debugger/remote_inspect_refresh_interval");
- EditorRunBar::get_singleton()->get_pause_button()->connect("pressed", callable_mp(this, &EditorDebuggerNode::_paused));
+ EditorRunBar::get_singleton()->get_pause_button()->connect(SceneStringName(pressed), callable_mp(this, &EditorDebuggerNode::_paused));
}
ScriptEditorDebugger *EditorDebuggerNode::_add_debugger() {
diff --git a/editor/debugger/editor_profiler.cpp b/editor/debugger/editor_profiler.cpp
index 290b7f5405..69cf13ea0b 100644
--- a/editor/debugger/editor_profiler.cpp
+++ b/editor/debugger/editor_profiler.cpp
@@ -614,12 +614,12 @@ EditorProfiler::EditorProfiler() {
activate->set_toggle_mode(true);
activate->set_disabled(true);
activate->set_text(TTR("Start"));
- activate->connect("pressed", callable_mp(this, &EditorProfiler::_activate_pressed));
+ activate->connect(SceneStringName(pressed), callable_mp(this, &EditorProfiler::_activate_pressed));
hb->add_child(activate);
clear_button = memnew(Button);
clear_button->set_text(TTR("Clear"));
- clear_button->connect("pressed", callable_mp(this, &EditorProfiler::_clear_pressed));
+ clear_button->connect(SceneStringName(pressed), callable_mp(this, &EditorProfiler::_clear_pressed));
clear_button->set_disabled(true);
hb->add_child(clear_button);
@@ -649,7 +649,7 @@ EditorProfiler::EditorProfiler() {
display_internal_profiles = memnew(CheckButton(TTR("Display internal functions")));
display_internal_profiles->set_visible(EDITOR_GET("debugger/profile_native_calls"));
display_internal_profiles->set_pressed(false);
- display_internal_profiles->connect("pressed", callable_mp(this, &EditorProfiler::_internal_profiles_pressed));
+ display_internal_profiles->connect(SceneStringName(pressed), callable_mp(this, &EditorProfiler::_internal_profiles_pressed));
hb->add_child(display_internal_profiles);
hb->add_spacer();
diff --git a/editor/debugger/editor_visual_profiler.cpp b/editor/debugger/editor_visual_profiler.cpp
index d54ea2d433..38f1061a72 100644
--- a/editor/debugger/editor_visual_profiler.cpp
+++ b/editor/debugger/editor_visual_profiler.cpp
@@ -736,13 +736,13 @@ EditorVisualProfiler::EditorVisualProfiler() {
activate->set_toggle_mode(true);
activate->set_disabled(true);
activate->set_text(TTR("Start"));
- activate->connect("pressed", callable_mp(this, &EditorVisualProfiler::_activate_pressed));
+ activate->connect(SceneStringName(pressed), callable_mp(this, &EditorVisualProfiler::_activate_pressed));
hb->add_child(activate);
clear_button = memnew(Button);
clear_button->set_text(TTR("Clear"));
clear_button->set_disabled(true);
- clear_button->connect("pressed", callable_mp(this, &EditorVisualProfiler::_clear_pressed));
+ clear_button->connect(SceneStringName(pressed), callable_mp(this, &EditorVisualProfiler::_clear_pressed));
hb->add_child(clear_button);
hb->add_child(memnew(Label(TTR("Measure:"))));
@@ -757,11 +757,11 @@ EditorVisualProfiler::EditorVisualProfiler() {
frame_relative = memnew(CheckBox(TTR("Fit to Frame")));
frame_relative->set_pressed(true);
hb->add_child(frame_relative);
- frame_relative->connect("pressed", callable_mp(this, &EditorVisualProfiler::_update_plot));
+ frame_relative->connect(SceneStringName(pressed), callable_mp(this, &EditorVisualProfiler::_update_plot));
linked = memnew(CheckBox(TTR("Linked")));
linked->set_pressed(true);
hb->add_child(linked);
- linked->connect("pressed", callable_mp(this, &EditorVisualProfiler::_update_plot));
+ linked->connect(SceneStringName(pressed), callable_mp(this, &EditorVisualProfiler::_update_plot));
hb->add_spacer();
diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp
index d5cf887a4e..156e740509 100644
--- a/editor/debugger/script_editor_debugger.cpp
+++ b/editor/debugger/script_editor_debugger.cpp
@@ -849,8 +849,8 @@ void ScriptEditorDebugger::_set_reason_text(const String &p_reason, MessageType
void ScriptEditorDebugger::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE: {
- le_set->connect("pressed", callable_mp(this, &ScriptEditorDebugger::_live_edit_set));
- le_clear->connect("pressed", callable_mp(this, &ScriptEditorDebugger::_live_edit_clear));
+ le_set->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::_live_edit_set));
+ le_clear->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::_live_edit_clear));
error_tree->connect("item_selected", callable_mp(this, &ScriptEditorDebugger::_error_selected));
error_tree->connect("item_activated", callable_mp(this, &ScriptEditorDebugger::_error_activated));
breakpoints_tree->connect("item_activated", callable_mp(this, &ScriptEditorDebugger::_breakpoint_tree_clicked));
@@ -1826,7 +1826,7 @@ ScriptEditorDebugger::ScriptEditorDebugger() {
skip_breakpoints->set_theme_type_variation("FlatButton");
hbc->add_child(skip_breakpoints);
skip_breakpoints->set_tooltip_text(TTR("Skip Breakpoints"));
- skip_breakpoints->connect("pressed", callable_mp(this, &ScriptEditorDebugger::debug_skip_breakpoints));
+ skip_breakpoints->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::debug_skip_breakpoints));
hbc->add_child(memnew(VSeparator));
@@ -1834,7 +1834,7 @@ ScriptEditorDebugger::ScriptEditorDebugger() {
copy->set_theme_type_variation("FlatButton");
hbc->add_child(copy);
copy->set_tooltip_text(TTR("Copy Error"));
- copy->connect("pressed", callable_mp(this, &ScriptEditorDebugger::debug_copy));
+ copy->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::debug_copy));
hbc->add_child(memnew(VSeparator));
@@ -1843,14 +1843,14 @@ ScriptEditorDebugger::ScriptEditorDebugger() {
hbc->add_child(step);
step->set_tooltip_text(TTR("Step Into"));
step->set_shortcut(ED_GET_SHORTCUT("debugger/step_into"));
- step->connect("pressed", callable_mp(this, &ScriptEditorDebugger::debug_step));
+ step->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::debug_step));
next = memnew(Button);
next->set_theme_type_variation("FlatButton");
hbc->add_child(next);
next->set_tooltip_text(TTR("Step Over"));
next->set_shortcut(ED_GET_SHORTCUT("debugger/step_over"));
- next->connect("pressed", callable_mp(this, &ScriptEditorDebugger::debug_next));
+ next->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::debug_next));
hbc->add_child(memnew(VSeparator));
@@ -1859,14 +1859,14 @@ ScriptEditorDebugger::ScriptEditorDebugger() {
hbc->add_child(dobreak);
dobreak->set_tooltip_text(TTR("Break"));
dobreak->set_shortcut(ED_GET_SHORTCUT("debugger/break"));
- dobreak->connect("pressed", callable_mp(this, &ScriptEditorDebugger::debug_break));
+ dobreak->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::debug_break));
docontinue = memnew(Button);
docontinue->set_theme_type_variation("FlatButton");
hbc->add_child(docontinue);
docontinue->set_tooltip_text(TTR("Continue"));
docontinue->set_shortcut(ED_GET_SHORTCUT("debugger/continue"));
- docontinue->connect("pressed", callable_mp(this, &ScriptEditorDebugger::debug_continue));
+ docontinue->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::debug_continue));
HSplitContainer *parent_sc = memnew(HSplitContainer);
vbc->add_child(parent_sc);
@@ -1952,13 +1952,13 @@ ScriptEditorDebugger::ScriptEditorDebugger() {
expand_all_button = memnew(Button);
expand_all_button->set_text(TTR("Expand All"));
expand_all_button->set_disabled(true);
- expand_all_button->connect("pressed", callable_mp(this, &ScriptEditorDebugger::_expand_errors_list));
+ expand_all_button->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::_expand_errors_list));
error_hbox->add_child(expand_all_button);
collapse_all_button = memnew(Button);
collapse_all_button->set_text(TTR("Collapse All"));
collapse_all_button->set_disabled(true);
- collapse_all_button->connect("pressed", callable_mp(this, &ScriptEditorDebugger::_collapse_errors_list));
+ collapse_all_button->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::_collapse_errors_list));
error_hbox->add_child(collapse_all_button);
Control *space = memnew(Control);
@@ -1969,7 +1969,7 @@ ScriptEditorDebugger::ScriptEditorDebugger() {
clear_button->set_text(TTR("Clear"));
clear_button->set_h_size_flags(0);
clear_button->set_disabled(true);
- clear_button->connect("pressed", callable_mp(this, &ScriptEditorDebugger::_clear_errors_list));
+ clear_button->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::_clear_errors_list));
error_hbox->add_child(clear_button);
error_tree = memnew(Tree);
@@ -2044,8 +2044,8 @@ ScriptEditorDebugger::ScriptEditorDebugger() {
vmem_export->set_tooltip_text(TTR("Export list to a CSV file"));
vmem_hb->add_child(vmem_export);
vmem_vb->add_child(vmem_hb);
- vmem_refresh->connect("pressed", callable_mp(this, &ScriptEditorDebugger::_video_mem_request));
- vmem_export->connect("pressed", callable_mp(this, &ScriptEditorDebugger::_video_mem_export));
+ vmem_refresh->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::_video_mem_request));
+ vmem_export->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::_video_mem_export));
VBoxContainer *vmmc = memnew(VBoxContainer);
vmem_tree = memnew(Tree);
@@ -2114,7 +2114,7 @@ ScriptEditorDebugger::ScriptEditorDebugger() {
HBoxContainer *buttons = memnew(HBoxContainer);
export_csv = memnew(Button(TTR("Export measures as CSV")));
- export_csv->connect("pressed", callable_mp(this, &ScriptEditorDebugger::_export_csv));
+ export_csv->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditorDebugger::_export_csv));
buttons->add_child(export_csv);
misc->add_child(buttons);
diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp
index 84d6cb67d8..4c21f51e9c 100644
--- a/editor/dependency_editor.cpp
+++ b/editor/dependency_editor.cpp
@@ -266,7 +266,7 @@ DependencyEditor::DependencyEditor() {
hbc->add_spacer();
fixdeps = memnew(Button(TTR("Fix Broken")));
hbc->add_child(fixdeps);
- fixdeps->connect("pressed", callable_mp(this, &DependencyEditor::_fix_all));
+ fixdeps->connect(SceneStringName(pressed), callable_mp(this, &DependencyEditor::_fix_all));
vb->add_child(hbc);
diff --git a/editor/editor_about.cpp b/editor/editor_about.cpp
index f97b2f790f..6893b2878b 100644
--- a/editor/editor_about.cpp
+++ b/editor/editor_about.cpp
@@ -215,7 +215,7 @@ EditorAbout::EditorAbout() {
}
version_btn->set_tooltip_text(vformat(TTR("Git commit date: %s\nClick to copy the version number."), build_date));
- version_btn->connect("pressed", callable_mp(this, &EditorAbout::_version_button_pressed));
+ version_btn->connect(SceneStringName(pressed), callable_mp(this, &EditorAbout::_version_button_pressed));
version_info_vbc->add_child(version_btn);
Label *about_text = memnew(Label);
diff --git a/editor/editor_asset_installer.cpp b/editor/editor_asset_installer.cpp
index 742dec8d69..8f675cf548 100644
--- a/editor/editor_asset_installer.cpp
+++ b/editor/editor_asset_installer.cpp
@@ -694,7 +694,7 @@ EditorAssetInstaller::EditorAssetInstaller() {
target_dir_button->set_text(TTR("Change Install Folder"));
target_dir_button->set_tooltip_text(TTR("Change the folder where the contents of the asset are going to be installed."));
remapping_tools->add_child(target_dir_button);
- target_dir_button->connect("pressed", callable_mp(this, &EditorAssetInstaller::_open_target_dir_dialog));
+ target_dir_button->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetInstaller::_open_target_dir_dialog));
remapping_tools->add_child(memnew(VSeparator));
@@ -716,7 +716,7 @@ EditorAssetInstaller::EditorAssetInstaller() {
asset_conflicts_link->set_tooltip_text(TTR("Show contents of the asset and conflicting files."));
asset_conflicts_link->set_visible(false);
remapping_tools->add_child(asset_conflicts_link);
- asset_conflicts_link->connect("pressed", callable_mp(this, &EditorAssetInstaller::_toggle_source_tree).bind(true, true));
+ asset_conflicts_link->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetInstaller::_toggle_source_tree).bind(true, true));
// File hierarchy trees.
diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp
index 6ac9e3849c..0b5122fce2 100644
--- a/editor/editor_audio_buses.cpp
+++ b/editor/editor_audio_buses.cpp
@@ -92,9 +92,9 @@ void EditorAudioBus::_notification(int p_what) {
Color bypass_color = EditorThemeManager::is_dark_theme() ? Color(0.13, 0.8, 1.0) : Color(1.03, 2.04, 2.35);
float darkening_factor = EditorThemeManager::is_dark_theme() ? 0.15 : 0.65;
- Ref<StyleBoxFlat>(solo->get_theme_stylebox("pressed"))->set_border_color(solo_color.darkened(darkening_factor));
- Ref<StyleBoxFlat>(mute->get_theme_stylebox("pressed"))->set_border_color(mute_color.darkened(darkening_factor));
- Ref<StyleBoxFlat>(bypass->get_theme_stylebox("pressed"))->set_border_color(bypass_color.darkened(darkening_factor));
+ Ref<StyleBoxFlat>(solo->get_theme_stylebox(SceneStringName(pressed)))->set_border_color(solo_color.darkened(darkening_factor));
+ Ref<StyleBoxFlat>(mute->get_theme_stylebox(SceneStringName(pressed)))->set_border_color(mute_color.darkened(darkening_factor));
+ Ref<StyleBoxFlat>(bypass->get_theme_stylebox(SceneStringName(pressed)))->set_border_color(bypass_color.darkened(darkening_factor));
solo->set_icon(get_editor_theme_icon(SNAME("AudioBusSolo")));
solo->add_theme_color_override("icon_pressed_color", solo_color);
@@ -815,21 +815,21 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) {
solo->set_toggle_mode(true);
solo->set_tooltip_text(TTR("Solo"));
solo->set_focus_mode(FOCUS_NONE);
- solo->connect("pressed", callable_mp(this, &EditorAudioBus::_solo_toggled));
+ solo->connect(SceneStringName(pressed), callable_mp(this, &EditorAudioBus::_solo_toggled));
hbc->add_child(solo);
mute = memnew(Button);
mute->set_theme_type_variation("FlatButton");
mute->set_toggle_mode(true);
mute->set_tooltip_text(TTR("Mute"));
mute->set_focus_mode(FOCUS_NONE);
- mute->connect("pressed", callable_mp(this, &EditorAudioBus::_mute_toggled));
+ mute->connect(SceneStringName(pressed), callable_mp(this, &EditorAudioBus::_mute_toggled));
hbc->add_child(mute);
bypass = memnew(Button);
bypass->set_theme_type_variation("FlatButton");
bypass->set_toggle_mode(true);
bypass->set_tooltip_text(TTR("Bypass"));
bypass->set_focus_mode(FOCUS_NONE);
- bypass->connect("pressed", callable_mp(this, &EditorAudioBus::_bypass_toggled));
+ bypass->connect(SceneStringName(pressed), callable_mp(this, &EditorAudioBus::_bypass_toggled));
hbc->add_child(bypass);
hbc->add_spacer();
@@ -845,7 +845,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) {
sbflat->set_content_margin_all(0);
sbflat->set_bg_color(Color(1, 1, 1, 0));
sbflat->set_border_width(Side::SIDE_BOTTOM, Math::round(3 * EDSCALE));
- child->add_theme_style_override("pressed", sbflat);
+ child->add_theme_style_override(SceneStringName(pressed), sbflat);
child->end_bulk_theme_override();
}
@@ -1313,7 +1313,7 @@ EditorAudioBuses::EditorAudioBuses() {
top_hb->add_child(add);
add->set_text(TTR("Add Bus"));
add->set_tooltip_text(TTR("Add a new Audio Bus to this layout."));
- add->connect("pressed", callable_mp(this, &EditorAudioBuses::_add_bus));
+ add->connect(SceneStringName(pressed), callable_mp(this, &EditorAudioBuses::_add_bus));
VSeparator *separator = memnew(VSeparator);
top_hb->add_child(separator);
@@ -1322,25 +1322,25 @@ EditorAudioBuses::EditorAudioBuses() {
load->set_text(TTR("Load"));
load->set_tooltip_text(TTR("Load an existing Bus Layout."));
top_hb->add_child(load);
- load->connect("pressed", callable_mp(this, &EditorAudioBuses::_load_layout));
+ load->connect(SceneStringName(pressed), callable_mp(this, &EditorAudioBuses::_load_layout));
save_as = memnew(Button);
save_as->set_text(TTR("Save As"));
save_as->set_tooltip_text(TTR("Save this Bus Layout to a file."));
top_hb->add_child(save_as);
- save_as->connect("pressed", callable_mp(this, &EditorAudioBuses::_save_as_layout));
+ save_as->connect(SceneStringName(pressed), callable_mp(this, &EditorAudioBuses::_save_as_layout));
_default = memnew(Button);
_default->set_text(TTR("Load Default"));
_default->set_tooltip_text(TTR("Load the default Bus Layout."));
top_hb->add_child(_default);
- _default->connect("pressed", callable_mp(this, &EditorAudioBuses::_load_default_layout));
+ _default->connect(SceneStringName(pressed), callable_mp(this, &EditorAudioBuses::_load_default_layout));
_new = memnew(Button);
_new->set_text(TTR("Create"));
_new->set_tooltip_text(TTR("Create a new Bus Layout."));
top_hb->add_child(_new);
- _new->connect("pressed", callable_mp(this, &EditorAudioBuses::_new_layout));
+ _new->connect(SceneStringName(pressed), callable_mp(this, &EditorAudioBuses::_new_layout));
bus_scroll = memnew(ScrollContainer);
bus_scroll->set_v_size_flags(SIZE_EXPAND_FILL);
diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp
index b0571a62c1..a5c4831db7 100644
--- a/editor/editor_autoload_settings.cpp
+++ b/editor/editor_autoload_settings.cpp
@@ -900,7 +900,7 @@ EditorAutoloadSettings::EditorAutoloadSettings() {
browse_button = memnew(Button);
hbc->add_child(browse_button);
- browse_button->connect("pressed", callable_mp(this, &EditorAutoloadSettings::_browse_autoload_add_path));
+ browse_button->connect(SceneStringName(pressed), callable_mp(this, &EditorAutoloadSettings::_browse_autoload_add_path));
file_dialog = memnew(EditorFileDialog);
hbc->add_child(file_dialog);
@@ -924,7 +924,7 @@ EditorAutoloadSettings::EditorAutoloadSettings() {
add_autoload = memnew(Button);
add_autoload->set_text(TTR("Add"));
- add_autoload->connect("pressed", callable_mp(this, &EditorAutoloadSettings::_autoload_add));
+ add_autoload->connect(SceneStringName(pressed), callable_mp(this, &EditorAutoloadSettings::_autoload_add));
// The button will be enabled once a valid name is entered (either automatically or manually).
add_autoload->set_disabled(true);
hbc->add_child(add_autoload);
diff --git a/editor/editor_build_profile.cpp b/editor/editor_build_profile.cpp
index c1db674cbe..799bda78ab 100644
--- a/editor/editor_build_profile.cpp
+++ b/editor/editor_build_profile.cpp
@@ -816,19 +816,19 @@ EditorBuildProfileManager::EditorBuildProfileManager() {
profile_actions[ACTION_NEW] = memnew(Button(TTR("New")));
path_hbc->add_child(profile_actions[ACTION_NEW]);
- profile_actions[ACTION_NEW]->connect("pressed", callable_mp(this, &EditorBuildProfileManager::_profile_action).bind(ACTION_NEW));
+ profile_actions[ACTION_NEW]->connect(SceneStringName(pressed), callable_mp(this, &EditorBuildProfileManager::_profile_action).bind(ACTION_NEW));
profile_actions[ACTION_LOAD] = memnew(Button(TTR("Load")));
path_hbc->add_child(profile_actions[ACTION_LOAD]);
- profile_actions[ACTION_LOAD]->connect("pressed", callable_mp(this, &EditorBuildProfileManager::_profile_action).bind(ACTION_LOAD));
+ profile_actions[ACTION_LOAD]->connect(SceneStringName(pressed), callable_mp(this, &EditorBuildProfileManager::_profile_action).bind(ACTION_LOAD));
profile_actions[ACTION_SAVE] = memnew(Button(TTR("Save")));
path_hbc->add_child(profile_actions[ACTION_SAVE]);
- profile_actions[ACTION_SAVE]->connect("pressed", callable_mp(this, &EditorBuildProfileManager::_profile_action).bind(ACTION_SAVE));
+ profile_actions[ACTION_SAVE]->connect(SceneStringName(pressed), callable_mp(this, &EditorBuildProfileManager::_profile_action).bind(ACTION_SAVE));
profile_actions[ACTION_SAVE_AS] = memnew(Button(TTR("Save As")));
path_hbc->add_child(profile_actions[ACTION_SAVE_AS]);
- profile_actions[ACTION_SAVE_AS]->connect("pressed", callable_mp(this, &EditorBuildProfileManager::_profile_action).bind(ACTION_SAVE_AS));
+ profile_actions[ACTION_SAVE_AS]->connect(SceneStringName(pressed), callable_mp(this, &EditorBuildProfileManager::_profile_action).bind(ACTION_SAVE_AS));
main_vbc->add_margin_child(TTR("Profile:"), path_hbc);
@@ -838,11 +838,11 @@ EditorBuildProfileManager::EditorBuildProfileManager() {
profile_actions[ACTION_RESET] = memnew(Button(TTR("Reset to Defaults")));
profiles_hbc->add_child(profile_actions[ACTION_RESET]);
- profile_actions[ACTION_RESET]->connect("pressed", callable_mp(this, &EditorBuildProfileManager::_profile_action).bind(ACTION_RESET));
+ profile_actions[ACTION_RESET]->connect(SceneStringName(pressed), callable_mp(this, &EditorBuildProfileManager::_profile_action).bind(ACTION_RESET));
profile_actions[ACTION_DETECT] = memnew(Button(TTR("Detect from Project")));
profiles_hbc->add_child(profile_actions[ACTION_DETECT]);
- profile_actions[ACTION_DETECT]->connect("pressed", callable_mp(this, &EditorBuildProfileManager::_profile_action).bind(ACTION_DETECT));
+ profile_actions[ACTION_DETECT]->connect(SceneStringName(pressed), callable_mp(this, &EditorBuildProfileManager::_profile_action).bind(ACTION_DETECT));
main_vbc->add_margin_child(TTR("Actions:"), profiles_hbc);
diff --git a/editor/editor_dock_manager.cpp b/editor/editor_dock_manager.cpp
index 4ba7832e76..5d98fefa76 100644
--- a/editor/editor_dock_manager.cpp
+++ b/editor/editor_dock_manager.cpp
@@ -59,12 +59,13 @@ void DockSplitContainer::_update_visibility() {
}
is_updating = true;
bool any_visible = false;
- for (int i = 0; i < 2; i++) {
- Control *split = get_containable_child(i);
- if (split && split->is_visible()) {
- any_visible = true;
- break;
+ for (int i = 0; i < get_child_count(false); i++) {
+ Control *c = Object::cast_to<Control>(get_child(i, false));
+ if (!c || !c->is_visible() || c->is_set_as_top_level()) {
+ continue;
}
+ any_visible = c;
+ break;
}
set_visible(any_visible);
is_updating = false;
@@ -74,10 +75,13 @@ void DockSplitContainer::add_child_notify(Node *p_child) {
SplitContainer::add_child_notify(p_child);
Control *child_control = nullptr;
- for (int i = 0; i < 2; i++) {
- Control *split = get_containable_child(i);
- if (p_child == split) {
- child_control = split;
+ for (int i = 0; i < get_child_count(false); i++) {
+ Control *c = Object::cast_to<Control>(get_child(i, false));
+ if (!c || c->is_set_as_top_level()) {
+ continue;
+ }
+ if (p_child == c) {
+ child_control = c;
break;
}
}
@@ -93,10 +97,13 @@ void DockSplitContainer::remove_child_notify(Node *p_child) {
SplitContainer::remove_child_notify(p_child);
Control *child_control = nullptr;
- for (int i = 0; i < 2; i++) {
- Control *split = get_containable_child(i);
- if (p_child == split) {
- child_control = split;
+ for (int i = 0; i < get_child_count(false); i++) {
+ Control *c = Object::cast_to<Control>(get_child(i, false));
+ if (!c || c->is_set_as_top_level()) {
+ continue;
+ }
+ if (p_child == c) {
+ child_control = c;
break;
}
}
@@ -1073,7 +1080,7 @@ DockContextPopup::DockContextPopup() {
tab_move_left_button = memnew(Button);
tab_move_left_button->set_flat(true);
tab_move_left_button->set_focus_mode(Control::FOCUS_NONE);
- tab_move_left_button->connect("pressed", callable_mp(this, &DockContextPopup::_tab_move_left));
+ tab_move_left_button->connect(SceneStringName(pressed), callable_mp(this, &DockContextPopup::_tab_move_left));
header_hb->add_child(tab_move_left_button);
Label *position_label = memnew(Label);
@@ -1085,7 +1092,7 @@ DockContextPopup::DockContextPopup() {
tab_move_right_button = memnew(Button);
tab_move_right_button->set_flat(true);
tab_move_right_button->set_focus_mode(Control::FOCUS_NONE);
- tab_move_right_button->connect("pressed", callable_mp(this, &DockContextPopup::_tab_move_right));
+ tab_move_right_button->connect(SceneStringName(pressed), callable_mp(this, &DockContextPopup::_tab_move_right));
header_hb->add_child(tab_move_right_button);
dock_select_popup_vb->add_child(header_hb);
@@ -1108,7 +1115,7 @@ DockContextPopup::DockContextPopup() {
}
make_float_button->set_focus_mode(Control::FOCUS_NONE);
make_float_button->set_h_size_flags(Control::SIZE_EXPAND_FILL);
- make_float_button->connect("pressed", callable_mp(this, &DockContextPopup::_float_dock));
+ make_float_button->connect(SceneStringName(pressed), callable_mp(this, &DockContextPopup::_float_dock));
dock_select_popup_vb->add_child(make_float_button);
dock_to_bottom_button = memnew(Button);
@@ -1116,7 +1123,7 @@ DockContextPopup::DockContextPopup() {
dock_to_bottom_button->set_tooltip_text(TTR("Move this dock to the bottom panel."));
dock_to_bottom_button->set_focus_mode(Control::FOCUS_NONE);
dock_to_bottom_button->set_h_size_flags(Control::SIZE_EXPAND_FILL);
- dock_to_bottom_button->connect("pressed", callable_mp(this, &DockContextPopup::_move_dock_to_bottom));
+ dock_to_bottom_button->connect(SceneStringName(pressed), callable_mp(this, &DockContextPopup::_move_dock_to_bottom));
dock_to_bottom_button->hide();
dock_select_popup_vb->add_child(dock_to_bottom_button);
@@ -1125,6 +1132,6 @@ DockContextPopup::DockContextPopup() {
close_button->set_tooltip_text(TTR("Close this dock."));
close_button->set_focus_mode(Control::FOCUS_NONE);
close_button->set_h_size_flags(Control::SIZE_EXPAND_FILL);
- close_button->connect("pressed", callable_mp(this, &DockContextPopup::_close_dock));
+ close_button->connect(SceneStringName(pressed), callable_mp(this, &DockContextPopup::_close_dock));
dock_select_popup_vb->add_child(close_button);
}
diff --git a/editor/editor_feature_profile.cpp b/editor/editor_feature_profile.cpp
index 86b7b3eb2f..5a7e914c11 100644
--- a/editor/editor_feature_profile.cpp
+++ b/editor/editor_feature_profile.cpp
@@ -915,7 +915,7 @@ EditorFeatureProfileManager::EditorFeatureProfileManager() {
profile_actions[PROFILE_CLEAR] = memnew(Button(TTR("Reset to Default")));
name_hbc->add_child(profile_actions[PROFILE_CLEAR]);
profile_actions[PROFILE_CLEAR]->set_disabled(true);
- profile_actions[PROFILE_CLEAR]->connect("pressed", callable_mp(this, &EditorFeatureProfileManager::_profile_action).bind(PROFILE_CLEAR));
+ profile_actions[PROFILE_CLEAR]->connect(SceneStringName(pressed), callable_mp(this, &EditorFeatureProfileManager::_profile_action).bind(PROFILE_CLEAR));
main_vbc->add_margin_child(TTR("Current Profile:"), name_hbc);
@@ -930,12 +930,12 @@ EditorFeatureProfileManager::EditorFeatureProfileManager() {
profile_actions[PROFILE_NEW] = memnew(Button(TTR("Create Profile")));
profiles_hbc->add_child(profile_actions[PROFILE_NEW]);
- profile_actions[PROFILE_NEW]->connect("pressed", callable_mp(this, &EditorFeatureProfileManager::_profile_action).bind(PROFILE_NEW));
+ profile_actions[PROFILE_NEW]->connect(SceneStringName(pressed), callable_mp(this, &EditorFeatureProfileManager::_profile_action).bind(PROFILE_NEW));
profile_actions[PROFILE_ERASE] = memnew(Button(TTR("Remove Profile")));
profiles_hbc->add_child(profile_actions[PROFILE_ERASE]);
profile_actions[PROFILE_ERASE]->set_disabled(true);
- profile_actions[PROFILE_ERASE]->connect("pressed", callable_mp(this, &EditorFeatureProfileManager::_profile_action).bind(PROFILE_ERASE));
+ profile_actions[PROFILE_ERASE]->connect(SceneStringName(pressed), callable_mp(this, &EditorFeatureProfileManager::_profile_action).bind(PROFILE_ERASE));
main_vbc->add_margin_child(TTR("Available Profiles:"), profiles_hbc);
@@ -944,18 +944,18 @@ EditorFeatureProfileManager::EditorFeatureProfileManager() {
profile_actions[PROFILE_SET] = memnew(Button(TTR("Make Current")));
current_profile_hbc->add_child(profile_actions[PROFILE_SET]);
profile_actions[PROFILE_SET]->set_disabled(true);
- profile_actions[PROFILE_SET]->connect("pressed", callable_mp(this, &EditorFeatureProfileManager::_profile_action).bind(PROFILE_SET));
+ profile_actions[PROFILE_SET]->connect(SceneStringName(pressed), callable_mp(this, &EditorFeatureProfileManager::_profile_action).bind(PROFILE_SET));
current_profile_hbc->add_child(memnew(VSeparator));
profile_actions[PROFILE_IMPORT] = memnew(Button(TTR("Import")));
current_profile_hbc->add_child(profile_actions[PROFILE_IMPORT]);
- profile_actions[PROFILE_IMPORT]->connect("pressed", callable_mp(this, &EditorFeatureProfileManager::_profile_action).bind(PROFILE_IMPORT));
+ profile_actions[PROFILE_IMPORT]->connect(SceneStringName(pressed), callable_mp(this, &EditorFeatureProfileManager::_profile_action).bind(PROFILE_IMPORT));
profile_actions[PROFILE_EXPORT] = memnew(Button(TTR("Export")));
current_profile_hbc->add_child(profile_actions[PROFILE_EXPORT]);
profile_actions[PROFILE_EXPORT]->set_disabled(true);
- profile_actions[PROFILE_EXPORT]->connect("pressed", callable_mp(this, &EditorFeatureProfileManager::_profile_action).bind(PROFILE_EXPORT));
+ profile_actions[PROFILE_EXPORT]->connect(SceneStringName(pressed), callable_mp(this, &EditorFeatureProfileManager::_profile_action).bind(PROFILE_EXPORT));
main_vbc->add_child(current_profile_hbc);
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp
index 960ccd4455..a8d978c66d 100644
--- a/editor/editor_help.cpp
+++ b/editor/editor_help.cpp
@@ -3117,7 +3117,7 @@ EditorHelp::EditorHelp() {
toggle_scripts_button = memnew(Button);
toggle_scripts_button->set_flat(true);
- toggle_scripts_button->connect("pressed", callable_mp(this, &EditorHelp::_toggle_scripts_pressed));
+ toggle_scripts_button->connect(SceneStringName(pressed), callable_mp(this, &EditorHelp::_toggle_scripts_pressed));
status_bar->add_child(toggle_scripts_button);
class_desc->set_selection_enabled(true);
@@ -4043,13 +4043,13 @@ FindBar::FindBar() {
find_prev->set_flat(true);
add_child(find_prev);
find_prev->set_focus_mode(FOCUS_NONE);
- find_prev->connect("pressed", callable_mp(this, &FindBar::search_prev));
+ find_prev->connect(SceneStringName(pressed), callable_mp(this, &FindBar::search_prev));
find_next = memnew(Button);
find_next->set_flat(true);
add_child(find_next);
find_next->set_focus_mode(FOCUS_NONE);
- find_next->connect("pressed", callable_mp(this, &FindBar::search_next));
+ find_next->connect(SceneStringName(pressed), callable_mp(this, &FindBar::search_next));
Control *space = memnew(Control);
add_child(space);
@@ -4060,7 +4060,7 @@ FindBar::FindBar() {
hide_button->set_focus_mode(FOCUS_NONE);
hide_button->set_ignore_texture_size(true);
hide_button->set_stretch_mode(TextureButton::STRETCH_KEEP_CENTERED);
- hide_button->connect("pressed", callable_mp(this, &FindBar::_hide_bar));
+ hide_button->connect(SceneStringName(pressed), callable_mp(this, &FindBar::_hide_bar));
}
void FindBar::popup_search() {
diff --git a/editor/editor_help_search.cpp b/editor/editor_help_search.cpp
index 0a6802fb7c..f42cc62fe2 100644
--- a/editor/editor_help_search.cpp
+++ b/editor/editor_help_search.cpp
@@ -323,7 +323,7 @@ EditorHelpSearch::EditorHelpSearch() {
case_sensitive_button = memnew(Button);
case_sensitive_button->set_theme_type_variation("FlatButton");
case_sensitive_button->set_tooltip_text(TTR("Case Sensitive"));
- case_sensitive_button->connect("pressed", callable_mp(this, &EditorHelpSearch::_update_results));
+ case_sensitive_button->connect(SceneStringName(pressed), callable_mp(this, &EditorHelpSearch::_update_results));
case_sensitive_button->set_toggle_mode(true);
case_sensitive_button->set_focus_mode(Control::FOCUS_NONE);
hbox->add_child(case_sensitive_button);
@@ -331,7 +331,7 @@ EditorHelpSearch::EditorHelpSearch() {
hierarchy_button = memnew(Button);
hierarchy_button->set_theme_type_variation("FlatButton");
hierarchy_button->set_tooltip_text(TTR("Show Hierarchy"));
- hierarchy_button->connect("pressed", callable_mp(this, &EditorHelpSearch::_update_results));
+ hierarchy_button->connect(SceneStringName(pressed), callable_mp(this, &EditorHelpSearch::_update_results));
hierarchy_button->set_toggle_mode(true);
hierarchy_button->set_pressed(true);
hierarchy_button->set_focus_mode(Control::FOCUS_NONE);
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index e427e3f3ac..8e608fb797 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -2203,7 +2203,7 @@ void EditorInspectorArray::_setup() {
if (element_position > 0) {
ae.move_up = memnew(Button);
ae.move_up->set_icon(get_editor_theme_icon(SNAME("MoveUp")));
- ae.move_up->connect("pressed", callable_mp(this, &EditorInspectorArray::_move_element).bind(element_position, element_position - 1));
+ ae.move_up->connect(SceneStringName(pressed), callable_mp(this, &EditorInspectorArray::_move_element).bind(element_position, element_position - 1));
move_vbox->add_child(ae.move_up);
}
@@ -2219,7 +2219,7 @@ void EditorInspectorArray::_setup() {
if (element_position < _get_array_count() - 1) {
ae.move_down = memnew(Button);
ae.move_down->set_icon(get_editor_theme_icon(SNAME("MoveDown")));
- ae.move_down->connect("pressed", callable_mp(this, &EditorInspectorArray::_move_element).bind(element_position, element_position + 2));
+ ae.move_down->connect(SceneStringName(pressed), callable_mp(this, &EditorInspectorArray::_move_element).bind(element_position, element_position + 2));
move_vbox->add_child(ae.move_down);
}
}
@@ -2243,7 +2243,7 @@ void EditorInspectorArray::_setup() {
ae.erase = memnew(Button);
ae.erase->set_icon(get_editor_theme_icon(SNAME("Remove")));
ae.erase->set_v_size_flags(SIZE_SHRINK_CENTER);
- ae.erase->connect("pressed", callable_mp(this, &EditorInspectorArray::_remove_item).bind(element_position));
+ ae.erase->connect(SceneStringName(pressed), callable_mp(this, &EditorInspectorArray::_remove_item).bind(element_position));
ae.hbox->add_child(ae.erase);
}
@@ -2433,7 +2433,7 @@ EditorInspectorArray::EditorInspectorArray(bool p_read_only) {
vbox->add_child(elements_vbox);
add_button = EditorInspector::create_inspector_action_button(TTR("Add Element"));
- add_button->connect("pressed", callable_mp(this, &EditorInspectorArray::_add_button_pressed));
+ add_button->connect(SceneStringName(pressed), callable_mp(this, &EditorInspectorArray::_add_button_pressed));
add_button->set_disabled(read_only);
vbox->add_child(add_button);
@@ -2528,12 +2528,12 @@ EditorPaginator::EditorPaginator() {
first_page_button = memnew(Button);
first_page_button->set_flat(true);
- first_page_button->connect("pressed", callable_mp(this, &EditorPaginator::_first_page_button_pressed));
+ first_page_button->connect(SceneStringName(pressed), callable_mp(this, &EditorPaginator::_first_page_button_pressed));
add_child(first_page_button);
prev_page_button = memnew(Button);
prev_page_button->set_flat(true);
- prev_page_button->connect("pressed", callable_mp(this, &EditorPaginator::_prev_page_button_pressed));
+ prev_page_button->connect(SceneStringName(pressed), callable_mp(this, &EditorPaginator::_prev_page_button_pressed));
add_child(prev_page_button);
page_line_edit = memnew(LineEdit);
@@ -2546,12 +2546,12 @@ EditorPaginator::EditorPaginator() {
next_page_button = memnew(Button);
next_page_button->set_flat(true);
- next_page_button->connect("pressed", callable_mp(this, &EditorPaginator::_next_page_button_pressed));
+ next_page_button->connect(SceneStringName(pressed), callable_mp(this, &EditorPaginator::_next_page_button_pressed));
add_child(next_page_button);
last_page_button = memnew(Button);
last_page_button->set_flat(true);
- last_page_button->connect("pressed", callable_mp(this, &EditorPaginator::_last_page_button_pressed));
+ last_page_button->connect(SceneStringName(pressed), callable_mp(this, &EditorPaginator::_last_page_button_pressed));
add_child(last_page_button);
}
@@ -3465,7 +3465,7 @@ void EditorInspector::update_tree() {
Button *add_md = EditorInspector::create_inspector_action_button(TTR("Add Metadata"));
add_md->set_icon(get_editor_theme_icon(SNAME("Add")));
- add_md->connect(SNAME("pressed"), callable_mp(this, &EditorInspector::_show_add_meta_dialog));
+ add_md->connect(SceneStringName(pressed), callable_mp(this, &EditorInspector::_show_add_meta_dialog));
main_vbox->add_child(add_md);
if (all_read_only) {
add_md->set_disabled(true);
diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp
index ab4950f01b..6615133dea 100644
--- a/editor/editor_log.cpp
+++ b/editor/editor_log.cpp
@@ -483,7 +483,7 @@ EditorLog::EditorLog() {
clear_button->set_theme_type_variation("FlatButton");
clear_button->set_focus_mode(FOCUS_NONE);
clear_button->set_shortcut(ED_SHORTCUT("editor/clear_output", TTR("Clear Output"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::ALT | Key::K));
- clear_button->connect("pressed", callable_mp(this, &EditorLog::_clear_request));
+ clear_button->connect(SceneStringName(pressed), callable_mp(this, &EditorLog::_clear_request));
hb_tools->add_child(clear_button);
// Copy.
@@ -492,7 +492,7 @@ EditorLog::EditorLog() {
copy_button->set_focus_mode(FOCUS_NONE);
copy_button->set_shortcut(ED_SHORTCUT("editor/copy_output", TTR("Copy Selection"), KeyModifierMask::CMD_OR_CTRL | Key::C));
copy_button->set_shortcut_context(this);
- copy_button->connect("pressed", callable_mp(this, &EditorLog::_copy_request));
+ copy_button->connect(SceneStringName(pressed), callable_mp(this, &EditorLog::_copy_request));
hb_tools->add_child(copy_button);
// Separate toggle buttons from normal buttons.
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 5702751f17..68fcc613ee 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -521,7 +521,7 @@ void EditorNode::_update_theme(bool p_skip_creation) {
scene_root_parent->add_theme_style_override("panel", theme->get_stylebox(SNAME("Content"), EditorStringName(EditorStyles)));
bottom_panel->add_theme_style_override("panel", theme->get_stylebox(SNAME("BottomPanel"), EditorStringName(EditorStyles)));
distraction_free->set_icon(theme->get_icon(SNAME("DistractionFree"), EditorStringName(EditorIcons)));
- distraction_free->add_theme_style_override("pressed", theme->get_stylebox("normal", "FlatMenuButton"));
+ distraction_free->add_theme_style_override(SceneStringName(pressed), theme->get_stylebox("normal", "FlatMenuButton"));
help_menu->set_item_icon(help_menu->get_item_index(HELP_SEARCH), theme->get_icon(SNAME("HelpSearch"), EditorStringName(EditorIcons)));
help_menu->set_item_icon(help_menu->get_item_index(HELP_COPY_SYSTEM_INFO), theme->get_icon(SNAME("ActionCopy"), EditorStringName(EditorIcons)));
@@ -3468,7 +3468,7 @@ void EditorNode::add_editor_plugin(EditorPlugin *p_editor, bool p_config_changed
icon->connect_changed(callable_mp((Control *)tb, &Control::update_minimum_size));
}
- tb->connect("pressed", callable_mp(singleton, &EditorNode::editor_select).bind(singleton->main_editor_buttons.size()));
+ tb->connect(SceneStringName(pressed), callable_mp(singleton, &EditorNode::editor_select).bind(singleton->main_editor_buttons.size()));
singleton->main_editor_buttons.push_back(tb);
singleton->main_editor_button_hb->add_child(tb);
@@ -3498,8 +3498,8 @@ void EditorNode::remove_editor_plugin(EditorPlugin *p_editor, bool p_config_chan
break;
} else {
- singleton->main_editor_buttons[i]->disconnect("pressed", callable_mp(singleton, &EditorNode::editor_select));
- singleton->main_editor_buttons[i]->connect("pressed", callable_mp(singleton, &EditorNode::editor_select).bind(i - 1));
+ singleton->main_editor_buttons[i]->disconnect(SceneStringName(pressed), callable_mp(singleton, &EditorNode::editor_select));
+ singleton->main_editor_buttons[i]->connect(SceneStringName(pressed), callable_mp(singleton, &EditorNode::editor_select).bind(i - 1));
}
}
@@ -3533,7 +3533,6 @@ void EditorNode::add_extension_editor_plugin(const StringName &p_class_name) {
EditorPlugin *plugin = Object::cast_to<EditorPlugin>(ClassDB::instantiate(p_class_name));
singleton->editor_data.add_extension_editor_plugin(p_class_name, plugin);
add_editor_plugin(plugin);
- plugin->enable_plugin();
}
void EditorNode::remove_extension_editor_plugin(const StringName &p_class_name) {
@@ -6652,7 +6651,7 @@ EditorNode::EditorNode() {
distraction_free->set_tooltip_text(TTR("Toggle distraction-free mode."));
distraction_free->set_toggle_mode(true);
scene_tabs->add_extra_button(distraction_free);
- distraction_free->connect("pressed", callable_mp(this, &EditorNode::_toggle_distraction_free_mode));
+ distraction_free->connect(SceneStringName(pressed), callable_mp(this, &EditorNode::_toggle_distraction_free_mode));
scene_root_parent = memnew(PanelContainer);
scene_root_parent->set_custom_minimum_size(Size2(0, 80) * EDSCALE);
@@ -7135,7 +7134,7 @@ EditorNode::EditorNode() {
gradle_build_manage_templates = memnew(ConfirmationDialog);
gradle_build_manage_templates->set_text(TTR("Android build template is missing, please install relevant templates."));
gradle_build_manage_templates->set_ok_button_text(TTR("Manage Templates"));
- gradle_build_manage_templates->add_button(TTR("Install from file"))->connect("pressed", callable_mp(this, &EditorNode::_menu_option).bind(SETTINGS_INSTALL_ANDROID_BUILD_TEMPLATE));
+ gradle_build_manage_templates->add_button(TTR("Install from file"))->connect(SceneStringName(pressed), callable_mp(this, &EditorNode::_menu_option).bind(SETTINGS_INSTALL_ANDROID_BUILD_TEMPLATE));
gradle_build_manage_templates->connect("confirmed", callable_mp(this, &EditorNode::_menu_option).bind(SETTINGS_MANAGE_EXPORT_TEMPLATES));
gui_base->add_child(gradle_build_manage_templates);
@@ -7273,9 +7272,7 @@ EditorNode::EditorNode() {
add_editor_plugin(memnew(AudioBusesEditorPlugin(audio_bus_editor)));
for (int i = 0; i < EditorPlugins::get_plugin_count(); i++) {
- EditorPlugin *plugin = EditorPlugins::create(i);
- add_editor_plugin(plugin);
- plugin->enable_plugin();
+ add_editor_plugin(EditorPlugins::create(i));
}
for (const StringName &extension_class_name : GDExtensionEditorPlugins::get_extension_classes()) {
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index 3195b99f76..49b30bd06e 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -235,7 +235,7 @@ EditorPropertyMultilineText::EditorPropertyMultilineText(bool p_expression) {
text->set_h_size_flags(SIZE_EXPAND_FILL);
open_big_text = memnew(Button);
open_big_text->set_flat(true);
- open_big_text->connect("pressed", callable_mp(this, &EditorPropertyMultilineText::_open_big_text));
+ open_big_text->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyMultilineText::_open_big_text));
hb->add_child(open_big_text);
big_text_dialog = nullptr;
big_text = nullptr;
@@ -382,7 +382,7 @@ EditorPropertyTextEnum::EditorPropertyTextEnum() {
edit_button->set_flat(true);
edit_button->hide();
default_layout->add_child(edit_button);
- edit_button->connect("pressed", callable_mp(this, &EditorPropertyTextEnum::_edit_custom_value));
+ edit_button->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyTextEnum::_edit_custom_value));
custom_value_edit = memnew(LineEdit);
custom_value_edit->set_h_size_flags(SIZE_EXPAND_FILL);
@@ -392,12 +392,12 @@ EditorPropertyTextEnum::EditorPropertyTextEnum() {
accept_button = memnew(Button);
accept_button->set_flat(true);
edit_custom_layout->add_child(accept_button);
- accept_button->connect("pressed", callable_mp(this, &EditorPropertyTextEnum::_custom_value_accepted));
+ accept_button->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyTextEnum::_custom_value_accepted));
cancel_button = memnew(Button);
cancel_button->set_flat(true);
edit_custom_layout->add_child(cancel_button);
- cancel_button->connect("pressed", callable_mp(this, &EditorPropertyTextEnum::_custom_value_canceled));
+ cancel_button->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyTextEnum::_custom_value_canceled));
add_focusable(option_button);
add_focusable(edit_button);
@@ -464,7 +464,7 @@ EditorPropertyLocale::EditorPropertyLocale() {
locale_hb->add_child(locale_edit);
add_focusable(locale);
dialog = nullptr;
- locale_edit->connect("pressed", callable_mp(this, &EditorPropertyLocale::_locale_pressed));
+ locale_edit->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyLocale::_locale_pressed));
}
///////////////////// PATH /////////////////////////
@@ -605,7 +605,7 @@ EditorPropertyPath::EditorPropertyPath() {
path_hb->add_child(path_edit);
add_focusable(path);
dialog = nullptr;
- path_edit->connect("pressed", callable_mp(this, &EditorPropertyPath::_path_pressed));
+ path_edit->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyPath::_path_pressed));
}
///////////////////// CLASS NAME /////////////////////////
@@ -646,7 +646,7 @@ EditorPropertyClassName::EditorPropertyClassName() {
add_child(property);
add_focusable(property);
property->set_text(selected_type);
- property->connect("pressed", callable_mp(this, &EditorPropertyClassName::_property_selected));
+ property->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyClassName::_property_selected));
dialog = memnew(CreateDialog);
dialog->set_base_type(base_type);
dialog->connect("create", callable_mp(this, &EditorPropertyClassName::_dialog_created));
@@ -677,7 +677,7 @@ EditorPropertyCheck::EditorPropertyCheck() {
checkbox->set_text(TTR("On"));
add_child(checkbox);
add_focusable(checkbox);
- checkbox->connect("pressed", callable_mp(this, &EditorPropertyCheck::_checkbox_pressed));
+ checkbox->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyCheck::_checkbox_pressed));
}
///////////////////// ENUM /////////////////////////
@@ -791,7 +791,7 @@ void EditorPropertyFlags::setup(const Vector<String> &p_options) {
CheckBox *cb = memnew(CheckBox);
cb->set_text(text_split[0]);
cb->set_clip_text(true);
- cb->connect("pressed", callable_mp(this, &EditorPropertyFlags::_flag_toggled).bind(flag_index));
+ cb->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyFlags::_flag_toggled).bind(flag_index));
add_focusable(cb);
vbox->add_child(cb);
flags.push_back(cb);
@@ -1296,7 +1296,7 @@ EditorPropertyLayers::EditorPropertyLayers() {
button = memnew(TextureButton);
button->set_stretch_mode(TextureButton::STRETCH_KEEP_CENTERED);
button->set_toggle_mode(true);
- button->connect("pressed", callable_mp(this, &EditorPropertyLayers::_button_pressed));
+ button->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyLayers::_button_pressed));
hb->add_child(button);
set_bottom_editor(hb);
@@ -1393,7 +1393,7 @@ EditorPropertyObjectID::EditorPropertyObjectID() {
add_child(edit);
add_focusable(edit);
edit->set_text_overrun_behavior(TextServer::OVERRUN_TRIM_ELLIPSIS);
- edit->connect("pressed", callable_mp(this, &EditorPropertyObjectID::_edit_pressed));
+ edit->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyObjectID::_edit_pressed));
}
///////////////////// SIGNAL /////////////////////////
@@ -1420,7 +1420,7 @@ EditorPropertySignal::EditorPropertySignal() {
edit = memnew(Button);
add_child(edit);
add_focusable(edit);
- edit->connect("pressed", callable_mp(this, &EditorPropertySignal::_edit_pressed));
+ edit->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertySignal::_edit_pressed));
}
///////////////////// CALLABLE /////////////////////////
@@ -2154,7 +2154,7 @@ EditorPropertyQuaternion::EditorPropertyQuaternion() {
warning = memnew(Button);
warning->set_text(TTR("Temporary Euler may be changed implicitly!"));
warning->set_clip_text(true);
- warning->connect("pressed", callable_mp(this, &EditorPropertyQuaternion::_warning_pressed));
+ warning->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyQuaternion::_warning_pressed));
warning_dialog = memnew(AcceptDialog);
add_child(warning_dialog);
warning_dialog->set_text(TTR("Temporary Euler will not be stored in the object with the original value. Instead, it will be stored as Quaternion with irreversible conversion.\nThis is due to the fact that the result of Euler->Quaternion can be determined uniquely, but the result of Quaternion->Euler can be multi-existent."));
@@ -2182,7 +2182,7 @@ EditorPropertyQuaternion::EditorPropertyQuaternion() {
edit_button->set_flat(true);
edit_button->set_toggle_mode(true);
default_layout->add_child(edit_button);
- edit_button->connect("pressed", callable_mp(this, &EditorPropertyQuaternion::_edit_custom_value));
+ edit_button->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyQuaternion::_edit_custom_value));
add_focusable(edit_button);
@@ -2981,7 +2981,7 @@ EditorPropertyNodePath::EditorPropertyNodePath() {
assign->set_clip_text(true);
assign->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
assign->set_expand_icon(true);
- assign->connect("pressed", callable_mp(this, &EditorPropertyNodePath::_node_assign));
+ assign->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyNodePath::_node_assign));
SET_DRAG_FORWARDING_CD(assign, EditorPropertyNodePath);
hbc->add_child(assign);
diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp
index 4c75f12952..ca1070d7f3 100644
--- a/editor/editor_properties_array_dict.cpp
+++ b/editor/editor_properties_array_dict.cpp
@@ -287,13 +287,13 @@ void EditorPropertyArray::_create_new_property_slot() {
Button *edit_btn = memnew(Button);
edit_btn->set_icon(get_editor_theme_icon(SNAME("Edit")));
edit_btn->set_disabled(is_read_only());
- edit_btn->connect("pressed", callable_mp(this, &EditorPropertyArray::_change_type).bind(edit_btn, idx));
+ edit_btn->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyArray::_change_type).bind(edit_btn, idx));
hbox->add_child(edit_btn);
} else {
Button *remove_btn = memnew(Button);
remove_btn->set_icon(get_editor_theme_icon(SNAME("Remove")));
remove_btn->set_disabled(is_read_only());
- remove_btn->connect("pressed", callable_mp(this, &EditorPropertyArray::_remove_pressed).bind(idx));
+ remove_btn->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyArray::_remove_pressed).bind(idx));
hbox->add_child(remove_btn);
}
property_vbox->add_child(hbox);
@@ -383,7 +383,7 @@ void EditorPropertyArray::update_property() {
button_add_item = EditorInspector::create_inspector_action_button(TTR("Add Element"));
button_add_item->set_icon(get_editor_theme_icon(SNAME("Add")));
- button_add_item->connect(SNAME("pressed"), callable_mp(this, &EditorPropertyArray::_add_element));
+ button_add_item->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyArray::_add_element));
button_add_item->set_disabled(is_read_only());
vbox->add_child(button_add_item);
@@ -829,7 +829,7 @@ EditorPropertyArray::EditorPropertyArray() {
edit = memnew(Button);
edit->set_h_size_flags(SIZE_EXPAND_FILL);
edit->set_clip_text(true);
- edit->connect("pressed", callable_mp(this, &EditorPropertyArray::_edit_pressed));
+ edit->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyArray::_edit_pressed));
edit->set_toggle_mode(true);
SET_DRAG_FORWARDING_CD(edit, EditorPropertyArray);
edit->connect(SceneStringName(draw), callable_mp(this, &EditorPropertyArray::_button_draw));
@@ -901,7 +901,7 @@ void EditorPropertyDictionary::_create_new_property_slot(int p_idx) {
Button *edit_btn = memnew(Button);
edit_btn->set_icon(get_editor_theme_icon(SNAME("Edit")));
edit_btn->set_disabled(is_read_only());
- edit_btn->connect("pressed", callable_mp(this, &EditorPropertyDictionary::_change_type).bind(edit_btn, slots.size()));
+ edit_btn->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyDictionary::_change_type).bind(edit_btn, slots.size()));
hbox->add_child(edit_btn);
if (add_panel) {
add_panel->get_child(0)->add_child(hbox);
@@ -1011,7 +1011,7 @@ void EditorPropertyDictionary::update_property() {
button_add_item = EditorInspector::create_inspector_action_button(TTR("Add Key/Value Pair"));
button_add_item->set_icon(get_theme_icon(SNAME("Add"), EditorStringName(EditorIcons)));
button_add_item->set_disabled(is_read_only());
- button_add_item->connect("pressed", callable_mp(this, &EditorPropertyDictionary::_add_key_value));
+ button_add_item->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyDictionary::_add_key_value));
add_vbox->add_child(button_add_item);
}
@@ -1143,7 +1143,7 @@ EditorPropertyDictionary::EditorPropertyDictionary() {
edit = memnew(Button);
edit->set_h_size_flags(SIZE_EXPAND_FILL);
edit->set_clip_text(true);
- edit->connect("pressed", callable_mp(this, &EditorPropertyDictionary::_edit_pressed));
+ edit->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyDictionary::_edit_pressed));
edit->set_toggle_mode(true);
add_child(edit);
add_focusable(edit);
@@ -1290,7 +1290,7 @@ void EditorPropertyLocalizableString::update_property() {
Button *edit_btn = memnew(Button);
edit_btn->set_icon(get_editor_theme_icon(SNAME("Remove")));
hbox->add_child(edit_btn);
- edit_btn->connect("pressed", callable_mp(this, &EditorPropertyLocalizableString::_remove_item).bind(edit_btn, remove_index));
+ edit_btn->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyLocalizableString::_remove_item).bind(edit_btn, remove_index));
prop->update_property();
}
@@ -1298,7 +1298,7 @@ void EditorPropertyLocalizableString::update_property() {
if (page_index == max_page) {
button_add_item = EditorInspector::create_inspector_action_button(TTR("Add Translation"));
button_add_item->set_icon(get_editor_theme_icon(SNAME("Add")));
- button_add_item->connect("pressed", callable_mp(this, &EditorPropertyLocalizableString::_add_locale_popup));
+ button_add_item->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyLocalizableString::_add_locale_popup));
property_vbox->add_child(button_add_item);
}
@@ -1358,7 +1358,7 @@ EditorPropertyLocalizableString::EditorPropertyLocalizableString() {
edit = memnew(Button);
edit->set_h_size_flags(SIZE_EXPAND_FILL);
edit->set_clip_text(true);
- edit->connect("pressed", callable_mp(this, &EditorPropertyLocalizableString::_edit_pressed));
+ edit->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyLocalizableString::_edit_pressed));
edit->set_toggle_mode(true);
add_child(edit);
add_focusable(edit);
diff --git a/editor/editor_properties_vector.cpp b/editor/editor_properties_vector.cpp
index 46bfb69e29..de7de9337f 100644
--- a/editor/editor_properties_vector.cpp
+++ b/editor/editor_properties_vector.cpp
@@ -230,7 +230,7 @@ EditorPropertyVectorN::EditorPropertyVectorN(Variant::Type p_type, bool p_force_
linked->set_toggle_mode(true);
linked->set_stretch_mode(TextureButton::STRETCH_KEEP_CENTERED);
linked->set_tooltip_text(TTR("Lock/Unlock Component Ratio"));
- linked->connect(SNAME("pressed"), callable_mp(this, &EditorPropertyVectorN::_update_ratio));
+ linked->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyVectorN::_update_ratio));
linked->connect(SNAME("toggled"), callable_mp(this, &EditorPropertyVectorN::_store_link));
hb->add_child(linked);
diff --git a/editor/editor_resource_picker.cpp b/editor/editor_resource_picker.cpp
index ef4469623c..50820ac12f 100644
--- a/editor/editor_resource_picker.cpp
+++ b/editor/editor_resource_picker.cpp
@@ -1043,7 +1043,7 @@ EditorResourcePicker::EditorResourcePicker(bool p_hide_assign_button_controls) {
assign_button->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
SET_DRAG_FORWARDING_GCD(assign_button, EditorResourcePicker);
add_child(assign_button);
- assign_button->connect("pressed", callable_mp(this, &EditorResourcePicker::_resource_selected));
+ assign_button->connect(SceneStringName(pressed), callable_mp(this, &EditorResourcePicker::_resource_selected));
assign_button->connect(SceneStringName(draw), callable_mp(this, &EditorResourcePicker::_button_draw));
assign_button->connect(SceneStringName(gui_input), callable_mp(this, &EditorResourcePicker::_button_input));
@@ -1061,7 +1061,7 @@ EditorResourcePicker::EditorResourcePicker(bool p_hide_assign_button_controls) {
edit_button = memnew(Button);
edit_button->set_flat(true);
edit_button->set_toggle_mode(true);
- edit_button->connect("pressed", callable_mp(this, &EditorResourcePicker::_update_menu));
+ edit_button->connect(SceneStringName(pressed), callable_mp(this, &EditorResourcePicker::_update_menu));
add_child(edit_button);
edit_button->connect(SceneStringName(gui_input), callable_mp(this, &EditorResourcePicker::_button_input));
diff --git a/editor/editor_settings_dialog.cpp b/editor/editor_settings_dialog.cpp
index 37210714f1..2c6c13401f 100644
--- a/editor/editor_settings_dialog.cpp
+++ b/editor/editor_settings_dialog.cpp
@@ -747,12 +747,12 @@ EditorSettingsDialog::EditorSettingsDialog() {
restart_hb->add_child(restart_label);
restart_hb->add_spacer();
Button *restart_button = memnew(Button);
- restart_button->connect("pressed", callable_mp(this, &EditorSettingsDialog::_editor_restart));
+ restart_button->connect(SceneStringName(pressed), callable_mp(this, &EditorSettingsDialog::_editor_restart));
restart_hb->add_child(restart_button);
restart_button->set_text(TTR("Save & Restart"));
restart_close_button = memnew(Button);
restart_close_button->set_flat(true);
- restart_close_button->connect("pressed", callable_mp(this, &EditorSettingsDialog::_editor_restart_close));
+ restart_close_button->connect(SceneStringName(pressed), callable_mp(this, &EditorSettingsDialog::_editor_restart_close));
restart_hb->add_child(restart_close_button);
restart_container->hide();
@@ -784,8 +784,8 @@ EditorSettingsDialog::EditorSettingsDialog() {
Button *clear_all_search = memnew(Button);
clear_all_search->set_text(TTR("Clear All"));
- clear_all_search->connect("pressed", callable_mp(shortcut_search_box, &LineEdit::clear));
- clear_all_search->connect("pressed", callable_mp(shortcut_search_by_event, &EventListenerLineEdit::clear_event));
+ clear_all_search->connect(SceneStringName(pressed), callable_mp(shortcut_search_box, &LineEdit::clear));
+ clear_all_search->connect(SceneStringName(pressed), callable_mp(shortcut_search_by_event, &EventListenerLineEdit::clear_event));
top_hbox->add_child(clear_all_search);
shortcuts = memnew(Tree);
diff --git a/editor/export/export_template_manager.cpp b/editor/export/export_template_manager.cpp
index 9fad872a3b..339a6e4b7f 100644
--- a/editor/export/export_template_manager.cpp
+++ b/editor/export/export_template_manager.cpp
@@ -928,13 +928,13 @@ ExportTemplateManager::ExportTemplateManager() {
current_open_button->set_text(TTR("Open Folder"));
current_open_button->set_tooltip_text(TTR("Open the folder containing installed templates for the current version."));
current_installed_hb->add_child(current_open_button);
- current_open_button->connect("pressed", callable_mp(this, &ExportTemplateManager::_open_template_folder).bind(VERSION_FULL_CONFIG));
+ current_open_button->connect(SceneStringName(pressed), callable_mp(this, &ExportTemplateManager::_open_template_folder).bind(VERSION_FULL_CONFIG));
current_uninstall_button = memnew(Button);
current_uninstall_button->set_text(TTR("Uninstall"));
current_uninstall_button->set_tooltip_text(TTR("Uninstall templates for the current version."));
current_installed_hb->add_child(current_uninstall_button);
- current_uninstall_button->connect("pressed", callable_mp(this, &ExportTemplateManager::_uninstall_template).bind(VERSION_FULL_CONFIG));
+ current_uninstall_button->connect(SceneStringName(pressed), callable_mp(this, &ExportTemplateManager::_uninstall_template).bind(VERSION_FULL_CONFIG));
main_vb->add_child(memnew(HSeparator));
@@ -981,7 +981,7 @@ ExportTemplateManager::ExportTemplateManager() {
download_current_button->set_text(TTR("Download and Install"));
download_current_button->set_tooltip_text(TTR("Download and install templates for the current version from the best possible mirror."));
download_install_hb->add_child(download_current_button);
- download_current_button->connect("pressed", callable_mp(this, &ExportTemplateManager::_download_current));
+ download_current_button->connect(SceneStringName(pressed), callable_mp(this, &ExportTemplateManager::_download_current));
// Update downloads buttons to prevent unsupported downloads.
if (!downloads_available) {
@@ -997,7 +997,7 @@ ExportTemplateManager::ExportTemplateManager() {
install_file_button->set_text(TTR("Install from File"));
install_file_button->set_tooltip_text(TTR("Install templates from a local file."));
install_file_hb->add_child(install_file_button);
- install_file_button->connect("pressed", callable_mp(this, &ExportTemplateManager::_install_file));
+ install_file_button->connect(SceneStringName(pressed), callable_mp(this, &ExportTemplateManager::_install_file));
// Templates are being downloaded; buttons unavailable.
download_progress_hb = memnew(HBoxContainer);
@@ -1023,7 +1023,7 @@ ExportTemplateManager::ExportTemplateManager() {
download_cancel_button->set_text(TTR("Cancel"));
download_cancel_button->set_tooltip_text(TTR("Cancel the download of the templates."));
download_progress_hb->add_child(download_cancel_button);
- download_cancel_button->connect("pressed", callable_mp(this, &ExportTemplateManager::_cancel_template_download));
+ download_cancel_button->connect(SceneStringName(pressed), callable_mp(this, &ExportTemplateManager::_cancel_template_download));
download_templates = memnew(HTTPRequest);
install_templates_hb->add_child(download_templates);
diff --git a/editor/export/project_export.cpp b/editor/export/project_export.cpp
index 1da75ff88f..c6a671b7f9 100644
--- a/editor/export/project_export.cpp
+++ b/editor/export/project_export.cpp
@@ -88,7 +88,7 @@ ProjectExportTextureFormatError::ProjectExportTextureFormatError() {
fix_texture_format_button->set_v_size_flags(Control::SIZE_SHRINK_CENTER);
fix_texture_format_button->set_text(TTR("Fix Import"));
add_child(fix_texture_format_button);
- fix_texture_format_button->connect("pressed", callable_mp(this, &ProjectExportTextureFormatError::_on_fix_texture_format_pressed));
+ fix_texture_format_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectExportTextureFormatError::_on_fix_texture_format_pressed));
}
void ProjectExportDialog::_notification(int p_what) {
@@ -1251,12 +1251,12 @@ ProjectExportDialog::ProjectExportDialog() {
duplicate_preset->set_tooltip_text(TTR("Duplicate"));
duplicate_preset->set_flat(true);
preset_hb->add_child(duplicate_preset);
- duplicate_preset->connect("pressed", callable_mp(this, &ProjectExportDialog::_duplicate_preset));
+ duplicate_preset->connect(SceneStringName(pressed), callable_mp(this, &ProjectExportDialog::_duplicate_preset));
delete_preset = memnew(Button);
delete_preset->set_tooltip_text(TTR("Delete"));
delete_preset->set_flat(true);
preset_hb->add_child(delete_preset);
- delete_preset->connect("pressed", callable_mp(this, &ProjectExportDialog::_delete_preset));
+ delete_preset->connect(SceneStringName(pressed), callable_mp(this, &ProjectExportDialog::_delete_preset));
// Preset settings.
@@ -1271,12 +1271,12 @@ ProjectExportDialog::ProjectExportDialog() {
runnable = memnew(CheckButton);
runnable->set_text(TTR("Runnable"));
runnable->set_tooltip_text(TTR("If checked, the preset will be available for use in one-click deploy.\nOnly one preset per platform may be marked as runnable."));
- runnable->connect("pressed", callable_mp(this, &ProjectExportDialog::_runnable_pressed));
+ runnable->connect(SceneStringName(pressed), callable_mp(this, &ProjectExportDialog::_runnable_pressed));
advanced_options = memnew(CheckButton);
advanced_options->set_text(TTR("Advanced Options"));
advanced_options->set_tooltip_text(TTR("If checked, the advanced options will be shown."));
- advanced_options->connect("pressed", callable_mp(this, &ProjectExportDialog::_advanced_options_pressed));
+ advanced_options->connect(SceneStringName(pressed), callable_mp(this, &ProjectExportDialog::_advanced_options_pressed));
HBoxContainer *preset_configs_container = memnew(HBoxContainer);
preset_configs_container->add_spacer(true);
@@ -1434,7 +1434,7 @@ ProjectExportDialog::ProjectExportDialog() {
LinkButton *sec_more_info = memnew(LinkButton);
sec_more_info->set_text(TTR("More Info..."));
- sec_more_info->connect("pressed", callable_mp(this, &ProjectExportDialog::_open_key_help_link));
+ sec_more_info->connect(SceneStringName(pressed), callable_mp(this, &ProjectExportDialog::_open_key_help_link));
sec_vb->add_child(sec_more_info);
// Script export parameters.
@@ -1484,7 +1484,7 @@ ProjectExportDialog::ProjectExportDialog() {
export_button = add_button(TTR("Export Project..."), !DisplayServer::get_singleton()->get_swap_cancel_ok(), "export");
export_button->set_tooltip_text(TTR("Export the project as a playable build (Godot executable and project data) for the selected preset."));
#endif
- export_button->connect("pressed", callable_mp(this, &ProjectExportDialog::_export_project));
+ export_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectExportDialog::_export_project));
// Disable initially before we select a valid preset
export_button->set_disabled(true);
@@ -1504,7 +1504,7 @@ ProjectExportDialog::ProjectExportDialog() {
#else
export_all_button = add_button(TTR("Export All..."), !DisplayServer::get_singleton()->get_swap_cancel_ok(), "export");
#endif
- export_all_button->connect("pressed", callable_mp(this, &ProjectExportDialog::_export_all_dialog));
+ export_all_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectExportDialog::_export_all_dialog));
export_all_button->set_disabled(true);
export_pck_zip = memnew(EditorFileDialog);
@@ -1554,7 +1554,7 @@ ProjectExportDialog::ProjectExportDialog() {
download_templates->set_text(TTR("Manage Export Templates"));
download_templates->set_v_size_flags(Control::SIZE_SHRINK_CENTER);
export_templates_error->add_child(download_templates);
- download_templates->connect("pressed", callable_mp(this, &ProjectExportDialog::_open_export_template_manager));
+ download_templates->connect(SceneStringName(pressed), callable_mp(this, &ProjectExportDialog::_open_export_template_manager));
// Export project file dialog.
diff --git a/editor/fbx_importer_manager.cpp b/editor/fbx_importer_manager.cpp
index 2049ac9344..f9673771e1 100644
--- a/editor/fbx_importer_manager.cpp
+++ b/editor/fbx_importer_manager.cpp
@@ -153,7 +153,7 @@ FBXImporterManager::FBXImporterManager() {
hb->add_child(fbx_path);
fbx_path_browse = memnew(Button);
fbx_path_browse->set_text(TTR("Browse"));
- fbx_path_browse->connect("pressed", callable_mp(this, &FBXImporterManager::_browse_install));
+ fbx_path_browse->connect(SceneStringName(pressed), callable_mp(this, &FBXImporterManager::_browse_install));
hb->add_child(fbx_path_browse);
hb->set_h_size_flags(Control::SIZE_EXPAND_FILL);
hb->set_custom_minimum_size(Size2(400 * EDSCALE, 0));
@@ -168,7 +168,7 @@ FBXImporterManager::FBXImporterManager() {
fbx_path->connect("text_changed", callable_mp(this, &FBXImporterManager::_validate_path));
get_ok_button()->set_text(TTR("Confirm Path"));
- get_cancel_button()->connect("pressed", callable_mp(this, &FBXImporterManager::_cancel_setup));
+ get_cancel_button()->connect(SceneStringName(pressed), callable_mp(this, &FBXImporterManager::_cancel_setup));
browse_dialog = memnew(EditorFileDialog);
browse_dialog->set_access(EditorFileDialog::ACCESS_FILESYSTEM);
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index b087f4e64e..b05cafa694 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -538,10 +538,10 @@ void FileSystemDock::_notification(int p_what) {
EditorFileSystem::get_singleton()->connect("filesystem_changed", callable_mp(this, &FileSystemDock::_fs_changed));
EditorResourcePreview::get_singleton()->connect("preview_invalidated", callable_mp(this, &FileSystemDock::_preview_invalidated));
- button_file_list_display_mode->connect("pressed", callable_mp(this, &FileSystemDock::_toggle_file_display));
+ button_file_list_display_mode->connect(SceneStringName(pressed), callable_mp(this, &FileSystemDock::_toggle_file_display));
files->connect("item_activated", callable_mp(this, &FileSystemDock::_file_list_activate_file));
- button_hist_next->connect("pressed", callable_mp(this, &FileSystemDock::_fw_history));
- button_hist_prev->connect("pressed", callable_mp(this, &FileSystemDock::_bw_history));
+ button_hist_next->connect(SceneStringName(pressed), callable_mp(this, &FileSystemDock::_fw_history));
+ button_hist_prev->connect(SceneStringName(pressed), callable_mp(this, &FileSystemDock::_bw_history));
file_list_popup->connect("id_pressed", callable_mp(this, &FileSystemDock::_file_list_rmb_option));
tree_popup->connect("id_pressed", callable_mp(this, &FileSystemDock::_tree_rmb_option));
current_path_line_edit->connect("text_submitted", callable_mp(this, &FileSystemDock::_navigate_to_path).bind(false));
@@ -3959,14 +3959,14 @@ FileSystemDock::FileSystemDock() {
toolbar_hbc->add_child(current_path_line_edit);
button_reload = memnew(Button);
- button_reload->connect("pressed", callable_mp(this, &FileSystemDock::_rescan));
+ button_reload->connect(SceneStringName(pressed), callable_mp(this, &FileSystemDock::_rescan));
button_reload->set_focus_mode(FOCUS_NONE);
button_reload->set_tooltip_text(TTR("Re-Scan Filesystem"));
button_reload->hide();
toolbar_hbc->add_child(button_reload);
button_toggle_display_mode = memnew(Button);
- button_toggle_display_mode->connect("pressed", callable_mp(this, &FileSystemDock::_change_split_mode));
+ button_toggle_display_mode->connect(SceneStringName(pressed), callable_mp(this, &FileSystemDock::_change_split_mode));
button_toggle_display_mode->set_focus_mode(FOCUS_NONE);
button_toggle_display_mode->set_tooltip_text(TTR("Change Split Mode"));
button_toggle_display_mode->set_theme_type_variation("FlatMenuButton");
@@ -3974,7 +3974,7 @@ FileSystemDock::FileSystemDock() {
button_dock_placement = memnew(Button);
button_dock_placement->set_flat(true);
- button_dock_placement->connect("pressed", callable_mp(this, &FileSystemDock::_change_bottom_dock_placement));
+ button_dock_placement->connect(SceneStringName(pressed), callable_mp(this, &FileSystemDock::_change_bottom_dock_placement));
button_dock_placement->hide();
toolbar_hbc->add_child(button_dock_placement);
@@ -4093,7 +4093,7 @@ FileSystemDock::FileSystemDock() {
overwrite_dialog = memnew(ConfirmationDialog);
add_child(overwrite_dialog);
overwrite_dialog->set_ok_button_text(TTR("Overwrite"));
- overwrite_dialog->add_button(TTR("Keep Both"), true)->connect("pressed", callable_mp(this, &FileSystemDock::_overwrite_dialog_action).bind(false));
+ overwrite_dialog->add_button(TTR("Keep Both"), true)->connect(SceneStringName(pressed), callable_mp(this, &FileSystemDock::_overwrite_dialog_action).bind(false));
overwrite_dialog->connect("confirmed", callable_mp(this, &FileSystemDock::_overwrite_dialog_action).bind(true));
VBoxContainer *overwrite_dialog_vb = memnew(VBoxContainer);
diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp
index 87c23564ee..e9edcab52f 100644
--- a/editor/find_in_files.cpp
+++ b/editor/find_in_files.cpp
@@ -367,7 +367,7 @@ FindInFilesDialog::FindInFilesDialog() {
Button *folder_button = memnew(Button);
folder_button->set_text("...");
- folder_button->connect("pressed", callable_mp(this, &FindInFilesDialog::_on_folder_button_pressed));
+ folder_button->connect(SceneStringName(pressed), callable_mp(this, &FindInFilesDialog::_on_folder_button_pressed));
hbc->add_child(folder_button);
_folder_dialog = memnew(FileDialog);
@@ -603,19 +603,19 @@ FindInFilesPanel::FindInFilesPanel() {
_refresh_button = memnew(Button);
_refresh_button->set_text(TTR("Refresh"));
- _refresh_button->connect("pressed", callable_mp(this, &FindInFilesPanel::_on_refresh_button_clicked));
+ _refresh_button->connect(SceneStringName(pressed), callable_mp(this, &FindInFilesPanel::_on_refresh_button_clicked));
_refresh_button->hide();
hbc->add_child(_refresh_button);
_cancel_button = memnew(Button);
_cancel_button->set_text(TTR("Cancel"));
- _cancel_button->connect("pressed", callable_mp(this, &FindInFilesPanel::_on_cancel_button_clicked));
+ _cancel_button->connect(SceneStringName(pressed), callable_mp(this, &FindInFilesPanel::_on_cancel_button_clicked));
_cancel_button->hide();
hbc->add_child(_cancel_button);
_close_button = memnew(Button);
_close_button->set_text(TTR("Close"));
- _close_button->connect("pressed", callable_mp(this, &FindInFilesPanel::_on_close_button_clicked));
+ _close_button->connect(SceneStringName(pressed), callable_mp(this, &FindInFilesPanel::_on_close_button_clicked));
hbc->add_child(_close_button);
vbc->add_child(hbc);
@@ -649,7 +649,7 @@ FindInFilesPanel::FindInFilesPanel() {
_replace_all_button = memnew(Button);
_replace_all_button->set_text(TTR("Replace all (no undo)"));
- _replace_all_button->connect("pressed", callable_mp(this, &FindInFilesPanel::_on_replace_all_clicked));
+ _replace_all_button->connect(SceneStringName(pressed), callable_mp(this, &FindInFilesPanel::_on_replace_all_clicked));
_replace_container->add_child(_replace_all_button);
_replace_container->hide();
diff --git a/editor/group_settings_editor.cpp b/editor/group_settings_editor.cpp
index a7cfa0d6f4..981a847428 100644
--- a/editor/group_settings_editor.cpp
+++ b/editor/group_settings_editor.cpp
@@ -516,7 +516,7 @@ GroupSettingsEditor::GroupSettingsEditor() {
add_button = memnew(Button);
add_button->set_text(TTR("Add"));
add_button->set_disabled(true);
- add_button->connect("pressed", callable_mp(this, &GroupSettingsEditor::_add_group));
+ add_button->connect(SceneStringName(pressed), callable_mp(this, &GroupSettingsEditor::_add_group));
hbc->add_child(add_button);
tree = memnew(Tree);
diff --git a/editor/groups_editor.cpp b/editor/groups_editor.cpp
index daa014bfac..fc2ea80be9 100644
--- a/editor/groups_editor.cpp
+++ b/editor/groups_editor.cpp
@@ -836,7 +836,7 @@ GroupsEditor::GroupsEditor() {
add = memnew(Button);
add->set_flat(true);
add->set_tooltip_text(TTR("Add a new group."));
- add->connect("pressed", callable_mp(this, &GroupsEditor::_show_add_group_dialog));
+ add->connect(SceneStringName(pressed), callable_mp(this, &GroupsEditor::_show_add_group_dialog));
hbc->add_child(add);
filter = memnew(LineEdit);
diff --git a/editor/gui/editor_bottom_panel.cpp b/editor/gui/editor_bottom_panel.cpp
index b575910976..3dbefa5cbc 100644
--- a/editor/gui/editor_bottom_panel.cpp
+++ b/editor/gui/editor_bottom_panel.cpp
@@ -265,7 +265,7 @@ EditorBottomPanel::EditorBottomPanel() {
build_date = TTR("(unknown)");
}
version_btn->set_tooltip_text(vformat(TTR("Git commit date: %s\nClick to copy the version information."), build_date));
- version_btn->connect("pressed", callable_mp(this, &EditorBottomPanel::_version_button_pressed));
+ version_btn->connect(SceneStringName(pressed), callable_mp(this, &EditorBottomPanel::_version_button_pressed));
version_btn->set_v_size_flags(Control::SIZE_SHRINK_CENTER);
bottom_hbox->add_child(version_btn);
diff --git a/editor/gui/editor_dir_dialog.cpp b/editor/gui/editor_dir_dialog.cpp
index 08612f419c..e64761d5b5 100644
--- a/editor/gui/editor_dir_dialog.cpp
+++ b/editor/gui/editor_dir_dialog.cpp
@@ -213,7 +213,7 @@ EditorDirDialog::EditorDirDialog() {
makedir = memnew(Button(TTR("Create Folder")));
hb->add_child(makedir);
- makedir->connect("pressed", callable_mp(this, &EditorDirDialog::_make_dir));
+ makedir->connect(SceneStringName(pressed), callable_mp(this, &EditorDirDialog::_make_dir));
tree = memnew(Tree);
vb->add_child(tree);
@@ -224,7 +224,7 @@ EditorDirDialog::EditorDirDialog() {
set_ok_button_text(TTR("Move"));
copy = add_button(TTR("Copy"), !DisplayServer::get_singleton()->get_swap_cancel_ok());
- copy->connect("pressed", callable_mp(this, &EditorDirDialog::_copy_pressed));
+ copy->connect(SceneStringName(pressed), callable_mp(this, &EditorDirDialog::_copy_pressed));
makedialog = memnew(DirectoryCreateDialog);
add_child(makedialog);
diff --git a/editor/gui/editor_file_dialog.cpp b/editor/gui/editor_file_dialog.cpp
index 08e75ee812..8883c0b9af 100644
--- a/editor/gui/editor_file_dialog.cpp
+++ b/editor/gui/editor_file_dialog.cpp
@@ -2109,9 +2109,9 @@ EditorFileDialog::EditorFileDialog() {
pathhb->add_child(dir_next);
pathhb->add_child(dir_up);
- dir_prev->connect("pressed", callable_mp(this, &EditorFileDialog::_go_back));
- dir_next->connect("pressed", callable_mp(this, &EditorFileDialog::_go_forward));
- dir_up->connect("pressed", callable_mp(this, &EditorFileDialog::_go_up));
+ dir_prev->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::_go_back));
+ dir_next->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::_go_forward));
+ dir_up->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::_go_up));
Label *l = memnew(Label(TTR("Path:")));
l->set_theme_type_variation("HeaderSmall");
@@ -2128,14 +2128,14 @@ EditorFileDialog::EditorFileDialog() {
refresh = memnew(Button);
refresh->set_theme_type_variation("FlatButton");
refresh->set_tooltip_text(TTR("Refresh files."));
- refresh->connect("pressed", callable_mp(this, &EditorFileDialog::update_file_list));
+ refresh->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::update_file_list));
pathhb->add_child(refresh);
favorite = memnew(Button);
favorite->set_theme_type_variation("FlatButton");
favorite->set_toggle_mode(true);
favorite->set_tooltip_text(TTR("(Un)favorite current folder."));
- favorite->connect("pressed", callable_mp(this, &EditorFileDialog::_favorite_pressed));
+ favorite->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::_favorite_pressed));
pathhb->add_child(favorite);
show_hidden = memnew(Button);
@@ -2153,7 +2153,7 @@ EditorFileDialog::EditorFileDialog() {
mode_thumbnails = memnew(Button);
mode_thumbnails->set_theme_type_variation("FlatButton");
- mode_thumbnails->connect("pressed", callable_mp(this, &EditorFileDialog::set_display_mode).bind(DISPLAY_THUMBNAILS));
+ mode_thumbnails->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::set_display_mode).bind(DISPLAY_THUMBNAILS));
mode_thumbnails->set_toggle_mode(true);
mode_thumbnails->set_pressed(display_mode == DISPLAY_THUMBNAILS);
mode_thumbnails->set_button_group(view_mode_group);
@@ -2162,7 +2162,7 @@ EditorFileDialog::EditorFileDialog() {
mode_list = memnew(Button);
mode_list->set_theme_type_variation("FlatButton");
- mode_list->connect("pressed", callable_mp(this, &EditorFileDialog::set_display_mode).bind(DISPLAY_LIST));
+ mode_list->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::set_display_mode).bind(DISPLAY_LIST));
mode_list->set_toggle_mode(true);
mode_list->set_pressed(display_mode == DISPLAY_LIST);
mode_list->set_button_group(view_mode_group);
@@ -2181,7 +2181,7 @@ EditorFileDialog::EditorFileDialog() {
makedir = memnew(Button);
makedir->set_theme_type_variation("FlatButton");
makedir->set_tooltip_text(TTR("Create a new folder."));
- makedir->connect("pressed", callable_mp(this, &EditorFileDialog::_make_dir));
+ makedir->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::_make_dir));
pathhb->add_child(makedir);
body_hsplit = memnew(HSplitContainer);
@@ -2215,11 +2215,11 @@ EditorFileDialog::EditorFileDialog() {
fav_up = memnew(Button);
fav_up->set_theme_type_variation("FlatButton");
fav_hb->add_child(fav_up);
- fav_up->connect("pressed", callable_mp(this, &EditorFileDialog::_favorite_move_up));
+ fav_up->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::_favorite_move_up));
fav_down = memnew(Button);
fav_down->set_theme_type_variation("FlatButton");
fav_hb->add_child(fav_down);
- fav_down->connect("pressed", callable_mp(this, &EditorFileDialog::_favorite_move_down));
+ fav_down->connect(SceneStringName(pressed), callable_mp(this, &EditorFileDialog::_favorite_move_down));
favorites = memnew(ItemList);
favorites->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
diff --git a/editor/gui/editor_object_selector.cpp b/editor/gui/editor_object_selector.cpp
index 862ecc0a68..a713aa1ecd 100644
--- a/editor/gui/editor_object_selector.cpp
+++ b/editor/gui/editor_object_selector.cpp
@@ -211,7 +211,7 @@ void EditorObjectSelector::_notification(int p_what) {
} break;
case NOTIFICATION_READY: {
- connect("pressed", callable_mp(this, &EditorObjectSelector::_show_popup));
+ connect(SceneStringName(pressed), callable_mp(this, &EditorObjectSelector::_show_popup));
} break;
}
}
diff --git a/editor/gui/editor_run_bar.cpp b/editor/gui/editor_run_bar.cpp
index a44dfc9858..31331126b2 100644
--- a/editor/gui/editor_run_bar.cpp
+++ b/editor/gui/editor_run_bar.cpp
@@ -376,7 +376,7 @@ EditorRunBar::EditorRunBar() {
play_button->set_toggle_mode(true);
play_button->set_focus_mode(Control::FOCUS_NONE);
play_button->set_tooltip_text(TTR("Run the project's default scene."));
- play_button->connect("pressed", callable_mp(this, &EditorRunBar::play_main_scene).bind(false));
+ play_button->connect(SceneStringName(pressed), callable_mp(this, &EditorRunBar::play_main_scene).bind(false));
ED_SHORTCUT_AND_COMMAND("editor/run_project", TTR("Run Project"), Key::F5);
ED_SHORTCUT_OVERRIDE("editor/run_project", "macos", KeyModifierMask::META | Key::B);
@@ -400,7 +400,7 @@ EditorRunBar::EditorRunBar() {
stop_button->set_focus_mode(Control::FOCUS_NONE);
stop_button->set_tooltip_text(TTR("Stop the currently running project."));
stop_button->set_disabled(true);
- stop_button->connect("pressed", callable_mp(this, &EditorRunBar::stop_playing));
+ stop_button->connect(SceneStringName(pressed), callable_mp(this, &EditorRunBar::stop_playing));
ED_SHORTCUT("editor/stop_running_project", TTR("Stop Running Project"), Key::F8);
ED_SHORTCUT_OVERRIDE("editor/stop_running_project", "macos", KeyModifierMask::META | Key::PERIOD);
@@ -416,7 +416,7 @@ EditorRunBar::EditorRunBar() {
play_scene_button->set_toggle_mode(true);
play_scene_button->set_focus_mode(Control::FOCUS_NONE);
play_scene_button->set_tooltip_text(TTR("Run the currently edited scene."));
- play_scene_button->connect("pressed", callable_mp(this, &EditorRunBar::_play_current_pressed));
+ play_scene_button->connect(SceneStringName(pressed), callable_mp(this, &EditorRunBar::_play_current_pressed));
ED_SHORTCUT_AND_COMMAND("editor/run_current_scene", TTR("Run Current Scene"), Key::F6);
ED_SHORTCUT_OVERRIDE("editor/run_current_scene", "macos", KeyModifierMask::META | Key::R);
@@ -428,7 +428,7 @@ EditorRunBar::EditorRunBar() {
play_custom_scene_button->set_toggle_mode(true);
play_custom_scene_button->set_focus_mode(Control::FOCUS_NONE);
play_custom_scene_button->set_tooltip_text(TTR("Run a specific scene."));
- play_custom_scene_button->connect("pressed", callable_mp(this, &EditorRunBar::_play_custom_pressed));
+ play_custom_scene_button->connect(SceneStringName(pressed), callable_mp(this, &EditorRunBar::_play_custom_pressed));
ED_SHORTCUT_AND_COMMAND("editor/run_specific_scene", TTR("Run Specific Scene"), KeyModifierMask::CTRL | KeyModifierMask::SHIFT | Key::F5);
ED_SHORTCUT_OVERRIDE("editor/run_specific_scene", "macos", KeyModifierMask::META | KeyModifierMask::SHIFT | Key::R);
diff --git a/editor/gui/editor_scene_tabs.cpp b/editor/gui/editor_scene_tabs.cpp
index f39e2adcb1..f1ca59e0ac 100644
--- a/editor/gui/editor_scene_tabs.cpp
+++ b/editor/gui/editor_scene_tabs.cpp
@@ -415,7 +415,7 @@ EditorSceneTabs::EditorSceneTabs() {
scene_tab_add->set_flat(true);
scene_tab_add->set_tooltip_text(TTR("Add a new scene."));
scene_tabs->add_child(scene_tab_add);
- scene_tab_add->connect("pressed", callable_mp(EditorNode::get_singleton(), &EditorNode::trigger_menu_option).bind(EditorNode::FILE_NEW_SCENE, false));
+ scene_tab_add->connect(SceneStringName(pressed), callable_mp(EditorNode::get_singleton(), &EditorNode::trigger_menu_option).bind(EditorNode::FILE_NEW_SCENE, false));
scene_tab_add_ph = memnew(Control);
scene_tab_add_ph->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
diff --git a/editor/gui/editor_toaster.cpp b/editor/gui/editor_toaster.cpp
index e857a82fa5..7aa5335b77 100644
--- a/editor/gui/editor_toaster.cpp
+++ b/editor/gui/editor_toaster.cpp
@@ -376,7 +376,7 @@ Control *EditorToaster::popup(Control *p_control, Severity p_severity, double p_
Button *close_button = memnew(Button);
close_button->set_flat(true);
close_button->set_icon(get_editor_theme_icon(SNAME("Close")));
- close_button->connect("pressed", callable_mp(this, &EditorToaster::close).bind(panel));
+ close_button->connect(SceneStringName(pressed), callable_mp(this, &EditorToaster::close).bind(panel));
close_button->connect(SceneStringName(theme_changed), callable_mp(this, &EditorToaster::_close_button_theme_changed).bind(close_button));
hbox_container->add_child(close_button);
}
@@ -544,8 +544,8 @@ EditorToaster::EditorToaster() {
main_button->set_modulate(Color(0.5, 0.5, 0.5));
main_button->set_disabled(true);
main_button->set_theme_type_variation("FlatMenuButton");
- main_button->connect("pressed", callable_mp(this, &EditorToaster::_set_notifications_enabled).bind(true));
- main_button->connect("pressed", callable_mp(this, &EditorToaster::_repop_old));
+ main_button->connect(SceneStringName(pressed), callable_mp(this, &EditorToaster::_set_notifications_enabled).bind(true));
+ main_button->connect(SceneStringName(pressed), callable_mp(this, &EditorToaster::_repop_old));
main_button->connect(SceneStringName(draw), callable_mp(this, &EditorToaster::_draw_button));
add_child(main_button);
@@ -558,7 +558,7 @@ EditorToaster::EditorToaster() {
disable_notifications_button = memnew(Button);
disable_notifications_button->set_tooltip_text(TTR("Silence the notifications."));
disable_notifications_button->set_flat(true);
- disable_notifications_button->connect("pressed", callable_mp(this, &EditorToaster::_set_notifications_enabled).bind(false));
+ disable_notifications_button->connect(SceneStringName(pressed), callable_mp(this, &EditorToaster::_set_notifications_enabled).bind(false));
disable_notifications_panel->add_child(disable_notifications_button);
// Other
diff --git a/editor/gui/editor_zoom_widget.cpp b/editor/gui/editor_zoom_widget.cpp
index 6db4c5047e..e3d8d4b224 100644
--- a/editor/gui/editor_zoom_widget.cpp
+++ b/editor/gui/editor_zoom_widget.cpp
@@ -199,7 +199,7 @@ EditorZoomWidget::EditorZoomWidget() {
zoom_minus->set_shortcut_context(this);
zoom_minus->set_focus_mode(FOCUS_NONE);
add_child(zoom_minus);
- zoom_minus->connect("pressed", callable_mp(this, &EditorZoomWidget::_button_zoom_minus));
+ zoom_minus->connect(SceneStringName(pressed), callable_mp(this, &EditorZoomWidget::_button_zoom_minus));
zoom_reset = memnew(Button);
zoom_reset->set_flat(true);
@@ -208,7 +208,7 @@ EditorZoomWidget::EditorZoomWidget() {
zoom_reset->add_theme_style_override("normal", empty_stylebox);
zoom_reset->add_theme_style_override("hover", empty_stylebox);
zoom_reset->add_theme_style_override("focus", empty_stylebox);
- zoom_reset->add_theme_style_override("pressed", empty_stylebox);
+ zoom_reset->add_theme_style_override(SceneStringName(pressed), empty_stylebox);
zoom_reset->add_theme_constant_override("outline_size", Math::ceil(2 * EDSCALE));
zoom_reset->add_theme_color_override("font_outline_color", Color(0, 0, 0));
zoom_reset->add_theme_color_override("font_color", Color(1, 1, 1));
@@ -220,7 +220,7 @@ EditorZoomWidget::EditorZoomWidget() {
// Prevent the button's size from changing when the text size changes
zoom_reset->set_custom_minimum_size(Size2(56 * EDSCALE, 0));
add_child(zoom_reset);
- zoom_reset->connect("pressed", callable_mp(this, &EditorZoomWidget::_button_zoom_reset));
+ zoom_reset->connect(SceneStringName(pressed), callable_mp(this, &EditorZoomWidget::_button_zoom_reset));
zoom_plus = memnew(Button);
zoom_plus->set_flat(true);
@@ -228,7 +228,7 @@ EditorZoomWidget::EditorZoomWidget() {
zoom_plus->set_shortcut_context(this);
zoom_plus->set_focus_mode(FOCUS_NONE);
add_child(zoom_plus);
- zoom_plus->connect("pressed", callable_mp(this, &EditorZoomWidget::_button_zoom_plus));
+ zoom_plus->connect(SceneStringName(pressed), callable_mp(this, &EditorZoomWidget::_button_zoom_plus));
_update_zoom_label();
diff --git a/editor/import/3d/scene_import_settings.cpp b/editor/import/3d/scene_import_settings.cpp
index ff5eb670af..4c78c620c1 100644
--- a/editor/import/3d/scene_import_settings.cpp
+++ b/editor/import/3d/scene_import_settings.cpp
@@ -1263,7 +1263,7 @@ void SceneImportSettingsDialog::_notification(int p_what) {
action_menu->begin_bulk_theme_override();
action_menu->add_theme_style_override("normal", get_theme_stylebox("normal", "Button"));
action_menu->add_theme_style_override("hover", get_theme_stylebox("hover", "Button"));
- action_menu->add_theme_style_override("pressed", get_theme_stylebox("pressed", "Button"));
+ action_menu->add_theme_style_override(SceneStringName(pressed), get_theme_stylebox(SceneStringName(pressed), "Button"));
action_menu->end_bulk_theme_override();
if (animation_player != nullptr && animation_player->is_playing()) {
@@ -1649,13 +1649,13 @@ SceneImportSettingsDialog::SceneImportSettingsDialog() {
animation_play_button->set_flat(true);
animation_play_button->set_focus_mode(Control::FOCUS_NONE);
animation_play_button->set_shortcut(ED_SHORTCUT("scene_import_settings/play_selected_animation", TTR("Selected Animation Play/Pause"), Key::SPACE));
- animation_play_button->connect(SNAME("pressed"), callable_mp(this, &SceneImportSettingsDialog::_play_animation));
+ animation_play_button->connect(SceneStringName(pressed), callable_mp(this, &SceneImportSettingsDialog::_play_animation));
animation_stop_button = memnew(Button);
animation_hbox->add_child(animation_stop_button);
animation_stop_button->set_flat(true);
animation_stop_button->set_focus_mode(Control::FOCUS_NONE);
- animation_stop_button->connect(SNAME("pressed"), callable_mp(this, &SceneImportSettingsDialog::_stop_current_animation));
+ animation_stop_button->connect(SceneStringName(pressed), callable_mp(this, &SceneImportSettingsDialog::_stop_current_animation));
animation_slider = memnew(HSlider);
animation_hbox->add_child(animation_slider);
@@ -1684,7 +1684,7 @@ SceneImportSettingsDialog::SceneImportSettingsDialog() {
light_rotate_switch->set_toggle_mode(true);
light_rotate_switch->set_pressed(true);
light_rotate_switch->set_tooltip_text(TTR("Rotate Lights With Model"));
- light_rotate_switch->connect("pressed", callable_mp(this, &SceneImportSettingsDialog::_on_light_rotate_switch_pressed));
+ light_rotate_switch->connect(SceneStringName(pressed), callable_mp(this, &SceneImportSettingsDialog::_on_light_rotate_switch_pressed));
vb_light->add_child(light_rotate_switch);
light_1_switch = memnew(Button);
@@ -1692,7 +1692,7 @@ SceneImportSettingsDialog::SceneImportSettingsDialog() {
light_1_switch->set_toggle_mode(true);
light_1_switch->set_pressed(true);
light_1_switch->set_tooltip_text(TTR("Primary Light"));
- light_1_switch->connect("pressed", callable_mp(this, &SceneImportSettingsDialog::_on_light_1_switch_pressed));
+ light_1_switch->connect(SceneStringName(pressed), callable_mp(this, &SceneImportSettingsDialog::_on_light_1_switch_pressed));
vb_light->add_child(light_1_switch);
light_2_switch = memnew(Button);
@@ -1700,7 +1700,7 @@ SceneImportSettingsDialog::SceneImportSettingsDialog() {
light_2_switch->set_toggle_mode(true);
light_2_switch->set_pressed(true);
light_2_switch->set_tooltip_text(TTR("Secondary Light"));
- light_2_switch->connect("pressed", callable_mp(this, &SceneImportSettingsDialog::_on_light_2_switch_pressed));
+ light_2_switch->connect(SceneStringName(pressed), callable_mp(this, &SceneImportSettingsDialog::_on_light_2_switch_pressed));
vb_light->add_child(light_2_switch);
camera = memnew(Camera3D);
diff --git a/editor/import/audio_stream_import_settings.cpp b/editor/import/audio_stream_import_settings.cpp
index a342da4bcf..6353e63695 100644
--- a/editor/import/audio_stream_import_settings.cpp
+++ b/editor/import/audio_stream_import_settings.cpp
@@ -618,9 +618,9 @@ AudioStreamImportSettingsDialog::AudioStreamImportSettingsDialog() {
zoom_hbox->add_child(zoom_out);
zoom_hbox->add_child(zoom_reset);
zoom_hbox->add_child(zoom_in);
- zoom_in->connect("pressed", callable_mp(this, &AudioStreamImportSettingsDialog::_preview_zoom_in));
- zoom_reset->connect("pressed", callable_mp(this, &AudioStreamImportSettingsDialog::_preview_zoom_reset));
- zoom_out->connect("pressed", callable_mp(this, &AudioStreamImportSettingsDialog::_preview_zoom_out));
+ zoom_in->connect(SceneStringName(pressed), callable_mp(this, &AudioStreamImportSettingsDialog::_preview_zoom_in));
+ zoom_reset->connect(SceneStringName(pressed), callable_mp(this, &AudioStreamImportSettingsDialog::_preview_zoom_reset));
+ zoom_out->connect(SceneStringName(pressed), callable_mp(this, &AudioStreamImportSettingsDialog::_preview_zoom_out));
zoom_bar->connect("value_changed", callable_mp(this, &AudioStreamImportSettingsDialog::_preview_zoom_offset_changed));
vbox->add_child(zoom_hbox);
@@ -639,13 +639,13 @@ AudioStreamImportSettingsDialog::AudioStreamImportSettingsDialog() {
_play_button->set_flat(true);
hbox->add_child(_play_button);
_play_button->set_focus_mode(Control::FOCUS_NONE);
- _play_button->connect("pressed", callable_mp(this, &AudioStreamImportSettingsDialog::_play));
+ _play_button->connect(SceneStringName(pressed), callable_mp(this, &AudioStreamImportSettingsDialog::_play));
_stop_button = memnew(Button);
_stop_button->set_flat(true);
hbox->add_child(_stop_button);
_stop_button->set_focus_mode(Control::FOCUS_NONE);
- _stop_button->connect("pressed", callable_mp(this, &AudioStreamImportSettingsDialog::_stop));
+ _stop_button->connect(SceneStringName(pressed), callable_mp(this, &AudioStreamImportSettingsDialog::_stop));
_current_label = memnew(Label);
_current_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT);
diff --git a/editor/import/dynamic_font_import_settings.cpp b/editor/import/dynamic_font_import_settings.cpp
index f2096c362e..aad7302ec5 100644
--- a/editor/import/dynamic_font_import_settings.cpp
+++ b/editor/import/dynamic_font_import_settings.cpp
@@ -1372,7 +1372,7 @@ DynamicFontImportSettingsDialog::DynamicFontImportSettingsDialog() {
add_var = memnew(Button);
add_var->set_tooltip_text(TTR("Add configuration"));
page2_hb_vars->add_child(add_var);
- add_var->connect("pressed", callable_mp(this, &DynamicFontImportSettingsDialog::_variation_add));
+ add_var->connect(SceneStringName(pressed), callable_mp(this, &DynamicFontImportSettingsDialog::_variation_add));
vars_list = memnew(Tree);
vars_list->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
@@ -1414,7 +1414,7 @@ DynamicFontImportSettingsDialog::DynamicFontImportSettingsDialog() {
Button *btn_clear = memnew(Button);
btn_clear->set_text(TTR("Clear Glyph List"));
gl_hb->add_child(btn_clear);
- btn_clear->connect("pressed", callable_mp(this, &DynamicFontImportSettingsDialog::_glyph_clear));
+ btn_clear->connect(SceneStringName(pressed), callable_mp(this, &DynamicFontImportSettingsDialog::_glyph_clear));
VBoxContainer *page2_0_vb = memnew(VBoxContainer);
page2_0_vb->set_name(TTR("Glyphs from the Translations"));
@@ -1446,7 +1446,7 @@ DynamicFontImportSettingsDialog::DynamicFontImportSettingsDialog() {
btn_fill_locales = memnew(Button);
btn_fill_locales->set_text(TTR("Shape all Strings in the Translations and Add Glyphs"));
locale_hb->add_child(btn_fill_locales);
- btn_fill_locales->connect("pressed", callable_mp(this, &DynamicFontImportSettingsDialog::_process_locales));
+ btn_fill_locales->connect(SceneStringName(pressed), callable_mp(this, &DynamicFontImportSettingsDialog::_process_locales));
// Page 2.1 layout: Text to select glyphs
VBoxContainer *page2_1_vb = memnew(VBoxContainer);
@@ -1484,7 +1484,7 @@ DynamicFontImportSettingsDialog::DynamicFontImportSettingsDialog() {
btn_fill = memnew(Button);
btn_fill->set_text(TTR("Shape Text and Add Glyphs"));
text_hb->add_child(btn_fill);
- btn_fill->connect("pressed", callable_mp(this, &DynamicFontImportSettingsDialog::_glyph_text_selected));
+ btn_fill->connect(SceneStringName(pressed), callable_mp(this, &DynamicFontImportSettingsDialog::_glyph_text_selected));
// Page 2.2 layout: Character map
VBoxContainer *page2_2_vb = memnew(VBoxContainer);
diff --git a/editor/import_defaults_editor.cpp b/editor/import_defaults_editor.cpp
index 968f2a8915..ab7988109f 100644
--- a/editor/import_defaults_editor.cpp
+++ b/editor/import_defaults_editor.cpp
@@ -211,7 +211,7 @@ ImportDefaultsEditor::ImportDefaultsEditor() {
reset_defaults = memnew(Button);
reset_defaults->set_text(TTR("Reset to Defaults"));
reset_defaults->set_disabled(true);
- reset_defaults->connect("pressed", callable_mp(this, &ImportDefaultsEditor::_reset));
+ reset_defaults->connect(SceneStringName(pressed), callable_mp(this, &ImportDefaultsEditor::_reset));
hb->add_child(reset_defaults);
add_child(hb);
@@ -225,7 +225,7 @@ ImportDefaultsEditor::ImportDefaultsEditor() {
CenterContainer *cc = memnew(CenterContainer);
save_defaults = memnew(Button);
save_defaults->set_text(TTR("Save"));
- save_defaults->connect("pressed", callable_mp(this, &ImportDefaultsEditor::_save));
+ save_defaults->connect(SceneStringName(pressed), callable_mp(this, &ImportDefaultsEditor::_save));
cc->add_child(save_defaults);
add_child(cc);
diff --git a/editor/import_dock.cpp b/editor/import_dock.cpp
index e12f74eb64..fbe76e1d5c 100644
--- a/editor/import_dock.cpp
+++ b/editor/import_dock.cpp
@@ -798,7 +798,7 @@ ImportDock::ImportDock() {
import = memnew(Button);
import->set_text(TTR("Reimport"));
import->set_disabled(true);
- import->connect("pressed", callable_mp(this, &ImportDock::_reimport_pressed));
+ import->connect(SceneStringName(pressed), callable_mp(this, &ImportDock::_reimport_pressed));
if (!DisplayServer::get_singleton()->get_swap_cancel_ok()) {
advanced_spacer = hb->add_spacer();
advanced = memnew(Button);
@@ -818,7 +818,7 @@ ImportDock::ImportDock() {
advanced->hide();
advanced_spacer->hide();
- advanced->connect("pressed", callable_mp(this, &ImportDock::_advanced_options));
+ advanced->connect(SceneStringName(pressed), callable_mp(this, &ImportDock::_advanced_options));
reimport_confirm = memnew(ConfirmationDialog);
content->add_child(reimport_confirm);
diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp
index 2965a8a904..5455933809 100644
--- a/editor/inspector_dock.cpp
+++ b/editor/inspector_dock.cpp
@@ -649,14 +649,14 @@ InspectorDock::InspectorDock(EditorData &p_editor_data) {
resource_new_button->set_theme_type_variation("FlatMenuButton");
resource_new_button->set_tooltip_text(TTR("Create a new resource in memory and edit it."));
general_options_hb->add_child(resource_new_button);
- resource_new_button->connect("pressed", callable_mp(this, &InspectorDock::_new_resource));
+ resource_new_button->connect(SceneStringName(pressed), callable_mp(this, &InspectorDock::_new_resource));
resource_new_button->set_focus_mode(Control::FOCUS_NONE);
resource_load_button = memnew(Button);
resource_load_button->set_theme_type_variation("FlatMenuButton");
resource_load_button->set_tooltip_text(TTR("Load an existing resource from disk and edit it."));
general_options_hb->add_child(resource_load_button);
- resource_load_button->connect("pressed", callable_mp(this, &InspectorDock::_open_resource_selector));
+ resource_load_button->connect(SceneStringName(pressed), callable_mp(this, &InspectorDock::_open_resource_selector));
resource_load_button->set_focus_mode(Control::FOCUS_NONE);
resource_save_button = memnew(MenuButton);
@@ -692,14 +692,14 @@ InspectorDock::InspectorDock(EditorData &p_editor_data) {
general_options_hb->add_child(backward_button);
backward_button->set_tooltip_text(TTR("Go to previous edited object in history."));
backward_button->set_disabled(true);
- backward_button->connect("pressed", callable_mp(this, &InspectorDock::_edit_back));
+ backward_button->connect(SceneStringName(pressed), callable_mp(this, &InspectorDock::_edit_back));
forward_button = memnew(Button);
forward_button->set_flat(true);
general_options_hb->add_child(forward_button);
forward_button->set_tooltip_text(TTR("Go to next edited object in history."));
forward_button->set_disabled(true);
- forward_button->connect("pressed", callable_mp(this, &InspectorDock::_edit_forward));
+ forward_button->connect(SceneStringName(pressed), callable_mp(this, &InspectorDock::_edit_forward));
history_menu = memnew(MenuButton);
history_menu->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
@@ -722,7 +722,7 @@ InspectorDock::InspectorDock(EditorData &p_editor_data) {
open_docs_button->set_tooltip_text(TTR("Open documentation for this object."));
open_docs_button->set_shortcut(ED_SHORTCUT("property_editor/open_help", TTR("Open Documentation")));
subresource_hb->add_child(open_docs_button);
- open_docs_button->connect("pressed", callable_mp(this, &InspectorDock::_menu_option).bind(OBJECT_REQUEST_HELP));
+ open_docs_button->connect(SceneStringName(pressed), callable_mp(this, &InspectorDock::_menu_option).bind(OBJECT_REQUEST_HELP));
new_resource_dialog = memnew(CreateDialog);
EditorNode::get_singleton()->get_gui_base()->add_child(new_resource_dialog);
@@ -751,7 +751,7 @@ InspectorDock::InspectorDock(EditorData &p_editor_data) {
add_child(info);
info->set_clip_text(true);
info->hide();
- info->connect("pressed", callable_mp(this, &InspectorDock::_info_pressed));
+ info->connect(SceneStringName(pressed), callable_mp(this, &InspectorDock::_info_pressed));
unique_resources_confirmation = memnew(ConfirmationDialog);
add_child(unique_resources_confirmation);
diff --git a/editor/localization_editor.cpp b/editor/localization_editor.cpp
index eb7f508695..11d1b3e089 100644
--- a/editor/localization_editor.cpp
+++ b/editor/localization_editor.cpp
@@ -626,7 +626,7 @@ LocalizationEditor::LocalizationEditor() {
tvb->add_child(thb);
Button *addtr = memnew(Button(TTR("Add...")));
- addtr->connect("pressed", callable_mp(this, &LocalizationEditor::_translation_file_open));
+ addtr->connect(SceneStringName(pressed), callable_mp(this, &LocalizationEditor::_translation_file_open));
thb->add_child(addtr);
VBoxContainer *tmc = memnew(VBoxContainer);
@@ -660,7 +660,7 @@ LocalizationEditor::LocalizationEditor() {
tvb->add_child(thb);
Button *addtr = memnew(Button(TTR("Add...")));
- addtr->connect("pressed", callable_mp(this, &LocalizationEditor::_translation_res_file_open));
+ addtr->connect(SceneStringName(pressed), callable_mp(this, &LocalizationEditor::_translation_res_file_open));
thb->add_child(addtr);
VBoxContainer *tmc = memnew(VBoxContainer);
@@ -686,7 +686,7 @@ LocalizationEditor::LocalizationEditor() {
tvb->add_child(thb);
addtr = memnew(Button(TTR("Add...")));
- addtr->connect("pressed", callable_mp(this, &LocalizationEditor::_translation_res_option_file_open));
+ addtr->connect(SceneStringName(pressed), callable_mp(this, &LocalizationEditor::_translation_res_option_file_open));
translation_res_option_add_button = addtr;
thb->add_child(addtr);
@@ -729,11 +729,11 @@ LocalizationEditor::LocalizationEditor() {
tvb->add_child(thb);
Button *addtr = memnew(Button(TTR("Add...")));
- addtr->connect("pressed", callable_mp(this, &LocalizationEditor::_pot_file_open));
+ addtr->connect(SceneStringName(pressed), callable_mp(this, &LocalizationEditor::_pot_file_open));
thb->add_child(addtr);
pot_generate_button = memnew(Button(TTR("Generate POT")));
- pot_generate_button->connect("pressed", callable_mp(this, &LocalizationEditor::_pot_generate_open));
+ pot_generate_button->connect(SceneStringName(pressed), callable_mp(this, &LocalizationEditor::_pot_generate_open));
thb->add_child(pot_generate_button);
translation_pot_list = memnew(Tree);
@@ -742,7 +742,7 @@ LocalizationEditor::LocalizationEditor() {
translation_pot_add_builtin = memnew(CheckBox(TTR("Add Built-in Strings to POT")));
translation_pot_add_builtin->set_tooltip_text(TTR("Add strings from built-in components such as certain Control nodes."));
- translation_pot_add_builtin->connect("pressed", callable_mp(this, &LocalizationEditor::_pot_add_builtin_toggled));
+ translation_pot_add_builtin->connect(SceneStringName(pressed), callable_mp(this, &LocalizationEditor::_pot_add_builtin_toggled));
tvb->add_child(translation_pot_add_builtin);
pot_generate_dialog = memnew(EditorFileDialog);
diff --git a/editor/node_dock.cpp b/editor/node_dock.cpp
index 71bc9c64be..b8e0b61cd9 100644
--- a/editor/node_dock.cpp
+++ b/editor/node_dock.cpp
@@ -120,7 +120,7 @@ NodeDock::NodeDock() {
connections_button->set_h_size_flags(SIZE_EXPAND_FILL);
connections_button->set_clip_text(true);
mode_hb->add_child(connections_button);
- connections_button->connect("pressed", callable_mp(this, &NodeDock::show_connections));
+ connections_button->connect(SceneStringName(pressed), callable_mp(this, &NodeDock::show_connections));
groups_button = memnew(Button);
groups_button->set_theme_type_variation("FlatButton");
@@ -130,7 +130,7 @@ NodeDock::NodeDock() {
groups_button->set_h_size_flags(SIZE_EXPAND_FILL);
groups_button->set_clip_text(true);
mode_hb->add_child(groups_button);
- groups_button->connect("pressed", callable_mp(this, &NodeDock::show_groups));
+ groups_button->connect(SceneStringName(pressed), callable_mp(this, &NodeDock::show_groups));
connections = memnew(ConnectionsDock);
add_child(connections);
diff --git a/editor/plugins/abstract_polygon_2d_editor.cpp b/editor/plugins/abstract_polygon_2d_editor.cpp
index dd52375c10..b1279e4192 100644
--- a/editor/plugins/abstract_polygon_2d_editor.cpp
+++ b/editor/plugins/abstract_polygon_2d_editor.cpp
@@ -730,19 +730,19 @@ AbstractPolygon2DEditor::AbstractPolygon2DEditor(bool p_wip_destructive) {
button_create = memnew(Button);
button_create->set_theme_type_variation("FlatButton");
add_child(button_create);
- button_create->connect("pressed", callable_mp(this, &AbstractPolygon2DEditor::_menu_option).bind(MODE_CREATE));
+ button_create->connect(SceneStringName(pressed), callable_mp(this, &AbstractPolygon2DEditor::_menu_option).bind(MODE_CREATE));
button_create->set_toggle_mode(true);
button_edit = memnew(Button);
button_edit->set_theme_type_variation("FlatButton");
add_child(button_edit);
- button_edit->connect("pressed", callable_mp(this, &AbstractPolygon2DEditor::_menu_option).bind(MODE_EDIT));
+ button_edit->connect(SceneStringName(pressed), callable_mp(this, &AbstractPolygon2DEditor::_menu_option).bind(MODE_EDIT));
button_edit->set_toggle_mode(true);
button_delete = memnew(Button);
button_delete->set_theme_type_variation("FlatButton");
add_child(button_delete);
- button_delete->connect("pressed", callable_mp(this, &AbstractPolygon2DEditor::_menu_option).bind(MODE_DELETE));
+ button_delete->connect(SceneStringName(pressed), callable_mp(this, &AbstractPolygon2DEditor::_menu_option).bind(MODE_DELETE));
button_delete->set_toggle_mode(true);
create_resource = memnew(ConfirmationDialog);
diff --git a/editor/plugins/animation_blend_space_1d_editor.cpp b/editor/plugins/animation_blend_space_1d_editor.cpp
index 377c533b9e..95b184b8ab 100644
--- a/editor/plugins/animation_blend_space_1d_editor.cpp
+++ b/editor/plugins/animation_blend_space_1d_editor.cpp
@@ -667,7 +667,7 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() {
top_hb->add_child(tool_blend);
tool_blend->set_pressed(true);
tool_blend->set_tooltip_text(TTR("Set the blending position within the space"));
- tool_blend->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace1DEditor::_tool_switch).bind(3));
+ tool_blend->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace1DEditor::_tool_switch).bind(3));
tool_select = memnew(Button);
tool_select->set_theme_type_variation("FlatButton");
@@ -675,7 +675,7 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() {
tool_select->set_button_group(bg);
top_hb->add_child(tool_select);
tool_select->set_tooltip_text(TTR("Select and move points, create points with RMB."));
- tool_select->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace1DEditor::_tool_switch).bind(0));
+ tool_select->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace1DEditor::_tool_switch).bind(0));
tool_create = memnew(Button);
tool_create->set_theme_type_variation("FlatButton");
@@ -683,7 +683,7 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() {
tool_create->set_button_group(bg);
top_hb->add_child(tool_create);
tool_create->set_tooltip_text(TTR("Create points."));
- tool_create->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace1DEditor::_tool_switch).bind(1));
+ tool_create->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace1DEditor::_tool_switch).bind(1));
tool_erase_sep = memnew(VSeparator);
top_hb->add_child(tool_erase_sep);
@@ -691,7 +691,7 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() {
tool_erase->set_theme_type_variation("FlatButton");
top_hb->add_child(tool_erase);
tool_erase->set_tooltip_text(TTR("Erase points."));
- tool_erase->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace1DEditor::_erase_selected));
+ tool_erase->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace1DEditor::_erase_selected));
top_hb->add_child(memnew(VSeparator));
@@ -701,7 +701,7 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() {
top_hb->add_child(snap);
snap->set_pressed(true);
snap->set_tooltip_text(TTR("Enable snap and show grid."));
- snap->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace1DEditor::_snap_toggled));
+ snap->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace1DEditor::_snap_toggled));
snap_value = memnew(SpinBox);
top_hb->add_child(snap_value);
@@ -737,7 +737,7 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() {
open_editor = memnew(Button);
edit_hb->add_child(open_editor);
open_editor->set_text(TTR("Open Editor"));
- open_editor->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace1DEditor::_open_editor), CONNECT_DEFERRED);
+ open_editor->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace1DEditor::_open_editor), CONNECT_DEFERRED);
edit_hb->hide();
open_editor->hide();
diff --git a/editor/plugins/animation_blend_space_2d_editor.cpp b/editor/plugins/animation_blend_space_2d_editor.cpp
index 9d91be0174..7ee86c77d2 100644
--- a/editor/plugins/animation_blend_space_2d_editor.cpp
+++ b/editor/plugins/animation_blend_space_2d_editor.cpp
@@ -888,7 +888,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() {
top_hb->add_child(tool_blend);
tool_blend->set_pressed(true);
tool_blend->set_tooltip_text(TTR("Set the blending position within the space"));
- tool_blend->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_tool_switch).bind(3));
+ tool_blend->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace2DEditor::_tool_switch).bind(3));
tool_select = memnew(Button);
tool_select->set_theme_type_variation("FlatButton");
@@ -896,7 +896,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() {
tool_select->set_button_group(bg);
top_hb->add_child(tool_select);
tool_select->set_tooltip_text(TTR("Select and move points, create points with RMB."));
- tool_select->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_tool_switch).bind(0));
+ tool_select->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace2DEditor::_tool_switch).bind(0));
tool_create = memnew(Button);
tool_create->set_theme_type_variation("FlatButton");
@@ -904,7 +904,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() {
tool_create->set_button_group(bg);
top_hb->add_child(tool_create);
tool_create->set_tooltip_text(TTR("Create points."));
- tool_create->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_tool_switch).bind(1));
+ tool_create->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace2DEditor::_tool_switch).bind(1));
tool_triangle = memnew(Button);
tool_triangle->set_theme_type_variation("FlatButton");
@@ -912,7 +912,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() {
tool_triangle->set_button_group(bg);
top_hb->add_child(tool_triangle);
tool_triangle->set_tooltip_text(TTR("Create triangles by connecting points."));
- tool_triangle->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_tool_switch).bind(2));
+ tool_triangle->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace2DEditor::_tool_switch).bind(2));
tool_erase_sep = memnew(VSeparator);
top_hb->add_child(tool_erase_sep);
@@ -920,7 +920,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() {
tool_erase->set_theme_type_variation("FlatButton");
top_hb->add_child(tool_erase);
tool_erase->set_tooltip_text(TTR("Erase points and triangles."));
- tool_erase->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_erase_selected));
+ tool_erase->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace2DEditor::_erase_selected));
tool_erase->set_disabled(true);
top_hb->add_child(memnew(VSeparator));
@@ -928,7 +928,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() {
auto_triangles = memnew(Button);
auto_triangles->set_theme_type_variation("FlatButton");
top_hb->add_child(auto_triangles);
- auto_triangles->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_auto_triangles_toggled));
+ auto_triangles->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace2DEditor::_auto_triangles_toggled));
auto_triangles->set_toggle_mode(true);
auto_triangles->set_tooltip_text(TTR("Generate blend triangles automatically (instead of manually)"));
@@ -940,7 +940,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() {
top_hb->add_child(snap);
snap->set_pressed(true);
snap->set_tooltip_text(TTR("Enable snap and show grid."));
- snap->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_snap_toggled));
+ snap->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace2DEditor::_snap_toggled));
snap_x = memnew(SpinBox);
top_hb->add_child(snap_x);
@@ -989,7 +989,7 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() {
open_editor = memnew(Button);
edit_hb->add_child(open_editor);
open_editor->set_text(TTR("Open Editor"));
- open_editor->connect("pressed", callable_mp(this, &AnimationNodeBlendSpace2DEditor::_open_editor), CONNECT_DEFERRED);
+ open_editor->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendSpace2DEditor::_open_editor), CONNECT_DEFERRED);
edit_hb->hide();
open_editor->hide();
diff --git a/editor/plugins/animation_blend_tree_editor_plugin.cpp b/editor/plugins/animation_blend_tree_editor_plugin.cpp
index 2ba75f9deb..26a90c3ce8 100644
--- a/editor/plugins/animation_blend_tree_editor_plugin.cpp
+++ b/editor/plugins/animation_blend_tree_editor_plugin.cpp
@@ -177,7 +177,7 @@ void AnimationNodeBlendTreeEditor::update_graph() {
delete_button->set_flat(true);
delete_button->set_focus_mode(FOCUS_NONE);
delete_button->set_icon(get_editor_theme_icon(SNAME("Close")));
- delete_button->connect("pressed", callable_mp(this, &AnimationNodeBlendTreeEditor::_delete_node_request).bind(E), CONNECT_DEFERRED);
+ delete_button->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendTreeEditor::_delete_node_request).bind(E), CONNECT_DEFERRED);
node->get_titlebar_hbox()->add_child(delete_button);
}
}
@@ -216,7 +216,7 @@ void AnimationNodeBlendTreeEditor::update_graph() {
open_in_editor->set_text(TTR("Open Editor"));
open_in_editor->set_icon(get_editor_theme_icon(SNAME("Edit")));
node->add_child(open_in_editor);
- open_in_editor->connect("pressed", callable_mp(this, &AnimationNodeBlendTreeEditor::_open_in_editor).bind(E), CONNECT_DEFERRED);
+ open_in_editor->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendTreeEditor::_open_in_editor).bind(E), CONNECT_DEFERRED);
open_in_editor->set_h_size_flags(SIZE_SHRINK_CENTER);
}
@@ -230,7 +230,7 @@ void AnimationNodeBlendTreeEditor::update_graph() {
}
inspect_filters->set_icon(get_editor_theme_icon(SNAME("AnimationFilter")));
node->add_child(inspect_filters);
- inspect_filters->connect("pressed", callable_mp(this, &AnimationNodeBlendTreeEditor::_inspect_filters).bind(E), CONNECT_DEFERRED);
+ inspect_filters->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendTreeEditor::_inspect_filters).bind(E), CONNECT_DEFERRED);
inspect_filters->set_h_size_flags(SIZE_SHRINK_CENTER);
}
@@ -1232,22 +1232,22 @@ AnimationNodeBlendTreeEditor::AnimationNodeBlendTreeEditor() {
filter_enabled = memnew(CheckBox);
filter_enabled->set_text(TTR("Enable Filtering"));
- filter_enabled->connect("pressed", callable_mp(this, &AnimationNodeBlendTreeEditor::_filter_toggled));
+ filter_enabled->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendTreeEditor::_filter_toggled));
filter_hbox->add_child(filter_enabled);
filter_fill_selection = memnew(Button);
filter_fill_selection->set_text(TTR("Fill Selected Children"));
- filter_fill_selection->connect("pressed", callable_mp(this, &AnimationNodeBlendTreeEditor::_filter_fill_selection));
+ filter_fill_selection->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendTreeEditor::_filter_fill_selection));
filter_hbox->add_child(filter_fill_selection);
filter_invert_selection = memnew(Button);
filter_invert_selection->set_text(TTR("Invert"));
- filter_invert_selection->connect("pressed", callable_mp(this, &AnimationNodeBlendTreeEditor::_filter_invert_selection));
+ filter_invert_selection->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendTreeEditor::_filter_invert_selection));
filter_hbox->add_child(filter_invert_selection);
filter_clear_selection = memnew(Button);
filter_clear_selection->set_text(TTR("Clear"));
- filter_clear_selection->connect("pressed", callable_mp(this, &AnimationNodeBlendTreeEditor::_filter_clear_selection));
+ filter_clear_selection->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeBlendTreeEditor::_filter_clear_selection));
filter_hbox->add_child(filter_clear_selection);
filters = memnew(Tree);
diff --git a/editor/plugins/animation_library_editor.cpp b/editor/plugins/animation_library_editor.cpp
index 9a7974acef..8620c3b883 100644
--- a/editor/plugins/animation_library_editor.cpp
+++ b/editor/plugins/animation_library_editor.cpp
@@ -29,6 +29,7 @@
/**************************************************************************/
#include "animation_library_editor.h"
+
#include "editor/editor_node.h"
#include "editor/editor_settings.h"
#include "editor/editor_string_names.h"
@@ -811,11 +812,11 @@ AnimationLibraryEditor::AnimationLibraryEditor() {
hb->add_spacer(true);
new_library_button = memnew(Button(TTR("New Library")));
new_library_button->set_tooltip_text(TTR("Create new empty animation library."));
- new_library_button->connect("pressed", callable_mp(this, &AnimationLibraryEditor::_add_library));
+ new_library_button->connect(SceneStringName(pressed), callable_mp(this, &AnimationLibraryEditor::_add_library));
hb->add_child(new_library_button);
load_library_button = memnew(Button(TTR("Load Library")));
load_library_button->set_tooltip_text(TTR("Load animation library from disk."));
- load_library_button->connect("pressed", callable_mp(this, &AnimationLibraryEditor::_load_library));
+ load_library_button->connect(SceneStringName(pressed), callable_mp(this, &AnimationLibraryEditor::_load_library));
hb->add_child(load_library_button);
vb->add_child(hb);
tree = memnew(Tree);
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp
index d2b29b02ff..1366a38bec 100644
--- a/editor/plugins/animation_player_editor_plugin.cpp
+++ b/editor/plugins/animation_player_editor_plugin.cpp
@@ -1987,7 +1987,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(AnimationPlayerEditorPlugin *p_plug
onion_toggle->set_theme_type_variation("FlatButton");
onion_toggle->set_toggle_mode(true);
onion_toggle->set_tooltip_text(TTR("Enable Onion Skinning"));
- onion_toggle->connect(SNAME("pressed"), callable_mp(this, &AnimationPlayerEditor::_onion_skinning_menu).bind(ONION_SKINNING_ENABLE));
+ onion_toggle->connect(SceneStringName(pressed), callable_mp(this, &AnimationPlayerEditor::_onion_skinning_menu).bind(ONION_SKINNING_ENABLE));
hb->add_child(onion_toggle);
onion_skinning = memnew(MenuButton);
@@ -2018,7 +2018,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(AnimationPlayerEditorPlugin *p_plug
pin->set_toggle_mode(true);
pin->set_tooltip_text(TTR("Pin AnimationPlayer"));
hb->add_child(pin);
- pin->connect(SNAME("pressed"), callable_mp(this, &AnimationPlayerEditor::_pin_pressed));
+ pin->connect(SceneStringName(pressed), callable_mp(this, &AnimationPlayerEditor::_pin_pressed));
file = memnew(EditorFileDialog);
add_child(file);
@@ -2074,13 +2074,13 @@ AnimationPlayerEditor::AnimationPlayerEditor(AnimationPlayerEditorPlugin *p_plug
blend_editor.next->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
blend_vb->add_margin_child(TTR("Next (Auto Queue):"), blend_editor.next);
- autoplay->connect(SNAME("pressed"), callable_mp(this, &AnimationPlayerEditor::_autoplay_pressed));
+ autoplay->connect(SceneStringName(pressed), callable_mp(this, &AnimationPlayerEditor::_autoplay_pressed));
autoplay->set_toggle_mode(true);
- play->connect(SNAME("pressed"), callable_mp(this, &AnimationPlayerEditor::_play_pressed));
- play_from->connect(SNAME("pressed"), callable_mp(this, &AnimationPlayerEditor::_play_from_pressed));
- play_bw->connect(SNAME("pressed"), callable_mp(this, &AnimationPlayerEditor::_play_bw_pressed));
- play_bw_from->connect(SNAME("pressed"), callable_mp(this, &AnimationPlayerEditor::_play_bw_from_pressed));
- stop->connect(SNAME("pressed"), callable_mp(this, &AnimationPlayerEditor::_stop_pressed));
+ play->connect(SceneStringName(pressed), callable_mp(this, &AnimationPlayerEditor::_play_pressed));
+ play_from->connect(SceneStringName(pressed), callable_mp(this, &AnimationPlayerEditor::_play_from_pressed));
+ play_bw->connect(SceneStringName(pressed), callable_mp(this, &AnimationPlayerEditor::_play_bw_pressed));
+ play_bw_from->connect(SceneStringName(pressed), callable_mp(this, &AnimationPlayerEditor::_play_bw_from_pressed));
+ stop->connect(SceneStringName(pressed), callable_mp(this, &AnimationPlayerEditor::_stop_pressed));
animation->connect(SNAME("item_selected"), callable_mp(this, &AnimationPlayerEditor::_animation_selected));
diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp
index e1942bb33e..b6d81ce461 100644
--- a/editor/plugins/animation_state_machine_editor.cpp
+++ b/editor/plugins/animation_state_machine_editor.cpp
@@ -1673,7 +1673,7 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() {
tool_select->set_button_group(bg);
tool_select->set_pressed(true);
tool_select->set_tooltip_text(TTR("Select and move nodes.\nRMB: Add node at position clicked.\nShift+LMB+Drag: Connects the selected node with another node or creates a new node if you select an area without nodes."));
- tool_select->connect("pressed", callable_mp(this, &AnimationNodeStateMachineEditor::_update_mode), CONNECT_DEFERRED);
+ tool_select->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeStateMachineEditor::_update_mode), CONNECT_DEFERRED);
tool_create = memnew(Button);
tool_create->set_theme_type_variation("FlatButton");
@@ -1681,7 +1681,7 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() {
tool_create->set_toggle_mode(true);
tool_create->set_button_group(bg);
tool_create->set_tooltip_text(TTR("Create new nodes."));
- tool_create->connect("pressed", callable_mp(this, &AnimationNodeStateMachineEditor::_update_mode), CONNECT_DEFERRED);
+ tool_create->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeStateMachineEditor::_update_mode), CONNECT_DEFERRED);
tool_connect = memnew(Button);
tool_connect->set_theme_type_variation("FlatButton");
@@ -1689,7 +1689,7 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() {
tool_connect->set_toggle_mode(true);
tool_connect->set_button_group(bg);
tool_connect->set_tooltip_text(TTR("Connect nodes."));
- tool_connect->connect("pressed", callable_mp(this, &AnimationNodeStateMachineEditor::_update_mode), CONNECT_DEFERRED);
+ tool_connect->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeStateMachineEditor::_update_mode), CONNECT_DEFERRED);
// Context-sensitive selection tools:
selection_tools_hb = memnew(HBoxContainer);
@@ -1699,7 +1699,7 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() {
tool_erase = memnew(Button);
tool_erase->set_theme_type_variation("FlatButton");
tool_erase->set_tooltip_text(TTR("Remove selected node or transition."));
- tool_erase->connect("pressed", callable_mp(this, &AnimationNodeStateMachineEditor::_erase_selected).bind(false));
+ tool_erase->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeStateMachineEditor::_erase_selected).bind(false));
tool_erase->set_disabled(true);
selection_tools_hb->add_child(tool_erase);
@@ -1815,10 +1815,10 @@ AnimationNodeStateMachineEditor::AnimationNodeStateMachineEditor() {
Button *ok = delete_window->get_cancel_button();
ok->set_text(TTR("Delete Selected"));
- ok->connect("pressed", callable_mp(this, &AnimationNodeStateMachineEditor::_delete_selected));
+ ok->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeStateMachineEditor::_delete_selected));
Button *delete_all = delete_window->add_button(TTR("Delete All"), true);
- delete_all->connect("pressed", callable_mp(this, &AnimationNodeStateMachineEditor::_delete_all));
+ delete_all->connect(SceneStringName(pressed), callable_mp(this, &AnimationNodeStateMachineEditor::_delete_all));
}
void EditorAnimationMultiTransitionEdit::add_transition(const StringName &p_from, const StringName &p_to, Ref<AnimationNodeStateMachineTransition> p_transition) {
diff --git a/editor/plugins/animation_tree_editor_plugin.cpp b/editor/plugins/animation_tree_editor_plugin.cpp
index 7470bb0e44..cc1f51348d 100644
--- a/editor/plugins/animation_tree_editor_plugin.cpp
+++ b/editor/plugins/animation_tree_editor_plugin.cpp
@@ -100,7 +100,7 @@ void AnimationTreeEditor::_update_path() {
b->set_button_group(group);
b->set_pressed(true);
b->set_focus_mode(FOCUS_NONE);
- b->connect("pressed", callable_mp(this, &AnimationTreeEditor::_path_button_pressed).bind(-1));
+ b->connect(SceneStringName(pressed), callable_mp(this, &AnimationTreeEditor::_path_button_pressed).bind(-1));
path_hb->add_child(b);
for (int i = 0; i < button_path.size(); i++) {
b = memnew(Button);
@@ -111,7 +111,7 @@ void AnimationTreeEditor::_update_path() {
path_hb->add_child(b);
b->set_pressed(true);
b->set_focus_mode(FOCUS_NONE);
- b->connect("pressed", callable_mp(this, &AnimationTreeEditor::_path_button_pressed).bind(i));
+ b->connect(SceneStringName(pressed), callable_mp(this, &AnimationTreeEditor::_path_button_pressed).bind(i));
}
}
diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp
index 638532b7cf..99c7ab63e9 100644
--- a/editor/plugins/asset_library_editor_plugin.cpp
+++ b/editor/plugins/asset_library_editor_plugin.cpp
@@ -165,10 +165,10 @@ EditorAssetLibraryItem::EditorAssetLibraryItem(bool p_clickable) {
if (p_clickable) {
author->set_underline_mode(LinkButton::UNDERLINE_MODE_ON_HOVER);
icon->set_default_cursor_shape(CURSOR_POINTING_HAND);
- icon->connect("pressed", callable_mp(this, &EditorAssetLibraryItem::_asset_clicked));
- title->connect("pressed", callable_mp(this, &EditorAssetLibraryItem::_asset_clicked));
- category->connect("pressed", callable_mp(this, &EditorAssetLibraryItem::_category_clicked));
- author->connect("pressed", callable_mp(this, &EditorAssetLibraryItem::_author_clicked));
+ icon->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibraryItem::_asset_clicked));
+ title->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibraryItem::_asset_clicked));
+ category->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibraryItem::_category_clicked));
+ author->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibraryItem::_author_clicked));
} else {
title->set_mouse_filter(MOUSE_FILTER_IGNORE);
category->set_mouse_filter(MOUSE_FILTER_IGNORE);
@@ -303,7 +303,7 @@ void EditorAssetLibraryItemDescription::add_preview(int p_id, bool p_video, cons
new_preview.button = memnew(Button);
new_preview.button->set_icon(previews->get_editor_theme_icon(SNAME("ThumbnailWait")));
new_preview.button->set_toggle_mode(true);
- new_preview.button->connect("pressed", callable_mp(this, &EditorAssetLibraryItemDescription::_preview_click).bind(p_id));
+ new_preview.button->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibraryItemDescription::_preview_click).bind(p_id));
preview_hb->add_child(new_preview.button);
if (!p_video) {
new_preview.image = previews->get_editor_theme_icon(SNAME("ThumbnailWait"));
@@ -577,7 +577,7 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() {
title->set_h_size_flags(Control::SIZE_EXPAND_FILL);
dismiss_button = memnew(TextureButton);
- dismiss_button->connect("pressed", callable_mp(this, &EditorAssetLibraryItemDownload::_close));
+ dismiss_button->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibraryItemDownload::_close));
title_hb->add_child(dismiss_button);
title->set_clip_text(true);
@@ -597,11 +597,11 @@ EditorAssetLibraryItemDownload::EditorAssetLibraryItemDownload() {
install_button = memnew(Button);
install_button->set_text(TTR("Install..."));
install_button->set_disabled(true);
- install_button->connect("pressed", callable_mp(this, &EditorAssetLibraryItemDownload::install));
+ install_button->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibraryItemDownload::install));
retry_button = memnew(Button);
retry_button->set_text(TTR("Retry"));
- retry_button->connect("pressed", callable_mp(this, &EditorAssetLibraryItemDownload::_make_request));
+ retry_button->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibraryItemDownload::_make_request));
// Only show the Retry button in case of a failure.
retry_button->hide();
@@ -1134,7 +1134,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int
first->set_text(TTR("First", "Pagination"));
first->set_theme_type_variation("PanelBackgroundButton");
if (p_page != 0) {
- first->connect("pressed", callable_mp(this, &EditorAssetLibrary::_search).bind(0));
+ first->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibrary::_search).bind(0));
} else {
first->set_disabled(true);
first->set_focus_mode(Control::FOCUS_NONE);
@@ -1145,7 +1145,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int
prev->set_text(TTR("Previous", "Pagination"));
prev->set_theme_type_variation("PanelBackgroundButton");
if (p_page > 0) {
- prev->connect("pressed", callable_mp(this, &EditorAssetLibrary::_search).bind(p_page - 1));
+ prev->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibrary::_search).bind(p_page - 1));
} else {
prev->set_disabled(true);
prev->set_focus_mode(Control::FOCUS_NONE);
@@ -1162,7 +1162,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int
current->set_disabled(true);
current->set_focus_mode(Control::FOCUS_NONE);
} else {
- current->connect("pressed", callable_mp(this, &EditorAssetLibrary::_search).bind(i));
+ current->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibrary::_search).bind(i));
}
hbc->add_child(current);
}
@@ -1171,7 +1171,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int
next->set_text(TTR("Next", "Pagination"));
next->set_theme_type_variation("PanelBackgroundButton");
if (p_page < p_page_count - 1) {
- next->connect("pressed", callable_mp(this, &EditorAssetLibrary::_search).bind(p_page + 1));
+ next->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibrary::_search).bind(p_page + 1));
} else {
next->set_disabled(true);
next->set_focus_mode(Control::FOCUS_NONE);
@@ -1183,7 +1183,7 @@ HBoxContainer *EditorAssetLibrary::_make_pages(int p_page, int p_page_count, int
last->set_text(TTR("Last", "Pagination"));
last->set_theme_type_variation("PanelBackgroundButton");
if (p_page != p_page_count - 1) {
- last->connect("pressed", callable_mp(this, &EditorAssetLibrary::_search).bind(p_page_count - 1));
+ last->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibrary::_search).bind(p_page_count - 1));
} else {
last->set_disabled(true);
last->set_focus_mode(Control::FOCUS_NONE);
@@ -1542,7 +1542,7 @@ void EditorAssetLibrary::_set_library_message(const String &p_message) {
library_message->set_text(p_message);
if (library_message_action.is_valid()) {
- library_message_button->disconnect("pressed", library_message_action);
+ library_message_button->disconnect(SceneStringName(pressed), library_message_action);
library_message_action = Callable();
}
library_message_button->hide();
@@ -1555,11 +1555,11 @@ void EditorAssetLibrary::_set_library_message_with_action(const String &p_messag
library_message_button->set_text(p_action_text);
if (library_message_action.is_valid()) {
- library_message_button->disconnect("pressed", library_message_action);
+ library_message_button->disconnect(SceneStringName(pressed), library_message_action);
library_message_action = Callable();
}
library_message_action = p_action;
- library_message_button->connect("pressed", library_message_action);
+ library_message_button->connect(SceneStringName(pressed), library_message_action);
library_message_button->show();
library_message_box->show();
@@ -1618,12 +1618,12 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) {
Button *open_asset = memnew(Button);
open_asset->set_text(TTR("Import..."));
search_hb->add_child(open_asset);
- open_asset->connect("pressed", callable_mp(this, &EditorAssetLibrary::_asset_open));
+ open_asset->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibrary::_asset_open));
Button *plugins = memnew(Button);
plugins->set_text(TTR("Plugins..."));
search_hb->add_child(plugins);
- plugins->connect("pressed", callable_mp(this, &EditorAssetLibrary::_manage_plugins));
+ plugins->connect(SceneStringName(pressed), callable_mp(this, &EditorAssetLibrary::_manage_plugins));
if (p_templates_only) {
open_asset->hide();
diff --git a/editor/plugins/audio_stream_editor_plugin.cpp b/editor/plugins/audio_stream_editor_plugin.cpp
index 6a64f46a93..af6bbb679a 100644
--- a/editor/plugins/audio_stream_editor_plugin.cpp
+++ b/editor/plugins/audio_stream_editor_plugin.cpp
@@ -244,14 +244,14 @@ AudioStreamEditor::AudioStreamEditor() {
hbox->add_child(_play_button);
_play_button->set_flat(true);
_play_button->set_focus_mode(Control::FOCUS_NONE);
- _play_button->connect(SNAME("pressed"), callable_mp(this, &AudioStreamEditor::_play));
+ _play_button->connect(SceneStringName(pressed), callable_mp(this, &AudioStreamEditor::_play));
_play_button->set_shortcut(ED_SHORTCUT("audio_stream_editor/audio_preview_play_pause", TTR("Audio Preview Play/Pause"), Key::SPACE));
_stop_button = memnew(Button);
hbox->add_child(_stop_button);
_stop_button->set_flat(true);
_stop_button->set_focus_mode(Control::FOCUS_NONE);
- _stop_button->connect(SNAME("pressed"), callable_mp(this, &AudioStreamEditor::_stop));
+ _stop_button->connect(SceneStringName(pressed), callable_mp(this, &AudioStreamEditor::_stop));
_current_label = memnew(Label);
_current_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT);
diff --git a/editor/plugins/bone_map_editor_plugin.cpp b/editor/plugins/bone_map_editor_plugin.cpp
index 2bf9ad9e09..c7207a6eab 100644
--- a/editor/plugins/bone_map_editor_plugin.cpp
+++ b/editor/plugins/bone_map_editor_plugin.cpp
@@ -120,7 +120,7 @@ void BoneMapperItem::create_editor() {
picker_button = memnew(Button);
picker_button->set_icon(get_editor_theme_icon(SNAME("ClassList")));
- picker_button->connect("pressed", callable_mp(this, &BoneMapperItem::_open_picker));
+ picker_button->connect(SceneStringName(pressed), callable_mp(this, &BoneMapperItem::_open_picker));
hbox->add_child(picker_button);
add_child(memnew(HSeparator));
@@ -301,7 +301,7 @@ void BoneMapper::create_editor() {
clear_mapping_button = memnew(Button);
clear_mapping_button->set_icon(get_editor_theme_icon(SNAME("Clear")));
clear_mapping_button->set_tooltip_text(TTR("Clear mappings in current group."));
- clear_mapping_button->connect("pressed", callable_mp(this, &BoneMapper::_clear_mapping_current_group));
+ clear_mapping_button->connect(SceneStringName(pressed), callable_mp(this, &BoneMapper::_clear_mapping_current_group));
group_hbox->add_child(clear_mapping_button);
bone_mapper_field = memnew(AspectRatioContainer);
@@ -422,7 +422,7 @@ void BoneMapper::recreate_editor() {
for (int i = 0; i < len; i++) {
if (profile->get_group(i) == profile->get_group_name(current_group_idx)) {
BoneMapperButton *mb = memnew(BoneMapperButton(profile->get_bone_name(i), profile->is_required(i), current_bone_idx == i));
- mb->connect("pressed", callable_mp(this, &BoneMapper::set_current_bone_idx).bind(i), CONNECT_DEFERRED);
+ mb->connect(SceneStringName(pressed), callable_mp(this, &BoneMapper::set_current_bone_idx).bind(i), CONNECT_DEFERRED);
mb->set_h_grow_direction(GROW_DIRECTION_BOTH);
mb->set_v_grow_direction(GROW_DIRECTION_BOTH);
Vector2 vc = profile->get_handle_offset(i);
diff --git a/editor/plugins/camera_3d_editor_plugin.cpp b/editor/plugins/camera_3d_editor_plugin.cpp
index b9555296b8..62b40043c1 100644
--- a/editor/plugins/camera_3d_editor_plugin.cpp
+++ b/editor/plugins/camera_3d_editor_plugin.cpp
@@ -76,7 +76,7 @@ Camera3DEditor::Camera3DEditor() {
preview->set_offset(SIDE_RIGHT, 0);
preview->set_offset(SIDE_TOP, 0);
preview->set_offset(SIDE_BOTTOM, 10);
- preview->connect("pressed", callable_mp(this, &Camera3DEditor::_pressed));
+ preview->connect(SceneStringName(pressed), callable_mp(this, &Camera3DEditor::_pressed));
}
void Camera3DEditorPlugin::edit(Object *p_object) {
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index 0ab9192454..731c89250e 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -5251,7 +5251,7 @@ CanvasItemEditor::CanvasItemEditor() {
controls_hb->add_child(button_center_view);
button_center_view->set_flat(true);
button_center_view->set_tooltip_text(TTR("Center View"));
- button_center_view->connect("pressed", callable_mp(this, &CanvasItemEditor::_popup_callback).bind(VIEW_CENTER_TO_SELECTION));
+ button_center_view->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_popup_callback).bind(VIEW_CENTER_TO_SELECTION));
zoom_widget = memnew(EditorZoomWidget);
zoom_widget->set_anchors_and_offsets_preset(Control::PRESET_TOP_LEFT, Control::PRESET_MODE_MINSIZE, 2 * EDSCALE);
@@ -5288,7 +5288,7 @@ CanvasItemEditor::CanvasItemEditor() {
select_button->set_theme_type_variation("FlatButton");
main_menu_hbox->add_child(select_button);
select_button->set_toggle_mode(true);
- select_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_SELECT));
+ select_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_SELECT));
select_button->set_pressed(true);
select_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/select_mode", TTR("Select Mode"), Key::Q));
select_button->set_shortcut_context(this);
@@ -5300,7 +5300,7 @@ CanvasItemEditor::CanvasItemEditor() {
move_button->set_theme_type_variation("FlatButton");
main_menu_hbox->add_child(move_button);
move_button->set_toggle_mode(true);
- move_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_MOVE));
+ move_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_MOVE));
move_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/move_mode", TTR("Move Mode"), Key::W));
move_button->set_shortcut_context(this);
move_button->set_tooltip_text(TTR("Move Mode"));
@@ -5309,7 +5309,7 @@ CanvasItemEditor::CanvasItemEditor() {
rotate_button->set_theme_type_variation("FlatButton");
main_menu_hbox->add_child(rotate_button);
rotate_button->set_toggle_mode(true);
- rotate_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_ROTATE));
+ rotate_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_ROTATE));
rotate_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/rotate_mode", TTR("Rotate Mode"), Key::E));
rotate_button->set_shortcut_context(this);
rotate_button->set_tooltip_text(TTR("Rotate Mode"));
@@ -5318,7 +5318,7 @@ CanvasItemEditor::CanvasItemEditor() {
scale_button->set_theme_type_variation("FlatButton");
main_menu_hbox->add_child(scale_button);
scale_button->set_toggle_mode(true);
- scale_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_SCALE));
+ scale_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_SCALE));
scale_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/scale_mode", TTR("Scale Mode"), Key::S));
scale_button->set_shortcut_context(this);
scale_button->set_tooltip_text(TTR("Shift: Scale proportionally."));
@@ -5329,21 +5329,21 @@ CanvasItemEditor::CanvasItemEditor() {
list_select_button->set_theme_type_variation("FlatButton");
main_menu_hbox->add_child(list_select_button);
list_select_button->set_toggle_mode(true);
- list_select_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_LIST_SELECT));
+ list_select_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_LIST_SELECT));
list_select_button->set_tooltip_text(TTR("Show list of selectable nodes at position clicked."));
pivot_button = memnew(Button);
pivot_button->set_theme_type_variation("FlatButton");
main_menu_hbox->add_child(pivot_button);
pivot_button->set_toggle_mode(true);
- pivot_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_EDIT_PIVOT));
+ pivot_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_EDIT_PIVOT));
pivot_button->set_tooltip_text(TTR("Click to change object's rotation pivot.") + "\n" + TTR("Shift: Set temporary rotation pivot.") + "\n" + TTR("Click this button while holding Shift to put the rotation pivot in the center of the selected nodes."));
pan_button = memnew(Button);
pan_button->set_theme_type_variation("FlatButton");
main_menu_hbox->add_child(pan_button);
pan_button->set_toggle_mode(true);
- pan_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_PAN));
+ pan_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_PAN));
pan_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/pan_mode", TTR("Pan Mode"), Key::G));
pan_button->set_shortcut_context(this);
pan_button->set_tooltip_text(TTR("You can also use Pan View shortcut (Space by default) to pan in any mode."));
@@ -5352,7 +5352,7 @@ CanvasItemEditor::CanvasItemEditor() {
ruler_button->set_theme_type_variation("FlatButton");
main_menu_hbox->add_child(ruler_button);
ruler_button->set_toggle_mode(true);
- ruler_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_RULER));
+ ruler_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_button_tool_select).bind(TOOL_RULER));
ruler_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/ruler_mode", TTR("Ruler Mode"), Key::R));
ruler_button->set_shortcut_context(this);
ruler_button->set_tooltip_text(TTR("Ruler Mode"));
@@ -5414,7 +5414,7 @@ CanvasItemEditor::CanvasItemEditor() {
lock_button->set_theme_type_variation("FlatButton");
main_menu_hbox->add_child(lock_button);
- lock_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_popup_callback).bind(LOCK_SELECTED));
+ lock_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_popup_callback).bind(LOCK_SELECTED));
lock_button->set_tooltip_text(TTR("Lock selected node, preventing selection and movement."));
// Define the shortcut globally (without a context) so that it works if the Scene tree dock is currently focused.
lock_button->set_shortcut(ED_SHORTCUT("editor/lock_selected_nodes", TTR("Lock Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | Key::L));
@@ -5422,7 +5422,7 @@ CanvasItemEditor::CanvasItemEditor() {
unlock_button = memnew(Button);
unlock_button->set_theme_type_variation("FlatButton");
main_menu_hbox->add_child(unlock_button);
- unlock_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_popup_callback).bind(UNLOCK_SELECTED));
+ unlock_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_popup_callback).bind(UNLOCK_SELECTED));
unlock_button->set_tooltip_text(TTR("Unlock selected node, allowing selection and movement."));
// Define the shortcut globally (without a context) so that it works if the Scene tree dock is currently focused.
unlock_button->set_shortcut(ED_SHORTCUT("editor/unlock_selected_nodes", TTR("Unlock Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::L));
@@ -5430,7 +5430,7 @@ CanvasItemEditor::CanvasItemEditor() {
group_button = memnew(Button);
group_button->set_theme_type_variation("FlatButton");
main_menu_hbox->add_child(group_button);
- group_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_popup_callback).bind(GROUP_SELECTED));
+ group_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_popup_callback).bind(GROUP_SELECTED));
group_button->set_tooltip_text(TTR("Groups the selected node with its children. This causes the parent to be selected when any child node is clicked in 2D and 3D view."));
// Define the shortcut globally (without a context) so that it works if the Scene tree dock is currently focused.
group_button->set_shortcut(ED_SHORTCUT("editor/group_selected_nodes", TTR("Group Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | Key::G));
@@ -5438,7 +5438,7 @@ CanvasItemEditor::CanvasItemEditor() {
ungroup_button = memnew(Button);
ungroup_button->set_theme_type_variation("FlatButton");
main_menu_hbox->add_child(ungroup_button);
- ungroup_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_popup_callback).bind(UNGROUP_SELECTED));
+ ungroup_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_popup_callback).bind(UNGROUP_SELECTED));
ungroup_button->set_tooltip_text(TTR("Ungroups the selected node from its children. Child nodes will be individual items in 2D and 3D view."));
// Define the shortcut globally (without a context) so that it works if the Scene tree dock is currently focused.
ungroup_button->set_shortcut(ED_SHORTCUT("editor/ungroup_selected_nodes", TTR("Ungroup Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::G));
@@ -5550,7 +5550,7 @@ CanvasItemEditor::CanvasItemEditor() {
key_loc_button->set_toggle_mode(true);
key_loc_button->set_pressed(true);
key_loc_button->set_focus_mode(FOCUS_NONE);
- key_loc_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_popup_callback).bind(ANIM_INSERT_POS));
+ key_loc_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_popup_callback).bind(ANIM_INSERT_POS));
key_loc_button->set_tooltip_text(TTR("Translation mask for inserting keys."));
animation_hb->add_child(key_loc_button);
@@ -5559,7 +5559,7 @@ CanvasItemEditor::CanvasItemEditor() {
key_rot_button->set_toggle_mode(true);
key_rot_button->set_pressed(true);
key_rot_button->set_focus_mode(FOCUS_NONE);
- key_rot_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_popup_callback).bind(ANIM_INSERT_ROT));
+ key_rot_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_popup_callback).bind(ANIM_INSERT_ROT));
key_rot_button->set_tooltip_text(TTR("Rotation mask for inserting keys."));
animation_hb->add_child(key_rot_button);
@@ -5567,14 +5567,14 @@ CanvasItemEditor::CanvasItemEditor() {
key_scale_button->set_theme_type_variation("FlatButton");
key_scale_button->set_toggle_mode(true);
key_scale_button->set_focus_mode(FOCUS_NONE);
- key_scale_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_popup_callback).bind(ANIM_INSERT_SCALE));
+ key_scale_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_popup_callback).bind(ANIM_INSERT_SCALE));
key_scale_button->set_tooltip_text(TTR("Scale mask for inserting keys."));
animation_hb->add_child(key_scale_button);
key_insert_button = memnew(Button);
key_insert_button->set_theme_type_variation("FlatButton");
key_insert_button->set_focus_mode(FOCUS_NONE);
- key_insert_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_popup_callback).bind(ANIM_INSERT_KEY));
+ key_insert_button->connect(SceneStringName(pressed), callable_mp(this, &CanvasItemEditor::_popup_callback).bind(ANIM_INSERT_KEY));
key_insert_button->set_tooltip_text(TTR("Insert keys (based on mask)."));
key_insert_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/anim_insert_key", TTR("Insert Key"), Key::INSERT));
key_insert_button->set_shortcut_context(this);
diff --git a/editor/plugins/control_editor_plugin.cpp b/editor/plugins/control_editor_plugin.cpp
index 80446e48e8..1d5b0a832a 100644
--- a/editor/plugins/control_editor_plugin.cpp
+++ b/editor/plugins/control_editor_plugin.cpp
@@ -352,7 +352,7 @@ void EditorPropertySizeFlags::setup(const Vector<String> &p_options, bool p_vert
cb->set_text(text_split[0]);
cb->set_clip_text(true);
cb->set_meta("_value", current_val);
- cb->connect("pressed", callable_mp(this, &EditorPropertySizeFlags::_flag_toggled));
+ cb->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertySizeFlags::_flag_toggled));
add_focusable(cb);
flag_options->add_child(cb);
@@ -407,7 +407,7 @@ EditorPropertySizeFlags::EditorPropertySizeFlags() {
flag_expand->set_text(TTR("Expand"));
vb->add_child(flag_expand);
add_focusable(flag_expand);
- flag_expand->connect("pressed", callable_mp(this, &EditorPropertySizeFlags::_expand_toggled));
+ flag_expand->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertySizeFlags::_expand_toggled));
}
bool EditorInspectorPluginControl::can_handle(Object *p_object) {
@@ -552,7 +552,7 @@ void ControlEditorPresetPicker::_add_row_button(HBoxContainer *p_row, const int
b->set_tooltip_text(p_name);
b->set_flat(true);
p_row->add_child(b);
- b->connect("pressed", callable_mp(this, &ControlEditorPresetPicker::_preset_button_pressed).bind(p_preset));
+ b->connect(SceneStringName(pressed), callable_mp(this, &ControlEditorPresetPicker::_preset_button_pressed).bind(p_preset));
preset_buttons[p_preset] = b;
}
@@ -731,7 +731,7 @@ SizeFlagPresetPicker::SizeFlagPresetPicker(bool p_vertical) {
expand_button->set_flat(true);
expand_button->set_text(TTR("Expand"));
expand_button->set_tooltip_text(TTR("Enable to also set the Expand flag.\nDisable to only set Shrink/Fill flags."));
- expand_button->connect("pressed", callable_mp(this, &SizeFlagPresetPicker::_expand_button_pressed));
+ expand_button->connect(SceneStringName(pressed), callable_mp(this, &SizeFlagPresetPicker::_expand_button_pressed));
main_vb->add_child(expand_button);
}
@@ -1077,7 +1077,7 @@ ControlEditorToolbar::ControlEditorToolbar() {
keep_ratio_button->set_text(TTR("Set to Current Ratio"));
keep_ratio_button->set_tooltip_text(TTR("Adjust anchors and offsets to match the current rect size."));
anchors_button->get_popup_hbox()->add_child(keep_ratio_button);
- keep_ratio_button->connect("pressed", callable_mp(this, &ControlEditorToolbar::_anchors_to_current_ratio));
+ keep_ratio_button->connect(SceneStringName(pressed), callable_mp(this, &ControlEditorToolbar::_anchors_to_current_ratio));
anchor_mode_button = memnew(Button);
anchor_mode_button->set_theme_type_variation("FlatButton");
diff --git a/editor/plugins/editor_plugin_settings.cpp b/editor/plugins/editor_plugin_settings.cpp
index 2920cf19c0..afc60b09d6 100644
--- a/editor/plugins/editor_plugin_settings.cpp
+++ b/editor/plugins/editor_plugin_settings.cpp
@@ -215,7 +215,7 @@ EditorPluginSettings::EditorPluginSettings() {
title_hb->add_child(label);
title_hb->add_spacer();
Button *create_plugin_button = memnew(Button(TTR("Create New Plugin")));
- create_plugin_button->connect("pressed", callable_mp(this, &EditorPluginSettings::_create_clicked));
+ create_plugin_button->connect(SceneStringName(pressed), callable_mp(this, &EditorPluginSettings::_create_clicked));
title_hb->add_child(create_plugin_button);
add_child(title_hb);
diff --git a/editor/plugins/font_config_plugin.cpp b/editor/plugins/font_config_plugin.cpp
index be7ff6ba3e..1b104f9075 100644
--- a/editor/plugins/font_config_plugin.cpp
+++ b/editor/plugins/font_config_plugin.cpp
@@ -305,7 +305,7 @@ void EditorPropertyFontMetaOverride::update_property() {
Button *remove = memnew(Button);
remove->set_icon(get_editor_theme_icon(SNAME("Remove")));
hbox->add_child(remove);
- remove->connect("pressed", callable_mp(this, &EditorPropertyFontMetaOverride::_remove).bind(remove, name));
+ remove->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyFontMetaOverride::_remove).bind(remove, name));
prop->update_property();
}
@@ -316,7 +316,7 @@ void EditorPropertyFontMetaOverride::update_property() {
} else {
button_add = EditorInspector::create_inspector_action_button(TTR("Add Locale"));
}
- button_add->connect("pressed", callable_mp(this, &EditorPropertyFontMetaOverride::_add_menu));
+ button_add->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyFontMetaOverride::_add_menu));
property_vbox->add_child(button_add);
updating = false;
@@ -359,7 +359,7 @@ EditorPropertyFontMetaOverride::EditorPropertyFontMetaOverride(bool p_script) {
edit = memnew(Button);
edit->set_h_size_flags(SIZE_EXPAND_FILL);
edit->set_clip_text(true);
- edit->connect("pressed", callable_mp(this, &EditorPropertyFontMetaOverride::_edit_pressed));
+ edit->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyFontMetaOverride::_edit_pressed));
edit->set_toggle_mode(true);
add_child(edit);
add_focusable(edit);
@@ -530,7 +530,7 @@ EditorPropertyOTVariation::EditorPropertyOTVariation() {
edit = memnew(Button);
edit->set_h_size_flags(SIZE_EXPAND_FILL);
edit->set_clip_text(true);
- edit->connect("pressed", callable_mp(this, &EditorPropertyOTVariation::_edit_pressed));
+ edit->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyOTVariation::_edit_pressed));
edit->set_toggle_mode(true);
add_child(edit);
add_focusable(edit);
@@ -784,7 +784,7 @@ void EditorPropertyOTFeatures::update_property() {
Button *remove = memnew(Button);
remove->set_icon(get_editor_theme_icon(SNAME("Remove")));
hbox->add_child(remove);
- remove->connect("pressed", callable_mp(this, &EditorPropertyOTFeatures::_remove).bind(remove, name_tag));
+ remove->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyOTFeatures::_remove).bind(remove, name_tag));
prop->update_property();
}
@@ -792,7 +792,7 @@ void EditorPropertyOTFeatures::update_property() {
button_add = EditorInspector::create_inspector_action_button(TTR("Add Feature"));
button_add->set_icon(get_editor_theme_icon(SNAME("Add")));
- button_add->connect("pressed", callable_mp(this, &EditorPropertyOTFeatures::_add_menu));
+ button_add->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyOTFeatures::_add_menu));
property_vbox->add_child(button_add);
updating = false;
@@ -833,7 +833,7 @@ EditorPropertyOTFeatures::EditorPropertyOTFeatures() {
edit = memnew(Button);
edit->set_h_size_flags(SIZE_EXPAND_FILL);
edit->set_clip_text(true);
- edit->connect("pressed", callable_mp(this, &EditorPropertyOTFeatures::_edit_pressed));
+ edit->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyOTFeatures::_edit_pressed));
edit->set_toggle_mode(true);
add_child(edit);
add_focusable(edit);
diff --git a/editor/plugins/gpu_particles_collision_sdf_editor_plugin.cpp b/editor/plugins/gpu_particles_collision_sdf_editor_plugin.cpp
index 99a702f3a4..25b076d0e5 100644
--- a/editor/plugins/gpu_particles_collision_sdf_editor_plugin.cpp
+++ b/editor/plugins/gpu_particles_collision_sdf_editor_plugin.cpp
@@ -186,7 +186,7 @@ GPUParticlesCollisionSDF3DEditorPlugin::GPUParticlesCollisionSDF3DEditorPlugin()
bake->set_theme_type_variation("FlatButton");
bake->set_icon(EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("Bake"), EditorStringName(EditorIcons)));
bake->set_text(TTR("Bake SDF"));
- bake->connect("pressed", callable_mp(this, &GPUParticlesCollisionSDF3DEditorPlugin::_bake));
+ bake->connect(SceneStringName(pressed), callable_mp(this, &GPUParticlesCollisionSDF3DEditorPlugin::_bake));
bake_hb->add_child(bake);
add_control_to_container(CONTAINER_SPATIAL_EDITOR_MENU, bake_hb);
diff --git a/editor/plugins/gradient_editor_plugin.cpp b/editor/plugins/gradient_editor_plugin.cpp
index 80a7121ee4..dd7998c6bf 100644
--- a/editor/plugins/gradient_editor_plugin.cpp
+++ b/editor/plugins/gradient_editor_plugin.cpp
@@ -644,7 +644,7 @@ GradientEditor::GradientEditor() {
gradient_editor_rect = memnew(GradientEdit);
add_child(gradient_editor_rect);
- reverse_button->connect("pressed", callable_mp(gradient_editor_rect, &GradientEdit::reverse_gradient));
+ reverse_button->connect(SceneStringName(pressed), callable_mp(gradient_editor_rect, &GradientEdit::reverse_gradient));
set_mouse_filter(MOUSE_FILTER_STOP);
_set_snap_enabled(snap_button->is_pressed());
diff --git a/editor/plugins/gradient_texture_2d_editor_plugin.cpp b/editor/plugins/gradient_texture_2d_editor_plugin.cpp
index ebc00c49bb..9a2e625210 100644
--- a/editor/plugins/gradient_texture_2d_editor_plugin.cpp
+++ b/editor/plugins/gradient_texture_2d_editor_plugin.cpp
@@ -282,7 +282,7 @@ GradientTexture2DEditor::GradientTexture2DEditor() {
reverse_button = memnew(Button);
reverse_button->set_tooltip_text(TTR("Swap Gradient Fill Points"));
toolbar->add_child(reverse_button);
- reverse_button->connect("pressed", callable_mp(this, &GradientTexture2DEditor::_reverse_button_pressed));
+ reverse_button->connect(SceneStringName(pressed), callable_mp(this, &GradientTexture2DEditor::_reverse_button_pressed));
toolbar->add_child(memnew(VSeparator));
diff --git a/editor/plugins/input_event_editor_plugin.cpp b/editor/plugins/input_event_editor_plugin.cpp
index 973c929059..1f6bb11929 100644
--- a/editor/plugins/input_event_editor_plugin.cpp
+++ b/editor/plugins/input_event_editor_plugin.cpp
@@ -88,7 +88,7 @@ InputEventConfigContainer::InputEventConfigContainer() {
add_child(input_event_text);
open_config_button = EditorInspector::create_inspector_action_button(TTR("Configure"));
- open_config_button->connect("pressed", callable_mp(this, &InputEventConfigContainer::_configure_pressed));
+ open_config_button->connect(SceneStringName(pressed), callable_mp(this, &InputEventConfigContainer::_configure_pressed));
add_child(open_config_button);
add_child(memnew(Control));
diff --git a/editor/plugins/lightmap_gi_editor_plugin.cpp b/editor/plugins/lightmap_gi_editor_plugin.cpp
index 335498dff9..2289105d78 100644
--- a/editor/plugins/lightmap_gi_editor_plugin.cpp
+++ b/editor/plugins/lightmap_gi_editor_plugin.cpp
@@ -177,7 +177,7 @@ LightmapGIEditorPlugin::LightmapGIEditorPlugin() {
bake->set_icon(EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("Bake"), EditorStringName(EditorIcons)));
bake->set_text(TTR("Bake Lightmaps"));
bake->hide();
- bake->connect("pressed", Callable(this, "_bake"));
+ bake->connect(SceneStringName(pressed), Callable(this, "_bake"));
add_control_to_container(CONTAINER_SPATIAL_EDITOR_MENU, bake);
lightmap = nullptr;
diff --git a/editor/plugins/material_editor_plugin.cpp b/editor/plugins/material_editor_plugin.cpp
index d3a0d56ec9..602e6f945c 100644
--- a/editor/plugins/material_editor_plugin.cpp
+++ b/editor/plugins/material_editor_plugin.cpp
@@ -242,14 +242,14 @@ MaterialEditor::MaterialEditor() {
sphere_switch->set_toggle_mode(true);
sphere_switch->set_pressed(true);
vb_shape->add_child(sphere_switch);
- sphere_switch->connect("pressed", callable_mp(this, &MaterialEditor::_on_sphere_switch_pressed));
+ sphere_switch->connect(SceneStringName(pressed), callable_mp(this, &MaterialEditor::_on_sphere_switch_pressed));
box_switch = memnew(Button);
box_switch->set_theme_type_variation("PreviewLightButton");
box_switch->set_toggle_mode(true);
box_switch->set_pressed(false);
vb_shape->add_child(box_switch);
- box_switch->connect("pressed", callable_mp(this, &MaterialEditor::_on_box_switch_pressed));
+ box_switch->connect(SceneStringName(pressed), callable_mp(this, &MaterialEditor::_on_box_switch_pressed));
layout_3d->add_spacer();
@@ -261,14 +261,14 @@ MaterialEditor::MaterialEditor() {
light_1_switch->set_toggle_mode(true);
light_1_switch->set_pressed(true);
vb_light->add_child(light_1_switch);
- light_1_switch->connect("pressed", callable_mp(this, &MaterialEditor::_on_light_1_switch_pressed));
+ light_1_switch->connect(SceneStringName(pressed), callable_mp(this, &MaterialEditor::_on_light_1_switch_pressed));
light_2_switch = memnew(Button);
light_2_switch->set_theme_type_variation("PreviewLightButton");
light_2_switch->set_toggle_mode(true);
light_2_switch->set_pressed(true);
vb_light->add_child(light_2_switch);
- light_2_switch->connect("pressed", callable_mp(this, &MaterialEditor::_on_light_2_switch_pressed));
+ light_2_switch->connect(SceneStringName(pressed), callable_mp(this, &MaterialEditor::_on_light_2_switch_pressed));
if (EditorSettings::get_singleton()->get_project_metadata("inspector_options", "material_preview_on_sphere", true)) {
box_instance->hide();
diff --git a/editor/plugins/mesh_editor_plugin.cpp b/editor/plugins/mesh_editor_plugin.cpp
index 0324b1d4f7..c8eda600b8 100644
--- a/editor/plugins/mesh_editor_plugin.cpp
+++ b/editor/plugins/mesh_editor_plugin.cpp
@@ -150,14 +150,14 @@ MeshEditor::MeshEditor() {
light_1_switch->set_toggle_mode(true);
light_1_switch->set_pressed(true);
vb_light->add_child(light_1_switch);
- light_1_switch->connect("pressed", callable_mp(this, &MeshEditor::_on_light_1_switch_pressed));
+ light_1_switch->connect(SceneStringName(pressed), callable_mp(this, &MeshEditor::_on_light_1_switch_pressed));
light_2_switch = memnew(Button);
light_2_switch->set_theme_type_variation("PreviewLightButton");
light_2_switch->set_toggle_mode(true);
light_2_switch->set_pressed(true);
vb_light->add_child(light_2_switch);
- light_2_switch->connect("pressed", callable_mp(this, &MeshEditor::_on_light_2_switch_pressed));
+ light_2_switch->connect(SceneStringName(pressed), callable_mp(this, &MeshEditor::_on_light_2_switch_pressed));
rot_x = 0;
rot_y = 0;
diff --git a/editor/plugins/mesh_library_editor_plugin.cpp b/editor/plugins/mesh_library_editor_plugin.cpp
index 1a5727a1e8..950aced7a1 100644
--- a/editor/plugins/mesh_library_editor_plugin.cpp
+++ b/editor/plugins/mesh_library_editor_plugin.cpp
@@ -276,12 +276,12 @@ MeshLibraryEditor::MeshLibraryEditor() {
cd_remove = memnew(ConfirmationDialog);
add_child(cd_remove);
- cd_remove->get_ok_button()->connect("pressed", callable_mp(this, &MeshLibraryEditor::_menu_remove_confirm));
+ cd_remove->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &MeshLibraryEditor::_menu_remove_confirm));
cd_update = memnew(ConfirmationDialog);
add_child(cd_update);
cd_update->set_ok_button_text(TTR("Apply without Transforms"));
- cd_update->get_ok_button()->connect("pressed", callable_mp(this, &MeshLibraryEditor::_menu_update_confirm).bind(false));
- cd_update->add_button(TTR("Apply with Transforms"))->connect("pressed", callable_mp(this, &MeshLibraryEditor::_menu_update_confirm).bind(true));
+ cd_update->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &MeshLibraryEditor::_menu_update_confirm).bind(false));
+ cd_update->add_button(TTR("Apply with Transforms"))->connect(SceneStringName(pressed), callable_mp(this, &MeshLibraryEditor::_menu_update_confirm).bind(true));
}
void MeshLibraryEditorPlugin::edit(Object *p_node) {
diff --git a/editor/plugins/multimesh_editor_plugin.cpp b/editor/plugins/multimesh_editor_plugin.cpp
index 9fec263af3..ffe46d5daa 100644
--- a/editor/plugins/multimesh_editor_plugin.cpp
+++ b/editor/plugins/multimesh_editor_plugin.cpp
@@ -296,7 +296,7 @@ MultiMeshEditor::MultiMeshEditor() {
Button *b = memnew(Button);
hbc->add_child(b);
b->set_text("..");
- b->connect("pressed", callable_mp(this, &MultiMeshEditor::_browse).bind(false));
+ b->connect(SceneStringName(pressed), callable_mp(this, &MultiMeshEditor::_browse).bind(false));
vbc->add_margin_child(TTR("Target Surface:"), hbc);
@@ -308,7 +308,7 @@ MultiMeshEditor::MultiMeshEditor() {
hbc->add_child(b);
b->set_text("..");
vbc->add_margin_child(TTR("Source Mesh:"), hbc);
- b->connect("pressed", callable_mp(this, &MultiMeshEditor::_browse).bind(true));
+ b->connect(SceneStringName(pressed), callable_mp(this, &MultiMeshEditor::_browse).bind(true));
populate_axis = memnew(OptionButton);
populate_axis->add_item(TTR("X-Axis"));
@@ -354,7 +354,7 @@ MultiMeshEditor::MultiMeshEditor() {
populate_dialog->set_ok_button_text(TTR("Populate"));
- populate_dialog->get_ok_button()->connect("pressed", callable_mp(this, &MultiMeshEditor::_populate));
+ populate_dialog->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &MultiMeshEditor::_populate));
std = memnew(SceneTreeDialog);
Vector<StringName> valid_types;
valid_types.push_back("MeshInstance3D");
diff --git a/editor/plugins/navigation_obstacle_2d_editor_plugin.cpp b/editor/plugins/navigation_obstacle_2d_editor_plugin.cpp
index 0cbc711982..a0ef3f9a20 100644
--- a/editor/plugins/navigation_obstacle_2d_editor_plugin.cpp
+++ b/editor/plugins/navigation_obstacle_2d_editor_plugin.cpp
@@ -41,6 +41,14 @@ void NavigationObstacle2DEditor::_set_node(Node *p_polygon) {
node = Object::cast_to<NavigationObstacle2D>(p_polygon);
}
+Variant NavigationObstacle2DEditor::_get_polygon(int p_idx) const {
+ return node->get_vertices();
+}
+
+void NavigationObstacle2DEditor::_set_polygon(int p_idx, const Variant &p_polygon) const {
+ node->set_vertices(p_polygon);
+}
+
void NavigationObstacle2DEditor::_action_add_polygon(const Variant &p_polygon) {
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
undo_redo->add_do_method(node, "set_vertices", p_polygon);
diff --git a/editor/plugins/navigation_obstacle_2d_editor_plugin.h b/editor/plugins/navigation_obstacle_2d_editor_plugin.h
index 5a2206b8df..ae5b3a056a 100644
--- a/editor/plugins/navigation_obstacle_2d_editor_plugin.h
+++ b/editor/plugins/navigation_obstacle_2d_editor_plugin.h
@@ -43,6 +43,9 @@ protected:
virtual Node2D *_get_node() const override;
virtual void _set_node(Node *p_polygon) override;
+ virtual Variant _get_polygon(int p_idx) const override;
+ virtual void _set_polygon(int p_idx, const Variant &p_polygon) const override;
+
virtual void _action_add_polygon(const Variant &p_polygon) override;
virtual void _action_remove_polygon(int p_idx) override;
virtual void _action_set_polygon(int p_idx, const Variant &p_previous, const Variant &p_polygon) override;
diff --git a/editor/plugins/navigation_obstacle_3d_editor_plugin.cpp b/editor/plugins/navigation_obstacle_3d_editor_plugin.cpp
index 37c62870e1..9629a673e9 100644
--- a/editor/plugins/navigation_obstacle_3d_editor_plugin.cpp
+++ b/editor/plugins/navigation_obstacle_3d_editor_plugin.cpp
@@ -526,13 +526,13 @@ NavigationObstacle3DEditor::NavigationObstacle3DEditor() {
button_create = memnew(Button);
button_create->set_theme_type_variation("FlatButton");
add_child(button_create);
- button_create->connect("pressed", callable_mp(this, &NavigationObstacle3DEditor::_menu_option).bind(MODE_CREATE));
+ button_create->connect(SceneStringName(pressed), callable_mp(this, &NavigationObstacle3DEditor::_menu_option).bind(MODE_CREATE));
button_create->set_toggle_mode(true);
button_edit = memnew(Button);
button_edit->set_theme_type_variation("FlatButton");
add_child(button_edit);
- button_edit->connect("pressed", callable_mp(this, &NavigationObstacle3DEditor::_menu_option).bind(MODE_EDIT));
+ button_edit->connect(SceneStringName(pressed), callable_mp(this, &NavigationObstacle3DEditor::_menu_option).bind(MODE_EDIT));
button_edit->set_toggle_mode(true);
mode = MODE_EDIT;
diff --git a/editor/plugins/navigation_polygon_editor_plugin.cpp b/editor/plugins/navigation_polygon_editor_plugin.cpp
index 8bddcd4881..8926f612a2 100644
--- a/editor/plugins/navigation_polygon_editor_plugin.cpp
+++ b/editor/plugins/navigation_polygon_editor_plugin.cpp
@@ -148,14 +148,14 @@ NavigationPolygonEditor::NavigationPolygonEditor() {
button_bake->set_toggle_mode(true);
button_bake->set_text(TTR("Bake NavigationPolygon"));
button_bake->set_tooltip_text(TTR("Bakes the NavigationPolygon by first parsing the scene for source geometry and then creating the navigation polygon vertices and polygons."));
- button_bake->connect("pressed", callable_mp(this, &NavigationPolygonEditor::_bake_pressed));
+ button_bake->connect(SceneStringName(pressed), callable_mp(this, &NavigationPolygonEditor::_bake_pressed));
button_reset = memnew(Button);
button_reset->set_flat(true);
bake_hbox->add_child(button_reset);
button_reset->set_text(TTR("Clear NavigationPolygon"));
button_reset->set_tooltip_text(TTR("Clears the internal NavigationPolygon outlines, vertices and polygons."));
- button_reset->connect("pressed", callable_mp(this, &NavigationPolygonEditor::_clear_pressed));
+ button_reset->connect(SceneStringName(pressed), callable_mp(this, &NavigationPolygonEditor::_clear_pressed));
bake_info = memnew(Label);
bake_hbox->add_child(bake_info);
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index 5eb12f795b..5873d10e76 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -3013,7 +3013,7 @@ void Node3DEditorViewport::_notification(int p_what) {
view_menu->begin_bulk_theme_override();
view_menu->add_theme_style_override("normal", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
view_menu->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
- view_menu->add_theme_style_override("pressed", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
+ view_menu->add_theme_style_override(SceneStringName(pressed), gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
view_menu->add_theme_style_override("focus", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
view_menu->add_theme_style_override("disabled", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
view_menu->end_bulk_theme_override();
@@ -3021,7 +3021,7 @@ void Node3DEditorViewport::_notification(int p_what) {
preview_camera->begin_bulk_theme_override();
preview_camera->add_theme_style_override("normal", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
preview_camera->add_theme_style_override("hover", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
- preview_camera->add_theme_style_override("pressed", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
+ preview_camera->add_theme_style_override(SceneStringName(pressed), gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
preview_camera->add_theme_style_override("focus", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
preview_camera->add_theme_style_override("disabled", gui_base->get_theme_stylebox(SNAME("Information3dViewport"), EditorStringName(EditorStyles)));
preview_camera->end_bulk_theme_override();
@@ -8360,7 +8360,7 @@ Node3DEditor::Node3DEditor() {
tool_button[TOOL_MODE_SELECT]->set_toggle_mode(true);
tool_button[TOOL_MODE_SELECT]->set_theme_type_variation("FlatButton");
tool_button[TOOL_MODE_SELECT]->set_pressed(true);
- tool_button[TOOL_MODE_SELECT]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_TOOL_SELECT));
+ tool_button[TOOL_MODE_SELECT]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_TOOL_SELECT));
tool_button[TOOL_MODE_SELECT]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_select", TTR("Select Mode"), Key::Q));
tool_button[TOOL_MODE_SELECT]->set_shortcut_context(this);
tool_button[TOOL_MODE_SELECT]->set_tooltip_text(keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Drag: Rotate selected node around pivot.") + "\n" + TTR("Alt+RMB: Show list of all nodes at position clicked, including locked."));
@@ -8371,7 +8371,7 @@ Node3DEditor::Node3DEditor() {
tool_button[TOOL_MODE_MOVE]->set_toggle_mode(true);
tool_button[TOOL_MODE_MOVE]->set_theme_type_variation("FlatButton");
- tool_button[TOOL_MODE_MOVE]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_TOOL_MOVE));
+ tool_button[TOOL_MODE_MOVE]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_TOOL_MOVE));
tool_button[TOOL_MODE_MOVE]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_move", TTR("Move Mode"), Key::W));
tool_button[TOOL_MODE_MOVE]->set_shortcut_context(this);
tool_button[TOOL_MODE_MOVE]->set_tooltip_text(keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Drag: Use snap.") + "\n" + TTR("Alt+RMB: Show list of all nodes at position clicked, including locked."));
@@ -8380,7 +8380,7 @@ Node3DEditor::Node3DEditor() {
main_menu_hbox->add_child(tool_button[TOOL_MODE_ROTATE]);
tool_button[TOOL_MODE_ROTATE]->set_toggle_mode(true);
tool_button[TOOL_MODE_ROTATE]->set_theme_type_variation("FlatButton");
- tool_button[TOOL_MODE_ROTATE]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_TOOL_ROTATE));
+ tool_button[TOOL_MODE_ROTATE]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_TOOL_ROTATE));
tool_button[TOOL_MODE_ROTATE]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_rotate", TTR("Rotate Mode"), Key::E));
tool_button[TOOL_MODE_ROTATE]->set_shortcut_context(this);
tool_button[TOOL_MODE_ROTATE]->set_tooltip_text(keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Drag: Use snap.") + "\n" + TTR("Alt+RMB: Show list of all nodes at position clicked, including locked."));
@@ -8389,7 +8389,7 @@ Node3DEditor::Node3DEditor() {
main_menu_hbox->add_child(tool_button[TOOL_MODE_SCALE]);
tool_button[TOOL_MODE_SCALE]->set_toggle_mode(true);
tool_button[TOOL_MODE_SCALE]->set_theme_type_variation("FlatButton");
- tool_button[TOOL_MODE_SCALE]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_TOOL_SCALE));
+ tool_button[TOOL_MODE_SCALE]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_TOOL_SCALE));
tool_button[TOOL_MODE_SCALE]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_scale", TTR("Scale Mode"), Key::R));
tool_button[TOOL_MODE_SCALE]->set_shortcut_context(this);
tool_button[TOOL_MODE_SCALE]->set_tooltip_text(keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Drag: Use snap.") + "\n" + TTR("Alt+RMB: Show list of all nodes at position clicked, including locked."));
@@ -8400,13 +8400,13 @@ Node3DEditor::Node3DEditor() {
main_menu_hbox->add_child(tool_button[TOOL_MODE_LIST_SELECT]);
tool_button[TOOL_MODE_LIST_SELECT]->set_toggle_mode(true);
tool_button[TOOL_MODE_LIST_SELECT]->set_theme_type_variation("FlatButton");
- tool_button[TOOL_MODE_LIST_SELECT]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_TOOL_LIST_SELECT));
+ tool_button[TOOL_MODE_LIST_SELECT]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_TOOL_LIST_SELECT));
tool_button[TOOL_MODE_LIST_SELECT]->set_tooltip_text(TTR("Show list of selectable nodes at position clicked."));
tool_button[TOOL_LOCK_SELECTED] = memnew(Button);
main_menu_hbox->add_child(tool_button[TOOL_LOCK_SELECTED]);
tool_button[TOOL_LOCK_SELECTED]->set_theme_type_variation("FlatButton");
- tool_button[TOOL_LOCK_SELECTED]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_LOCK_SELECTED));
+ tool_button[TOOL_LOCK_SELECTED]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_LOCK_SELECTED));
tool_button[TOOL_LOCK_SELECTED]->set_tooltip_text(TTR("Lock selected node, preventing selection and movement."));
// Define the shortcut globally (without a context) so that it works if the Scene tree dock is currently focused.
tool_button[TOOL_LOCK_SELECTED]->set_shortcut(ED_SHORTCUT("editor/lock_selected_nodes", TTR("Lock Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | Key::L));
@@ -8414,7 +8414,7 @@ Node3DEditor::Node3DEditor() {
tool_button[TOOL_UNLOCK_SELECTED] = memnew(Button);
main_menu_hbox->add_child(tool_button[TOOL_UNLOCK_SELECTED]);
tool_button[TOOL_UNLOCK_SELECTED]->set_theme_type_variation("FlatButton");
- tool_button[TOOL_UNLOCK_SELECTED]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_UNLOCK_SELECTED));
+ tool_button[TOOL_UNLOCK_SELECTED]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_UNLOCK_SELECTED));
tool_button[TOOL_UNLOCK_SELECTED]->set_tooltip_text(TTR("Unlock selected node, allowing selection and movement."));
// Define the shortcut globally (without a context) so that it works if the Scene tree dock is currently focused.
tool_button[TOOL_UNLOCK_SELECTED]->set_shortcut(ED_SHORTCUT("editor/unlock_selected_nodes", TTR("Unlock Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::L));
@@ -8422,7 +8422,7 @@ Node3DEditor::Node3DEditor() {
tool_button[TOOL_GROUP_SELECTED] = memnew(Button);
main_menu_hbox->add_child(tool_button[TOOL_GROUP_SELECTED]);
tool_button[TOOL_GROUP_SELECTED]->set_theme_type_variation("FlatButton");
- tool_button[TOOL_GROUP_SELECTED]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_GROUP_SELECTED));
+ tool_button[TOOL_GROUP_SELECTED]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_GROUP_SELECTED));
tool_button[TOOL_GROUP_SELECTED]->set_tooltip_text(TTR("Groups the selected node with its children. This selects the parent when any child node is clicked in 2D and 3D view."));
// Define the shortcut globally (without a context) so that it works if the Scene tree dock is currently focused.
tool_button[TOOL_GROUP_SELECTED]->set_shortcut(ED_SHORTCUT("editor/group_selected_nodes", TTR("Group Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | Key::G));
@@ -8430,7 +8430,7 @@ Node3DEditor::Node3DEditor() {
tool_button[TOOL_UNGROUP_SELECTED] = memnew(Button);
main_menu_hbox->add_child(tool_button[TOOL_UNGROUP_SELECTED]);
tool_button[TOOL_UNGROUP_SELECTED]->set_theme_type_variation("FlatButton");
- tool_button[TOOL_UNGROUP_SELECTED]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_UNGROUP_SELECTED));
+ tool_button[TOOL_UNGROUP_SELECTED]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_UNGROUP_SELECTED));
tool_button[TOOL_UNGROUP_SELECTED]->set_tooltip_text(TTR("Ungroups the selected node from its children. Child nodes will be individual items in 2D and 3D view."));
// Define the shortcut globally (without a context) so that it works if the Scene tree dock is currently focused.
tool_button[TOOL_UNGROUP_SELECTED]->set_shortcut(ED_SHORTCUT("editor/ungroup_selected_nodes", TTR("Ungroup Selected Node(s)"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::G));
@@ -8468,7 +8468,7 @@ Node3DEditor::Node3DEditor() {
sun_button->set_tooltip_text(TTR("Toggle preview sunlight.\nIf a DirectionalLight3D node is added to the scene, preview sunlight is disabled."));
sun_button->set_toggle_mode(true);
sun_button->set_theme_type_variation("FlatButton");
- sun_button->connect("pressed", callable_mp(this, &Node3DEditor::_update_preview_environment), CONNECT_DEFERRED);
+ sun_button->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_update_preview_environment), CONNECT_DEFERRED);
// Preview is enabled by default - ensure this applies on editor startup when there is no state yet.
sun_button->set_pressed(true);
@@ -8478,7 +8478,7 @@ Node3DEditor::Node3DEditor() {
environ_button->set_tooltip_text(TTR("Toggle preview environment.\nIf a WorldEnvironment node is added to the scene, preview environment is disabled."));
environ_button->set_toggle_mode(true);
environ_button->set_theme_type_variation("FlatButton");
- environ_button->connect("pressed", callable_mp(this, &Node3DEditor::_update_preview_environment), CONNECT_DEFERRED);
+ environ_button->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_update_preview_environment), CONNECT_DEFERRED);
// Preview is enabled by default - ensure this applies on editor startup when there is no state yet.
environ_button->set_pressed(true);
@@ -8487,7 +8487,7 @@ Node3DEditor::Node3DEditor() {
sun_environ_settings = memnew(Button);
sun_environ_settings->set_tooltip_text(TTR("Edit Sun and Environment settings."));
sun_environ_settings->set_theme_type_variation("FlatButton");
- sun_environ_settings->connect("pressed", callable_mp(this, &Node3DEditor::_sun_environ_settings_pressed));
+ sun_environ_settings->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_sun_environ_settings_pressed));
main_menu_hbox->add_child(sun_environ_settings);
@@ -8616,7 +8616,7 @@ Node3DEditor::Node3DEditor() {
snap_dialog->set_title(TTR("Snap Settings"));
add_child(snap_dialog);
snap_dialog->connect("confirmed", callable_mp(this, &Node3DEditor::_snap_changed));
- snap_dialog->get_cancel_button()->connect("pressed", callable_mp(this, &Node3DEditor::_snap_update));
+ snap_dialog->get_cancel_button()->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_snap_update));
VBoxContainer *snap_dialog_vbc = memnew(VBoxContainer);
snap_dialog->add_child(snap_dialog_vbc);
@@ -8852,7 +8852,7 @@ void fragment() {
sun_add_to_scene = memnew(Button);
sun_add_to_scene->set_text(TTR("Add Sun to Scene"));
sun_add_to_scene->set_tooltip_text(TTR("Adds a DirectionalLight3D node matching the preview sun settings to the current scene.\nHold Shift while clicking to also add the preview environment to the current scene."));
- sun_add_to_scene->connect("pressed", callable_mp(this, &Node3DEditor::_add_sun_to_scene).bind(false));
+ sun_add_to_scene->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_add_sun_to_scene).bind(false));
sun_vb->add_spacer();
sun_vb->add_child(sun_add_to_scene);
@@ -8901,29 +8901,29 @@ void fragment() {
environ_ao_button = memnew(Button);
environ_ao_button->set_text(TTR("AO"));
environ_ao_button->set_toggle_mode(true);
- environ_ao_button->connect("pressed", callable_mp(this, &Node3DEditor::_preview_settings_changed), CONNECT_DEFERRED);
+ environ_ao_button->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_preview_settings_changed), CONNECT_DEFERRED);
fx_vb->add_child(environ_ao_button);
environ_glow_button = memnew(Button);
environ_glow_button->set_text(TTR("Glow"));
environ_glow_button->set_toggle_mode(true);
- environ_glow_button->connect("pressed", callable_mp(this, &Node3DEditor::_preview_settings_changed), CONNECT_DEFERRED);
+ environ_glow_button->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_preview_settings_changed), CONNECT_DEFERRED);
fx_vb->add_child(environ_glow_button);
environ_tonemap_button = memnew(Button);
environ_tonemap_button->set_text(TTR("Tonemap"));
environ_tonemap_button->set_toggle_mode(true);
- environ_tonemap_button->connect("pressed", callable_mp(this, &Node3DEditor::_preview_settings_changed), CONNECT_DEFERRED);
+ environ_tonemap_button->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_preview_settings_changed), CONNECT_DEFERRED);
fx_vb->add_child(environ_tonemap_button);
environ_gi_button = memnew(Button);
environ_gi_button->set_text(TTR("GI"));
environ_gi_button->set_toggle_mode(true);
- environ_gi_button->connect("pressed", callable_mp(this, &Node3DEditor::_preview_settings_changed), CONNECT_DEFERRED);
+ environ_gi_button->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_preview_settings_changed), CONNECT_DEFERRED);
fx_vb->add_child(environ_gi_button);
environ_vb->add_margin_child(TTR("Post Process"), fx_vb);
environ_add_to_scene = memnew(Button);
environ_add_to_scene->set_text(TTR("Add Environment to Scene"));
environ_add_to_scene->set_tooltip_text(TTR("Adds a WorldEnvironment node matching the preview environment settings to the current scene.\nHold Shift while clicking to also add the preview sun to the current scene."));
- environ_add_to_scene->connect("pressed", callable_mp(this, &Node3DEditor::_add_environment_to_scene).bind(false));
+ environ_add_to_scene->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_add_environment_to_scene).bind(false));
environ_vb->add_spacer();
environ_vb->add_child(environ_add_to_scene);
diff --git a/editor/plugins/occluder_instance_3d_editor_plugin.cpp b/editor/plugins/occluder_instance_3d_editor_plugin.cpp
index b0bd6f7817..c14d9e02aa 100644
--- a/editor/plugins/occluder_instance_3d_editor_plugin.cpp
+++ b/editor/plugins/occluder_instance_3d_editor_plugin.cpp
@@ -108,7 +108,7 @@ OccluderInstance3DEditorPlugin::OccluderInstance3DEditorPlugin() {
bake->set_icon(EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("Bake"), EditorStringName(EditorIcons)));
bake->set_text(TTR("Bake Occluders"));
bake->hide();
- bake->connect("pressed", Callable(this, "_bake"));
+ bake->connect(SceneStringName(pressed), Callable(this, "_bake"));
add_control_to_container(CONTAINER_SPATIAL_EDITOR_MENU, bake);
occluder_instance = nullptr;
diff --git a/editor/plugins/packed_scene_editor_plugin.cpp b/editor/plugins/packed_scene_editor_plugin.cpp
index 540779b232..c2d9851c17 100644
--- a/editor/plugins/packed_scene_editor_plugin.cpp
+++ b/editor/plugins/packed_scene_editor_plugin.cpp
@@ -52,7 +52,7 @@ PackedSceneEditor::PackedSceneEditor(Ref<PackedScene> &p_packed_scene) {
packed_scene = p_packed_scene;
open_scene_button = EditorInspector::create_inspector_action_button(TTR("Open Scene"));
- open_scene_button->connect(SNAME("pressed"), callable_mp(this, &PackedSceneEditor::_on_open_scene_pressed));
+ open_scene_button->connect(SceneStringName(pressed), callable_mp(this, &PackedSceneEditor::_on_open_scene_pressed));
open_scene_button->set_disabled(!packed_scene->get_path().get_file().is_valid_filename());
add_child(open_scene_button);
diff --git a/editor/plugins/path_2d_editor_plugin.cpp b/editor/plugins/path_2d_editor_plugin.cpp
index ca884c4d97..f404dca88b 100644
--- a/editor/plugins/path_2d_editor_plugin.cpp
+++ b/editor/plugins/path_2d_editor_plugin.cpp
@@ -612,7 +612,7 @@ Path2DEditor::Path2DEditor() {
curve_edit->set_pressed(true);
curve_edit->set_focus_mode(Control::FOCUS_NONE);
curve_edit->set_tooltip_text(TTR("Select Points") + "\n" + TTR("Shift+Drag: Select Control Points") + "\n" + keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Click: Add Point") + "\n" + TTR("Left Click: Split Segment (in curve)") + "\n" + TTR("Right Click: Delete Point"));
- curve_edit->connect("pressed", callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_EDIT));
+ curve_edit->connect(SceneStringName(pressed), callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_EDIT));
add_child(curve_edit);
curve_edit_curve = memnew(Button);
@@ -620,7 +620,7 @@ Path2DEditor::Path2DEditor() {
curve_edit_curve->set_toggle_mode(true);
curve_edit_curve->set_focus_mode(Control::FOCUS_NONE);
curve_edit_curve->set_tooltip_text(TTR("Select Control Points (Shift+Drag)"));
- curve_edit_curve->connect("pressed", callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_EDIT_CURVE));
+ curve_edit_curve->connect(SceneStringName(pressed), callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_EDIT_CURVE));
add_child(curve_edit_curve);
curve_create = memnew(Button);
@@ -628,7 +628,7 @@ Path2DEditor::Path2DEditor() {
curve_create->set_toggle_mode(true);
curve_create->set_focus_mode(Control::FOCUS_NONE);
curve_create->set_tooltip_text(TTR("Add Point (in empty space)") + "\n" + TTR("Right Click: Delete Point"));
- curve_create->connect("pressed", callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_CREATE));
+ curve_create->connect(SceneStringName(pressed), callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_CREATE));
add_child(curve_create);
curve_del = memnew(Button);
@@ -636,21 +636,21 @@ Path2DEditor::Path2DEditor() {
curve_del->set_toggle_mode(true);
curve_del->set_focus_mode(Control::FOCUS_NONE);
curve_del->set_tooltip_text(TTR("Delete Point"));
- curve_del->connect("pressed", callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_DELETE));
+ curve_del->connect(SceneStringName(pressed), callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_DELETE));
add_child(curve_del);
curve_close = memnew(Button);
curve_close->set_theme_type_variation("FlatButton");
curve_close->set_focus_mode(Control::FOCUS_NONE);
curve_close->set_tooltip_text(TTR("Close Curve"));
- curve_close->connect("pressed", callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_CLOSE));
+ curve_close->connect(SceneStringName(pressed), callable_mp(this, &Path2DEditor::_mode_selected).bind(MODE_CLOSE));
add_child(curve_close);
curve_clear_points = memnew(Button);
curve_clear_points->set_theme_type_variation("FlatButton");
curve_clear_points->set_focus_mode(Control::FOCUS_NONE);
curve_clear_points->set_tooltip_text(TTR("Clear Points"));
- curve_clear_points->connect("pressed", callable_mp(this, &Path2DEditor::_confirm_clear_points));
+ curve_clear_points->connect(SceneStringName(pressed), callable_mp(this, &Path2DEditor::_confirm_clear_points));
add_child(curve_clear_points);
clear_points_dialog = memnew(ConfirmationDialog);
diff --git a/editor/plugins/path_3d_editor_plugin.cpp b/editor/plugins/path_3d_editor_plugin.cpp
index 34af6d1d7e..3f5ade8a03 100644
--- a/editor/plugins/path_3d_editor_plugin.cpp
+++ b/editor/plugins/path_3d_editor_plugin.cpp
@@ -465,11 +465,11 @@ Path3DGizmo::Path3DGizmo(Path3D *p_path, float p_disk_size) {
// Connecting to a signal once, rather than plaguing the implementation with calls to `Node3DEditor::update_transform_gizmo`.
path->connect("curve_changed", callable_mp(this, &Path3DGizmo::_update_transform_gizmo));
- Path3DEditorPlugin::singleton->curve_edit->connect("pressed", callable_mp(this, &Path3DGizmo::redraw));
- Path3DEditorPlugin::singleton->curve_edit_curve->connect("pressed", callable_mp(this, &Path3DGizmo::redraw));
- Path3DEditorPlugin::singleton->curve_create->connect("pressed", callable_mp(this, &Path3DGizmo::redraw));
- Path3DEditorPlugin::singleton->curve_del->connect("pressed", callable_mp(this, &Path3DGizmo::redraw));
- Path3DEditorPlugin::singleton->curve_close->connect("pressed", callable_mp(this, &Path3DGizmo::redraw));
+ Path3DEditorPlugin::singleton->curve_edit->connect(SceneStringName(pressed), callable_mp(this, &Path3DGizmo::redraw));
+ Path3DEditorPlugin::singleton->curve_edit_curve->connect(SceneStringName(pressed), callable_mp(this, &Path3DGizmo::redraw));
+ Path3DEditorPlugin::singleton->curve_create->connect(SceneStringName(pressed), callable_mp(this, &Path3DGizmo::redraw));
+ Path3DEditorPlugin::singleton->curve_del->connect(SceneStringName(pressed), callable_mp(this, &Path3DGizmo::redraw));
+ Path3DEditorPlugin::singleton->curve_close->connect(SceneStringName(pressed), callable_mp(this, &Path3DGizmo::redraw));
}
EditorPlugin::AfterGUIInput Path3DEditorPlugin::forward_3d_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event) {
@@ -788,12 +788,12 @@ void Path3DEditorPlugin::_update_theme() {
void Path3DEditorPlugin::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE: {
- curve_create->connect("pressed", callable_mp(this, &Path3DEditorPlugin::_mode_changed).bind(MODE_CREATE));
- curve_edit_curve->connect("pressed", callable_mp(this, &Path3DEditorPlugin::_mode_changed).bind(MODE_EDIT_CURVE));
- curve_edit_tilt->connect("pressed", callable_mp(this, &Path3DEditorPlugin::_mode_changed).bind(MODE_EDIT_TILT));
- curve_edit->connect("pressed", callable_mp(this, &Path3DEditorPlugin::_mode_changed).bind(MODE_EDIT));
- curve_del->connect("pressed", callable_mp(this, &Path3DEditorPlugin::_mode_changed).bind(MODE_DELETE));
- curve_close->connect("pressed", callable_mp(this, &Path3DEditorPlugin::_close_curve));
+ curve_create->connect(SceneStringName(pressed), callable_mp(this, &Path3DEditorPlugin::_mode_changed).bind(MODE_CREATE));
+ curve_edit_curve->connect(SceneStringName(pressed), callable_mp(this, &Path3DEditorPlugin::_mode_changed).bind(MODE_EDIT_CURVE));
+ curve_edit_tilt->connect(SceneStringName(pressed), callable_mp(this, &Path3DEditorPlugin::_mode_changed).bind(MODE_EDIT_TILT));
+ curve_edit->connect(SceneStringName(pressed), callable_mp(this, &Path3DEditorPlugin::_mode_changed).bind(MODE_EDIT));
+ curve_del->connect(SceneStringName(pressed), callable_mp(this, &Path3DEditorPlugin::_mode_changed).bind(MODE_DELETE));
+ curve_close->connect(SceneStringName(pressed), callable_mp(this, &Path3DEditorPlugin::_close_curve));
_update_theme();
} break;
@@ -875,7 +875,7 @@ Path3DEditorPlugin::Path3DEditorPlugin() {
curve_clear_points->set_theme_type_variation("FlatButton");
curve_clear_points->set_focus_mode(Control::FOCUS_NONE);
curve_clear_points->set_tooltip_text(TTR("Clear Points"));
- curve_clear_points->connect("pressed", callable_mp(this, &Path3DEditorPlugin::_confirm_clear_points));
+ curve_clear_points->connect(SceneStringName(pressed), callable_mp(this, &Path3DEditorPlugin::_confirm_clear_points));
topmenu_bar->add_child(curve_clear_points);
clear_points_dialog = memnew(ConfirmationDialog);
diff --git a/editor/plugins/plugin_config_dialog.cpp b/editor/plugins/plugin_config_dialog.cpp
index a535b18b9d..fda06c3eec 100644
--- a/editor/plugins/plugin_config_dialog.cpp
+++ b/editor/plugins/plugin_config_dialog.cpp
@@ -161,7 +161,7 @@ void PluginConfigDialog::_notification(int p_what) {
case NOTIFICATION_READY: {
connect("confirmed", callable_mp(this, &PluginConfigDialog::_on_confirmed));
- get_cancel_button()->connect("pressed", callable_mp(this, &PluginConfigDialog::_on_canceled));
+ get_cancel_button()->connect(SceneStringName(pressed), callable_mp(this, &PluginConfigDialog::_on_canceled));
} break;
}
}
diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp
index 240bf7463c..8bffbeaf15 100644
--- a/editor/plugins/polygon_2d_editor_plugin.cpp
+++ b/editor/plugins/polygon_2d_editor_plugin.cpp
@@ -212,7 +212,7 @@ void Polygon2DEditor::_update_bone_list() {
cb->set_pressed(true);
}
- cb->connect("pressed", callable_mp(this, &Polygon2DEditor::_bone_paint_selected).bind(i));
+ cb->connect(SceneStringName(pressed), callable_mp(this, &Polygon2DEditor::_bone_paint_selected).bind(i));
}
uv_edit_draw->queue_redraw();
@@ -1302,7 +1302,7 @@ Polygon2DEditor::Polygon2DEditor() {
button_uv->set_theme_type_variation("FlatButton");
add_child(button_uv);
button_uv->set_tooltip_text(TTR("Open Polygon 2D UV editor."));
- button_uv->connect("pressed", callable_mp(this, &Polygon2DEditor::_menu_option).bind(MODE_EDIT_UV));
+ button_uv->connect(SceneStringName(pressed), callable_mp(this, &Polygon2DEditor::_menu_option).bind(MODE_EDIT_UV));
uv_mode = UV_MODE_EDIT_POINT;
uv_edit = memnew(AcceptDialog);
@@ -1341,10 +1341,10 @@ Polygon2DEditor::Polygon2DEditor() {
uv_edit_mode[2]->set_button_group(uv_edit_group);
uv_edit_mode[3]->set_button_group(uv_edit_group);
- uv_edit_mode[0]->connect("pressed", callable_mp(this, &Polygon2DEditor::_uv_edit_mode_select).bind(0));
- uv_edit_mode[1]->connect("pressed", callable_mp(this, &Polygon2DEditor::_uv_edit_mode_select).bind(1));
- uv_edit_mode[2]->connect("pressed", callable_mp(this, &Polygon2DEditor::_uv_edit_mode_select).bind(2));
- uv_edit_mode[3]->connect("pressed", callable_mp(this, &Polygon2DEditor::_uv_edit_mode_select).bind(3));
+ uv_edit_mode[0]->connect(SceneStringName(pressed), callable_mp(this, &Polygon2DEditor::_uv_edit_mode_select).bind(0));
+ uv_edit_mode[1]->connect(SceneStringName(pressed), callable_mp(this, &Polygon2DEditor::_uv_edit_mode_select).bind(1));
+ uv_edit_mode[2]->connect(SceneStringName(pressed), callable_mp(this, &Polygon2DEditor::_uv_edit_mode_select).bind(2));
+ uv_edit_mode[3]->connect(SceneStringName(pressed), callable_mp(this, &Polygon2DEditor::_uv_edit_mode_select).bind(3));
uv_mode_hb->add_child(memnew(VSeparator));
@@ -1354,7 +1354,7 @@ Polygon2DEditor::Polygon2DEditor() {
uv_button[i]->set_theme_type_variation("FlatButton");
uv_button[i]->set_toggle_mode(true);
uv_mode_hb->add_child(uv_button[i]);
- uv_button[i]->connect("pressed", callable_mp(this, &Polygon2DEditor::_uv_mode).bind(i));
+ uv_button[i]->connect(SceneStringName(pressed), callable_mp(this, &Polygon2DEditor::_uv_mode).bind(i));
uv_button[i]->set_focus_mode(FOCUS_NONE);
}
@@ -1521,7 +1521,7 @@ Polygon2DEditor::Polygon2DEditor() {
sync_bones = memnew(Button(TTR("Sync Bones to Polygon")));
bone_scroll_main_vb->add_child(sync_bones);
sync_bones->set_h_size_flags(0);
- sync_bones->connect("pressed", callable_mp(this, &Polygon2DEditor::_sync_bones));
+ sync_bones->connect(SceneStringName(pressed), callable_mp(this, &Polygon2DEditor::_sync_bones));
uv_main_hsc->add_child(bone_scroll_main_vb);
bone_scroll = memnew(ScrollContainer);
bone_scroll->set_v_scroll(true);
diff --git a/editor/plugins/polygon_3d_editor_plugin.cpp b/editor/plugins/polygon_3d_editor_plugin.cpp
index 7c41093774..56baa4a839 100644
--- a/editor/plugins/polygon_3d_editor_plugin.cpp
+++ b/editor/plugins/polygon_3d_editor_plugin.cpp
@@ -538,13 +538,13 @@ Polygon3DEditor::Polygon3DEditor() {
button_create = memnew(Button);
button_create->set_theme_type_variation("FlatButton");
add_child(button_create);
- button_create->connect("pressed", callable_mp(this, &Polygon3DEditor::_menu_option).bind(MODE_CREATE));
+ button_create->connect(SceneStringName(pressed), callable_mp(this, &Polygon3DEditor::_menu_option).bind(MODE_CREATE));
button_create->set_toggle_mode(true);
button_edit = memnew(Button);
button_edit->set_theme_type_variation("FlatButton");
add_child(button_edit);
- button_edit->connect("pressed", callable_mp(this, &Polygon3DEditor::_menu_option).bind(MODE_EDIT));
+ button_edit->connect(SceneStringName(pressed), callable_mp(this, &Polygon3DEditor::_menu_option).bind(MODE_EDIT));
button_edit->set_toggle_mode(true);
mode = MODE_EDIT;
diff --git a/editor/plugins/resource_preloader_editor_plugin.cpp b/editor/plugins/resource_preloader_editor_plugin.cpp
index c95195ae2a..ba6699fcc4 100644
--- a/editor/plugins/resource_preloader_editor_plugin.cpp
+++ b/editor/plugins/resource_preloader_editor_plugin.cpp
@@ -385,8 +385,8 @@ ResourcePreloaderEditor::ResourcePreloaderEditor() {
dialog = memnew(AcceptDialog);
add_child(dialog);
- load->connect("pressed", callable_mp(this, &ResourcePreloaderEditor::_load_pressed));
- paste->connect("pressed", callable_mp(this, &ResourcePreloaderEditor::_paste_pressed));
+ load->connect(SceneStringName(pressed), callable_mp(this, &ResourcePreloaderEditor::_load_pressed));
+ paste->connect(SceneStringName(pressed), callable_mp(this, &ResourcePreloaderEditor::_paste_pressed));
file->connect("files_selected", callable_mp(this, &ResourcePreloaderEditor::_files_load_request));
tree->connect("item_edited", callable_mp(this, &ResourcePreloaderEditor::_item_edited));
loading_scene = false;
diff --git a/editor/plugins/root_motion_editor_plugin.cpp b/editor/plugins/root_motion_editor_plugin.cpp
index f6a5c58acf..4d0156eb5b 100644
--- a/editor/plugins/root_motion_editor_plugin.cpp
+++ b/editor/plugins/root_motion_editor_plugin.cpp
@@ -202,11 +202,11 @@ EditorPropertyRootMotion::EditorPropertyRootMotion() {
assign = memnew(Button);
assign->set_h_size_flags(SIZE_EXPAND_FILL);
assign->set_clip_text(true);
- assign->connect("pressed", callable_mp(this, &EditorPropertyRootMotion::_node_assign));
+ assign->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyRootMotion::_node_assign));
hbc->add_child(assign);
clear = memnew(Button);
- clear->connect("pressed", callable_mp(this, &EditorPropertyRootMotion::_node_clear));
+ clear->connect(SceneStringName(pressed), callable_mp(this, &EditorPropertyRootMotion::_node_clear));
hbc->add_child(clear);
filter_dialog = memnew(ConfirmationDialog);
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 9c5072ec67..6cb49bbfa6 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -4148,14 +4148,14 @@ ScriptEditor::ScriptEditor(WindowWrapper *p_wrapper) {
site_search = memnew(Button);
site_search->set_flat(true);
site_search->set_text(TTR("Online Docs"));
- site_search->connect("pressed", callable_mp(this, &ScriptEditor::_menu_option).bind(SEARCH_WEBSITE));
+ site_search->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditor::_menu_option).bind(SEARCH_WEBSITE));
menu_hb->add_child(site_search);
site_search->set_tooltip_text(TTR("Open Godot online documentation."));
help_search = memnew(Button);
help_search->set_flat(true);
help_search->set_text(TTR("Search Help"));
- help_search->connect("pressed", callable_mp(this, &ScriptEditor::_menu_option).bind(SEARCH_HELP));
+ help_search->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditor::_menu_option).bind(SEARCH_HELP));
menu_hb->add_child(help_search);
help_search->set_tooltip_text(TTR("Search the reference documentation."));
@@ -4163,14 +4163,14 @@ ScriptEditor::ScriptEditor(WindowWrapper *p_wrapper) {
script_back = memnew(Button);
script_back->set_flat(true);
- script_back->connect("pressed", callable_mp(this, &ScriptEditor::_history_back));
+ script_back->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditor::_history_back));
menu_hb->add_child(script_back);
script_back->set_disabled(true);
script_back->set_tooltip_text(TTR("Go to previous edited document."));
script_forward = memnew(Button);
script_forward->set_flat(true);
- script_forward->connect("pressed", callable_mp(this, &ScriptEditor::_history_forward));
+ script_forward->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditor::_history_forward));
menu_hb->add_child(script_forward);
script_forward->set_disabled(true);
script_forward->set_tooltip_text(TTR("Go to next edited document."));
diff --git a/editor/plugins/shader_file_editor_plugin.cpp b/editor/plugins/shader_file_editor_plugin.cpp
index 3e025f8ba0..dac5592113 100644
--- a/editor/plugins/shader_file_editor_plugin.cpp
+++ b/editor/plugins/shader_file_editor_plugin.cpp
@@ -286,7 +286,7 @@ ShaderFileEditor::ShaderFileEditor() {
stage_hb->add_child(button);
stages[i] = button;
button->set_button_group(bg);
- button->connect("pressed", callable_mp(this, &ShaderFileEditor::_version_selected).bind(i));
+ button->connect(SceneStringName(pressed), callable_mp(this, &ShaderFileEditor::_version_selected).bind(i));
}
error_text = memnew(RichTextLabel);
diff --git a/editor/plugins/skeleton_3d_editor_plugin.cpp b/editor/plugins/skeleton_3d_editor_plugin.cpp
index 527c56aec3..e792f0998b 100644
--- a/editor/plugins/skeleton_3d_editor_plugin.cpp
+++ b/editor/plugins/skeleton_3d_editor_plugin.cpp
@@ -789,7 +789,7 @@ void Skeleton3DEditor::create_editors() {
key_insert_button = memnew(Button);
key_insert_button->set_theme_type_variation("FlatButton");
key_insert_button->set_focus_mode(FOCUS_NONE);
- key_insert_button->connect("pressed", callable_mp(this, &Skeleton3DEditor::insert_keys).bind(false));
+ key_insert_button->connect(SceneStringName(pressed), callable_mp(this, &Skeleton3DEditor::insert_keys).bind(false));
key_insert_button->set_tooltip_text(TTR("Insert key of bone poses already exist track."));
key_insert_button->set_shortcut(ED_SHORTCUT("skeleton_3d_editor/insert_key_to_existing_tracks", TTR("Insert Key (Existing Tracks)"), Key::INSERT));
animation_hb->add_child(key_insert_button);
@@ -797,7 +797,7 @@ void Skeleton3DEditor::create_editors() {
key_insert_all_button = memnew(Button);
key_insert_all_button->set_theme_type_variation("FlatButton");
key_insert_all_button->set_focus_mode(FOCUS_NONE);
- key_insert_all_button->connect("pressed", callable_mp(this, &Skeleton3DEditor::insert_keys).bind(true));
+ key_insert_all_button->connect(SceneStringName(pressed), callable_mp(this, &Skeleton3DEditor::insert_keys).bind(true));
key_insert_all_button->set_tooltip_text(TTR("Insert key of all bone poses."));
key_insert_all_button->set_shortcut(ED_SHORTCUT("skeleton_3d_editor/insert_key_of_all_bones", TTR("Insert Key (All Bones)"), KeyModifierMask::CMD_OR_CTRL + Key::INSERT));
animation_hb->add_child(key_insert_all_button);
diff --git a/editor/plugins/skeleton_ik_3d_editor_plugin.cpp b/editor/plugins/skeleton_ik_3d_editor_plugin.cpp
index 003380dec1..1753df5cb7 100644
--- a/editor/plugins/skeleton_ik_3d_editor_plugin.cpp
+++ b/editor/plugins/skeleton_ik_3d_editor_plugin.cpp
@@ -82,7 +82,7 @@ SkeletonIK3DEditorPlugin::SkeletonIK3DEditorPlugin() {
play_btn->set_text(TTR("Play IK"));
play_btn->set_toggle_mode(true);
play_btn->hide();
- play_btn->connect("pressed", callable_mp(this, &SkeletonIK3DEditorPlugin::_play));
+ play_btn->connect(SceneStringName(pressed), callable_mp(this, &SkeletonIK3DEditorPlugin::_play));
add_control_to_container(CONTAINER_SPATIAL_EDITOR_MENU, play_btn);
skeleton_ik = nullptr;
}
diff --git a/editor/plugins/sprite_2d_editor_plugin.cpp b/editor/plugins/sprite_2d_editor_plugin.cpp
index fa1fd626c3..0b882e265d 100644
--- a/editor/plugins/sprite_2d_editor_plugin.cpp
+++ b/editor/plugins/sprite_2d_editor_plugin.cpp
@@ -647,7 +647,7 @@ Sprite2DEditor::Sprite2DEditor() {
hb->add_spacer();
update_preview = memnew(Button);
update_preview->set_text(TTR("Update Preview"));
- update_preview->connect("pressed", callable_mp(this, &Sprite2DEditor::_update_mesh_data));
+ update_preview->connect(SceneStringName(pressed), callable_mp(this, &Sprite2DEditor::_update_mesh_data));
hb->add_child(update_preview);
vb->add_margin_child(TTR("Settings:"), hb);
diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp
index 46a478b0c3..56f8e1173f 100644
--- a/editor/plugins/sprite_frames_editor_plugin.cpp
+++ b/editor/plugins/sprite_frames_editor_plugin.cpp
@@ -1782,13 +1782,13 @@ SpriteFramesEditor::SpriteFramesEditor() {
add_anim = memnew(Button);
add_anim->set_theme_type_variation("FlatButton");
hbc_animlist->add_child(add_anim);
- add_anim->connect("pressed", callable_mp(this, &SpriteFramesEditor::_animation_add));
+ add_anim->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_animation_add));
delete_anim = memnew(Button);
delete_anim->set_theme_type_variation("FlatButton");
hbc_animlist->add_child(delete_anim);
delete_anim->set_disabled(true);
- delete_anim->connect("pressed", callable_mp(this, &SpriteFramesEditor::_animation_remove));
+ delete_anim->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_animation_remove));
autoplay_container = memnew(HBoxContainer);
hbc_animlist->add_child(autoplay_container);
@@ -1806,7 +1806,7 @@ SpriteFramesEditor::SpriteFramesEditor() {
anim_loop->set_toggle_mode(true);
anim_loop->set_theme_type_variation("FlatButton");
anim_loop->set_tooltip_text(TTR("Animation Looping"));
- anim_loop->connect("pressed", callable_mp(this, &SpriteFramesEditor::_animation_loop_changed));
+ anim_loop->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_animation_loop_changed));
hbc_animlist->add_child(anim_loop);
anim_speed = memnew(SpinBox);
@@ -1890,13 +1890,13 @@ SpriteFramesEditor::SpriteFramesEditor() {
playback_container->add_child(memnew(VSeparator));
- autoplay->connect("pressed", callable_mp(this, &SpriteFramesEditor::_autoplay_pressed));
+ autoplay->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_autoplay_pressed));
autoplay->set_toggle_mode(true);
- play->connect("pressed", callable_mp(this, &SpriteFramesEditor::_play_pressed));
- play_from->connect("pressed", callable_mp(this, &SpriteFramesEditor::_play_from_pressed));
- play_bw->connect("pressed", callable_mp(this, &SpriteFramesEditor::_play_bw_pressed));
- play_bw_from->connect("pressed", callable_mp(this, &SpriteFramesEditor::_play_bw_from_pressed));
- stop->connect("pressed", callable_mp(this, &SpriteFramesEditor::_stop_pressed));
+ play->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_play_pressed));
+ play_from->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_play_from_pressed));
+ play_bw->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_play_bw_pressed));
+ play_bw_from->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_play_bw_from_pressed));
+ stop->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_stop_pressed));
HBoxContainer *hbc_actions = memnew(HBoxContainer);
hfc->add_child(hbc_actions);
@@ -1973,19 +1973,19 @@ SpriteFramesEditor::SpriteFramesEditor() {
hfc->add_child(hbc_zoom);
zoom_out = memnew(Button);
- zoom_out->connect("pressed", callable_mp(this, &SpriteFramesEditor::_zoom_out));
+ zoom_out->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_zoom_out));
zoom_out->set_flat(true);
zoom_out->set_tooltip_text(TTR("Zoom Out"));
hbc_zoom->add_child(zoom_out);
zoom_reset = memnew(Button);
- zoom_reset->connect("pressed", callable_mp(this, &SpriteFramesEditor::_zoom_reset));
+ zoom_reset->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_zoom_reset));
zoom_reset->set_flat(true);
zoom_reset->set_tooltip_text(TTR("Zoom Reset"));
hbc_zoom->add_child(zoom_reset);
zoom_in = memnew(Button);
- zoom_in->connect("pressed", callable_mp(this, &SpriteFramesEditor::_zoom_in));
+ zoom_in->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_zoom_in));
zoom_in->set_flat(true);
zoom_in->set_tooltip_text(TTR("Zoom In"));
hbc_zoom->add_child(zoom_in);
@@ -2014,15 +2014,15 @@ SpriteFramesEditor::SpriteFramesEditor() {
dialog = memnew(AcceptDialog);
add_child(dialog);
- load->connect("pressed", callable_mp(this, &SpriteFramesEditor::_load_pressed));
- load_sheet->connect("pressed", callable_mp(this, &SpriteFramesEditor::_open_sprite_sheet));
- delete_frame->connect("pressed", callable_mp(this, &SpriteFramesEditor::_delete_pressed));
- copy->connect("pressed", callable_mp(this, &SpriteFramesEditor::_copy_pressed));
- paste->connect("pressed", callable_mp(this, &SpriteFramesEditor::_paste_pressed));
- empty_before->connect("pressed", callable_mp(this, &SpriteFramesEditor::_empty_pressed));
- empty_after->connect("pressed", callable_mp(this, &SpriteFramesEditor::_empty2_pressed));
- move_up->connect("pressed", callable_mp(this, &SpriteFramesEditor::_up_pressed));
- move_down->connect("pressed", callable_mp(this, &SpriteFramesEditor::_down_pressed));
+ load->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_load_pressed));
+ load_sheet->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_open_sprite_sheet));
+ delete_frame->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_delete_pressed));
+ copy->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_copy_pressed));
+ paste->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_paste_pressed));
+ empty_before->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_empty_pressed));
+ empty_after->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_empty2_pressed));
+ move_up->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_up_pressed));
+ move_down->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_down_pressed));
load->set_shortcut_context(frame_list);
load->set_shortcut(ED_SHORTCUT("sprite_frames/load_from_file", TTR("Add frame from file"), KeyModifierMask::CMD_OR_CTRL | Key::O));
@@ -2096,12 +2096,12 @@ SpriteFramesEditor::SpriteFramesEditor() {
Button *select_all = memnew(Button);
select_all->set_text(TTR("Select All"));
- select_all->connect("pressed", callable_mp(this, &SpriteFramesEditor::_sheet_select_all_frames));
+ select_all->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_sheet_select_all_frames));
split_sheet_menu_hb->add_child(select_all);
Button *clear_all = memnew(Button);
clear_all->set_text(TTR("Select None"));
- clear_all->connect("pressed", callable_mp(this, &SpriteFramesEditor::_sheet_clear_all_frames));
+ clear_all->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_sheet_clear_all_frames));
split_sheet_menu_hb->add_child(clear_all);
split_sheet_menu_hb->add_spacer();
@@ -2109,7 +2109,7 @@ SpriteFramesEditor::SpriteFramesEditor() {
toggle_settings_button = memnew(Button);
toggle_settings_button->set_h_size_flags(SIZE_SHRINK_END);
toggle_settings_button->set_theme_type_variation("FlatButton");
- toggle_settings_button->connect("pressed", callable_mp(this, &SpriteFramesEditor::_toggle_show_settings));
+ toggle_settings_button->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_toggle_show_settings));
toggle_settings_button->set_tooltip_text(TTR("Toggle Settings Panel"));
split_sheet_menu_hb->add_child(toggle_settings_button);
@@ -2149,21 +2149,21 @@ SpriteFramesEditor::SpriteFramesEditor() {
split_sheet_zoom_out->set_theme_type_variation("FlatButton");
split_sheet_zoom_out->set_focus_mode(FOCUS_NONE);
split_sheet_zoom_out->set_tooltip_text(TTR("Zoom Out"));
- split_sheet_zoom_out->connect("pressed", callable_mp(this, &SpriteFramesEditor::_sheet_zoom_out));
+ split_sheet_zoom_out->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_sheet_zoom_out));
split_sheet_zoom_hb->add_child(split_sheet_zoom_out);
split_sheet_zoom_reset = memnew(Button);
split_sheet_zoom_reset->set_theme_type_variation("FlatButton");
split_sheet_zoom_reset->set_focus_mode(FOCUS_NONE);
split_sheet_zoom_reset->set_tooltip_text(TTR("Zoom Reset"));
- split_sheet_zoom_reset->connect("pressed", callable_mp(this, &SpriteFramesEditor::_sheet_zoom_reset));
+ split_sheet_zoom_reset->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_sheet_zoom_reset));
split_sheet_zoom_hb->add_child(split_sheet_zoom_reset);
split_sheet_zoom_in = memnew(Button);
split_sheet_zoom_in->set_theme_type_variation("FlatButton");
split_sheet_zoom_in->set_focus_mode(FOCUS_NONE);
split_sheet_zoom_in->set_tooltip_text(TTR("Zoom In"));
- split_sheet_zoom_in->connect("pressed", callable_mp(this, &SpriteFramesEditor::_sheet_zoom_in));
+ split_sheet_zoom_in->connect(SceneStringName(pressed), callable_mp(this, &SpriteFramesEditor::_sheet_zoom_in));
split_sheet_zoom_hb->add_child(split_sheet_zoom_in);
split_sheet_settings_vb = memnew(VBoxContainer);
diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp
index 00c3cf4663..6b90ea79b2 100644
--- a/editor/plugins/texture_region_editor_plugin.cpp
+++ b/editor/plugins/texture_region_editor_plugin.cpp
@@ -1228,19 +1228,19 @@ TextureRegionEditor::TextureRegionEditor() {
zoom_out = memnew(Button);
zoom_out->set_flat(true);
zoom_out->set_tooltip_text(TTR("Zoom Out"));
- zoom_out->connect("pressed", callable_mp(this, &TextureRegionEditor::_zoom_out));
+ zoom_out->connect(SceneStringName(pressed), callable_mp(this, &TextureRegionEditor::_zoom_out));
zoom_hb->add_child(zoom_out);
zoom_reset = memnew(Button);
zoom_reset->set_flat(true);
zoom_reset->set_tooltip_text(TTR("Zoom Reset"));
- zoom_reset->connect("pressed", callable_mp(this, &TextureRegionEditor::_zoom_reset));
+ zoom_reset->connect(SceneStringName(pressed), callable_mp(this, &TextureRegionEditor::_zoom_reset));
zoom_hb->add_child(zoom_reset);
zoom_in = memnew(Button);
zoom_in->set_flat(true);
zoom_in->set_tooltip_text(TTR("Zoom In"));
- zoom_in->connect("pressed", callable_mp(this, &TextureRegionEditor::_zoom_in));
+ zoom_in->connect(SceneStringName(pressed), callable_mp(this, &TextureRegionEditor::_zoom_in));
zoom_hb->add_child(zoom_in);
vscroll = memnew(VScrollBar);
@@ -1271,7 +1271,7 @@ bool EditorInspectorPluginTextureRegion::parse_property(Object *p_object, const
if (((Object::cast_to<Sprite2D>(p_object) || Object::cast_to<Sprite3D>(p_object) || Object::cast_to<NinePatchRect>(p_object) || Object::cast_to<StyleBoxTexture>(p_object)) && p_path == "region_rect") || (Object::cast_to<AtlasTexture>(p_object) && p_path == "region")) {
Button *button = EditorInspector::create_inspector_action_button(TTR("Edit Region"));
button->set_icon(texture_region_editor->get_editor_theme_icon(SNAME("RegionEdit")));
- button->connect("pressed", callable_mp(this, &EditorInspectorPluginTextureRegion::_region_edit).bind(p_object));
+ button->connect(SceneStringName(pressed), callable_mp(this, &EditorInspectorPluginTextureRegion::_region_edit).bind(p_object));
add_property_editor(p_path, button, true);
}
}
diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp
index ef1bbdcb0f..8489574194 100644
--- a/editor/plugins/theme_editor_plugin.cpp
+++ b/editor/plugins/theme_editor_plugin.cpp
@@ -1120,15 +1120,15 @@ ThemeItemImportTree::ThemeItemImportTree() {
select_all_items_button->set_flat(true);
select_all_items_button->set_tooltip_text(select_all_items_tooltip);
button_set->add_child(select_all_items_button);
- select_all_items_button->connect("pressed", callable_mp(this, &ThemeItemImportTree::_select_all_data_type_pressed).bind(i));
+ select_all_items_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemImportTree::_select_all_data_type_pressed).bind(i));
select_full_items_button->set_flat(true);
select_full_items_button->set_tooltip_text(select_full_items_tooltip);
button_set->add_child(select_full_items_button);
- select_full_items_button->connect("pressed", callable_mp(this, &ThemeItemImportTree::_select_full_data_type_pressed).bind(i));
+ select_full_items_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemImportTree::_select_full_data_type_pressed).bind(i));
deselect_all_items_button->set_flat(true);
deselect_all_items_button->set_tooltip_text(deselect_all_items_tooltip);
button_set->add_child(deselect_all_items_button);
- deselect_all_items_button->connect("pressed", callable_mp(this, &ThemeItemImportTree::_deselect_all_data_type_pressed).bind(i));
+ deselect_all_items_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemImportTree::_deselect_all_data_type_pressed).bind(i));
total_selected_items_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT);
total_selected_items_label->hide();
@@ -1159,12 +1159,12 @@ ThemeItemImportTree::ThemeItemImportTree() {
import_collapse_types_button->set_flat(true);
import_collapse_types_button->set_tooltip_text(TTR("Collapse types."));
import_buttons->add_child(import_collapse_types_button);
- import_collapse_types_button->connect("pressed", callable_mp(this, &ThemeItemImportTree::_toggle_type_items).bind(true));
+ import_collapse_types_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemImportTree::_toggle_type_items).bind(true));
import_expand_types_button = memnew(Button);
import_expand_types_button->set_flat(true);
import_expand_types_button->set_tooltip_text(TTR("Expand types."));
import_buttons->add_child(import_expand_types_button);
- import_expand_types_button->connect("pressed", callable_mp(this, &ThemeItemImportTree::_toggle_type_items).bind(false));
+ import_expand_types_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemImportTree::_toggle_type_items).bind(false));
import_buttons->add_child(memnew(VSeparator));
@@ -1173,26 +1173,26 @@ ThemeItemImportTree::ThemeItemImportTree() {
import_select_all_button->set_text(TTR("Select All"));
import_select_all_button->set_tooltip_text(TTR("Select all Theme items."));
import_buttons->add_child(import_select_all_button);
- import_select_all_button->connect("pressed", callable_mp(this, &ThemeItemImportTree::_select_all_items_pressed));
+ import_select_all_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemImportTree::_select_all_items_pressed));
import_select_full_button = memnew(Button);
import_select_full_button->set_flat(true);
import_select_full_button->set_text(TTR("Select With Data"));
import_select_full_button->set_tooltip_text(TTR("Select all Theme items with item data."));
import_buttons->add_child(import_select_full_button);
- import_select_full_button->connect("pressed", callable_mp(this, &ThemeItemImportTree::_select_full_items_pressed));
+ import_select_full_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemImportTree::_select_full_items_pressed));
import_deselect_all_button = memnew(Button);
import_deselect_all_button->set_flat(true);
import_deselect_all_button->set_text(TTR("Deselect All"));
import_deselect_all_button->set_tooltip_text(TTR("Deselect all Theme items."));
import_buttons->add_child(import_deselect_all_button);
- import_deselect_all_button->connect("pressed", callable_mp(this, &ThemeItemImportTree::_deselect_all_items_pressed));
+ import_deselect_all_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemImportTree::_deselect_all_items_pressed));
import_buttons->add_spacer();
Button *import_add_selected_button = memnew(Button);
import_add_selected_button->set_text(TTR("Import Selected"));
import_buttons->add_child(import_add_selected_button);
- import_add_selected_button->connect("pressed", callable_mp(this, &ThemeItemImportTree::_import_selected));
+ import_add_selected_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemImportTree::_import_selected));
}
///////////////////////
@@ -1950,7 +1950,7 @@ ThemeItemEditorDialog::ThemeItemEditorDialog(ThemeTypeEditor *p_theme_type_edito
edit_add_type_hb->add_child(edit_add_type_value);
edit_add_type_button = memnew(Button);
edit_add_type_hb->add_child(edit_add_type_button);
- edit_add_type_button->connect("pressed", callable_mp(this, &ThemeItemEditorDialog::_add_theme_type).bind(""));
+ edit_add_type_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemEditorDialog::_add_theme_type).bind(""));
VBoxContainer *edit_items_vb = memnew(VBoxContainer);
edit_items_vb->set_h_size_flags(Control::SIZE_EXPAND_FILL);
@@ -1968,42 +1968,42 @@ ThemeItemEditorDialog::ThemeItemEditorDialog(ThemeTypeEditor *p_theme_type_edito
edit_items_add_color->set_flat(true);
edit_items_add_color->set_disabled(true);
edit_items_toolbar->add_child(edit_items_add_color);
- edit_items_add_color->connect("pressed", callable_mp(this, &ThemeItemEditorDialog::_open_add_theme_item_dialog).bind(Theme::DATA_TYPE_COLOR));
+ edit_items_add_color->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemEditorDialog::_open_add_theme_item_dialog).bind(Theme::DATA_TYPE_COLOR));
edit_items_add_constant = memnew(Button);
edit_items_add_constant->set_tooltip_text(TTR("Add Constant Item"));
edit_items_add_constant->set_flat(true);
edit_items_add_constant->set_disabled(true);
edit_items_toolbar->add_child(edit_items_add_constant);
- edit_items_add_constant->connect("pressed", callable_mp(this, &ThemeItemEditorDialog::_open_add_theme_item_dialog).bind(Theme::DATA_TYPE_CONSTANT));
+ edit_items_add_constant->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemEditorDialog::_open_add_theme_item_dialog).bind(Theme::DATA_TYPE_CONSTANT));
edit_items_add_font = memnew(Button);
edit_items_add_font->set_tooltip_text(TTR("Add Font Item"));
edit_items_add_font->set_flat(true);
edit_items_add_font->set_disabled(true);
edit_items_toolbar->add_child(edit_items_add_font);
- edit_items_add_font->connect("pressed", callable_mp(this, &ThemeItemEditorDialog::_open_add_theme_item_dialog).bind(Theme::DATA_TYPE_FONT));
+ edit_items_add_font->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemEditorDialog::_open_add_theme_item_dialog).bind(Theme::DATA_TYPE_FONT));
edit_items_add_font_size = memnew(Button);
edit_items_add_font_size->set_tooltip_text(TTR("Add Font Size Item"));
edit_items_add_font_size->set_flat(true);
edit_items_add_font_size->set_disabled(true);
edit_items_toolbar->add_child(edit_items_add_font_size);
- edit_items_add_font_size->connect("pressed", callable_mp(this, &ThemeItemEditorDialog::_open_add_theme_item_dialog).bind(Theme::DATA_TYPE_FONT_SIZE));
+ edit_items_add_font_size->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemEditorDialog::_open_add_theme_item_dialog).bind(Theme::DATA_TYPE_FONT_SIZE));
edit_items_add_icon = memnew(Button);
edit_items_add_icon->set_tooltip_text(TTR("Add Icon Item"));
edit_items_add_icon->set_flat(true);
edit_items_add_icon->set_disabled(true);
edit_items_toolbar->add_child(edit_items_add_icon);
- edit_items_add_icon->connect("pressed", callable_mp(this, &ThemeItemEditorDialog::_open_add_theme_item_dialog).bind(Theme::DATA_TYPE_ICON));
+ edit_items_add_icon->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemEditorDialog::_open_add_theme_item_dialog).bind(Theme::DATA_TYPE_ICON));
edit_items_add_stylebox = memnew(Button);
edit_items_add_stylebox->set_tooltip_text(TTR("Add StyleBox Item"));
edit_items_add_stylebox->set_flat(true);
edit_items_add_stylebox->set_disabled(true);
edit_items_toolbar->add_child(edit_items_add_stylebox);
- edit_items_add_stylebox->connect("pressed", callable_mp(this, &ThemeItemEditorDialog::_open_add_theme_item_dialog).bind(Theme::DATA_TYPE_STYLEBOX));
+ edit_items_add_stylebox->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemEditorDialog::_open_add_theme_item_dialog).bind(Theme::DATA_TYPE_STYLEBOX));
edit_items_toolbar->add_child(memnew(VSeparator));
@@ -2016,21 +2016,21 @@ ThemeItemEditorDialog::ThemeItemEditorDialog(ThemeTypeEditor *p_theme_type_edito
edit_items_remove_class->set_flat(true);
edit_items_remove_class->set_disabled(true);
edit_items_toolbar->add_child(edit_items_remove_class);
- edit_items_remove_class->connect("pressed", callable_mp(this, &ThemeItemEditorDialog::_remove_class_items));
+ edit_items_remove_class->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemEditorDialog::_remove_class_items));
edit_items_remove_custom = memnew(Button);
edit_items_remove_custom->set_tooltip_text(TTR("Remove Custom Items"));
edit_items_remove_custom->set_flat(true);
edit_items_remove_custom->set_disabled(true);
edit_items_toolbar->add_child(edit_items_remove_custom);
- edit_items_remove_custom->connect("pressed", callable_mp(this, &ThemeItemEditorDialog::_remove_custom_items));
+ edit_items_remove_custom->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemEditorDialog::_remove_custom_items));
edit_items_remove_all = memnew(Button);
edit_items_remove_all->set_tooltip_text(TTR("Remove All Items"));
edit_items_remove_all->set_flat(true);
edit_items_remove_all->set_disabled(true);
edit_items_toolbar->add_child(edit_items_remove_all);
- edit_items_remove_all->connect("pressed", callable_mp(this, &ThemeItemEditorDialog::_remove_all_items));
+ edit_items_remove_all->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemEditorDialog::_remove_all_items));
edit_items_tree = memnew(Tree);
edit_items_tree->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
@@ -2096,7 +2096,7 @@ ThemeItemEditorDialog::ThemeItemEditorDialog(ThemeTypeEditor *p_theme_type_edito
import_another_file_hb->add_child(import_another_theme_value);
import_another_theme_button = memnew(Button);
import_another_file_hb->add_child(import_another_theme_button);
- import_another_theme_button->connect("pressed", callable_mp(this, &ThemeItemEditorDialog::_open_select_another_theme));
+ import_another_theme_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeItemEditorDialog::_open_select_another_theme));
import_another_theme_dialog = memnew(EditorFileDialog);
import_another_theme_dialog->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILE);
@@ -2296,7 +2296,7 @@ VBoxContainer *ThemeTypeEditor::_create_item_list(Theme::DataType p_data_type) {
item_add_button->set_text(TTR("Add"));
item_add_button->set_disabled(true);
item_add_hb->add_child(item_add_button);
- item_add_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_item_add_cbk).bind(p_data_type, item_add_edit));
+ item_add_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeTypeEditor::_item_add_cbk).bind(p_data_type, item_add_edit));
item_add_edit->set_meta("button", item_add_button);
item_add_edit->connect("text_changed", callable_mp(this, &ThemeTypeEditor::_update_add_button).bind(item_add_edit));
@@ -2472,21 +2472,21 @@ HBoxContainer *ThemeTypeEditor::_create_property_control(Theme::DataType p_data_
item_rename_button->set_tooltip_text(TTR("Rename Item"));
item_rename_button->set_flat(true);
item_name_container->add_child(item_rename_button);
- item_rename_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_item_rename_cbk).bind(p_data_type, p_item_name, item_name_container));
+ item_rename_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeTypeEditor::_item_rename_cbk).bind(p_data_type, p_item_name, item_name_container));
Button *item_remove_button = memnew(Button);
item_remove_button->set_icon(get_editor_theme_icon(SNAME("Remove")));
item_remove_button->set_tooltip_text(TTR("Remove Item"));
item_remove_button->set_flat(true);
item_name_container->add_child(item_remove_button);
- item_remove_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_item_remove_cbk).bind(p_data_type, p_item_name));
+ item_remove_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeTypeEditor::_item_remove_cbk).bind(p_data_type, p_item_name));
Button *item_rename_confirm_button = memnew(Button);
item_rename_confirm_button->set_icon(get_editor_theme_icon(SNAME("ImportCheck")));
item_rename_confirm_button->set_tooltip_text(TTR("Confirm Item Rename"));
item_rename_confirm_button->set_flat(true);
item_name_container->add_child(item_rename_confirm_button);
- item_rename_confirm_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_item_rename_confirmed).bind(p_data_type, p_item_name, item_name_container));
+ item_rename_confirm_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeTypeEditor::_item_rename_confirmed).bind(p_data_type, p_item_name, item_name_container));
item_rename_confirm_button->hide();
Button *item_rename_cancel_button = memnew(Button);
@@ -2494,7 +2494,7 @@ HBoxContainer *ThemeTypeEditor::_create_property_control(Theme::DataType p_data_
item_rename_cancel_button->set_tooltip_text(TTR("Cancel Item Rename"));
item_rename_cancel_button->set_flat(true);
item_name_container->add_child(item_rename_cancel_button);
- item_rename_cancel_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_item_rename_canceled).bind(p_data_type, p_item_name, item_name_container));
+ item_rename_cancel_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeTypeEditor::_item_rename_canceled).bind(p_data_type, p_item_name, item_name_container));
item_rename_cancel_button->hide();
} else {
item_name->add_theme_color_override("font_color", get_theme_color(SNAME("font_disabled_color"), EditorStringName(Editor)));
@@ -2504,7 +2504,7 @@ HBoxContainer *ThemeTypeEditor::_create_property_control(Theme::DataType p_data_
item_override_button->set_tooltip_text(TTR("Override Item"));
item_override_button->set_flat(true);
item_name_container->add_child(item_override_button);
- item_override_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_item_override_cbk).bind(p_data_type, p_item_name));
+ item_override_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeTypeEditor::_item_override_cbk).bind(p_data_type, p_item_name));
}
return item_control;
@@ -2712,7 +2712,7 @@ void ThemeTypeEditor::_update_type_items() {
pin_leader_button->set_icon(get_editor_theme_icon(SNAME("Pin")));
pin_leader_button->set_tooltip_text(TTR("Unpin this StyleBox as a main style."));
item_control->add_child(pin_leader_button);
- pin_leader_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_on_unpin_leader_button_pressed));
+ pin_leader_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeTypeEditor::_on_unpin_leader_button_pressed));
item_control->add_child(item_editor);
@@ -2755,7 +2755,7 @@ void ThemeTypeEditor::_update_type_items() {
pin_leader_button->set_icon(get_editor_theme_icon(SNAME("Pin")));
pin_leader_button->set_tooltip_text(TTR("Pin this StyleBox as a main style. Editing its properties will update the same properties in all other StyleBoxes of this type."));
item_control->add_child(pin_leader_button);
- pin_leader_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_on_pin_leader_button_pressed).bind(item_editor, E.key));
+ pin_leader_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeTypeEditor::_on_pin_leader_button_pressed).bind(item_editor, E.key));
} else {
if (ThemeDB::get_singleton()->get_default_theme()->has_stylebox(E.key, edited_type)) {
item_editor->set_edited_resource(ThemeDB::get_singleton()->get_default_theme()->get_stylebox(E.key, edited_type));
@@ -3446,7 +3446,7 @@ ThemeTypeEditor::ThemeTypeEditor() {
add_type_button = memnew(Button);
add_type_button->set_tooltip_text(TTR("Add a type from a list of available types or create a new one."));
type_list_hb->add_child(add_type_button);
- add_type_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_add_type_button_cbk));
+ add_type_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeTypeEditor::_add_type_button_cbk));
HBoxContainer *type_controls = memnew(HBoxContainer);
main_vb->add_child(type_controls);
@@ -3457,14 +3457,14 @@ ThemeTypeEditor::ThemeTypeEditor() {
show_default_items_button->set_tooltip_text(TTR("Show default type items alongside items that have been overridden."));
show_default_items_button->set_pressed(true);
type_controls->add_child(show_default_items_button);
- show_default_items_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_update_type_items));
+ show_default_items_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeTypeEditor::_update_type_items));
Button *add_default_items_button = memnew(Button);
add_default_items_button->set_h_size_flags(SIZE_EXPAND_FILL);
add_default_items_button->set_text(TTR("Override All"));
add_default_items_button->set_tooltip_text(TTR("Override all default type items."));
type_controls->add_child(add_default_items_button);
- add_default_items_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_add_default_type_items));
+ add_default_items_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeTypeEditor::_add_default_type_items));
data_type_tabs = memnew(TabContainer);
data_type_tabs->set_tab_alignment(TabBar::ALIGNMENT_CENTER);
@@ -3510,7 +3510,7 @@ ThemeTypeEditor::ThemeTypeEditor() {
type_variation_button = memnew(Button);
type_variation_hb->add_child(type_variation_button);
type_variation_button->set_tooltip_text(TTR("Select the variation base type from a list of available types."));
- type_variation_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_add_type_variation_cbk));
+ type_variation_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeTypeEditor::_add_type_variation_cbk));
type_variation_locked = memnew(Label);
type_variation_vb->add_child(type_variation_locked);
@@ -3691,19 +3691,19 @@ ThemeEditor::ThemeEditor() {
Button *theme_save_button = memnew(Button);
theme_save_button->set_text(TTR("Save"));
theme_save_button->set_flat(true);
- theme_save_button->connect("pressed", callable_mp(this, &ThemeEditor::_theme_save_button_cbk).bind(false));
+ theme_save_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeEditor::_theme_save_button_cbk).bind(false));
top_menu->add_child(theme_save_button);
Button *theme_save_as_button = memnew(Button);
theme_save_as_button->set_text(TTR("Save As..."));
theme_save_as_button->set_flat(true);
- theme_save_as_button->connect("pressed", callable_mp(this, &ThemeEditor::_theme_save_button_cbk).bind(true));
+ theme_save_as_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeEditor::_theme_save_button_cbk).bind(true));
top_menu->add_child(theme_save_as_button);
Button *theme_close_button = memnew(Button);
theme_close_button->set_text(TTR("Close"));
theme_close_button->set_flat(true);
- theme_close_button->connect("pressed", callable_mp(this, &ThemeEditor::_theme_close_button_cbk));
+ theme_close_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeEditor::_theme_close_button_cbk));
top_menu->add_child(theme_close_button);
top_menu->add_child(memnew(VSeparator));
@@ -3712,7 +3712,7 @@ ThemeEditor::ThemeEditor() {
theme_edit_button->set_text(TTR("Manage Items..."));
theme_edit_button->set_tooltip_text(TTR("Add, remove, organize and import Theme items."));
theme_edit_button->set_flat(true);
- theme_edit_button->connect("pressed", callable_mp(this, &ThemeEditor::_theme_edit_button_cbk));
+ theme_edit_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeEditor::_theme_edit_button_cbk));
top_menu->add_child(theme_edit_button);
theme_type_editor = memnew(ThemeTypeEditor);
@@ -3748,7 +3748,7 @@ ThemeEditor::ThemeEditor() {
add_preview_button = memnew(Button);
add_preview_button->set_text(TTR("Add Preview"));
add_preview_button_hb->add_child(add_preview_button);
- add_preview_button->connect("pressed", callable_mp(this, &ThemeEditor::_add_preview_button_cbk));
+ add_preview_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeEditor::_add_preview_button_cbk));
DefaultThemeEditorPreview *default_preview_tab = memnew(DefaultThemeEditorPreview);
preview_tabs_content->add_child(default_preview_tab);
diff --git a/editor/plugins/theme_editor_preview.cpp b/editor/plugins/theme_editor_preview.cpp
index e3cc80ebbc..4d98b24ccc 100644
--- a/editor/plugins/theme_editor_preview.cpp
+++ b/editor/plugins/theme_editor_preview.cpp
@@ -243,7 +243,7 @@ ThemeEditorPreview::ThemeEditorPreview() {
picker_button->set_theme_type_variation("FlatButton");
picker_button->set_toggle_mode(true);
picker_button->set_tooltip_text(TTR("Toggle the control picker, allowing to visually select control types for edit."));
- picker_button->connect("pressed", callable_mp(this, &ThemeEditorPreview::_picker_button_cbk));
+ picker_button->connect(SceneStringName(pressed), callable_mp(this, &ThemeEditorPreview::_picker_button_cbk));
MarginContainer *preview_body = memnew(MarginContainer);
preview_body->set_custom_minimum_size(Size2(480, 0) * EDSCALE);
@@ -531,5 +531,5 @@ SceneThemeEditorPreview::SceneThemeEditorPreview() {
reload_scene_button->set_flat(true);
reload_scene_button->set_tooltip_text(TTR("Reload the scene to reflect its most actual state."));
preview_toolbar->add_child(reload_scene_button);
- reload_scene_button->connect("pressed", callable_mp(this, &SceneThemeEditorPreview::_reload_scene));
+ reload_scene_button->connect(SceneStringName(pressed), callable_mp(this, &SceneThemeEditorPreview::_reload_scene));
}
diff --git a/editor/plugins/tiles/tile_atlas_view.cpp b/editor/plugins/tiles/tile_atlas_view.cpp
index 0807b59c22..2ee0dc0316 100644
--- a/editor/plugins/tiles/tile_atlas_view.cpp
+++ b/editor/plugins/tiles/tile_atlas_view.cpp
@@ -614,7 +614,7 @@ TileAtlasView::TileAtlasView() {
button_center_view = memnew(Button);
button_center_view->set_anchors_and_offsets_preset(Control::PRESET_TOP_RIGHT, Control::PRESET_MODE_MINSIZE, 5);
button_center_view->set_grow_direction_preset(Control::PRESET_TOP_RIGHT);
- button_center_view->connect("pressed", callable_mp(this, &TileAtlasView::_center_view));
+ button_center_view->connect(SceneStringName(pressed), callable_mp(this, &TileAtlasView::_center_view));
button_center_view->set_flat(true);
button_center_view->set_disabled(true);
button_center_view->set_tooltip_text(TTR("Center View"));
diff --git a/editor/plugins/tiles/tile_data_editors.cpp b/editor/plugins/tiles/tile_data_editors.cpp
index 3dd4ccc132..2d0e5214db 100644
--- a/editor/plugins/tiles/tile_data_editors.cpp
+++ b/editor/plugins/tiles/tile_data_editors.cpp
@@ -952,7 +952,7 @@ GenericTilePolygonEditor::GenericTilePolygonEditor() {
button_center_view = memnew(Button);
button_center_view->set_anchors_and_offsets_preset(Control::PRESET_TOP_RIGHT, Control::PRESET_MODE_MINSIZE, 5);
button_center_view->set_grow_direction_preset(Control::PRESET_TOP_RIGHT);
- button_center_view->connect("pressed", callable_mp(this, &GenericTilePolygonEditor::_center_view));
+ button_center_view->connect(SceneStringName(pressed), callable_mp(this, &GenericTilePolygonEditor::_center_view));
button_center_view->set_theme_type_variation("FlatButton");
button_center_view->set_tooltip_text(TTR("Center View"));
button_center_view->set_disabled(true);
diff --git a/editor/plugins/tiles/tile_map_layer_editor.cpp b/editor/plugins/tiles/tile_map_layer_editor.cpp
index 285302ca56..98c05e9b15 100644
--- a/editor/plugins/tiles/tile_map_layer_editor.cpp
+++ b/editor/plugins/tiles/tile_map_layer_editor.cpp
@@ -616,7 +616,7 @@ bool TileMapLayerEditorTilesPlugin::forward_canvas_gui_input(const Ref<InputEven
b->set_pressed(b->get_button_group().is_valid() || !b->is_pressed());
} else {
// Can't press a button without toggle mode, so just emit the signal directly.
- b->emit_signal(SNAME("pressed"));
+ b->emit_signal(SceneStringName(pressed));
}
return true;
}
@@ -2209,7 +2209,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
select_tool_button->set_toggle_mode(true);
select_tool_button->set_button_group(tool_buttons_group);
select_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/selection_tool", TTR("Selection"), Key::S));
- select_tool_button->connect("pressed", callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_toolbar));
+ select_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_toolbar));
tilemap_tiles_tools_buttons->add_child(select_tool_button);
viewport_shortcut_buttons.push_back(select_tool_button);
@@ -2219,7 +2219,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
paint_tool_button->set_button_group(tool_buttons_group);
paint_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/paint_tool", TTR("Paint"), Key::D));
paint_tool_button->set_tooltip_text(TTR("Shift: Draw line.") + "\n" + keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Shift: Draw rectangle."));
- paint_tool_button->connect("pressed", callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_toolbar));
+ paint_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_toolbar));
tilemap_tiles_tools_buttons->add_child(paint_tool_button);
viewport_shortcut_buttons.push_back(paint_tool_button);
@@ -2229,7 +2229,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
line_tool_button->set_button_group(tool_buttons_group);
// TRANSLATORS: This refers to the line tool in the tilemap editor.
line_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/line_tool", TTR("Line", "Tool"), Key::L));
- line_tool_button->connect("pressed", callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_toolbar));
+ line_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_toolbar));
tilemap_tiles_tools_buttons->add_child(line_tool_button);
viewport_shortcut_buttons.push_back(line_tool_button);
@@ -2238,7 +2238,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
rect_tool_button->set_toggle_mode(true);
rect_tool_button->set_button_group(tool_buttons_group);
rect_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/rect_tool", TTR("Rect"), Key::R));
- rect_tool_button->connect("pressed", callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_toolbar));
+ rect_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_toolbar));
tilemap_tiles_tools_buttons->add_child(rect_tool_button);
viewport_shortcut_buttons.push_back(rect_tool_button);
@@ -2247,7 +2247,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
bucket_tool_button->set_toggle_mode(true);
bucket_tool_button->set_button_group(tool_buttons_group);
bucket_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/bucket_tool", TTR("Bucket"), Key::B));
- bucket_tool_button->connect("pressed", callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_toolbar));
+ bucket_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_update_toolbar));
tilemap_tiles_tools_buttons->add_child(bucket_tool_button);
toolbar->add_child(tilemap_tiles_tools_buttons);
viewport_shortcut_buttons.push_back(bucket_tool_button);
@@ -2266,7 +2266,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
picker_button->set_shortcut(ED_SHORTCUT("tiles_editor/picker", TTR("Picker"), Key::P));
Key key = (OS::get_singleton()->has_feature("macos") || OS::get_singleton()->has_feature("web_macos") || OS::get_singleton()->has_feature("web_ios")) ? Key::META : Key::CTRL;
picker_button->set_tooltip_text(vformat(TTR("Alternatively hold %s with other tools to pick tile."), find_keycode_name(key)));
- picker_button->connect("pressed", callable_mp(CanvasItemEditor::get_singleton(), &CanvasItemEditor::update_viewport));
+ picker_button->connect(SceneStringName(pressed), callable_mp(CanvasItemEditor::get_singleton(), &CanvasItemEditor::update_viewport));
tools_settings->add_child(picker_button);
viewport_shortcut_buttons.push_back(picker_button);
@@ -2276,7 +2276,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
erase_button->set_toggle_mode(true);
erase_button->set_shortcut(ED_SHORTCUT("tiles_editor/eraser", TTR("Eraser"), Key::E));
erase_button->set_tooltip_text(TTR("Alternatively use RMB to erase tiles."));
- erase_button->connect("pressed", callable_mp(CanvasItemEditor::get_singleton(), &CanvasItemEditor::update_viewport));
+ erase_button->connect(SceneStringName(pressed), callable_mp(CanvasItemEditor::get_singleton(), &CanvasItemEditor::update_viewport));
tools_settings->add_child(erase_button);
viewport_shortcut_buttons.push_back(erase_button);
@@ -2289,28 +2289,28 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
transform_button_rotate_left->set_theme_type_variation("FlatButton");
transform_button_rotate_left->set_shortcut(ED_SHORTCUT("tiles_editor/rotate_tile_left", TTR("Rotate Tile Left"), Key::Z));
transform_toolbar->add_child(transform_button_rotate_left);
- transform_button_rotate_left->connect("pressed", callable_mp(this, &TileMapLayerEditorTilesPlugin::_apply_transform).bind(TRANSFORM_ROTATE_LEFT));
+ transform_button_rotate_left->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_apply_transform).bind(TRANSFORM_ROTATE_LEFT));
viewport_shortcut_buttons.push_back(transform_button_rotate_left);
transform_button_rotate_right = memnew(Button);
transform_button_rotate_right->set_theme_type_variation("FlatButton");
transform_button_rotate_right->set_shortcut(ED_SHORTCUT("tiles_editor/rotate_tile_right", TTR("Rotate Tile Right"), Key::X));
transform_toolbar->add_child(transform_button_rotate_right);
- transform_button_rotate_right->connect("pressed", callable_mp(this, &TileMapLayerEditorTilesPlugin::_apply_transform).bind(TRANSFORM_ROTATE_RIGHT));
+ transform_button_rotate_right->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_apply_transform).bind(TRANSFORM_ROTATE_RIGHT));
viewport_shortcut_buttons.push_back(transform_button_rotate_right);
transform_button_flip_h = memnew(Button);
transform_button_flip_h->set_theme_type_variation("FlatButton");
transform_button_flip_h->set_shortcut(ED_SHORTCUT("tiles_editor/flip_tile_horizontal", TTR("Flip Tile Horizontally"), Key::C));
transform_toolbar->add_child(transform_button_flip_h);
- transform_button_flip_h->connect("pressed", callable_mp(this, &TileMapLayerEditorTilesPlugin::_apply_transform).bind(TRANSFORM_FLIP_H));
+ transform_button_flip_h->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_apply_transform).bind(TRANSFORM_FLIP_H));
viewport_shortcut_buttons.push_back(transform_button_flip_h);
transform_button_flip_v = memnew(Button);
transform_button_flip_v->set_theme_type_variation("FlatButton");
transform_button_flip_v->set_shortcut(ED_SHORTCUT("tiles_editor/flip_tile_vertical", TTR("Flip Tile Vertically"), Key::V));
transform_toolbar->add_child(transform_button_flip_v);
- transform_button_flip_v->connect("pressed", callable_mp(this, &TileMapLayerEditorTilesPlugin::_apply_transform).bind(TRANSFORM_FLIP_V));
+ transform_button_flip_v->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTilesPlugin::_apply_transform).bind(TRANSFORM_FLIP_V));
viewport_shortcut_buttons.push_back(transform_button_flip_v);
// Separator 2.
@@ -3553,7 +3553,7 @@ TileMapLayerEditorTerrainsPlugin::TileMapLayerEditorTerrainsPlugin() {
paint_tool_button->set_button_group(tool_buttons_group);
paint_tool_button->set_pressed(true);
paint_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/paint_tool", TTR("Paint"), Key::D));
- paint_tool_button->connect("pressed", callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_toolbar));
+ paint_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_toolbar));
tilemap_tiles_tools_buttons->add_child(paint_tool_button);
viewport_shortcut_buttons.push_back(paint_tool_button);
@@ -3562,7 +3562,7 @@ TileMapLayerEditorTerrainsPlugin::TileMapLayerEditorTerrainsPlugin() {
line_tool_button->set_toggle_mode(true);
line_tool_button->set_button_group(tool_buttons_group);
line_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/line_tool", TTR("Line"), Key::L));
- line_tool_button->connect("pressed", callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_toolbar));
+ line_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_toolbar));
tilemap_tiles_tools_buttons->add_child(line_tool_button);
viewport_shortcut_buttons.push_back(line_tool_button);
@@ -3571,7 +3571,7 @@ TileMapLayerEditorTerrainsPlugin::TileMapLayerEditorTerrainsPlugin() {
rect_tool_button->set_toggle_mode(true);
rect_tool_button->set_button_group(tool_buttons_group);
rect_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/rect_tool", TTR("Rect"), Key::R));
- rect_tool_button->connect("pressed", callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_toolbar));
+ rect_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_toolbar));
tilemap_tiles_tools_buttons->add_child(rect_tool_button);
viewport_shortcut_buttons.push_back(rect_tool_button);
@@ -3580,7 +3580,7 @@ TileMapLayerEditorTerrainsPlugin::TileMapLayerEditorTerrainsPlugin() {
bucket_tool_button->set_toggle_mode(true);
bucket_tool_button->set_button_group(tool_buttons_group);
bucket_tool_button->set_shortcut(ED_SHORTCUT("tiles_editor/bucket_tool", TTR("Bucket"), Key::B));
- bucket_tool_button->connect("pressed", callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_toolbar));
+ bucket_tool_button->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditorTerrainsPlugin::_update_toolbar));
tilemap_tiles_tools_buttons->add_child(bucket_tool_button);
viewport_shortcut_buttons.push_back(bucket_tool_button);
@@ -3598,7 +3598,7 @@ TileMapLayerEditorTerrainsPlugin::TileMapLayerEditorTerrainsPlugin() {
picker_button->set_theme_type_variation("FlatButton");
picker_button->set_toggle_mode(true);
picker_button->set_shortcut(ED_SHORTCUT("tiles_editor/picker", TTR("Picker"), Key::P));
- picker_button->connect("pressed", callable_mp(CanvasItemEditor::get_singleton(), &CanvasItemEditor::update_viewport));
+ picker_button->connect(SceneStringName(pressed), callable_mp(CanvasItemEditor::get_singleton(), &CanvasItemEditor::update_viewport));
tools_settings->add_child(picker_button);
viewport_shortcut_buttons.push_back(picker_button);
@@ -3607,7 +3607,7 @@ TileMapLayerEditorTerrainsPlugin::TileMapLayerEditorTerrainsPlugin() {
erase_button->set_theme_type_variation("FlatButton");
erase_button->set_toggle_mode(true);
erase_button->set_shortcut(ED_SHORTCUT("tiles_editor/eraser", TTR("Eraser"), Key::E));
- erase_button->connect("pressed", callable_mp(CanvasItemEditor::get_singleton(), &CanvasItemEditor::update_viewport));
+ erase_button->connect(SceneStringName(pressed), callable_mp(CanvasItemEditor::get_singleton(), &CanvasItemEditor::update_viewport));
tools_settings->add_child(erase_button);
viewport_shortcut_buttons.push_back(erase_button);
@@ -4457,19 +4457,19 @@ TileMapLayerEditor::TileMapLayerEditor() {
select_previous_layer = memnew(Button);
select_previous_layer->set_theme_type_variation("FlatButton");
select_previous_layer->set_tooltip_text(TTR("Select previous layer"));
- select_previous_layer->connect("pressed", callable_mp(this, &TileMapLayerEditor::_select_previous_layer_pressed));
+ select_previous_layer->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditor::_select_previous_layer_pressed));
layer_selection_hbox->add_child(select_previous_layer);
select_next_layer = memnew(Button);
select_next_layer->set_theme_type_variation("FlatButton");
select_next_layer->set_tooltip_text(TTR("Select next layer"));
- select_next_layer->connect("pressed", callable_mp(this, &TileMapLayerEditor::_select_next_layer_pressed));
+ select_next_layer->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditor::_select_next_layer_pressed));
layer_selection_hbox->add_child(select_next_layer);
select_all_layers = memnew(Button);
select_all_layers->set_theme_type_variation("FlatButton");
select_all_layers->set_text(TTR("Select all layers"));
- select_all_layers->connect("pressed", callable_mp(this, &TileMapLayerEditor::_select_all_layers_pressed));
+ select_all_layers->connect(SceneStringName(pressed), callable_mp(this, &TileMapLayerEditor::_select_all_layers_pressed));
select_all_layers->set_tooltip_text(TTR("Select all TileMapLayers in scene"));
layer_selection_hbox->add_child(select_all_layers);
diff --git a/editor/plugins/tiles/tile_proxies_manager_dialog.cpp b/editor/plugins/tiles/tile_proxies_manager_dialog.cpp
index a75ab45106..9add6ef586 100644
--- a/editor/plugins/tiles/tile_proxies_manager_dialog.cpp
+++ b/editor/plugins/tiles/tile_proxies_manager_dialog.cpp
@@ -463,7 +463,7 @@ TileProxiesManagerDialog::TileProxiesManagerDialog() {
Button *add_button = memnew(Button);
add_button->set_text(TTR("Add"));
add_button->set_h_size_flags(Control::SIZE_SHRINK_CENTER);
- add_button->connect("pressed", callable_mp(this, &TileProxiesManagerDialog::_add_button_pressed));
+ add_button->connect(SceneStringName(pressed), callable_mp(this, &TileProxiesManagerDialog::_add_button_pressed));
vbox_container->add_child(add_button);
h_separator = memnew(HSeparator);
@@ -480,13 +480,13 @@ TileProxiesManagerDialog::TileProxiesManagerDialog() {
Button *clear_invalid_button = memnew(Button);
clear_invalid_button->set_text(TTR("Clear Invalid"));
clear_invalid_button->set_h_size_flags(Control::SIZE_SHRINK_CENTER);
- clear_invalid_button->connect("pressed", callable_mp(this, &TileProxiesManagerDialog::_clear_invalid_button_pressed));
+ clear_invalid_button->connect(SceneStringName(pressed), callable_mp(this, &TileProxiesManagerDialog::_clear_invalid_button_pressed));
hboxcontainer->add_child(clear_invalid_button);
Button *clear_all_button = memnew(Button);
clear_all_button->set_text(TTR("Clear All"));
clear_all_button->set_h_size_flags(Control::SIZE_SHRINK_CENTER);
- clear_all_button->connect("pressed", callable_mp(this, &TileProxiesManagerDialog::_clear_all_button_pressed));
+ clear_all_button->connect(SceneStringName(pressed), callable_mp(this, &TileProxiesManagerDialog::_clear_all_button_pressed));
hboxcontainer->add_child(clear_all_button);
h_separator = memnew(HSeparator);
diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp
index 0fffd1e9c9..e4fd32a637 100644
--- a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp
+++ b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp
@@ -1000,8 +1000,8 @@ void TileSetAtlasSourceEditor::_update_atlas_view() {
button->add_theme_style_override("normal", memnew(StyleBoxEmpty));
button->add_theme_style_override("hover", memnew(StyleBoxEmpty));
button->add_theme_style_override("focus", memnew(StyleBoxEmpty));
- button->add_theme_style_override("pressed", memnew(StyleBoxEmpty));
- button->connect("pressed", callable_mp(tile_set_atlas_source, &TileSetAtlasSource::create_alternative_tile).bind(tile_id, TileSetSource::INVALID_TILE_ALTERNATIVE));
+ button->add_theme_style_override(SceneStringName(pressed), memnew(StyleBoxEmpty));
+ button->connect(SceneStringName(pressed), callable_mp(tile_set_atlas_source, &TileSetAtlasSource::create_alternative_tile).bind(tile_id, TileSetSource::INVALID_TILE_ALTERNATIVE));
button->set_rect(Rect2(Vector2(pos.x, pos.y + (y_increment - texture_region_base_size.y) / 2.0), Vector2(texture_region_base_size_min, texture_region_base_size_min)));
button->set_expand_icon(true);
alternative_tiles_control->add_child(button);
@@ -2510,14 +2510,14 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() {
// -- Toolbox --
tools_button_group.instantiate();
- tools_button_group->connect("pressed", callable_mp(this, &TileSetAtlasSourceEditor::_update_fix_selected_and_hovered_tiles).unbind(1));
- tools_button_group->connect("pressed", callable_mp(this, &TileSetAtlasSourceEditor::_update_tile_id_label).unbind(1));
- tools_button_group->connect("pressed", callable_mp(this, &TileSetAtlasSourceEditor::_update_atlas_source_inspector).unbind(1));
- tools_button_group->connect("pressed", callable_mp(this, &TileSetAtlasSourceEditor::_update_tile_inspector).unbind(1));
- tools_button_group->connect("pressed", callable_mp(this, &TileSetAtlasSourceEditor::_update_tile_data_editors).unbind(1));
- tools_button_group->connect("pressed", callable_mp(this, &TileSetAtlasSourceEditor::_update_current_tile_data_editor).unbind(1));
- tools_button_group->connect("pressed", callable_mp(this, &TileSetAtlasSourceEditor::_update_atlas_view).unbind(1));
- tools_button_group->connect("pressed", callable_mp(this, &TileSetAtlasSourceEditor::_update_toolbar).unbind(1));
+ tools_button_group->connect(SceneStringName(pressed), callable_mp(this, &TileSetAtlasSourceEditor::_update_fix_selected_and_hovered_tiles).unbind(1));
+ tools_button_group->connect(SceneStringName(pressed), callable_mp(this, &TileSetAtlasSourceEditor::_update_tile_id_label).unbind(1));
+ tools_button_group->connect(SceneStringName(pressed), callable_mp(this, &TileSetAtlasSourceEditor::_update_atlas_source_inspector).unbind(1));
+ tools_button_group->connect(SceneStringName(pressed), callable_mp(this, &TileSetAtlasSourceEditor::_update_tile_inspector).unbind(1));
+ tools_button_group->connect(SceneStringName(pressed), callable_mp(this, &TileSetAtlasSourceEditor::_update_tile_data_editors).unbind(1));
+ tools_button_group->connect(SceneStringName(pressed), callable_mp(this, &TileSetAtlasSourceEditor::_update_current_tile_data_editor).unbind(1));
+ tools_button_group->connect(SceneStringName(pressed), callable_mp(this, &TileSetAtlasSourceEditor::_update_atlas_view).unbind(1));
+ tools_button_group->connect(SceneStringName(pressed), callable_mp(this, &TileSetAtlasSourceEditor::_update_toolbar).unbind(1));
HBoxContainer *toolbox = memnew(HBoxContainer);
middle_vbox_container->add_child(toolbox);
@@ -2586,7 +2586,7 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() {
tile_data_editor_dropdown_button = memnew(Button);
tile_data_editor_dropdown_button->connect(SceneStringName(draw), callable_mp(this, &TileSetAtlasSourceEditor::_tile_data_editor_dropdown_button_draw));
- tile_data_editor_dropdown_button->connect("pressed", callable_mp(this, &TileSetAtlasSourceEditor::_tile_data_editor_dropdown_button_pressed));
+ tile_data_editor_dropdown_button->connect(SceneStringName(pressed), callable_mp(this, &TileSetAtlasSourceEditor::_tile_data_editor_dropdown_button_pressed));
tile_data_editors_vbox->add_child(tile_data_editor_dropdown_button);
tile_data_editor_dropdown_button->add_child(tile_data_editors_popup);
diff --git a/editor/plugins/tiles/tile_set_editor.cpp b/editor/plugins/tiles/tile_set_editor.cpp
index 00228cb649..0efed44ac7 100644
--- a/editor/plugins/tiles/tile_set_editor.cpp
+++ b/editor/plugins/tiles/tile_set_editor.cpp
@@ -877,7 +877,7 @@ TileSetEditor::TileSetEditor() {
sources_delete_button = memnew(Button);
sources_delete_button->set_theme_type_variation("FlatButton");
sources_delete_button->set_disabled(true);
- sources_delete_button->connect("pressed", callable_mp(this, &TileSetEditor::_source_delete_pressed));
+ sources_delete_button->connect(SceneStringName(pressed), callable_mp(this, &TileSetEditor::_source_delete_pressed));
sources_bottom_actions->add_child(sources_delete_button);
sources_add_button = memnew(MenuButton);
@@ -1019,7 +1019,7 @@ bool TileSourceInspectorPlugin::parse_property(Object *p_object, const Variant::
Button *button = memnew(Button(TTR("Edit")));
button->set_h_size_flags(Control::SIZE_EXPAND_FILL);
hbox->add_child(button);
- button->connect("pressed", callable_mp(this, &TileSourceInspectorPlugin::_show_id_edit_dialog).bind(p_object));
+ button->connect(SceneStringName(pressed), callable_mp(this, &TileSourceInspectorPlugin::_show_id_edit_dialog).bind(p_object));
ep->add_child(hbox);
add_property_editor(p_path, ep);
diff --git a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp
index 4a2301e513..88c117272c 100644
--- a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp
+++ b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp
@@ -573,13 +573,13 @@ TileSetScenesCollectionSourceEditor::TileSetScenesCollectionSourceEditor() {
scene_tile_add_button = memnew(Button);
scene_tile_add_button->set_theme_type_variation("FlatButton");
- scene_tile_add_button->connect("pressed", callable_mp(this, &TileSetScenesCollectionSourceEditor::_source_add_pressed));
+ scene_tile_add_button->connect(SceneStringName(pressed), callable_mp(this, &TileSetScenesCollectionSourceEditor::_source_add_pressed));
scenes_bottom_actions->add_child(scene_tile_add_button);
scene_tile_delete_button = memnew(Button);
scene_tile_delete_button->set_theme_type_variation("FlatButton");
scene_tile_delete_button->set_disabled(true);
- scene_tile_delete_button->connect("pressed", callable_mp(this, &TileSetScenesCollectionSourceEditor::_source_delete_pressed));
+ scene_tile_delete_button->connect(SceneStringName(pressed), callable_mp(this, &TileSetScenesCollectionSourceEditor::_source_delete_pressed));
scenes_bottom_actions->add_child(scene_tile_delete_button);
}
diff --git a/editor/plugins/version_control_editor_plugin.cpp b/editor/plugins/version_control_editor_plugin.cpp
index b48b649488..beed89ea10 100644
--- a/editor/plugins/version_control_editor_plugin.cpp
+++ b/editor/plugins/version_control_editor_plugin.cpp
@@ -941,7 +941,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() {
metadata_dialog = memnew(ConfirmationDialog);
metadata_dialog->set_title(TTR("Create Version Control Metadata"));
metadata_dialog->set_min_size(Size2(200, 40));
- metadata_dialog->get_ok_button()->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_create_vcs_metadata_files));
+ metadata_dialog->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_create_vcs_metadata_files));
EditorInterface::get_singleton()->get_base_control()->add_child(metadata_dialog);
VBoxContainer *metadata_vb = memnew(VBoxContainer);
@@ -975,7 +975,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() {
Button *set_up_apply_button = set_up_dialog->get_ok_button();
set_up_apply_button->set_text(TTR("Apply"));
- set_up_apply_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_set_credentials));
+ set_up_apply_button->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_set_credentials));
set_up_vbc = memnew(VBoxContainer);
set_up_vbc->set_alignment(BoxContainer::ALIGNMENT_CENTER);
@@ -1082,7 +1082,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() {
Button *select_public_path_button = memnew(Button);
select_public_path_button->set_icon(EditorNode::get_singleton()->get_gui_base()->get_editor_theme_icon("Folder"));
- select_public_path_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_popup_file_dialog).bind(set_up_ssh_public_key_file_dialog));
+ select_public_path_button->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_popup_file_dialog).bind(set_up_ssh_public_key_file_dialog));
select_public_path_button->set_tooltip_text(TTR("Select SSH public key path"));
set_up_ssh_public_key_input_hbc->add_child(select_public_path_button);
@@ -1115,7 +1115,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() {
Button *select_private_path_button = memnew(Button);
select_private_path_button->set_icon(EditorNode::get_singleton()->get_gui_base()->get_editor_theme_icon("Folder"));
- select_private_path_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_popup_file_dialog).bind(set_up_ssh_private_key_file_dialog));
+ select_private_path_button->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_popup_file_dialog).bind(set_up_ssh_private_key_file_dialog));
select_private_path_button->set_tooltip_text(TTR("Select SSH private key path"));
set_up_ssh_private_key_input_hbc->add_child(select_private_path_button);
@@ -1160,10 +1160,10 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() {
refresh_button->set_tooltip_text(TTR("Detect new changes"));
refresh_button->set_theme_type_variation("FlatButton");
refresh_button->set_icon(EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("Reload"), EditorStringName(EditorIcons)));
- refresh_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_refresh_stage_area));
- refresh_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_refresh_commit_list));
- refresh_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_refresh_branch_list));
- refresh_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_refresh_remote_list));
+ refresh_button->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_refresh_stage_area));
+ refresh_button->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_refresh_commit_list));
+ refresh_button->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_refresh_branch_list));
+ refresh_button->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_refresh_remote_list));
unstage_title->add_child(refresh_button);
discard_all_confirm = memnew(AcceptDialog);
@@ -1175,12 +1175,12 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() {
discard_all_confirm->add_cancel_button();
version_commit_dock->add_child(discard_all_confirm);
- discard_all_confirm->get_ok_button()->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_discard_all));
+ discard_all_confirm->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_discard_all));
discard_all_button = memnew(Button);
discard_all_button->set_tooltip_text(TTR("Discard all changes"));
discard_all_button->set_icon(EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("Close"), EditorStringName(EditorIcons)));
- discard_all_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_confirm_discard_all));
+ discard_all_button->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_confirm_discard_all));
discard_all_button->set_theme_type_variation("FlatButton");
unstage_title->add_child(discard_all_button);
@@ -1232,8 +1232,8 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() {
stage_area->add_child(staged_files);
// Editor crashes if bind is null
- unstage_all_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_move_all).bind(staged_files));
- stage_all_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_move_all).bind(unstaged_files));
+ unstage_all_button->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_move_all).bind(staged_files));
+ stage_all_button->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_move_all).bind(unstaged_files));
version_commit_dock->add_child(memnew(HSeparator));
@@ -1260,7 +1260,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() {
commit_button = memnew(Button);
commit_button->set_text(TTR("Commit Changes"));
commit_button->set_disabled(true);
- commit_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_commit));
+ commit_button->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_commit));
commit_area->add_child(commit_button);
version_commit_dock->add_child(memnew(HSeparator));
@@ -1308,7 +1308,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() {
branch_select->set_tooltip_text(TTR("Branches"));
branch_select->set_h_size_flags(Control::SIZE_EXPAND_FILL);
branch_select->connect(SNAME("item_selected"), callable_mp(this, &VersionControlEditorPlugin::_branch_item_selected));
- branch_select->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_refresh_branch_list));
+ branch_select->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_refresh_branch_list));
menu_bar->add_child(branch_select);
branch_create_confirm = memnew(AcceptDialog);
@@ -1320,7 +1320,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() {
branch_create_ok = branch_create_confirm->get_ok_button();
branch_create_ok->set_text(TTR("Create"));
branch_create_ok->set_disabled(true);
- branch_create_ok->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_create_branch));
+ branch_create_ok->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_create_branch));
branch_remove_confirm = memnew(AcceptDialog);
branch_remove_confirm->set_title(TTR("Remove Branch"));
@@ -1329,7 +1329,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() {
Button *branch_remove_ok = branch_remove_confirm->get_ok_button();
branch_remove_ok->set_text(TTR("Remove"));
- branch_remove_ok->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_remove_branch));
+ branch_remove_ok->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_remove_branch));
VBoxContainer *branch_create_vbc = memnew(VBoxContainer);
branch_create_vbc->set_alignment(BoxContainer::ALIGNMENT_CENTER);
@@ -1353,7 +1353,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() {
remote_select->set_tooltip_text(TTR("Remotes"));
remote_select->set_h_size_flags(Control::SIZE_EXPAND_FILL);
remote_select->connect(SNAME("item_selected"), callable_mp(this, &VersionControlEditorPlugin::_remote_selected));
- remote_select->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_refresh_remote_list));
+ remote_select->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_refresh_remote_list));
menu_bar->add_child(remote_select);
remote_create_confirm = memnew(AcceptDialog);
@@ -1365,7 +1365,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() {
remote_create_ok = remote_create_confirm->get_ok_button();
remote_create_ok->set_text(TTR("Create"));
remote_create_ok->set_disabled(true);
- remote_create_ok->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_create_remote));
+ remote_create_ok->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_create_remote));
remote_remove_confirm = memnew(AcceptDialog);
remote_remove_confirm->set_title(TTR("Remove Remote"));
@@ -1374,7 +1374,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() {
Button *remote_remove_ok = remote_remove_confirm->get_ok_button();
remote_remove_ok->set_text(TTR("Remove"));
- remote_remove_ok->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_remove_remote));
+ remote_remove_ok->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_remove_remote));
VBoxContainer *remote_create_vbc = memnew(VBoxContainer);
remote_create_vbc->set_alignment(BoxContainer::ALIGNMENT_CENTER);
@@ -1412,21 +1412,21 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() {
fetch_button->set_theme_type_variation("FlatButton");
fetch_button->set_tooltip_text(TTR("Fetch"));
fetch_button->set_icon(EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("Reload"), EditorStringName(EditorIcons)));
- fetch_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_fetch));
+ fetch_button->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_fetch));
menu_bar->add_child(fetch_button);
pull_button = memnew(Button);
pull_button->set_theme_type_variation("FlatButton");
pull_button->set_tooltip_text(TTR("Pull"));
pull_button->set_icon(EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("MoveDown"), EditorStringName(EditorIcons)));
- pull_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_pull));
+ pull_button->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_pull));
menu_bar->add_child(pull_button);
push_button = memnew(Button);
push_button->set_theme_type_variation("FlatButton");
push_button->set_tooltip_text(TTR("Push"));
push_button->set_icon(EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("MoveUp"), EditorStringName(EditorIcons)));
- push_button->connect(SNAME("pressed"), callable_mp(this, &VersionControlEditorPlugin::_push));
+ push_button->connect(SceneStringName(pressed), callable_mp(this, &VersionControlEditorPlugin::_push));
menu_bar->add_child(push_button);
extra_options = memnew(MenuButton);
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp
index 41f05d7c13..01551a52c2 100644
--- a/editor/plugins/visual_shader_editor_plugin.cpp
+++ b/editor/plugins/visual_shader_editor_plugin.cpp
@@ -978,14 +978,14 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool
Button *add_input_btn = memnew(Button);
add_input_btn->set_text(TTR("Add Input"));
- add_input_btn->connect("pressed", callable_mp(editor, &VisualShaderEditor::_add_input_port).bind(p_id, group_node->get_free_input_port_id(), VisualShaderNode::PORT_TYPE_VECTOR_3D, input_port_name), CONNECT_DEFERRED);
+ add_input_btn->connect(SceneStringName(pressed), callable_mp(editor, &VisualShaderEditor::_add_input_port).bind(p_id, group_node->get_free_input_port_id(), VisualShaderNode::PORT_TYPE_VECTOR_3D, input_port_name), CONNECT_DEFERRED);
hb2->add_child(add_input_btn);
hb2->add_spacer();
Button *add_output_btn = memnew(Button);
add_output_btn->set_text(TTR("Add Output"));
- add_output_btn->connect("pressed", callable_mp(editor, &VisualShaderEditor::_add_output_port).bind(p_id, group_node->get_free_output_port_id(), VisualShaderNode::PORT_TYPE_VECTOR_3D, output_port_name), CONNECT_DEFERRED);
+ add_output_btn->connect(SceneStringName(pressed), callable_mp(editor, &VisualShaderEditor::_add_output_port).bind(p_id, group_node->get_free_output_port_id(), VisualShaderNode::PORT_TYPE_VECTOR_3D, output_port_name), CONNECT_DEFERRED);
hb2->add_child(add_output_btn);
node->add_child(hb2);
@@ -1094,7 +1094,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool
Button *button = memnew(Button);
hb->add_child(button);
register_default_input_button(p_id, j, button);
- button->connect("pressed", callable_mp(editor, &VisualShaderEditor::_edit_port_default_input).bind(button, p_id, j));
+ button->connect(SceneStringName(pressed), callable_mp(editor, &VisualShaderEditor::_edit_port_default_input).bind(button, p_id, j));
if (default_value.get_type() != Variant::NIL) { // only a label
set_input_port_default_value(p_type, p_id, j, default_value);
} else {
@@ -1133,7 +1133,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool
Button *remove_btn = memnew(Button);
remove_btn->set_icon(EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("Remove"), EditorStringName(EditorIcons)));
remove_btn->set_tooltip_text(TTR("Remove") + " " + name_left);
- remove_btn->connect("pressed", callable_mp(editor, &VisualShaderEditor::_remove_input_port).bind(p_id, j), CONNECT_DEFERRED);
+ remove_btn->connect(SceneStringName(pressed), callable_mp(editor, &VisualShaderEditor::_remove_input_port).bind(p_id, j), CONNECT_DEFERRED);
hb->add_child(remove_btn);
} else {
Label *label = memnew(Label);
@@ -1161,7 +1161,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool
Button *remove_btn = memnew(Button);
remove_btn->set_icon(EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("Remove"), EditorStringName(EditorIcons)));
remove_btn->set_tooltip_text(TTR("Remove") + " " + name_left);
- remove_btn->connect("pressed", callable_mp(editor, &VisualShaderEditor::_remove_output_port).bind(p_id, i), CONNECT_DEFERRED);
+ remove_btn->connect(SceneStringName(pressed), callable_mp(editor, &VisualShaderEditor::_remove_output_port).bind(p_id, i), CONNECT_DEFERRED);
hb->add_child(remove_btn);
LineEdit *name_box = memnew(LineEdit);
@@ -1203,7 +1203,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool
expand->set_texture_pressed(editor->get_editor_theme_icon(SNAME("GuiTreeArrowDown")));
expand->set_v_size_flags(Control::SIZE_SHRINK_CENTER);
expand->set_pressed(vsnode->_is_output_port_expanded(i));
- expand->connect("pressed", callable_mp(editor, &VisualShaderEditor::_expand_output_port).bind(p_id, i, !vsnode->_is_output_port_expanded(i)), CONNECT_DEFERRED);
+ expand->connect(SceneStringName(pressed), callable_mp(editor, &VisualShaderEditor::_expand_output_port).bind(p_id, i, !vsnode->_is_output_port_expanded(i)), CONNECT_DEFERRED);
hb->add_child(expand);
}
if (vsnode->has_output_port_preview(i) && port_right != VisualShaderNode::PORT_TYPE_TRANSFORM && port_right != VisualShaderNode::PORT_TYPE_SAMPLER) {
@@ -1215,7 +1215,7 @@ void VisualShaderGraphPlugin::add_node(VisualShader::Type p_type, int p_id, bool
register_output_port(p_id, j, preview);
- preview->connect("pressed", callable_mp(editor, &VisualShaderEditor::_preview_select_port).bind(p_id, j), CONNECT_DEFERRED);
+ preview->connect(SceneStringName(pressed), callable_mp(editor, &VisualShaderEditor::_preview_select_port).bind(p_id, j), CONNECT_DEFERRED);
hb->add_child(preview);
}
}
@@ -6183,7 +6183,7 @@ VisualShaderEditor::VisualShaderEditor() {
add_node->set_text(TTR("Add Node..."));
graph->get_menu_hbox()->add_child(add_node);
graph->get_menu_hbox()->move_child(add_node, 0);
- add_node->connect("pressed", callable_mp(this, &VisualShaderEditor::_show_members_dialog).bind(false, VisualShaderNode::PORT_TYPE_MAX, VisualShaderNode::PORT_TYPE_MAX));
+ add_node->connect(SceneStringName(pressed), callable_mp(this, &VisualShaderEditor::_show_members_dialog).bind(false, VisualShaderNode::PORT_TYPE_MAX, VisualShaderNode::PORT_TYPE_MAX));
graph->connect("graph_elements_linked_to_frame_request", callable_mp(this, &VisualShaderEditor::_nodes_linked_to_frame_request));
graph->connect("frame_rect_changed", callable_mp(this, &VisualShaderEditor::_frame_rect_changed));
@@ -6203,7 +6203,7 @@ VisualShaderEditor::VisualShaderEditor() {
preview_shader->set_toggle_mode(true);
preview_shader->set_tooltip_text(TTR("Show generated shader code."));
graph->get_menu_hbox()->add_child(preview_shader);
- preview_shader->connect("pressed", callable_mp(this, &VisualShaderEditor::_show_preview_text));
+ preview_shader->connect(SceneStringName(pressed), callable_mp(this, &VisualShaderEditor::_show_preview_text));
///////////////////////////////////////
// PREVIEW WINDOW
@@ -6326,7 +6326,7 @@ VisualShaderEditor::VisualShaderEditor() {
members_dialog->set_exclusive(true);
members_dialog->add_child(members_vb);
members_dialog->set_ok_button_text(TTR("Create"));
- members_dialog->get_ok_button()->connect("pressed", callable_mp(this, &VisualShaderEditor::_member_create));
+ members_dialog->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &VisualShaderEditor::_member_create));
members_dialog->get_ok_button()->set_disabled(true);
members_dialog->connect("canceled", callable_mp(this, &VisualShaderEditor::_member_cancel));
add_child(members_dialog);
@@ -6337,7 +6337,7 @@ VisualShaderEditor::VisualShaderEditor() {
add_varying_dialog->set_title(TTR("Create Shader Varying"));
add_varying_dialog->set_exclusive(true);
add_varying_dialog->set_ok_button_text(TTR("Create"));
- add_varying_dialog->get_ok_button()->connect("pressed", callable_mp(this, &VisualShaderEditor::_varying_create));
+ add_varying_dialog->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &VisualShaderEditor::_varying_create));
add_varying_dialog->get_ok_button()->set_disabled(true);
add_child(add_varying_dialog);
@@ -6383,7 +6383,7 @@ VisualShaderEditor::VisualShaderEditor() {
remove_varying_dialog->set_title(TTR("Delete Shader Varying"));
remove_varying_dialog->set_exclusive(true);
remove_varying_dialog->set_ok_button_text(TTR("Delete"));
- remove_varying_dialog->get_ok_button()->connect("pressed", callable_mp(this, &VisualShaderEditor::_varying_deleted));
+ remove_varying_dialog->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &VisualShaderEditor::_varying_deleted));
add_child(remove_varying_dialog);
VBoxContainer *vb = memnew(VBoxContainer);
@@ -6433,7 +6433,7 @@ VisualShaderEditor::VisualShaderEditor() {
Button *frame_tint_color_confirm_button = memnew(Button);
frame_tint_color_confirm_button->set_text(TTR("OK"));
frame_popup_item_tint_color_editor->add_child(frame_tint_color_confirm_button);
- frame_tint_color_confirm_button->connect("pressed", callable_mp(this, &VisualShaderEditor::_frame_color_confirm));
+ frame_tint_color_confirm_button->connect(SceneStringName(pressed), callable_mp(this, &VisualShaderEditor::_frame_color_confirm));
frame_tint_color_pick_popup->connect("popup_hide", callable_mp(this, &VisualShaderEditor::_frame_color_popup_hide));
add_child(frame_tint_color_pick_popup);
diff --git a/editor/plugins/voxel_gi_editor_plugin.cpp b/editor/plugins/voxel_gi_editor_plugin.cpp
index 5129fae176..e7b2435567 100644
--- a/editor/plugins/voxel_gi_editor_plugin.cpp
+++ b/editor/plugins/voxel_gi_editor_plugin.cpp
@@ -190,7 +190,7 @@ VoxelGIEditorPlugin::VoxelGIEditorPlugin() {
// when the editor theme updates.
bake->set_icon(EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("Bake"), EditorStringName(EditorIcons)));
bake->set_text(TTR("Bake VoxelGI"));
- bake->connect("pressed", callable_mp(this, &VoxelGIEditorPlugin::_bake));
+ bake->connect(SceneStringName(pressed), callable_mp(this, &VoxelGIEditorPlugin::_bake));
bake_hb->add_child(bake);
add_control_to_container(CONTAINER_SPATIAL_EDITOR_MENU, bake_hb);
diff --git a/editor/progress_dialog.cpp b/editor/progress_dialog.cpp
index ff8343fbeb..746b244bed 100644
--- a/editor/progress_dialog.cpp
+++ b/editor/progress_dialog.cpp
@@ -250,5 +250,5 @@ ProgressDialog::ProgressDialog() {
cancel_hb->add_child(cancel);
cancel->set_text(TTR("Cancel"));
cancel_hb->add_spacer();
- cancel->connect("pressed", callable_mp(this, &ProgressDialog::_cancel_pressed));
+ cancel->connect(SceneStringName(pressed), callable_mp(this, &ProgressDialog::_cancel_pressed));
}
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index 3a5fc8474e..00aa78f342 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -289,7 +289,7 @@ Button *ProjectManager::_add_main_view(MainViewTab p_id, const String &p_name, c
toggle_button->set_toggle_mode(true);
toggle_button->set_button_group(main_view_toggles_group);
toggle_button->set_text(p_name);
- toggle_button->connect("pressed", callable_mp(this, &ProjectManager::_select_main_view).bind((int)p_id));
+ toggle_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_select_main_view).bind((int)p_id));
main_view_toggles->add_child(toggle_button);
main_view_toggle_map[p_id] = toggle_button;
@@ -1153,7 +1153,7 @@ ProjectManager::ProjectManager() {
title_bar_logo = memnew(Button);
title_bar_logo->set_flat(true);
left_hbox->add_child(title_bar_logo);
- title_bar_logo->connect("pressed", callable_mp(this, &ProjectManager::_show_about));
+ title_bar_logo->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_show_about));
if (can_expand) {
// Spacer to center main toggles.
@@ -1187,7 +1187,7 @@ ProjectManager::ProjectManager() {
quick_settings_button->set_flat(true);
quick_settings_button->set_text(TTR("Settings"));
right_hbox->add_child(quick_settings_button);
- quick_settings_button->connect("pressed", callable_mp(this, &ProjectManager::_show_quick_settings));
+ quick_settings_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_show_quick_settings));
if (can_expand) {
// Add spacer to avoid other controls under the window minimize/maximize/close buttons (right side).
@@ -1216,19 +1216,19 @@ ProjectManager::ProjectManager() {
create_btn = memnew(Button);
create_btn->set_text(TTR("Create"));
create_btn->set_shortcut(ED_SHORTCUT("project_manager/new_project", TTR("New Project"), KeyModifierMask::CMD_OR_CTRL | Key::N));
- create_btn->connect("pressed", callable_mp(this, &ProjectManager::_new_project));
+ create_btn->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_new_project));
hb->add_child(create_btn);
import_btn = memnew(Button);
import_btn->set_text(TTR("Import"));
import_btn->set_shortcut(ED_SHORTCUT("project_manager/import_project", TTR("Import Project"), KeyModifierMask::CMD_OR_CTRL | Key::I));
- import_btn->connect("pressed", callable_mp(this, &ProjectManager::_import_project));
+ import_btn->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_import_project));
hb->add_child(import_btn);
scan_btn = memnew(Button);
scan_btn->set_text(TTR("Scan"));
scan_btn->set_shortcut(ED_SHORTCUT("project_manager/scan_projects", TTR("Scan Projects"), KeyModifierMask::CMD_OR_CTRL | Key::S));
- scan_btn->connect("pressed", callable_mp(this, &ProjectManager::_scan_projects));
+ scan_btn->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_scan_projects));
hb->add_child(scan_btn);
loading_label = memnew(Label(TTR("Loading, please wait...")));
@@ -1312,19 +1312,19 @@ ProjectManager::ProjectManager() {
empty_list_create_project->set_text(TTR("Create New Project"));
empty_list_create_project->set_theme_type_variation("PanelBackgroundButton");
empty_list_actions->add_child(empty_list_create_project);
- empty_list_create_project->connect("pressed", callable_mp(this, &ProjectManager::_new_project));
+ empty_list_create_project->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_new_project));
empty_list_import_project = memnew(Button);
empty_list_import_project->set_text(TTR("Import Existing Project"));
empty_list_import_project->set_theme_type_variation("PanelBackgroundButton");
empty_list_actions->add_child(empty_list_import_project);
- empty_list_import_project->connect("pressed", callable_mp(this, &ProjectManager::_import_project));
+ empty_list_import_project->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_import_project));
empty_list_open_assetlib = memnew(Button);
empty_list_open_assetlib->set_text(TTR("Open Asset Library"));
empty_list_open_assetlib->set_theme_type_variation("PanelBackgroundButton");
empty_list_actions->add_child(empty_list_open_assetlib);
- empty_list_open_assetlib->connect("pressed", callable_mp(this, &ProjectManager::_open_asset_library_confirmed));
+ empty_list_open_assetlib->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_open_asset_library_confirmed));
empty_list_online_warning = memnew(Label);
empty_list_online_warning->set_horizontal_alignment(HorizontalAlignment::HORIZONTAL_ALIGNMENT_CENTER);
@@ -1345,20 +1345,20 @@ ProjectManager::ProjectManager() {
open_btn = memnew(Button);
open_btn->set_text(TTR("Edit"));
open_btn->set_shortcut(ED_SHORTCUT("project_manager/edit_project", TTR("Edit Project"), KeyModifierMask::CMD_OR_CTRL | Key::E));
- open_btn->connect("pressed", callable_mp(this, &ProjectManager::_open_selected_projects_ask));
+ open_btn->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_open_selected_projects_ask));
project_list_sidebar->add_child(open_btn);
run_btn = memnew(Button);
run_btn->set_text(TTR("Run"));
run_btn->set_shortcut(ED_SHORTCUT("project_manager/run_project", TTR("Run Project"), KeyModifierMask::CMD_OR_CTRL | Key::R));
- run_btn->connect("pressed", callable_mp(this, &ProjectManager::_run_project));
+ run_btn->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_run_project));
project_list_sidebar->add_child(run_btn);
rename_btn = memnew(Button);
rename_btn->set_text(TTR("Rename"));
// The F2 shortcut isn't overridden with Enter on macOS as Enter is already used to edit a project.
rename_btn->set_shortcut(ED_SHORTCUT("project_manager/rename_project", TTR("Rename Project"), Key::F2));
- rename_btn->connect("pressed", callable_mp(this, &ProjectManager::_rename_project));
+ rename_btn->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_rename_project));
project_list_sidebar->add_child(rename_btn);
manage_tags_btn = memnew(Button);
@@ -1368,7 +1368,7 @@ ProjectManager::ProjectManager() {
erase_btn = memnew(Button);
erase_btn->set_text(TTR("Remove"));
erase_btn->set_shortcut(ED_SHORTCUT("project_manager/remove_project", TTR("Remove Project"), Key::KEY_DELETE));
- erase_btn->connect("pressed", callable_mp(this, &ProjectManager::_erase_project));
+ erase_btn->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_erase_project));
project_list_sidebar->add_child(erase_btn);
Control *filler = memnew(Control);
@@ -1377,7 +1377,7 @@ ProjectManager::ProjectManager() {
erase_missing_btn = memnew(Button);
erase_missing_btn->set_text(TTR("Remove Missing"));
- erase_missing_btn->connect("pressed", callable_mp(this, &ProjectManager::_erase_missing_projects));
+ erase_missing_btn->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_erase_missing_projects));
project_list_sidebar->add_child(erase_missing_btn);
}
}
@@ -1425,7 +1425,7 @@ ProjectManager::ProjectManager() {
build_date = TTR("(unknown)");
}
version_btn->set_tooltip_text(vformat(TTR("Git commit date: %s\nClick to copy the version information."), build_date));
- version_btn->connect("pressed", callable_mp(this, &ProjectManager::_version_button_pressed));
+ version_btn->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_version_button_pressed));
footer_bar->add_child(version_btn);
}
@@ -1446,12 +1446,12 @@ ProjectManager::ProjectManager() {
erase_missing_ask = memnew(ConfirmationDialog);
erase_missing_ask->set_ok_button_text(TTR("Remove All"));
- erase_missing_ask->get_ok_button()->connect("pressed", callable_mp(this, &ProjectManager::_erase_missing_projects_confirm));
+ erase_missing_ask->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_erase_missing_projects_confirm));
add_child(erase_missing_ask);
erase_ask = memnew(ConfirmationDialog);
erase_ask->set_ok_button_text(TTR("Remove"));
- erase_ask->get_ok_button()->connect("pressed", callable_mp(this, &ProjectManager::_erase_project_confirm));
+ erase_ask->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_erase_project_confirm));
add_child(erase_ask);
VBoxContainer *erase_ask_vb = memnew(VBoxContainer);
@@ -1468,19 +1468,19 @@ ProjectManager::ProjectManager() {
multi_open_ask = memnew(ConfirmationDialog);
multi_open_ask->set_ok_button_text(TTR("Edit"));
- multi_open_ask->get_ok_button()->connect("pressed", callable_mp(this, &ProjectManager::_open_selected_projects));
+ multi_open_ask->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_open_selected_projects));
add_child(multi_open_ask);
multi_run_ask = memnew(ConfirmationDialog);
multi_run_ask->set_ok_button_text(TTR("Run"));
- multi_run_ask->get_ok_button()->connect("pressed", callable_mp(this, &ProjectManager::_run_project_confirm));
+ multi_run_ask->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_run_project_confirm));
add_child(multi_run_ask);
ask_update_settings = memnew(ConfirmationDialog);
ask_update_settings->set_autowrap(true);
- ask_update_settings->get_ok_button()->connect("pressed", callable_mp(this, &ProjectManager::_open_selected_projects));
+ ask_update_settings->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_open_selected_projects));
full_convert_button = ask_update_settings->add_button(TTR("Convert Full Project"), !GLOBAL_GET("gui/common/swap_cancel_ok"));
- full_convert_button->connect("pressed", callable_mp(this, &ProjectManager::_full_convert_button_pressed));
+ full_convert_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_full_convert_button_pressed));
add_child(ask_update_settings);
ask_full_convert_dialog = memnew(ConfirmationDialog);
@@ -1507,8 +1507,8 @@ ProjectManager::ProjectManager() {
tag_manage_dialog = memnew(ConfirmationDialog);
add_child(tag_manage_dialog);
tag_manage_dialog->set_title(TTR("Manage Project Tags"));
- tag_manage_dialog->get_ok_button()->connect("pressed", callable_mp(this, &ProjectManager::_apply_project_tags));
- manage_tags_btn->connect("pressed", callable_mp(this, &ProjectManager::_manage_project_tags));
+ tag_manage_dialog->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_apply_project_tags));
+ manage_tags_btn->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_manage_project_tags));
VBoxContainer *tag_vb = memnew(VBoxContainer);
tag_manage_dialog->add_child(tag_vb);
@@ -1548,7 +1548,7 @@ ProjectManager::ProjectManager() {
create_tag_dialog = memnew(ConfirmationDialog);
tag_manage_dialog->add_child(create_tag_dialog);
create_tag_dialog->set_title(TTR("Create New Tag"));
- create_tag_dialog->get_ok_button()->connect("pressed", callable_mp(this, &ProjectManager::_create_new_tag));
+ create_tag_dialog->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &ProjectManager::_create_new_tag));
tag_vb = memnew(VBoxContainer);
create_tag_dialog->add_child(tag_vb);
@@ -1568,7 +1568,7 @@ ProjectManager::ProjectManager() {
create_tag_btn = memnew(Button);
all_tags->add_child(create_tag_btn);
- create_tag_btn->connect("pressed", callable_mp((Window *)create_tag_dialog, &Window::popup_centered).bind(Vector2i(500, 0) * EDSCALE));
+ create_tag_btn->connect(SceneStringName(pressed), callable_mp((Window *)create_tag_dialog, &Window::popup_centered).bind(Vector2i(500, 0) * EDSCALE));
}
// Initialize project list.
diff --git a/editor/project_manager/project_dialog.cpp b/editor/project_manager/project_dialog.cpp
index 81fdf9c369..99aa83a09c 100644
--- a/editor/project_manager/project_dialog.cpp
+++ b/editor/project_manager/project_dialog.cpp
@@ -462,7 +462,7 @@ void ProjectDialog::ok_pressed() {
ConfirmationDialog *cd = memnew(ConfirmationDialog);
cd->set_title(TTR("Warning: This folder is not empty"));
cd->set_text(TTR("You are about to create a Godot project in a non-empty folder.\nThe entire contents of this folder will be imported as project resources!\n\nAre you sure you wish to continue?"));
- cd->get_ok_button()->connect("pressed", callable_mp(this, &ProjectDialog::_nonempty_confirmation_ok_pressed));
+ cd->get_ok_button()->connect(SceneStringName(pressed), callable_mp(this, &ProjectDialog::_nonempty_confirmation_ok_pressed));
get_parent()->add_child(cd);
cd->popup_centered();
return;
@@ -855,7 +855,7 @@ ProjectDialog::ProjectDialog() {
project_browse = memnew(Button);
project_browse->set_text(TTR("Browse"));
- project_browse->connect("pressed", callable_mp(this, &ProjectDialog::_browse_project_path));
+ project_browse->connect(SceneStringName(pressed), callable_mp(this, &ProjectDialog::_browse_project_path));
pphb->add_child(project_browse);
// install status icon
@@ -865,7 +865,7 @@ ProjectDialog::ProjectDialog() {
install_browse = memnew(Button);
install_browse->set_text(TTR("Browse"));
- install_browse->connect("pressed", callable_mp(this, &ProjectDialog::_browse_install_path));
+ install_browse->connect(SceneStringName(pressed), callable_mp(this, &ProjectDialog::_browse_install_path));
iphb->add_child(install_browse);
msg = memnew(Label);
@@ -900,7 +900,7 @@ ProjectDialog::ProjectDialog() {
rs_button->set_disabled(true);
#endif
rs_button->set_meta(SNAME("rendering_method"), "forward_plus");
- rs_button->connect("pressed", callable_mp(this, &ProjectDialog::_renderer_selected));
+ rs_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectDialog::_renderer_selected));
rvb->add_child(rs_button);
if (default_renderer_type == "forward_plus") {
rs_button->set_pressed(true);
@@ -912,7 +912,7 @@ ProjectDialog::ProjectDialog() {
rs_button->set_disabled(true);
#endif
rs_button->set_meta(SNAME("rendering_method"), "mobile");
- rs_button->connect("pressed", callable_mp(this, &ProjectDialog::_renderer_selected));
+ rs_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectDialog::_renderer_selected));
rvb->add_child(rs_button);
if (default_renderer_type == "mobile") {
rs_button->set_pressed(true);
@@ -924,7 +924,7 @@ ProjectDialog::ProjectDialog() {
rs_button->set_disabled(true);
#endif
rs_button->set_meta(SNAME("rendering_method"), "gl_compatibility");
- rs_button->connect("pressed", callable_mp(this, &ProjectDialog::_renderer_selected));
+ rs_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectDialog::_renderer_selected));
rvb->add_child(rs_button);
#if defined(GLES3_ENABLED)
if (default_renderer_type == "gl_compatibility") {
diff --git a/editor/project_manager/project_list.cpp b/editor/project_manager/project_list.cpp
index 00f94a7e76..32f088ec60 100644
--- a/editor/project_manager/project_list.cpp
+++ b/editor/project_manager/project_list.cpp
@@ -216,7 +216,7 @@ ProjectListItemControl::ProjectListItemControl() {
// This makes the project's "hover" style display correctly when hovering the favorite icon.
favorite_button->set_mouse_filter(MOUSE_FILTER_PASS);
favorite_box->add_child(favorite_button);
- favorite_button->connect("pressed", callable_mp(this, &ProjectListItemControl::_favorite_button_pressed));
+ favorite_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectListItemControl::_favorite_button_pressed));
project_icon = memnew(TextureRect);
project_icon->set_name("ProjectIcon");
@@ -262,7 +262,7 @@ ProjectListItemControl::ProjectListItemControl() {
explore_button->set_name("ExploreButton");
explore_button->set_flat(true);
path_hb->add_child(explore_button);
- explore_button->connect("pressed", callable_mp(this, &ProjectListItemControl::_explore_button_pressed));
+ explore_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectListItemControl::_explore_button_pressed));
project_path = memnew(Label);
project_path->set_name("ProjectPath");
diff --git a/editor/project_manager/project_tag.cpp b/editor/project_manager/project_tag.cpp
index 8fb05b549e..618b6555d4 100644
--- a/editor/project_manager/project_tag.cpp
+++ b/editor/project_manager/project_tag.cpp
@@ -41,7 +41,7 @@ void ProjectTag::_notification(int p_what) {
}
void ProjectTag::connect_button_to(const Callable &p_callable) {
- button->connect(SNAME("pressed"), p_callable, CONNECT_DEFERRED);
+ button->connect(SceneStringName(pressed), p_callable, CONNECT_DEFERRED);
}
const String ProjectTag::get_tag() const {
diff --git a/editor/project_manager/quick_settings_dialog.cpp b/editor/project_manager/quick_settings_dialog.cpp
index 255b15f7f6..63fe423b1f 100644
--- a/editor/project_manager/quick_settings_dialog.cpp
+++ b/editor/project_manager/quick_settings_dialog.cpp
@@ -165,7 +165,7 @@ void QuickSettingsDialog::_set_setting_value(const String &p_setting, const Vari
if (!restart_required_button) {
restart_required_button = add_button(TTR("Restart Now"), !GLOBAL_GET("gui/common/swap_cancel_ok"));
- restart_required_button->connect("pressed", callable_mp(this, &QuickSettingsDialog::_request_restart));
+ restart_required_button->connect(SceneStringName(pressed), callable_mp(this, &QuickSettingsDialog::_request_restart));
}
}
}
diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp
index c4aeac434b..cff95cadc8 100644
--- a/editor/project_settings_editor.cpp
+++ b/editor/project_settings_editor.cpp
@@ -683,13 +683,13 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) {
add_button = memnew(Button);
add_button->set_text(TTR("Add"));
add_button->set_disabled(true);
- add_button->connect("pressed", callable_mp(this, &ProjectSettingsEditor::_add_setting));
+ add_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectSettingsEditor::_add_setting));
custom_properties->add_child(add_button);
del_button = memnew(Button);
del_button->set_text(TTR("Delete"));
del_button->set_disabled(true);
- del_button->connect("pressed", callable_mp(this, &ProjectSettingsEditor::_delete_setting));
+ del_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectSettingsEditor::_delete_setting));
custom_properties->add_child(del_button);
general_settings_inspector = memnew(SectionedInspector);
@@ -718,13 +718,13 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) {
restart_hb->add_spacer();
Button *restart_button = memnew(Button);
- restart_button->connect("pressed", callable_mp(this, &ProjectSettingsEditor::_editor_restart));
+ restart_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectSettingsEditor::_editor_restart));
restart_hb->add_child(restart_button);
restart_button->set_text(TTR("Save & Restart"));
restart_close_button = memnew(Button);
restart_close_button->set_flat(true);
- restart_close_button->connect("pressed", callable_mp(this, &ProjectSettingsEditor::_editor_restart_close));
+ restart_close_button->connect(SceneStringName(pressed), callable_mp(this, &ProjectSettingsEditor::_editor_restart_close));
restart_hb->add_child(restart_close_button);
action_map_editor = memnew(ActionMapEditor);
diff --git a/editor/rename_dialog.cpp b/editor/rename_dialog.cpp
index c08d8a9765..51f9d319a6 100644
--- a/editor/rename_dialog.cpp
+++ b/editor/rename_dialog.cpp
@@ -145,7 +145,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor) {
but_insert_name->set_text("NAME");
but_insert_name->set_tooltip_text(String("${NAME}\n") + TTR("Node name."));
but_insert_name->set_focus_mode(Control::FOCUS_NONE);
- but_insert_name->connect("pressed", callable_mp(this, &RenameDialog::_insert_text).bind("${NAME}"));
+ but_insert_name->connect(SceneStringName(pressed), callable_mp(this, &RenameDialog::_insert_text).bind("${NAME}"));
but_insert_name->set_h_size_flags(Control::SIZE_EXPAND_FILL);
grd_substitute->add_child(but_insert_name);
@@ -155,7 +155,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor) {
but_insert_parent->set_text("PARENT");
but_insert_parent->set_tooltip_text(String("${PARENT}\n") + TTR("Node's parent name, if available."));
but_insert_parent->set_focus_mode(Control::FOCUS_NONE);
- but_insert_parent->connect("pressed", callable_mp(this, &RenameDialog::_insert_text).bind("${PARENT}"));
+ but_insert_parent->connect(SceneStringName(pressed), callable_mp(this, &RenameDialog::_insert_text).bind("${PARENT}"));
but_insert_parent->set_h_size_flags(Control::SIZE_EXPAND_FILL);
grd_substitute->add_child(but_insert_parent);
@@ -165,7 +165,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor) {
but_insert_type->set_text("TYPE");
but_insert_type->set_tooltip_text(String("${TYPE}\n") + TTR("Node type."));
but_insert_type->set_focus_mode(Control::FOCUS_NONE);
- but_insert_type->connect("pressed", callable_mp(this, &RenameDialog::_insert_text).bind("${TYPE}"));
+ but_insert_type->connect(SceneStringName(pressed), callable_mp(this, &RenameDialog::_insert_text).bind("${TYPE}"));
but_insert_type->set_h_size_flags(Control::SIZE_EXPAND_FILL);
grd_substitute->add_child(but_insert_type);
@@ -175,7 +175,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor) {
but_insert_scene->set_text("SCENE");
but_insert_scene->set_tooltip_text(String("${SCENE}\n") + TTR("Current scene name."));
but_insert_scene->set_focus_mode(Control::FOCUS_NONE);
- but_insert_scene->connect("pressed", callable_mp(this, &RenameDialog::_insert_text).bind("${SCENE}"));
+ but_insert_scene->connect(SceneStringName(pressed), callable_mp(this, &RenameDialog::_insert_text).bind("${SCENE}"));
but_insert_scene->set_h_size_flags(Control::SIZE_EXPAND_FILL);
grd_substitute->add_child(but_insert_scene);
@@ -185,7 +185,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor) {
but_insert_root->set_text("ROOT");
but_insert_root->set_tooltip_text(String("${ROOT}\n") + TTR("Root node name."));
but_insert_root->set_focus_mode(Control::FOCUS_NONE);
- but_insert_root->connect("pressed", callable_mp(this, &RenameDialog::_insert_text).bind("${ROOT}"));
+ but_insert_root->connect(SceneStringName(pressed), callable_mp(this, &RenameDialog::_insert_text).bind("${ROOT}"));
but_insert_root->set_h_size_flags(Control::SIZE_EXPAND_FILL);
grd_substitute->add_child(but_insert_root);
@@ -195,7 +195,7 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor) {
but_insert_count->set_text("COUNTER");
but_insert_count->set_tooltip_text(String("${COUNTER}\n") + TTR("Sequential integer counter.\nCompare counter options."));
but_insert_count->set_focus_mode(Control::FOCUS_NONE);
- but_insert_count->connect("pressed", callable_mp(this, &RenameDialog::_insert_text).bind("${COUNTER}"));
+ but_insert_count->connect(SceneStringName(pressed), callable_mp(this, &RenameDialog::_insert_text).bind("${COUNTER}"));
but_insert_count->set_h_size_flags(Control::SIZE_EXPAND_FILL);
grd_substitute->add_child(but_insert_count);
@@ -327,11 +327,11 @@ RenameDialog::RenameDialog(SceneTreeEditor *p_scene_tree_editor) {
spn_count_padding->connect("value_changed", callable_mp(this, &RenameDialog::_update_preview_int));
opt_style->connect("item_selected", callable_mp(this, &RenameDialog::_update_preview_int));
opt_case->connect("item_selected", callable_mp(this, &RenameDialog::_update_preview_int));
- cbut_substitute->connect("pressed", callable_mp(this, &RenameDialog::_update_preview).bind(""));
- cbut_regex->connect("pressed", callable_mp(this, &RenameDialog::_update_preview).bind(""));
- cbut_process->connect("pressed", callable_mp(this, &RenameDialog::_update_preview).bind(""));
+ cbut_substitute->connect(SceneStringName(pressed), callable_mp(this, &RenameDialog::_update_preview).bind(""));
+ cbut_regex->connect(SceneStringName(pressed), callable_mp(this, &RenameDialog::_update_preview).bind(""));
+ cbut_process->connect(SceneStringName(pressed), callable_mp(this, &RenameDialog::_update_preview).bind(""));
- but_reset->connect("pressed", callable_mp(this, &RenameDialog::reset));
+ but_reset->connect(SceneStringName(pressed), callable_mp(this, &RenameDialog::reset));
reset();
_features_toggled(false);
diff --git a/editor/run_instances_dialog.cpp b/editor/run_instances_dialog.cpp
index d8733288b2..e15d578cb5 100644
--- a/editor/run_instances_dialog.cpp
+++ b/editor/run_instances_dialog.cpp
@@ -281,7 +281,7 @@ RunInstancesDialog::RunInstancesDialog() {
enable_multiple_instances_checkbox->set_text(TTR("Enable Multiple Instances"));
enable_multiple_instances_checkbox->set_pressed(EditorSettings::get_singleton()->get_project_metadata("debug_options", "multiple_instances_enabled", false));
args_gc->add_child(enable_multiple_instances_checkbox);
- enable_multiple_instances_checkbox->connect("pressed", callable_mp(this, &RunInstancesDialog::_start_main_timer));
+ enable_multiple_instances_checkbox->connect(SceneStringName(pressed), callable_mp(this, &RunInstancesDialog::_start_main_timer));
{
Label *l = memnew(Label);
diff --git a/editor/scene_create_dialog.cpp b/editor/scene_create_dialog.cpp
index 4c22b37d9d..fe773378b0 100644
--- a/editor/scene_create_dialog.cpp
+++ b/editor/scene_create_dialog.cpp
@@ -241,7 +241,7 @@ SceneCreateDialog::SceneCreateDialog() {
select_node_button = memnew(Button);
hb->add_child(select_node_button);
- select_node_button->connect("pressed", callable_mp(this, &SceneCreateDialog::browse_types));
+ select_node_button->connect(SceneStringName(pressed), callable_mp(this, &SceneCreateDialog::browse_types));
}
{
@@ -291,7 +291,7 @@ SceneCreateDialog::SceneCreateDialog() {
validation_panel->set_update_callback(callable_mp(this, &SceneCreateDialog::update_dialog));
validation_panel->set_accept_button(get_ok_button());
- node_type_group->connect("pressed", callable_mp(validation_panel, &EditorValidationPanel::update).unbind(1));
+ node_type_group->connect(SceneStringName(pressed), callable_mp(validation_panel, &EditorValidationPanel::update).unbind(1));
scene_name_edit->connect("text_changed", callable_mp(validation_panel, &EditorValidationPanel::update).unbind(1));
root_name_edit->connect("text_changed", callable_mp(validation_panel, &EditorValidationPanel::update).unbind(1));
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 628451ca0c..53145c3450 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -1470,7 +1470,7 @@ void SceneTreeDock::_notification(int p_what) {
node_shortcuts_toggle->set_tooltip_text(TTR("Toggle the display of favorite nodes."));
node_shortcuts_toggle->set_pressed(EDITOR_GET("_use_favorites_root_selection"));
node_shortcuts_toggle->set_anchors_and_offsets_preset(Control::PRESET_CENTER_RIGHT);
- node_shortcuts_toggle->connect("pressed", callable_mp(this, &SceneTreeDock::_update_create_root_dialog));
+ node_shortcuts_toggle->connect(SceneStringName(pressed), callable_mp(this, &SceneTreeDock::_update_create_root_dialog));
top_row->add_child(node_shortcuts_toggle);
create_root_dialog->add_child(top_row);
@@ -1491,19 +1491,19 @@ void SceneTreeDock::_notification(int p_what) {
beginner_node_shortcuts->add_child(button_2d);
button_2d->set_text(TTR("2D Scene"));
button_2d->set_icon(get_editor_theme_icon(SNAME("Node2D")));
- button_2d->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_CREATE_2D_SCENE, false));
+ button_2d->connect(SceneStringName(pressed), callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_CREATE_2D_SCENE, false));
button_3d = memnew(Button);
beginner_node_shortcuts->add_child(button_3d);
button_3d->set_text(TTR("3D Scene"));
button_3d->set_icon(get_editor_theme_icon(SNAME("Node3D")));
- button_3d->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_CREATE_3D_SCENE, false));
+ button_3d->connect(SceneStringName(pressed), callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_CREATE_3D_SCENE, false));
button_ui = memnew(Button);
beginner_node_shortcuts->add_child(button_ui);
button_ui->set_text(TTR("User Interface"));
button_ui->set_icon(get_editor_theme_icon(SNAME("Control")));
- button_ui->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_CREATE_USER_INTERFACE, false));
+ button_ui->connect(SceneStringName(pressed), callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_CREATE_USER_INTERFACE, false));
favorite_node_shortcuts = memnew(VBoxContainer);
node_shortcuts->add_child(favorite_node_shortcuts);
@@ -1512,13 +1512,13 @@ void SceneTreeDock::_notification(int p_what) {
node_shortcuts->add_child(button_custom);
button_custom->set_text(TTR("Other Node"));
button_custom->set_icon(get_editor_theme_icon(SNAME("Add")));
- button_custom->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_NEW, false));
+ button_custom->connect(SceneStringName(pressed), callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_NEW, false));
button_clipboard = memnew(Button);
node_shortcuts->add_child(button_clipboard);
button_clipboard->set_text(TTR("Paste From Clipboard"));
button_clipboard->set_icon(get_editor_theme_icon(SNAME("ActionPaste")));
- button_clipboard->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_PASTE, false));
+ button_clipboard->connect(SceneStringName(pressed), callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_PASTE, false));
_update_create_root_dialog();
} break;
@@ -2907,6 +2907,13 @@ void SceneTreeDock::_replace_node(Node *p_node, Node *p_by_node, bool p_keep_pro
}
}
+ // HACK: Remember size of anchored control.
+ Control *old_control = Object::cast_to<Control>(oldnode);
+ Size2 size;
+ if (old_control) {
+ size = old_control->get_size();
+ }
+
String newname = oldnode->get_name();
List<Node *> to_erase;
@@ -2917,6 +2924,12 @@ void SceneTreeDock::_replace_node(Node *p_node, Node *p_by_node, bool p_keep_pro
}
oldnode->replace_by(newnode, true);
+ // Re-apply size of anchored control.
+ Control *new_control = Object::cast_to<Control>(newnode);
+ if (old_control && new_control) {
+ new_control->set_size(size);
+ }
+
//small hack to make collisionshapes and other kind of nodes to work
for (int i = 0; i < newnode->get_child_count(); i++) {
Node *c = newnode->get_child(i);
@@ -3982,7 +3995,7 @@ void SceneTreeDock::_update_create_root_dialog() {
name = ScriptServer::get_global_class_native_base(name);
}
button->set_icon(EditorNode::get_singleton()->get_class_icon(name));
- button->connect("pressed", callable_mp(this, &SceneTreeDock::_favorite_root_selected).bind(l));
+ button->connect(SceneStringName(pressed), callable_mp(this, &SceneTreeDock::_favorite_root_selected).bind(l));
}
}
}
@@ -4266,14 +4279,14 @@ SceneTreeDock::SceneTreeDock(Node *p_scene_root, EditorSelection *p_editor_selec
button_add = memnew(Button);
button_add->set_theme_type_variation("FlatMenuButton");
- button_add->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_NEW, false));
+ button_add->connect(SceneStringName(pressed), callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_NEW, false));
button_add->set_tooltip_text(TTR("Add/Create a New Node."));
button_add->set_shortcut(ED_GET_SHORTCUT("scene_tree/add_child_node"));
filter_hbc->add_child(button_add);
button_instance = memnew(Button);
button_instance->set_theme_type_variation("FlatMenuButton");
- button_instance->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_INSTANTIATE, false));
+ button_instance->connect(SceneStringName(pressed), callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_INSTANTIATE, false));
button_instance->set_tooltip_text(TTR("Instantiate a scene file as a Node. Creates an inherited scene if no root node exists."));
button_instance->set_shortcut(ED_GET_SHORTCUT("scene_tree/instantiate_scene"));
filter_hbc->add_child(button_instance);
@@ -4298,7 +4311,7 @@ SceneTreeDock::SceneTreeDock(Node *p_scene_root, EditorSelection *p_editor_selec
button_create_script = memnew(Button);
button_create_script->set_theme_type_variation("FlatMenuButton");
- button_create_script->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_ATTACH_SCRIPT, false));
+ button_create_script->connect(SceneStringName(pressed), callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_ATTACH_SCRIPT, false));
button_create_script->set_tooltip_text(TTR("Attach a new or existing script to the selected node."));
button_create_script->set_shortcut(ED_GET_SHORTCUT("scene_tree/attach_script"));
filter_hbc->add_child(button_create_script);
@@ -4306,7 +4319,7 @@ SceneTreeDock::SceneTreeDock(Node *p_scene_root, EditorSelection *p_editor_selec
button_detach_script = memnew(Button);
button_detach_script->set_theme_type_variation("FlatMenuButton");
- button_detach_script->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_DETACH_SCRIPT, false));
+ button_detach_script->connect(SceneStringName(pressed), callable_mp(this, &SceneTreeDock::_tool_selected).bind(TOOL_DETACH_SCRIPT, false));
button_detach_script->set_tooltip_text(TTR("Detach the script from the selected node."));
button_detach_script->set_shortcut(ED_GET_SHORTCUT("scene_tree/detach_script"));
filter_hbc->add_child(button_detach_script);
@@ -4332,7 +4345,7 @@ SceneTreeDock::SceneTreeDock(Node *p_scene_root, EditorSelection *p_editor_selec
edit_remote->set_toggle_mode(true);
edit_remote->set_tooltip_text(TTR("If selected, the Remote scene tree dock will cause the project to stutter every time it updates.\nSwitch back to the Local scene tree dock to improve performance."));
button_hb->add_child(edit_remote);
- edit_remote->connect("pressed", callable_mp(this, &SceneTreeDock::_remote_tree_selected));
+ edit_remote->connect(SceneStringName(pressed), callable_mp(this, &SceneTreeDock::_remote_tree_selected));
edit_local = memnew(Button);
edit_local->set_theme_type_variation("FlatButton");
@@ -4341,7 +4354,7 @@ SceneTreeDock::SceneTreeDock(Node *p_scene_root, EditorSelection *p_editor_selec
edit_local->set_toggle_mode(true);
edit_local->set_pressed(true);
button_hb->add_child(edit_local);
- edit_local->connect("pressed", callable_mp(this, &SceneTreeDock::_local_tree_selected));
+ edit_local->connect(SceneStringName(pressed), callable_mp(this, &SceneTreeDock::_local_tree_selected));
remote_tree = nullptr;
button_hb->hide();
diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp
index c42d19395f..13fc5413b3 100644
--- a/editor/script_create_dialog.cpp
+++ b/editor/script_create_dialog.cpp
@@ -885,10 +885,10 @@ ScriptCreateDialog::ScriptCreateDialog() {
hb->add_child(parent_name);
register_text_enter(parent_name);
parent_search_button = memnew(Button);
- parent_search_button->connect("pressed", callable_mp(this, &ScriptCreateDialog::_browse_class_in_tree));
+ parent_search_button->connect(SceneStringName(pressed), callable_mp(this, &ScriptCreateDialog::_browse_class_in_tree));
hb->add_child(parent_search_button);
parent_browse_button = memnew(Button);
- parent_browse_button->connect("pressed", callable_mp(this, &ScriptCreateDialog::_browse_path).bind(true, false));
+ parent_browse_button->connect(SceneStringName(pressed), callable_mp(this, &ScriptCreateDialog::_browse_path).bind(true, false));
hb->add_child(parent_browse_button);
gc->add_child(memnew(Label(TTR("Inherits:"))));
gc->add_child(hb);
@@ -900,7 +900,7 @@ ScriptCreateDialog::ScriptCreateDialog() {
use_templates = memnew(CheckBox);
use_templates->set_pressed(is_using_templates);
- use_templates->connect("pressed", callable_mp(this, &ScriptCreateDialog::_use_template_pressed));
+ use_templates->connect(SceneStringName(pressed), callable_mp(this, &ScriptCreateDialog::_use_template_pressed));
template_hb->add_child(use_templates);
template_inactive_message = "";
@@ -916,7 +916,7 @@ ScriptCreateDialog::ScriptCreateDialog() {
built_in = memnew(CheckBox);
built_in->set_text(TTR("On"));
- built_in->connect("pressed", callable_mp(this, &ScriptCreateDialog::_built_in_pressed));
+ built_in->connect(SceneStringName(pressed), callable_mp(this, &ScriptCreateDialog::_built_in_pressed));
gc->add_child(memnew(Label(TTR("Built-in Script:"))));
gc->add_child(built_in);
@@ -930,7 +930,7 @@ ScriptCreateDialog::ScriptCreateDialog() {
hb->add_child(file_path);
register_text_enter(file_path);
path_button = memnew(Button);
- path_button->connect("pressed", callable_mp(this, &ScriptCreateDialog::_browse_path).bind(false, true));
+ path_button->connect(SceneStringName(pressed), callable_mp(this, &ScriptCreateDialog::_browse_path).bind(false, true));
hb->add_child(path_button);
Label *label = memnew(Label(TTR("Path:")));
gc->add_child(label);
diff --git a/editor/shader_create_dialog.cpp b/editor/shader_create_dialog.cpp
index 0b9915ca2b..6657aa6121 100644
--- a/editor/shader_create_dialog.cpp
+++ b/editor/shader_create_dialog.cpp
@@ -644,7 +644,7 @@ ShaderCreateDialog::ShaderCreateDialog() {
hb->add_child(file_path);
register_text_enter(file_path);
path_button = memnew(Button);
- path_button->connect("pressed", callable_mp(this, &ShaderCreateDialog::_browse_path));
+ path_button->connect(SceneStringName(pressed), callable_mp(this, &ShaderCreateDialog::_browse_path));
hb->add_child(path_button);
gc->add_child(memnew(Label(TTR("Path:"))));
gc->add_child(hb);
diff --git a/editor/shader_globals_editor.cpp b/editor/shader_globals_editor.cpp
index 216ccd71ab..bd9b80590e 100644
--- a/editor/shader_globals_editor.cpp
+++ b/editor/shader_globals_editor.cpp
@@ -473,7 +473,7 @@ ShaderGlobalsEditor::ShaderGlobalsEditor() {
variable_add = memnew(Button(TTR("Add")));
variable_add->set_disabled(true);
add_menu_hb->add_child(variable_add);
- variable_add->connect("pressed", callable_mp(this, &ShaderGlobalsEditor::_variable_added));
+ variable_add->connect(SceneStringName(pressed), callable_mp(this, &ShaderGlobalsEditor::_variable_added));
inspector = memnew(EditorInspector);
inspector->set_v_size_flags(SIZE_EXPAND_FILL);
diff --git a/editor/themes/editor_theme_manager.cpp b/editor/themes/editor_theme_manager.cpp
index 498ade7b5d..d56094b0f3 100644
--- a/editor/themes/editor_theme_manager.cpp
+++ b/editor/themes/editor_theme_manager.cpp
@@ -706,7 +706,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
p_theme->set_stylebox("normal", "Button", p_config.button_style);
p_theme->set_stylebox("hover", "Button", p_config.button_style_hover);
- p_theme->set_stylebox("pressed", "Button", p_config.button_style_pressed);
+ p_theme->set_stylebox(SceneStringName(pressed), "Button", p_config.button_style_pressed);
p_theme->set_stylebox("focus", "Button", p_config.button_style_focus);
p_theme->set_stylebox("disabled", "Button", p_config.button_style_disabled);
@@ -732,7 +732,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
p_theme->set_stylebox("normal", "MenuButton", p_config.panel_container_style);
p_theme->set_stylebox("hover", "MenuButton", p_config.button_style_hover);
- p_theme->set_stylebox("pressed", "MenuButton", p_config.panel_container_style);
+ p_theme->set_stylebox(SceneStringName(pressed), "MenuButton", p_config.panel_container_style);
p_theme->set_stylebox("focus", "MenuButton", p_config.panel_container_style);
p_theme->set_stylebox("disabled", "MenuButton", p_config.panel_container_style);
@@ -748,7 +748,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
p_theme->set_stylebox("normal", "MenuBar", p_config.button_style);
p_theme->set_stylebox("hover", "MenuBar", p_config.button_style_hover);
- p_theme->set_stylebox("pressed", "MenuBar", p_config.button_style_pressed);
+ p_theme->set_stylebox(SceneStringName(pressed), "MenuBar", p_config.button_style_pressed);
p_theme->set_stylebox("disabled", "MenuBar", p_config.button_style_disabled);
p_theme->set_color("font_color", "MenuBar", p_config.font_color);
@@ -785,7 +785,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
p_theme->set_stylebox("focus", "OptionButton", option_button_focus_style);
p_theme->set_stylebox("normal", "OptionButton", p_config.button_style);
p_theme->set_stylebox("hover", "OptionButton", p_config.button_style_hover);
- p_theme->set_stylebox("pressed", "OptionButton", p_config.button_style_pressed);
+ p_theme->set_stylebox(SceneStringName(pressed), "OptionButton", p_config.button_style_pressed);
p_theme->set_stylebox("disabled", "OptionButton", p_config.button_style_disabled);
p_theme->set_stylebox("normal_mirrored", "OptionButton", option_button_normal_style);
@@ -817,7 +817,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
// CheckButton.
p_theme->set_stylebox("normal", "CheckButton", p_config.panel_container_style);
- p_theme->set_stylebox("pressed", "CheckButton", p_config.panel_container_style);
+ p_theme->set_stylebox(SceneStringName(pressed), "CheckButton", p_config.panel_container_style);
p_theme->set_stylebox("disabled", "CheckButton", p_config.panel_container_style);
p_theme->set_stylebox("hover", "CheckButton", p_config.panel_container_style);
p_theme->set_stylebox("hover_pressed", "CheckButton", p_config.panel_container_style);
@@ -856,7 +856,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
checkbox_style->set_content_margin_all(p_config.base_margin * EDSCALE);
p_theme->set_stylebox("normal", "CheckBox", checkbox_style);
- p_theme->set_stylebox("pressed", "CheckBox", checkbox_style);
+ p_theme->set_stylebox(SceneStringName(pressed), "CheckBox", checkbox_style);
p_theme->set_stylebox("disabled", "CheckBox", checkbox_style);
p_theme->set_stylebox("hover", "CheckBox", checkbox_style);
p_theme->set_stylebox("hover_pressed", "CheckBox", checkbox_style);
@@ -1744,7 +1744,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
tag->set_corner_radius(CORNER_BOTTOM_LEFT, 0);
tag->set_corner_radius(CORNER_TOP_RIGHT, 4);
tag->set_corner_radius(CORNER_BOTTOM_RIGHT, 4);
- p_theme->set_stylebox("pressed", "ProjectTag", tag);
+ p_theme->set_stylebox(SceneStringName(pressed), "ProjectTag", tag);
}
}
@@ -1810,20 +1810,20 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
main_screen_button_hover->set_content_margin((Side)i, p_config.button_style_hover->get_content_margin((Side)i));
}
p_theme->set_stylebox("normal", "MainScreenButton", menu_transparent_style);
- p_theme->set_stylebox("pressed", "MainScreenButton", menu_transparent_style);
+ p_theme->set_stylebox(SceneStringName(pressed), "MainScreenButton", menu_transparent_style);
p_theme->set_stylebox("hover", "MainScreenButton", main_screen_button_hover);
p_theme->set_stylebox("hover_pressed", "MainScreenButton", main_screen_button_hover);
p_theme->set_type_variation("MainMenuBar", "FlatMenuButton");
p_theme->set_stylebox("normal", "MainMenuBar", menu_transparent_style);
- p_theme->set_stylebox("pressed", "MainMenuBar", main_screen_button_hover);
+ p_theme->set_stylebox(SceneStringName(pressed), "MainMenuBar", main_screen_button_hover);
p_theme->set_stylebox("hover", "MainMenuBar", main_screen_button_hover);
p_theme->set_stylebox("hover_pressed", "MainMenuBar", main_screen_button_hover);
// Run bar.
p_theme->set_type_variation("RunBarButton", "FlatMenuButton");
p_theme->set_stylebox("disabled", "RunBarButton", menu_transparent_style);
- p_theme->set_stylebox("pressed", "RunBarButton", menu_transparent_style);
+ p_theme->set_stylebox(SceneStringName(pressed), "RunBarButton", menu_transparent_style);
// Bottom panel.
Ref<StyleBoxFlat> style_bottom_panel = p_config.content_panel_style->duplicate();
@@ -1831,7 +1831,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
p_theme->set_stylebox("BottomPanel", EditorStringName(EditorStyles), style_bottom_panel);
p_theme->set_type_variation("BottomPanelButton", "FlatMenuButton");
p_theme->set_stylebox("normal", "BottomPanelButton", menu_transparent_style);
- p_theme->set_stylebox("pressed", "BottomPanelButton", menu_transparent_style);
+ p_theme->set_stylebox(SceneStringName(pressed), "BottomPanelButton", menu_transparent_style);
p_theme->set_stylebox("hover_pressed", "BottomPanelButton", main_screen_button_hover);
p_theme->set_stylebox("hover", "BottomPanelButton", main_screen_button_hover);
}
@@ -1902,12 +1902,12 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
p_theme->set_stylebox("normal", "FlatButton", style_flat_button);
p_theme->set_stylebox("hover", "FlatButton", style_flat_button_hover);
- p_theme->set_stylebox("pressed", "FlatButton", style_flat_button_pressed);
+ p_theme->set_stylebox(SceneStringName(pressed), "FlatButton", style_flat_button_pressed);
p_theme->set_stylebox("disabled", "FlatButton", style_flat_button);
p_theme->set_stylebox("normal", "FlatMenuButton", style_flat_button);
p_theme->set_stylebox("hover", "FlatMenuButton", style_flat_button_hover);
- p_theme->set_stylebox("pressed", "FlatMenuButton", style_flat_button_pressed);
+ p_theme->set_stylebox(SceneStringName(pressed), "FlatMenuButton", style_flat_button_pressed);
p_theme->set_stylebox("disabled", "FlatMenuButton", style_flat_button);
// Variation for Editor Log filter buttons.
@@ -1932,7 +1932,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
}
p_theme->set_stylebox("normal", "EditorLogFilterButton", style_flat_button);
p_theme->set_stylebox("hover", "EditorLogFilterButton", style_flat_button_hover);
- p_theme->set_stylebox("pressed", "EditorLogFilterButton", editor_log_button_pressed);
+ p_theme->set_stylebox(SceneStringName(pressed), "EditorLogFilterButton", editor_log_button_pressed);
}
// Buttons styles that stand out against the panel background (e.g. AssetLib).
@@ -1953,7 +1953,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
p_theme->set_stylebox("normal", "PanelBackgroundButton", panel_button_style);
p_theme->set_stylebox("hover", "PanelBackgroundButton", panel_button_style_hover);
- p_theme->set_stylebox("pressed", "PanelBackgroundButton", panel_button_style_pressed);
+ p_theme->set_stylebox(SceneStringName(pressed), "PanelBackgroundButton", panel_button_style_pressed);
p_theme->set_stylebox("disabled", "PanelBackgroundButton", panel_button_style_disabled);
}
@@ -1994,7 +1994,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
style_inspector_action = p_config.button_style_pressed->duplicate();
style_inspector_action->set_content_margin(SIDE_RIGHT, action_extra_margin);
- p_theme->set_stylebox("pressed", "InspectorActionButton", style_inspector_action);
+ p_theme->set_stylebox(SceneStringName(pressed), "InspectorActionButton", style_inspector_action);
style_inspector_action = p_config.button_style_disabled->duplicate();
style_inspector_action->set_content_margin(SIDE_RIGHT, action_extra_margin);
@@ -2019,7 +2019,7 @@ void EditorThemeManager::_populate_editor_styles(const Ref<EditorTheme> &p_theme
p_theme->set_stylebox("normal", "PreviewLightButton", sb_empty_borderless);
p_theme->set_stylebox("hover", "PreviewLightButton", sb_empty_borderless);
p_theme->set_stylebox("focus", "PreviewLightButton", sb_empty_borderless);
- p_theme->set_stylebox("pressed", "PreviewLightButton", sb_empty_borderless);
+ p_theme->set_stylebox(SceneStringName(pressed), "PreviewLightButton", sb_empty_borderless);
}
// TabContainerOdd variation.
diff --git a/editor/window_wrapper.cpp b/editor/window_wrapper.cpp
index 768b0c6efe..b964a07285 100644
--- a/editor/window_wrapper.cpp
+++ b/editor/window_wrapper.cpp
@@ -368,9 +368,9 @@ void ScreenSelect::_build_advanced_menu() {
button->add_theme_color_override("font_color", accent_color);
}
- button->connect("pressed", callable_mp(this, &ScreenSelect::_emit_screen_signal).bind(i));
- button->connect("pressed", callable_mp(static_cast<BaseButton *>(this), &ScreenSelect::set_pressed).bind(false));
- button->connect("pressed", callable_mp(static_cast<Window *>(popup), &Popup::hide));
+ button->connect(SceneStringName(pressed), callable_mp(this, &ScreenSelect::_emit_screen_signal).bind(i));
+ button->connect(SceneStringName(pressed), callable_mp(static_cast<BaseButton *>(this), &ScreenSelect::set_pressed).bind(false));
+ button->connect(SceneStringName(pressed), callable_mp(static_cast<Window *>(popup), &Popup::hide));
}
}
diff --git a/misc/dist/macos_template.app/Contents/Resources/PrivacyInfo.xcprivacy b/misc/dist/macos_template.app/Contents/Resources/PrivacyInfo.xcprivacy
new file mode 100644
index 0000000000..a5257b74a4
--- /dev/null
+++ b/misc/dist/macos_template.app/Contents/Resources/PrivacyInfo.xcprivacy
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ $priv_tracking
+ $priv_collection
+</dict>
+</plist>
diff --git a/misc/scripts/install_d3d12_sdk_windows.py b/misc/scripts/install_d3d12_sdk_windows.py
index 6dd0818b97..aed80d81a4 100644..100755
--- a/misc/scripts/install_d3d12_sdk_windows.py
+++ b/misc/scripts/install_d3d12_sdk_windows.py
@@ -4,6 +4,18 @@ import os
import urllib.request
import shutil
import subprocess
+import sys
+
+# 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)
# Base Godot dependencies path
# If cross-compiling (no LOCALAPPDATA), we install in `bin`
@@ -14,21 +26,27 @@ else:
deps_folder = os.path.join("bin", "build_deps")
# DirectX Shader Compiler
-dxc_version = "v1.7.2308"
-dxc_filename = "dxc_2023_08_14.zip"
+# Check for latest version: https://github.com/microsoft/DirectXShaderCompiler/releases/latest
+dxc_version = "v1.8.2403.2"
+dxc_filename = "dxc_2024_03_29.zip"
dxc_archive = os.path.join(deps_folder, dxc_filename)
dxc_folder = os.path.join(deps_folder, "dxc")
# Mesa NIR
+# Check for latest version: https://github.com/godotengine/godot-nir-static/releases/latest
mesa_version = "23.1.9"
mesa_filename = "godot-nir-23.1.9.zip"
mesa_archive = os.path.join(deps_folder, mesa_filename)
mesa_folder = os.path.join(deps_folder, "mesa")
# WinPixEventRuntime
-pix_version = "1.0.231030001"
+# Check for latest version: https://www.nuget.org/api/v2/package/WinPixEventRuntime (check downloaded filename)
+pix_version = "1.0.240308001"
pix_archive = os.path.join(deps_folder, f"WinPixEventRuntime_{pix_version}.nupkg")
pix_folder = os.path.join(deps_folder, "pix")
# DirectX 12 Agility SDK
-agility_sdk_version = "1.610.4"
+# Check for latest version: https://www.nuget.org/api/v2/package/Microsoft.Direct3D.D3D12 (check downloaded filename)
+# After updating this, remember to change the default value of the `rendering/rendering_device/d3d12/agility_sdk_version`
+# project setting to match the minor version (e.g. for `1.613.3`, it should be `613`).
+agility_sdk_version = "1.613.3"
agility_sdk_archive = os.path.join(deps_folder, f"Agility_SDK_{agility_sdk_version}.nupkg")
agility_sdk_folder = os.path.join(deps_folder, "agility_sdk")
@@ -37,7 +55,7 @@ if not os.path.exists(deps_folder):
os.makedirs(deps_folder)
# DirectX Shader Compiler
-print("[1/4] DirectX Shader Compiler")
+print("\x1b[1m[1/4] DirectX Shader Compiler\x1b[0m")
if os.path.isfile(dxc_archive):
os.remove(dxc_archive)
print(f"Downloading DirectX Shader Compiler {dxc_filename} ...")
@@ -54,7 +72,7 @@ os.remove(dxc_archive)
print(f"DirectX Shader Compiler {dxc_filename} installed successfully.\n")
# Mesa NIR
-print("[2/4] Mesa NIR")
+print("\x1b[1m[2/4] Mesa NIR\x1b[0m")
if os.path.isfile(mesa_archive):
os.remove(mesa_archive)
print(f"Downloading Mesa NIR {mesa_filename} ...")
@@ -81,7 +99,7 @@ if dlltool == "":
dlltool = shutil.which("x86_64-w64-mingw32-dlltool") or ""
has_mingw = gendef != "" and dlltool != ""
-print("[3/4] WinPixEventRuntime")
+print("\x1b[1m[3/4] WinPixEventRuntime\x1b[0m")
if os.path.isfile(pix_archive):
os.remove(pix_archive)
print(f"Downloading WinPixEventRuntime {pix_version} ...")
@@ -112,7 +130,7 @@ else:
print(f"WinPixEventRuntime {pix_version} installed successfully.\n")
# DirectX 12 Agility SDK
-print("[4/4] DirectX 12 Agility SDK")
+print("\x1b[1m[4/4] DirectX 12 Agility SDK\x1b[0m")
if os.path.isfile(agility_sdk_archive):
os.remove(agility_sdk_archive)
print(f"Downloading DirectX 12 Agility SDK {agility_sdk_version} ...")
@@ -128,5 +146,5 @@ os.remove(agility_sdk_archive)
print(f"DirectX 12 Agility SDK {agility_sdk_version} installed successfully.\n")
# Complete message
-print(f'All Direct3D 12 SDK components were installed to "{deps_folder}" successfully!')
-print('You can now build Godot with Direct3D 12 support enabled by running "scons d3d12=yes".')
+print(f'\x1b[92mAll Direct3D 12 SDK components were installed to "{deps_folder}" successfully!\x1b[0m')
+print('\x1b[92mYou can now build Godot with Direct3D 12 support enabled by running "scons d3d12=yes".\x1b[0m')
diff --git a/misc/scripts/mypy.ini b/misc/scripts/mypy.ini
deleted file mode 100644
index 45f048f118..0000000000
--- a/misc/scripts/mypy.ini
+++ /dev/null
@@ -1,13 +0,0 @@
-[mypy]
-ignore_missing_imports = True
-disallow_any_generics = True
-no_implicit_optional = True
-pretty = True
-show_column_numbers = True
-warn_redundant_casts = True
-warn_return_any = True
-warn_unreachable = True
-
-namespace_packages = True
-explicit_package_bases = True
-exclude = (?x)(^thirdparty)
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/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/gridmap/editor/grid_map_editor_plugin.cpp b/modules/gridmap/editor/grid_map_editor_plugin.cpp
index 0cb3ec2d5e..27c74421db 100644
--- a/modules/gridmap/editor/grid_map_editor_plugin.cpp
+++ b/modules/gridmap/editor/grid_map_editor_plugin.cpp
@@ -1294,14 +1294,14 @@ GridMapEditor::GridMapEditor() {
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);
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 2739e66e9e..cd3814879a 100644
--- a/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp
+++ b/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp
@@ -342,7 +342,7 @@ AudioStreamInteractiveTransitionEditor::AudioStreamInteractiveTransitionEditor()
transition_enabled = memnew(CheckBox);
transition_enabled->set_text(TTR("Enabled"));
edit_vb->add_margin_child(TTR("Use Transition:"), transition_enabled);
- transition_enabled->connect("pressed", callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited));
+ transition_enabled->connect(SceneStringName(pressed), callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited));
transition_from = memnew(OptionButton);
edit_vb->add_margin_child(TTR("Transition From:"), transition_from);
@@ -377,7 +377,7 @@ AudioStreamInteractiveTransitionEditor::AudioStreamInteractiveTransitionEditor()
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);
@@ -397,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..cc2fa18449 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;
@@ -906,7 +906,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 +914,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 +977,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 +1009,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 +1794,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/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/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/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 a25a2c2f68..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")
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/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 08e7ba360a..3cc0a5ae53 100644
--- a/modules/multiplayer/editor/replication_editor.cpp
+++ b/modules/multiplayer/editor/replication_editor.cpp
@@ -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/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/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/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 fb21c45fd8..994b08af53 100644
--- a/modules/openxr/extensions/openxr_composition_layer_extension.cpp
+++ b/modules/openxr/extensions/openxr_composition_layer_extension.cpp
@@ -286,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/platform/linuxbsd/x11/display_server_x11.cpp b/platform/linuxbsd/x11/display_server_x11.cpp
index 9174b65b1b..daf0247540 100644
--- a/platform/linuxbsd/x11/display_server_x11.cpp
+++ b/platform/linuxbsd/x11/display_server_x11.cpp
@@ -1007,7 +1007,8 @@ int DisplayServerX11::get_screen_count() const {
if (xinerama_ext_ok && XineramaQueryExtension(x11_display, &event_base, &error_base)) {
XineramaScreenInfo *xsi = XineramaQueryScreens(x11_display, &count);
XFree(xsi);
- } else {
+ }
+ if (count == 0) {
count = XScreenCount(x11_display);
}
@@ -1068,25 +1069,29 @@ Rect2i DisplayServerX11::_screen_get_rect(int p_screen) const {
ERR_FAIL_COND_V(p_screen < 0, rect);
// Using Xinerama Extension.
+ bool found = false;
int event_base, error_base;
if (xinerama_ext_ok && XineramaQueryExtension(x11_display, &event_base, &error_base)) {
int count;
XineramaScreenInfo *xsi = XineramaQueryScreens(x11_display, &count);
-
- // Check if screen is valid.
- if (p_screen < count) {
- rect.position.x = xsi[p_screen].x_org;
- rect.position.y = xsi[p_screen].y_org;
- rect.size.width = xsi[p_screen].width;
- rect.size.height = xsi[p_screen].height;
- } else {
- ERR_PRINT("Invalid screen index: " + itos(p_screen) + "(count: " + itos(count) + ").");
- }
-
if (xsi) {
+ if (count > 0) {
+ // Check if screen is valid.
+ if (p_screen < count) {
+ rect.position.x = xsi[p_screen].x_org;
+ rect.position.y = xsi[p_screen].y_org;
+ rect.size.width = xsi[p_screen].width;
+ rect.size.height = xsi[p_screen].height;
+ found = true;
+ } else {
+ ERR_PRINT(vformat("Invalid screen index: %d (count: %d).", p_screen, count));
+ }
+ }
XFree(xsi);
}
- } else {
+ }
+
+ if (!found) {
int count = XScreenCount(x11_display);
if (p_screen < count) {
Window root = XRootWindow(x11_display, p_screen);
@@ -1097,7 +1102,7 @@ Rect2i DisplayServerX11::_screen_get_rect(int p_screen) const {
rect.size.width = xwa.width;
rect.size.height = xwa.height;
} else {
- ERR_PRINT("Invalid screen index: " + itos(p_screen) + "(count: " + itos(count) + ").");
+ ERR_PRINT(vformat("Invalid screen index: %d (count: %d).", p_screen, count));
}
}
@@ -1503,25 +1508,33 @@ Ref<Image> DisplayServerX11::screen_get_image(int p_screen) const {
XImage *image = nullptr;
+ bool found = false;
int event_base, error_base;
if (xinerama_ext_ok && XineramaQueryExtension(x11_display, &event_base, &error_base)) {
int xin_count;
XineramaScreenInfo *xsi = XineramaQueryScreens(x11_display, &xin_count);
- if (p_screen < xin_count) {
- int x_count = XScreenCount(x11_display);
- for (int i = 0; i < x_count; i++) {
- Window root = XRootWindow(x11_display, i);
- XWindowAttributes root_attrs;
- XGetWindowAttributes(x11_display, root, &root_attrs);
- if ((xsi[p_screen].x_org >= root_attrs.x) && (xsi[p_screen].x_org <= root_attrs.x + root_attrs.width) && (xsi[p_screen].y_org >= root_attrs.y) && (xsi[p_screen].y_org <= root_attrs.y + root_attrs.height)) {
- image = XGetImage(x11_display, root, xsi[p_screen].x_org, xsi[p_screen].y_org, xsi[p_screen].width, xsi[p_screen].height, AllPlanes, ZPixmap);
- break;
+ if (xsi) {
+ if (xin_count > 0) {
+ if (p_screen < xin_count) {
+ int x_count = XScreenCount(x11_display);
+ for (int i = 0; i < x_count; i++) {
+ Window root = XRootWindow(x11_display, i);
+ XWindowAttributes root_attrs;
+ XGetWindowAttributes(x11_display, root, &root_attrs);
+ if ((xsi[p_screen].x_org >= root_attrs.x) && (xsi[p_screen].x_org <= root_attrs.x + root_attrs.width) && (xsi[p_screen].y_org >= root_attrs.y) && (xsi[p_screen].y_org <= root_attrs.y + root_attrs.height)) {
+ found = true;
+ image = XGetImage(x11_display, root, xsi[p_screen].x_org, xsi[p_screen].y_org, xsi[p_screen].width, xsi[p_screen].height, AllPlanes, ZPixmap);
+ break;
+ }
+ }
+ } else {
+ ERR_PRINT(vformat("Invalid screen index: %d (count: %d).", p_screen, xin_count));
}
}
- } else {
- ERR_FAIL_V_MSG(Ref<Image>(), "Invalid screen index: " + itos(p_screen) + "(count: " + itos(xin_count) + ").");
+ XFree(xsi);
}
- } else {
+ }
+ if (!found) {
int x_count = XScreenCount(x11_display);
if (p_screen < x_count) {
Window root = XRootWindow(x11_display, p_screen);
@@ -1531,7 +1544,7 @@ Ref<Image> DisplayServerX11::screen_get_image(int p_screen) const {
image = XGetImage(x11_display, root, root_attrs.x, root_attrs.y, root_attrs.width, root_attrs.height, AllPlanes, ZPixmap);
} else {
- ERR_FAIL_V_MSG(Ref<Image>(), "Invalid screen index: " + itos(p_screen) + "(count: " + itos(x_count) + ").");
+ ERR_PRINT(vformat("Invalid screen index: %d (count: %d).", p_screen, x_count));
}
}
diff --git a/platform/macos/doc_classes/EditorExportPlatformMacOS.xml b/platform/macos/doc_classes/EditorExportPlatformMacOS.xml
index 7355042a48..92ade4b77a 100644
--- a/platform/macos/doc_classes/EditorExportPlatformMacOS.xml
+++ b/platform/macos/doc_classes/EditorExportPlatformMacOS.xml
@@ -211,6 +211,426 @@
<member name="privacy/camera_usage_description_localized" type="Dictionary" setter="" getter="">
A message displayed when requesting access to the device's camera (localized).
</member>
+ <member name="privacy/collected_data/advertising_data/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects advertising data.
+ </member>
+ <member name="privacy/collected_data/advertising_data/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects advertising data. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/advertising_data/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links advertising data to the user's identity.
+ </member>
+ <member name="privacy/collected_data/advertising_data/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses advertising data for tracking.
+ </member>
+ <member name="privacy/collected_data/audio_data/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects audio data data.
+ </member>
+ <member name="privacy/collected_data/audio_data/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects audio data. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/audio_data/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links audio data data to the user's identity.
+ </member>
+ <member name="privacy/collected_data/audio_data/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses audio data data for tracking.
+ </member>
+ <member name="privacy/collected_data/browsing_history/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects browsing history.
+ </member>
+ <member name="privacy/collected_data/browsing_history/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects browsing history. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/browsing_history/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links browsing history to the user's identity.
+ </member>
+ <member name="privacy/collected_data/browsing_history/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses browsing history for tracking.
+ </member>
+ <member name="privacy/collected_data/coarse_location/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects coarse location data.
+ </member>
+ <member name="privacy/collected_data/coarse_location/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects coarse location data. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/coarse_location/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links coarse location data to the user's identity.
+ </member>
+ <member name="privacy/collected_data/coarse_location/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses coarse location data for tracking.
+ </member>
+ <member name="privacy/collected_data/contacts/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects contacts.
+ </member>
+ <member name="privacy/collected_data/contacts/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects contacts. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/contacts/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links contacts to the user's identity.
+ </member>
+ <member name="privacy/collected_data/contacts/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses contacts for tracking.
+ </member>
+ <member name="privacy/collected_data/crash_data/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects crash data.
+ </member>
+ <member name="privacy/collected_data/crash_data/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects crash data. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/crash_data/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links crash data to the user's identity.
+ </member>
+ <member name="privacy/collected_data/crash_data/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses crash data for tracking.
+ </member>
+ <member name="privacy/collected_data/credit_info/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects credit information.
+ </member>
+ <member name="privacy/collected_data/credit_info/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects credit information. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/credit_info/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links credit information to the user's identity.
+ </member>
+ <member name="privacy/collected_data/credit_info/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses credit information for tracking.
+ </member>
+ <member name="privacy/collected_data/customer_support/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects customer support data.
+ </member>
+ <member name="privacy/collected_data/customer_support/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects customer support data. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/customer_support/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links customer support data to the user's identity.
+ </member>
+ <member name="privacy/collected_data/customer_support/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses customer support data for tracking.
+ </member>
+ <member name="privacy/collected_data/device_id/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects device IDs.
+ </member>
+ <member name="privacy/collected_data/device_id/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects device IDs. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/device_id/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links device IDs to the user's identity.
+ </member>
+ <member name="privacy/collected_data/device_id/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses device IDs for tracking.
+ </member>
+ <member name="privacy/collected_data/email_address/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects email address.
+ </member>
+ <member name="privacy/collected_data/email_address/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects email address. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/email_address/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links email address to the user's identity.
+ </member>
+ <member name="privacy/collected_data/email_address/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses email address for tracking.
+ </member>
+ <member name="privacy/collected_data/emails_or_text_messages/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects emails or text messages.
+ </member>
+ <member name="privacy/collected_data/emails_or_text_messages/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects emails or text messages. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/emails_or_text_messages/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links emails or text messages to the user's identity.
+ </member>
+ <member name="privacy/collected_data/emails_or_text_messages/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses emails or text messages for tracking.
+ </member>
+ <member name="privacy/collected_data/environment_scanning/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects environment scanning data.
+ </member>
+ <member name="privacy/collected_data/environment_scanning/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects environment scanning data. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/environment_scanning/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links environment scanning data to the user's identity.
+ </member>
+ <member name="privacy/collected_data/environment_scanning/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses environment scanning data for tracking.
+ </member>
+ <member name="privacy/collected_data/fitness/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects fitness and exercise data.
+ </member>
+ <member name="privacy/collected_data/fitness/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects fitness and exercise data. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/fitness/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links fitness and exercise data to the user's identity.
+ </member>
+ <member name="privacy/collected_data/fitness/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses fitness and exercise data for tracking.
+ </member>
+ <member name="privacy/collected_data/gameplay_content/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects gameplay content.
+ </member>
+ <member name="privacy/collected_data/gameplay_content/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects gameplay content. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/gameplay_content/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links gameplay content to the user's identity.
+ </member>
+ <member name="privacy/collected_data/gameplay_content/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses gameplay content for tracking.
+ </member>
+ <member name="privacy/collected_data/hands/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects user's hand structure and hand movements.
+ </member>
+ <member name="privacy/collected_data/hands/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects user's hand structure and hand movements. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/hands/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links user's hand structure and hand movements to the user's identity.
+ </member>
+ <member name="privacy/collected_data/hands/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses user's hand structure and hand movements for tracking.
+ </member>
+ <member name="privacy/collected_data/head/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects user's head movement.
+ </member>
+ <member name="privacy/collected_data/head/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects user's head movement. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/head/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links user's head movement to the user's identity.
+ </member>
+ <member name="privacy/collected_data/head/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses user's head movement for tracking.
+ </member>
+ <member name="privacy/collected_data/health/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects health and medical data.
+ </member>
+ <member name="privacy/collected_data/health/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects health and medical data. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/health/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links health and medical data to the user's identity.
+ </member>
+ <member name="privacy/collected_data/health/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses health and medical data for tracking.
+ </member>
+ <member name="privacy/collected_data/name/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects user's name.
+ </member>
+ <member name="privacy/collected_data/name/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects user's name. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/name/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links user's name to the user's identity.
+ </member>
+ <member name="privacy/collected_data/name/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses user's name for tracking.
+ </member>
+ <member name="privacy/collected_data/other_contact_info/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects any other contact information.
+ </member>
+ <member name="privacy/collected_data/other_contact_info/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects any other contact information. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/other_contact_info/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links any other contact information to the user's identity.
+ </member>
+ <member name="privacy/collected_data/other_contact_info/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses any other contact information for tracking.
+ </member>
+ <member name="privacy/collected_data/other_data_types/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects any other data.
+ </member>
+ <member name="privacy/collected_data/other_data_types/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects any other data. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/other_data_types/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links any other data to the user's identity.
+ </member>
+ <member name="privacy/collected_data/other_data_types/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses any other data for tracking.
+ </member>
+ <member name="privacy/collected_data/other_diagnostic_data/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects any other diagnostic data.
+ </member>
+ <member name="privacy/collected_data/other_diagnostic_data/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects any other diagnostic data. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/other_diagnostic_data/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links any other diagnostic data to the user's identity.
+ </member>
+ <member name="privacy/collected_data/other_diagnostic_data/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses any other diagnostic data for tracking.
+ </member>
+ <member name="privacy/collected_data/other_financial_info/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects any other financial information.
+ </member>
+ <member name="privacy/collected_data/other_financial_info/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects any other financial information. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/other_financial_info/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links any other financial information to the user's identity.
+ </member>
+ <member name="privacy/collected_data/other_financial_info/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses any other financial information for tracking.
+ </member>
+ <member name="privacy/collected_data/other_usage_data/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects any other usage data.
+ </member>
+ <member name="privacy/collected_data/other_usage_data/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects any other usage data. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/other_usage_data/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links any other usage data to the user's identity.
+ </member>
+ <member name="privacy/collected_data/other_usage_data/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses any other usage data for tracking.
+ </member>
+ <member name="privacy/collected_data/other_user_content/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects any other user generated content.
+ </member>
+ <member name="privacy/collected_data/other_user_content/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects any other user generated content. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/other_user_content/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links any other user generated content to the user's identity.
+ </member>
+ <member name="privacy/collected_data/other_user_content/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses any other user generated content for tracking.
+ </member>
+ <member name="privacy/collected_data/payment_info/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects payment information.
+ </member>
+ <member name="privacy/collected_data/payment_info/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects payment information. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/payment_info/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links payment information to the user's identity.
+ </member>
+ <member name="privacy/collected_data/payment_info/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses payment information for tracking.
+ </member>
+ <member name="privacy/collected_data/performance_data/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects performance data.
+ </member>
+ <member name="privacy/collected_data/performance_data/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects performance data. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/performance_data/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links performance data to the user's identity.
+ </member>
+ <member name="privacy/collected_data/performance_data/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses performance data for tracking.
+ </member>
+ <member name="privacy/collected_data/phone_number/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects phone number.
+ </member>
+ <member name="privacy/collected_data/phone_number/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects phone number. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/phone_number/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links phone number to the user's identity.
+ </member>
+ <member name="privacy/collected_data/phone_number/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses phone number for tracking.
+ </member>
+ <member name="privacy/collected_data/photos_or_videos/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects photos or videos.
+ </member>
+ <member name="privacy/collected_data/photos_or_videos/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects photos or videos. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/photos_or_videos/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links photos or videos to the user's identity.
+ </member>
+ <member name="privacy/collected_data/photos_or_videos/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses photos or videos for tracking.
+ </member>
+ <member name="privacy/collected_data/physical_address/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects physical address.
+ </member>
+ <member name="privacy/collected_data/physical_address/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects physical address. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/physical_address/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links physical address to the user's identity.
+ </member>
+ <member name="privacy/collected_data/physical_address/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses physical address for tracking.
+ </member>
+ <member name="privacy/collected_data/precise_location/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects precise location data.
+ </member>
+ <member name="privacy/collected_data/precise_location/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects precise location data. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/precise_location/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links precise location data to the user's identity.
+ </member>
+ <member name="privacy/collected_data/precise_location/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses precise location data for tracking.
+ </member>
+ <member name="privacy/collected_data/product_interaction/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects product interaction data.
+ </member>
+ <member name="privacy/collected_data/product_interaction/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects product interaction data. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/product_interaction/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links product interaction data to the user's identity.
+ </member>
+ <member name="privacy/collected_data/product_interaction/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses product interaction data for tracking.
+ </member>
+ <member name="privacy/collected_data/purchase_history/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects purchase history.
+ </member>
+ <member name="privacy/collected_data/purchase_history/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects purchase history. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/purchase_history/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links purchase history to the user's identity.
+ </member>
+ <member name="privacy/collected_data/purchase_history/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses purchase history for tracking.
+ </member>
+ <member name="privacy/collected_data/search_hhistory/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects search history.
+ </member>
+ <member name="privacy/collected_data/search_hhistory/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects search history. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/search_hhistory/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links search history to the user's identity.
+ </member>
+ <member name="privacy/collected_data/search_hhistory/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses search history for tracking.
+ </member>
+ <member name="privacy/collected_data/sensitive_info/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects sensitive user information.
+ </member>
+ <member name="privacy/collected_data/sensitive_info/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects sensitive user information. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/sensitive_info/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links sensitive user information to the user's identity.
+ </member>
+ <member name="privacy/collected_data/sensitive_info/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses sensitive user information for tracking.
+ </member>
+ <member name="privacy/collected_data/user_id/collected" type="bool" setter="" getter="">
+ Indicates whether your app collects user IDs.
+ </member>
+ <member name="privacy/collected_data/user_id/collection_purposes" type="int" setter="" getter="">
+ The reasons your app collects user IDs. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_data_use_in_privacy_manifests]Describing data use in privacy manifests[/url].
+ </member>
+ <member name="privacy/collected_data/user_id/linked_to_user" type="bool" setter="" getter="">
+ Indicates whether your app links user IDs to the user's identity.
+ </member>
+ <member name="privacy/collected_data/user_id/used_for_tracking" type="bool" setter="" getter="">
+ Indicates whether your app uses user IDs for tracking.
+ </member>
<member name="privacy/desktop_folder_usage_description" type="String" setter="" getter="">
A message displayed when requesting access to the user's "Desktop" folder (in English).
</member>
@@ -259,6 +679,12 @@
<member name="privacy/removable_volumes_usage_description_localized" type="Dictionary" setter="" getter="">
A message displayed when requesting access to the user's removable drives (localized).
</member>
+ <member name="privacy/tracking_domains" type="PackedStringArray" setter="" getter="">
+ The list of internet domains your app connects to that engage in tracking. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files]Privacy manifest files[/url].
+ </member>
+ <member name="privacy/tracking_enabled" type="bool" setter="" getter="">
+ Indicates whether your app uses data for tracking. See [url=https://developer.apple.com/documentation/bundleresources/privacy_manifest_files]Privacy manifest files[/url].
+ </member>
<member name="ssh_remote_deploy/cleanup_script" type="String" setter="" getter="">
Script code to execute on the remote host when app is finished.
The following variables can be used in the script:
diff --git a/platform/macos/export/export_plugin.cpp b/platform/macos/export/export_plugin.cpp
index 96d64ef209..9c9d8fc1a4 100644
--- a/platform/macos/export/export_plugin.cpp
+++ b/platform/macos/export/export_plugin.cpp
@@ -325,6 +325,11 @@ bool EditorExportPlatformMacOS::get_export_option_visibility(const EditorExportP
}
} break;
}
+
+ bool advanced_options_enabled = p_preset->are_advanced_options_enabled();
+ if (p_option.begins_with("privacy")) {
+ return advanced_options_enabled;
+ }
}
// These entitlements are required to run managed code, and are always enabled in Mono builds.
@@ -373,6 +378,58 @@ List<String> EditorExportPlatformMacOS::get_binary_extensions(const Ref<EditorEx
return list;
}
+struct DataCollectionInfo {
+ String prop_name;
+ String type_name;
+};
+
+static const DataCollectionInfo data_collect_type_info[] = {
+ { "name", "NSPrivacyCollectedDataTypeName" },
+ { "email_address", "NSPrivacyCollectedDataTypeEmailAddress" },
+ { "phone_number", "NSPrivacyCollectedDataTypePhoneNumber" },
+ { "physical_address", "NSPrivacyCollectedDataTypePhysicalAddress" },
+ { "other_contact_info", "NSPrivacyCollectedDataTypeOtherUserContactInfo" },
+ { "health", "NSPrivacyCollectedDataTypeHealth" },
+ { "fitness", "NSPrivacyCollectedDataTypeFitness" },
+ { "payment_info", "NSPrivacyCollectedDataTypePaymentInfo" },
+ { "credit_info", "NSPrivacyCollectedDataTypeCreditInfo" },
+ { "other_financial_info", "NSPrivacyCollectedDataTypeOtherFinancialInfo" },
+ { "precise_location", "NSPrivacyCollectedDataTypePreciseLocation" },
+ { "coarse_location", "NSPrivacyCollectedDataTypeCoarseLocation" },
+ { "sensitive_info", "NSPrivacyCollectedDataTypeSensitiveInfo" },
+ { "contacts", "NSPrivacyCollectedDataTypeContacts" },
+ { "emails_or_text_messages", "NSPrivacyCollectedDataTypeEmailsOrTextMessages" },
+ { "photos_or_videos", "NSPrivacyCollectedDataTypePhotosorVideos" },
+ { "audio_data", "NSPrivacyCollectedDataTypeAudioData" },
+ { "gameplay_content", "NSPrivacyCollectedDataTypeGameplayContent" },
+ { "customer_support", "NSPrivacyCollectedDataTypeCustomerSupport" },
+ { "other_user_content", "NSPrivacyCollectedDataTypeOtherUserContent" },
+ { "browsing_history", "NSPrivacyCollectedDataTypeBrowsingHistory" },
+ { "search_hhistory", "NSPrivacyCollectedDataTypeSearchHistory" },
+ { "user_id", "NSPrivacyCollectedDataTypeUserID" },
+ { "device_id", "NSPrivacyCollectedDataTypeDeviceID" },
+ { "purchase_history", "NSPrivacyCollectedDataTypePurchaseHistory" },
+ { "product_interaction", "NSPrivacyCollectedDataTypeProductInteraction" },
+ { "advertising_data", "NSPrivacyCollectedDataTypeAdvertisingData" },
+ { "other_usage_data", "NSPrivacyCollectedDataTypeOtherUsageData" },
+ { "crash_data", "NSPrivacyCollectedDataTypeCrashData" },
+ { "performance_data", "NSPrivacyCollectedDataTypePerformanceData" },
+ { "other_diagnostic_data", "NSPrivacyCollectedDataTypeOtherDiagnosticData" },
+ { "environment_scanning", "NSPrivacyCollectedDataTypeEnvironmentScanning" },
+ { "hands", "NSPrivacyCollectedDataTypeHands" },
+ { "head", "NSPrivacyCollectedDataTypeHead" },
+ { "other_data_types", "NSPrivacyCollectedDataTypeOtherDataTypes" },
+};
+
+static const DataCollectionInfo data_collect_purpose_info[] = {
+ { "Analytics", "NSPrivacyCollectedDataTypePurposeAnalytics" },
+ { "App Functionality", "NSPrivacyCollectedDataTypePurposeAppFunctionality" },
+ { "Developer Advertising", "NSPrivacyCollectedDataTypePurposeDeveloperAdvertising" },
+ { "Third-party Advertising", "NSPrivacyCollectedDataTypePurposeThirdPartyAdvertising" },
+ { "Product Personalization", "NSPrivacyCollectedDataTypePurposeProductPersonalization" },
+ { "Other", "NSPrivacyCollectedDataTypePurposeOther" },
+};
+
void EditorExportPlatformMacOS::get_export_options(List<ExportOption> *r_options) const {
#ifdef MACOS_ENABLED
r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "export/distribution_type", PROPERTY_HINT_ENUM, "Testing,Distribution,App Store"), 1, true));
@@ -484,6 +541,25 @@ void EditorExportPlatformMacOS::get_export_options(List<ExportOption> *r_options
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "privacy/removable_volumes_usage_description", PROPERTY_HINT_PLACEHOLDER_TEXT, "Provide a message if you need to use removable volumes"), "", false, true));
r_options->push_back(ExportOption(PropertyInfo(Variant::DICTIONARY, "privacy/removable_volumes_usage_description_localized", PROPERTY_HINT_LOCALIZABLE_STRING), Dictionary()));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "privacy/tracking_enabled"), false));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::PACKED_STRING_ARRAY, "privacy/tracking_domains"), Vector<String>()));
+
+ {
+ String hint;
+ for (uint64_t i = 0; i < sizeof(data_collect_purpose_info) / sizeof(data_collect_purpose_info[0]); ++i) {
+ if (i != 0) {
+ hint += ",";
+ }
+ hint += vformat("%s:%d", data_collect_purpose_info[i].prop_name, (1 << i));
+ }
+ for (uint64_t i = 0; i < sizeof(data_collect_type_info) / sizeof(data_collect_type_info[0]); ++i) {
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, vformat("privacy/collected_data/%s/collected", data_collect_type_info[i].prop_name)), false));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, vformat("privacy/collected_data/%s/linked_to_user", data_collect_type_info[i].prop_name)), false));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, vformat("privacy/collected_data/%s/used_for_tracking", data_collect_type_info[i].prop_name)), false));
+ r_options->push_back(ExportOption(PropertyInfo(Variant::INT, vformat("privacy/collected_data/%s/collection_purposes", data_collect_type_info[i].prop_name), PROPERTY_HINT_FLAGS, hint), 0));
+ }
+ }
+
String run_script = "#!/usr/bin/env bash\n"
"unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\"\n"
"open \"{temp_dir}/{exe_name}.app\" --args {cmd_args}";
@@ -644,6 +720,85 @@ void EditorExportPlatformMacOS::_make_icon(const Ref<EditorExportPreset> &p_pres
p_data = data;
}
+void EditorExportPlatformMacOS::_fix_privacy_manifest(const Ref<EditorExportPreset> &p_preset, Vector<uint8_t> &plist) {
+ String str;
+ String strnew;
+ str.parse_utf8((const char *)plist.ptr(), plist.size());
+ Vector<String> lines = str.split("\n");
+ for (int i = 0; i < lines.size(); i++) {
+ if (lines[i].find("$priv_collection") != -1) {
+ bool section_opened = false;
+ for (uint64_t j = 0; j < sizeof(data_collect_type_info) / sizeof(data_collect_type_info[0]); ++j) {
+ bool data_collected = p_preset->get(vformat("privacy/collected_data/%s/collected", data_collect_type_info[j].prop_name));
+ bool linked = p_preset->get(vformat("privacy/collected_data/%s/linked_to_user", data_collect_type_info[j].prop_name));
+ bool tracking = p_preset->get(vformat("privacy/collected_data/%s/used_for_tracking", data_collect_type_info[j].prop_name));
+ int purposes = p_preset->get(vformat("privacy/collected_data/%s/collection_purposes", data_collect_type_info[j].prop_name));
+ if (data_collected) {
+ if (!section_opened) {
+ section_opened = true;
+ strnew += "\t<key>NSPrivacyCollectedDataTypes</key>\n";
+ strnew += "\t<array>\n";
+ }
+ strnew += "\t\t<dict>\n";
+ strnew += "\t\t\t<key>NSPrivacyCollectedDataType</key>\n";
+ strnew += vformat("\t\t\t<string>%s</string>\n", data_collect_type_info[j].type_name);
+ strnew += "\t\t\t\t<key>NSPrivacyCollectedDataTypeLinked</key>\n";
+ if (linked) {
+ strnew += "\t\t\t\t<true/>\n";
+ } else {
+ strnew += "\t\t\t\t<false/>\n";
+ }
+ strnew += "\t\t\t\t<key>NSPrivacyCollectedDataTypeTracking</key>\n";
+ if (tracking) {
+ strnew += "\t\t\t\t<true/>\n";
+ } else {
+ strnew += "\t\t\t\t<false/>\n";
+ }
+ if (purposes != 0) {
+ strnew += "\t\t\t\t<key>NSPrivacyCollectedDataTypePurposes</key>\n";
+ strnew += "\t\t\t\t<array>\n";
+ for (uint64_t k = 0; k < sizeof(data_collect_purpose_info) / sizeof(data_collect_purpose_info[0]); ++k) {
+ if (purposes & (1 << k)) {
+ strnew += vformat("\t\t\t\t\t<string>%s</string>\n", data_collect_purpose_info[k].type_name);
+ }
+ }
+ strnew += "\t\t\t\t</array>\n";
+ }
+ strnew += "\t\t\t</dict>\n";
+ }
+ }
+ if (section_opened) {
+ strnew += "\t</array>\n";
+ }
+ } else if (lines[i].find("$priv_tracking") != -1) {
+ bool tracking = p_preset->get("privacy/tracking_enabled");
+ strnew += "\t<key>NSPrivacyTracking</key>\n";
+ if (tracking) {
+ strnew += "\t<true/>\n";
+ } else {
+ strnew += "\t<false/>\n";
+ }
+ Vector<String> tracking_domains = p_preset->get("privacy/tracking_domains");
+ if (!tracking_domains.is_empty()) {
+ strnew += "\t<key>NSPrivacyTrackingDomains</key>\n";
+ strnew += "\t<array>\n";
+ for (const String &E : tracking_domains) {
+ strnew += "\t\t<string>" + E + "</string>\n";
+ }
+ strnew += "\t</array>\n";
+ }
+ } else {
+ strnew += lines[i] + "\n";
+ }
+ }
+
+ CharString cs = strnew.utf8();
+ plist.resize(cs.size() - 1);
+ for (int i = 0; i < cs.size() - 1; i++) {
+ plist.write[i] = cs[i];
+ }
+}
+
void EditorExportPlatformMacOS::_fix_plist(const Ref<EditorExportPreset> &p_preset, Vector<uint8_t> &plist, const String &p_binary) {
String str;
String strnew;
@@ -1674,6 +1829,10 @@ Error EditorExportPlatformMacOS::export_project(const Ref<EditorExportPreset> &p
_fix_plist(p_preset, data, pkg_name);
}
+ if (file == "Contents/Resources/PrivacyInfo.xcprivacy") {
+ _fix_privacy_manifest(p_preset, data);
+ }
+
if (file.begins_with("Contents/MacOS/godot_")) {
if (file != "Contents/MacOS/" + binary_to_use) {
ret = unzGoToNextFile(src_pkg_zip);
diff --git a/platform/macos/export/export_plugin.h b/platform/macos/export/export_plugin.h
index 2d615abede..6134d756b9 100644
--- a/platform/macos/export/export_plugin.h
+++ b/platform/macos/export/export_plugin.h
@@ -85,6 +85,7 @@ class EditorExportPlatformMacOS : public EditorExportPlatform {
OS::ProcessID ssh_pid = 0;
int menu_options = 0;
+ void _fix_privacy_manifest(const Ref<EditorExportPreset> &p_preset, Vector<uint8_t> &plist);
void _fix_plist(const Ref<EditorExportPreset> &p_preset, Vector<uint8_t> &plist, const String &p_binary);
void _make_icon(const Ref<EditorExportPreset> &p_preset, const Ref<Image> &p_icon, Vector<uint8_t> &p_data);
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000000..f1ea10fbae
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,16 @@
+[tool.mypy]
+ignore_missing_imports = true
+disallow_any_generics = true
+no_implicit_optional = true
+pretty = true
+show_column_numbers = true
+warn_redundant_casts = true
+warn_return_any = true
+warn_unreachable = true
+namespace_packages = true
+explicit_package_bases = true
+exclude = ["thirdparty/"]
+
+[tool.black]
+line-length = 120
+extend-exclude = ".*thirdparty/.*"
diff --git a/scene/2d/physics/joints/joint_2d.cpp b/scene/2d/physics/joints/joint_2d.cpp
index 6ed64960e8..a32bcbae78 100644
--- a/scene/2d/physics/joints/joint_2d.cpp
+++ b/scene/2d/physics/joints/joint_2d.cpp
@@ -116,8 +116,12 @@ void Joint2D::_update_joint(bool p_only_free) {
ba = body_a->get_rid();
bb = body_b->get_rid();
- body_a->connect(SceneStringName(tree_exiting), callable_mp(this, &Joint2D::_body_exit_tree));
- body_b->connect(SceneStringName(tree_exiting), callable_mp(this, &Joint2D::_body_exit_tree));
+ if (!body_a->is_connected(SceneStringName(tree_exiting), callable_mp(this, &Joint2D::_body_exit_tree))) {
+ body_a->connect(SceneStringName(tree_exiting), callable_mp(this, &Joint2D::_body_exit_tree));
+ }
+ if (!body_b->is_connected(SceneStringName(tree_exiting), callable_mp(this, &Joint2D::_body_exit_tree))) {
+ body_b->connect(SceneStringName(tree_exiting), callable_mp(this, &Joint2D::_body_exit_tree));
+ }
PhysicsServer2D::get_singleton()->joint_disable_collisions_between_bodies(joint, exclude_from_collision);
}
diff --git a/scene/2d/touch_screen_button.cpp b/scene/2d/touch_screen_button.cpp
index f682471a48..ff409272c5 100644
--- a/scene/2d/touch_screen_button.cpp
+++ b/scene/2d/touch_screen_button.cpp
@@ -305,7 +305,7 @@ void TouchScreenButton::_press(int p_finger_pressed) {
get_viewport()->push_input(iea, true);
}
- emit_signal(SNAME("pressed"));
+ emit_signal(SceneStringName(pressed));
queue_redraw();
}
@@ -373,7 +373,7 @@ bool TouchScreenButton::_set(const StringName &p_name, const Variant &p_value) {
if (p_name == CoreStringName(normal)) { // Compatibility with Godot 3.x.
set_texture_normal(p_value);
return true;
- } else if (p_name == SNAME("pressed")) { // Compatibility with Godot 3.x.
+ } else if (p_name == SceneStringName(pressed)) { // Compatibility with Godot 3.x.
set_texture_pressed(p_value);
return true;
}
diff --git a/scene/3d/cpu_particles_3d.cpp b/scene/3d/cpu_particles_3d.cpp
index 9c753037a5..03fe5e1fad 100644
--- a/scene/3d/cpu_particles_3d.cpp
+++ b/scene/3d/cpu_particles_3d.cpp
@@ -879,7 +879,7 @@ void CPUParticles3D::_particles_process(double p_delta) {
} break;
case EMISSION_SHAPE_RING: {
real_t ring_random_angle = Math::randf() * Math_TAU;
- real_t ring_random_radius = Math::sqrt(Math::randf() * (emission_ring_radius - emission_ring_inner_radius * emission_ring_inner_radius) + emission_ring_inner_radius * emission_ring_inner_radius);
+ real_t ring_random_radius = Math::sqrt(Math::randf() * (emission_ring_radius * emission_ring_radius - emission_ring_inner_radius * emission_ring_inner_radius) + emission_ring_inner_radius * emission_ring_inner_radius);
Vector3 axis = emission_ring_axis == Vector3(0.0, 0.0, 0.0) ? Vector3(0.0, 0.0, 1.0) : emission_ring_axis.normalized();
Vector3 ortho_axis;
if (axis.abs() == Vector3(1.0, 0.0, 0.0)) {
diff --git a/scene/3d/lightmap_gi.cpp b/scene/3d/lightmap_gi.cpp
index cc923b6676..ef492a6994 100644
--- a/scene/3d/lightmap_gi.cpp
+++ b/scene/3d/lightmap_gi.cpp
@@ -1102,7 +1102,7 @@ LightmapGI::BakeError LightmapGI::bake(Node *p_from_node, String p_image_data_pa
}
}
- Lightmapper::BakeError bake_err = lightmapper->bake(Lightmapper::BakeQuality(bake_quality), use_denoiser, denoiser_strength, bounces, bounce_indirect_energy, bias, max_texture_size, directional, use_texture_for_bounces, Lightmapper::GenerateProbes(gen_probes), environment_image, environment_transform, _lightmap_bake_step_function, &bsud, exposure_normalization);
+ Lightmapper::BakeError bake_err = lightmapper->bake(Lightmapper::BakeQuality(bake_quality), use_denoiser, denoiser_strength, denoiser_range, bounces, bounce_indirect_energy, bias, max_texture_size, directional, use_texture_for_bounces, Lightmapper::GenerateProbes(gen_probes), environment_image, environment_transform, _lightmap_bake_step_function, &bsud, exposure_normalization);
if (bake_err == Lightmapper::BAKE_ERROR_LIGHTMAP_TOO_SMALL) {
return BAKE_ERROR_TEXTURE_SIZE_TOO_SMALL;
@@ -1450,6 +1450,14 @@ float LightmapGI::get_denoiser_strength() const {
return denoiser_strength;
}
+void LightmapGI::set_denoiser_range(int p_denoiser_range) {
+ denoiser_range = p_denoiser_range;
+}
+
+int LightmapGI::get_denoiser_range() const {
+ return denoiser_range;
+}
+
void LightmapGI::set_directional(bool p_enable) {
directional = p_enable;
}
@@ -1593,6 +1601,9 @@ void LightmapGI::_validate_property(PropertyInfo &p_property) const {
if (p_property.name == "denoiser_strength" && !use_denoiser) {
p_property.usage = PROPERTY_USAGE_NONE;
}
+ if (p_property.name == "denoiser_range" && !use_denoiser) {
+ p_property.usage = PROPERTY_USAGE_NONE;
+ }
}
void LightmapGI::_bind_methods() {
@@ -1638,6 +1649,9 @@ void LightmapGI::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_denoiser_strength", "denoiser_strength"), &LightmapGI::set_denoiser_strength);
ClassDB::bind_method(D_METHOD("get_denoiser_strength"), &LightmapGI::get_denoiser_strength);
+ ClassDB::bind_method(D_METHOD("set_denoiser_range", "denoiser_range"), &LightmapGI::set_denoiser_range);
+ ClassDB::bind_method(D_METHOD("get_denoiser_range"), &LightmapGI::get_denoiser_range);
+
ClassDB::bind_method(D_METHOD("set_interior", "enable"), &LightmapGI::set_interior);
ClassDB::bind_method(D_METHOD("is_interior"), &LightmapGI::is_interior);
@@ -1661,6 +1675,7 @@ void LightmapGI::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "interior"), "set_interior", "is_interior");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_denoiser"), "set_use_denoiser", "is_using_denoiser");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "denoiser_strength", PROPERTY_HINT_RANGE, "0.001,0.2,0.001,or_greater"), "set_denoiser_strength", "get_denoiser_strength");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "denoiser_range", PROPERTY_HINT_RANGE, "1,20"), "set_denoiser_range", "get_denoiser_range");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "bias", PROPERTY_HINT_RANGE, "0.00001,0.1,0.00001,or_greater"), "set_bias", "get_bias");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "texel_scale", PROPERTY_HINT_RANGE, "0.01,100.0,0.01"), "set_texel_scale", "get_texel_scale");
ADD_PROPERTY(PropertyInfo(Variant::INT, "max_texture_size", PROPERTY_HINT_RANGE, "2048,16384,1"), "set_max_texture_size", "get_max_texture_size");
diff --git a/scene/3d/lightmap_gi.h b/scene/3d/lightmap_gi.h
index 765e4a731d..527667177b 100644
--- a/scene/3d/lightmap_gi.h
+++ b/scene/3d/lightmap_gi.h
@@ -156,6 +156,7 @@ private:
BakeQuality bake_quality = BAKE_QUALITY_MEDIUM;
bool use_denoiser = true;
float denoiser_strength = 0.1f;
+ int denoiser_range = 10;
int bounces = 3;
float bounce_indirect_energy = 1.0;
float bias = 0.0005;
@@ -256,6 +257,9 @@ public:
void set_denoiser_strength(float p_denoiser_strength);
float get_denoiser_strength() const;
+ void set_denoiser_range(int p_denoiser_range);
+ int get_denoiser_range() const;
+
void set_directional(bool p_enable);
bool is_directional() const;
diff --git a/scene/3d/lightmapper.h b/scene/3d/lightmapper.h
index 521013d600..39181ad9a2 100644
--- a/scene/3d/lightmapper.h
+++ b/scene/3d/lightmapper.h
@@ -180,7 +180,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) = 0;
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) = 0;
virtual void add_probe(const Vector3 &p_position) = 0;
- 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_step_userdata = nullptr, float p_exposure_normalization = 1.0) = 0;
+ 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_step_userdata = nullptr, float p_exposure_normalization = 1.0) = 0;
virtual int get_bake_texture_count() const = 0;
virtual Ref<Image> get_bake_texture(int p_index) const = 0;
diff --git a/scene/3d/node_3d.cpp b/scene/3d/node_3d.cpp
index b5fa48c9c1..2e08afb30d 100644
--- a/scene/3d/node_3d.cpp
+++ b/scene/3d/node_3d.cpp
@@ -192,7 +192,7 @@ void Node3D::_notification(int p_what) {
ERR_FAIL_NULL(data.viewport);
if (get_script_instance()) {
- get_script_instance()->call(SceneStringName(_enter_world));
+ get_script_instance()->call(SNAME("_enter_world"));
}
#ifdef TOOLS_ENABLED
@@ -210,7 +210,7 @@ void Node3D::_notification(int p_what) {
#endif
if (get_script_instance()) {
- get_script_instance()->call(SceneStringName(_exit_world));
+ get_script_instance()->call(SNAME("_exit_world"));
}
data.viewport = nullptr;
@@ -582,7 +582,7 @@ void Node3D::set_subgizmo_selection(Ref<Node3DGizmo> p_gizmo, int p_id, Transfor
}
if (is_part_of_edited_scene()) {
- get_tree()->call_group_flags(SceneTree::GROUP_CALL_DEFERRED, SceneStringName(_spatial_editor_group), SceneStringName(_set_subgizmo_selection), this, p_gizmo, p_id, p_transform);
+ get_tree()->call_group_flags(SceneTree::GROUP_CALL_DEFERRED, SceneStringName(_spatial_editor_group), SNAME("_set_subgizmo_selection"), this, p_gizmo, p_id, p_transform);
}
#endif
}
@@ -599,7 +599,7 @@ void Node3D::clear_subgizmo_selection() {
}
if (is_part_of_edited_scene()) {
- get_tree()->call_group_flags(SceneTree::GROUP_CALL_DEFERRED, SceneStringName(_spatial_editor_group), SceneStringName(_clear_subgizmo_selection), this);
+ get_tree()->call_group_flags(SceneTree::GROUP_CALL_DEFERRED, SceneStringName(_spatial_editor_group), SNAME("_clear_subgizmo_selection"), this);
}
#endif
}
diff --git a/scene/3d/physics/joints/joint_3d.cpp b/scene/3d/physics/joints/joint_3d.cpp
index 8feec9e0e7..47c89f37e2 100644
--- a/scene/3d/physics/joints/joint_3d.cpp
+++ b/scene/3d/physics/joints/joint_3d.cpp
@@ -106,12 +106,16 @@ void Joint3D::_update_joint(bool p_only_free) {
if (body_a) {
ba = body_a->get_rid();
- body_a->connect(SceneStringName(tree_exiting), callable_mp(this, &Joint3D::_body_exit_tree));
+ if (!body_a->is_connected(SceneStringName(tree_exiting), callable_mp(this, &Joint3D::_body_exit_tree))) {
+ body_a->connect(SceneStringName(tree_exiting), callable_mp(this, &Joint3D::_body_exit_tree));
+ }
}
if (body_b) {
bb = body_b->get_rid();
- body_b->connect(SceneStringName(tree_exiting), callable_mp(this, &Joint3D::_body_exit_tree));
+ if (!body_b->is_connected(SceneStringName(tree_exiting), callable_mp(this, &Joint3D::_body_exit_tree))) {
+ body_b->connect(SceneStringName(tree_exiting), callable_mp(this, &Joint3D::_body_exit_tree));
+ }
}
PhysicsServer3D::get_singleton()->joint_disable_collisions_between_bodies(joint, exclude_from_collision);
diff --git a/scene/3d/visual_instance_3d.cpp b/scene/3d/visual_instance_3d.cpp
index f129a6c810..f14ae3a285 100644
--- a/scene/3d/visual_instance_3d.cpp
+++ b/scene/3d/visual_instance_3d.cpp
@@ -276,12 +276,12 @@ bool GeometryInstance3D::_set(const StringName &p_name, const Variant &p_value)
return true;
}
#ifndef DISABLE_DEPRECATED
- if (p_name == SceneStringName(use_in_baked_light) && bool(p_value)) {
+ if (p_name == SNAME("use_in_baked_light") && bool(p_value)) {
set_gi_mode(GI_MODE_STATIC);
return true;
}
- if (p_name == SceneStringName(use_dynamic_gi) && bool(p_value)) {
+ if (p_name == SNAME("use_dynamic_gi") && bool(p_value)) {
set_gi_mode(GI_MODE_DYNAMIC);
return true;
}
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp
index 21820d399c..01e3cce78b 100644
--- a/scene/gui/base_button.cpp
+++ b/scene/gui/base_button.cpp
@@ -134,7 +134,7 @@ void BaseButton::_notification(int p_what) {
void BaseButton::_pressed() {
GDVIRTUAL_CALL(_pressed);
pressed();
- emit_signal(SNAME("pressed"));
+ emit_signal(SceneStringName(pressed));
}
void BaseButton::_toggled(bool p_pressed) {
@@ -161,7 +161,7 @@ void BaseButton::on_action_event(Ref<InputEvent> p_event) {
status.pressed = !status.pressed;
_unpress_group();
if (button_group.is_valid()) {
- button_group->emit_signal(SNAME("pressed"), this);
+ button_group->emit_signal(SceneStringName(pressed), this);
}
_toggled(status.pressed);
_pressed();
@@ -225,7 +225,7 @@ void BaseButton::set_pressed(bool p_pressed) {
if (p_pressed) {
_unpress_group();
if (button_group.is_valid()) {
- button_group->emit_signal(SNAME("pressed"), this);
+ button_group->emit_signal(SceneStringName(pressed), this);
}
}
_toggled(status.pressed);
@@ -367,7 +367,7 @@ void BaseButton::shortcut_input(const Ref<InputEvent> &p_event) {
_unpress_group();
if (button_group.is_valid()) {
- button_group->emit_signal(SNAME("pressed"), this);
+ button_group->emit_signal(SceneStringName(pressed), this);
}
_toggled(status.pressed);
diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp
index 65f3bcdbe7..245a086dda 100644
--- a/scene/gui/color_picker.cpp
+++ b/scene/gui/color_picker.cpp
@@ -95,7 +95,7 @@ void ColorPicker::_notification(int p_what) {
for (int i = 0; i < MODE_BUTTON_COUNT; i++) {
mode_btns[i]->begin_bulk_theme_override();
- mode_btns[i]->add_theme_style_override(SNAME("pressed"), theme_cache.mode_button_pressed);
+ mode_btns[i]->add_theme_style_override(SceneStringName(pressed), theme_cache.mode_button_pressed);
mode_btns[i]->add_theme_style_override(CoreStringName(normal), theme_cache.mode_button_normal);
mode_btns[i]->add_theme_style_override(SNAME("hover"), theme_cache.mode_button_hover);
mode_btns[i]->end_bulk_theme_override();
@@ -1836,11 +1836,11 @@ ColorPicker::ColorPicker() {
sample_hbc->add_child(btn_pick);
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_SCREEN_CAPTURE)) {
btn_pick->set_tooltip_text(ETR("Pick a color from the screen."));
- btn_pick->connect(SNAME("pressed"), callable_mp(this, &ColorPicker::_pick_button_pressed));
+ btn_pick->connect(SceneStringName(pressed), callable_mp(this, &ColorPicker::_pick_button_pressed));
} else {
// On unsupported platforms, use a legacy method for color picking.
btn_pick->set_tooltip_text(ETR("Pick a color from the application window."));
- btn_pick->connect(SNAME("pressed"), callable_mp(this, &ColorPicker::_pick_button_pressed_legacy));
+ btn_pick->connect(SceneStringName(pressed), callable_mp(this, &ColorPicker::_pick_button_pressed_legacy));
}
sample = memnew(TextureRect);
@@ -1883,7 +1883,7 @@ ColorPicker::ColorPicker() {
mode_btns[i]->set_toggle_mode(true);
mode_btns[i]->set_text(modes[i]->get_name());
mode_btns[i]->set_button_group(mode_group);
- mode_btns[i]->connect("pressed", callable_mp(this, &ColorPicker::set_color_mode).bind((ColorModeType)i));
+ mode_btns[i]->connect(SceneStringName(pressed), callable_mp(this, &ColorPicker::set_color_mode).bind((ColorModeType)i));
}
mode_btns[0]->set_pressed(true);
@@ -1936,7 +1936,7 @@ ColorPicker::ColorPicker() {
text_type->set_text("#");
text_type->set_tooltip_text(RTR("Switch between hexadecimal and code values."));
if (Engine::get_singleton()->is_editor_hint()) {
- text_type->connect("pressed", callable_mp(this, &ColorPicker::_text_type_toggled));
+ text_type->connect(SceneStringName(pressed), callable_mp(this, &ColorPicker::_text_type_toggled));
} else {
text_type->set_flat(true);
text_type->set_mouse_filter(MOUSE_FILTER_IGNORE);
@@ -2026,7 +2026,7 @@ ColorPicker::ColorPicker() {
btn_add_preset = memnew(Button);
btn_add_preset->set_icon_alignment(HORIZONTAL_ALIGNMENT_CENTER);
btn_add_preset->set_tooltip_text(ETR("Add current color as a preset."));
- btn_add_preset->connect("pressed", callable_mp(this, &ColorPicker::_add_preset_pressed));
+ btn_add_preset->connect(SceneStringName(pressed), callable_mp(this, &ColorPicker::_add_preset_pressed));
preset_container->add_child(btn_add_preset);
}
diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp
index 267096cd09..58961d370c 100644
--- a/scene/gui/dialogs.cpp
+++ b/scene/gui/dialogs.cpp
@@ -316,7 +316,7 @@ Button *AcceptDialog::add_button(const String &p_text, bool p_right, const Strin
}
if (!p_action.is_empty()) {
- button->connect("pressed", callable_mp(this, &AcceptDialog::_custom_action).bind(p_action));
+ button->connect(SceneStringName(pressed), callable_mp(this, &AcceptDialog::_custom_action).bind(p_action));
}
return button;
@@ -330,7 +330,7 @@ Button *AcceptDialog::add_cancel_button(const String &p_cancel) {
Button *b = swap_cancel_ok ? add_button(c, true) : add_button(c);
- b->connect("pressed", callable_mp(this, &AcceptDialog::_cancel_pressed));
+ b->connect(SceneStringName(pressed), callable_mp(this, &AcceptDialog::_cancel_pressed));
return b;
}
@@ -346,11 +346,11 @@ void AcceptDialog::remove_button(Button *p_button) {
}
p_button->disconnect(SceneStringName(visibility_changed), callable_mp(this, &AcceptDialog::_custom_button_visibility_changed));
- if (p_button->is_connected("pressed", callable_mp(this, &AcceptDialog::_custom_action))) {
- p_button->disconnect("pressed", callable_mp(this, &AcceptDialog::_custom_action));
+ if (p_button->is_connected(SceneStringName(pressed), callable_mp(this, &AcceptDialog::_custom_action))) {
+ p_button->disconnect(SceneStringName(pressed), callable_mp(this, &AcceptDialog::_custom_action));
}
- if (p_button->is_connected("pressed", callable_mp(this, &AcceptDialog::_cancel_pressed))) {
- p_button->disconnect("pressed", callable_mp(this, &AcceptDialog::_cancel_pressed));
+ if (p_button->is_connected(SceneStringName(pressed), callable_mp(this, &AcceptDialog::_cancel_pressed))) {
+ p_button->disconnect(SceneStringName(pressed), callable_mp(this, &AcceptDialog::_cancel_pressed));
}
if (right_spacer) {
@@ -433,7 +433,7 @@ AcceptDialog::AcceptDialog() {
buttons_hbox->add_child(ok_button);
buttons_hbox->add_spacer();
- ok_button->connect("pressed", callable_mp(this, &AcceptDialog::_ok_pressed));
+ ok_button->connect(SceneStringName(pressed), callable_mp(this, &AcceptDialog::_ok_pressed));
set_title(ETR("Alert!"));
}
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp
index 91424c0ffd..0c146ce173 100644
--- a/scene/gui/file_dialog.cpp
+++ b/scene/gui/file_dialog.cpp
@@ -1409,9 +1409,9 @@ FileDialog::FileDialog() {
hbc->add_child(dir_prev);
hbc->add_child(dir_next);
hbc->add_child(dir_up);
- dir_prev->connect("pressed", callable_mp(this, &FileDialog::_go_back));
- dir_next->connect("pressed", callable_mp(this, &FileDialog::_go_forward));
- dir_up->connect("pressed", callable_mp(this, &FileDialog::_go_up));
+ dir_prev->connect(SceneStringName(pressed), callable_mp(this, &FileDialog::_go_back));
+ dir_next->connect(SceneStringName(pressed), callable_mp(this, &FileDialog::_go_forward));
+ dir_up->connect(SceneStringName(pressed), callable_mp(this, &FileDialog::_go_up));
hbc->add_child(memnew(Label(ETR("Path:"))));
@@ -1430,7 +1430,7 @@ FileDialog::FileDialog() {
refresh = memnew(Button);
refresh->set_theme_type_variation("FlatButton");
refresh->set_tooltip_text(ETR("Refresh files."));
- refresh->connect("pressed", callable_mp(this, &FileDialog::update_file_list));
+ refresh->connect(SceneStringName(pressed), callable_mp(this, &FileDialog::update_file_list));
hbc->add_child(refresh);
show_hidden = memnew(Button);
@@ -1447,7 +1447,7 @@ FileDialog::FileDialog() {
makedir = memnew(Button);
makedir->set_theme_type_variation("FlatButton");
makedir->set_tooltip_text(ETR("Create a new folder."));
- makedir->connect("pressed", callable_mp(this, &FileDialog::_make_dir));
+ makedir->connect(SceneStringName(pressed), callable_mp(this, &FileDialog::_make_dir));
hbc->add_child(makedir);
vbox->add_child(hbc);
diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp
index 7878786716..d5ad258df8 100644
--- a/scene/gui/graph_edit.cpp
+++ b/scene/gui/graph_edit.cpp
@@ -2824,7 +2824,7 @@ GraphEdit::GraphEdit() {
zoom_minus_button->set_tooltip_text(ETR("Zoom Out"));
zoom_minus_button->set_focus_mode(FOCUS_NONE);
menu_hbox->add_child(zoom_minus_button);
- zoom_minus_button->connect("pressed", callable_mp(this, &GraphEdit::_zoom_minus));
+ zoom_minus_button->connect(SceneStringName(pressed), callable_mp(this, &GraphEdit::_zoom_minus));
zoom_reset_button = memnew(Button);
zoom_reset_button->set_theme_type_variation("FlatButton");
@@ -2832,7 +2832,7 @@ GraphEdit::GraphEdit() {
zoom_reset_button->set_tooltip_text(ETR("Zoom Reset"));
zoom_reset_button->set_focus_mode(FOCUS_NONE);
menu_hbox->add_child(zoom_reset_button);
- zoom_reset_button->connect("pressed", callable_mp(this, &GraphEdit::_zoom_reset));
+ zoom_reset_button->connect(SceneStringName(pressed), callable_mp(this, &GraphEdit::_zoom_reset));
zoom_plus_button = memnew(Button);
zoom_plus_button->set_theme_type_variation("FlatButton");
@@ -2840,7 +2840,7 @@ GraphEdit::GraphEdit() {
zoom_plus_button->set_tooltip_text(ETR("Zoom In"));
zoom_plus_button->set_focus_mode(FOCUS_NONE);
menu_hbox->add_child(zoom_plus_button);
- zoom_plus_button->connect("pressed", callable_mp(this, &GraphEdit::_zoom_plus));
+ zoom_plus_button->connect(SceneStringName(pressed), callable_mp(this, &GraphEdit::_zoom_plus));
// Grid controls.
@@ -2852,7 +2852,7 @@ GraphEdit::GraphEdit() {
toggle_grid_button->set_tooltip_text(ETR("Toggle the visual grid."));
toggle_grid_button->set_focus_mode(FOCUS_NONE);
menu_hbox->add_child(toggle_grid_button);
- toggle_grid_button->connect("pressed", callable_mp(this, &GraphEdit::_show_grid_toggled));
+ toggle_grid_button->connect(SceneStringName(pressed), callable_mp(this, &GraphEdit::_show_grid_toggled));
toggle_snapping_button = memnew(Button);
toggle_snapping_button->set_theme_type_variation("FlatButton");
@@ -2862,7 +2862,7 @@ GraphEdit::GraphEdit() {
toggle_snapping_button->set_pressed(snapping_enabled);
toggle_snapping_button->set_focus_mode(FOCUS_NONE);
menu_hbox->add_child(toggle_snapping_button);
- toggle_snapping_button->connect("pressed", callable_mp(this, &GraphEdit::_snapping_toggled));
+ toggle_snapping_button->connect(SceneStringName(pressed), callable_mp(this, &GraphEdit::_snapping_toggled));
snapping_distance_spinbox = memnew(SpinBox);
snapping_distance_spinbox->set_visible(show_grid_buttons);
@@ -2884,12 +2884,12 @@ GraphEdit::GraphEdit() {
minimap_button->set_pressed(show_grid);
minimap_button->set_focus_mode(FOCUS_NONE);
menu_hbox->add_child(minimap_button);
- minimap_button->connect("pressed", callable_mp(this, &GraphEdit::_minimap_toggled));
+ minimap_button->connect(SceneStringName(pressed), callable_mp(this, &GraphEdit::_minimap_toggled));
arrange_button = memnew(Button);
arrange_button->set_theme_type_variation("FlatButton");
arrange_button->set_visible(show_arrange_button);
- arrange_button->connect("pressed", callable_mp(this, &GraphEdit::arrange_nodes));
+ arrange_button->connect(SceneStringName(pressed), callable_mp(this, &GraphEdit::arrange_nodes));
arrange_button->set_focus_mode(FOCUS_NONE);
menu_hbox->add_child(arrange_button);
arrange_button->set_tooltip_text(ETR("Automatically arrange selected nodes."));
diff --git a/scene/gui/split_container.cpp b/scene/gui/split_container.cpp
index 98b1db4a96..925600756a 100644
--- a/scene/gui/split_container.cpp
+++ b/scene/gui/split_container.cpp
@@ -39,7 +39,7 @@ void SplitContainerDragger::gui_input(const Ref<InputEvent> &p_event) {
SplitContainer *sc = Object::cast_to<SplitContainer>(get_parent());
- if (sc->collapsed || !sc->get_containable_child(0) || !sc->get_containable_child(1) || sc->dragger_visibility != SplitContainer::DRAGGER_VISIBLE) {
+ if (sc->collapsed || !sc->_get_sortable_child(0) || !sc->_get_sortable_child(1) || sc->dragger_visibility != SplitContainer::DRAGGER_VISIBLE) {
return;
}
@@ -122,12 +122,12 @@ void SplitContainerDragger::_notification(int p_what) {
}
}
-Control *SplitContainer::get_containable_child(int p_idx) const {
+Control *SplitContainer::_get_sortable_child(int p_idx) const {
int idx = 0;
for (int i = 0; i < get_child_count(false); i++) {
- Control *c = Object::cast_to<Control>(get_child(i, false));
- if (!c || !c->is_visible() || c->is_set_as_top_level()) {
+ Control *c = as_sortable_control(get_child(i, false));
+ if (!c) {
continue;
}
@@ -154,8 +154,8 @@ Ref<Texture2D> SplitContainer::_get_grabber_icon() const {
}
void SplitContainer::_compute_middle_sep(bool p_clamp) {
- Control *first = get_containable_child(0);
- Control *second = get_containable_child(1);
+ Control *first = _get_sortable_child(0);
+ Control *second = _get_sortable_child(1);
// Determine expanded children.
bool first_expanded = (vertical ? first->get_v_size_flags() : first->get_h_size_flags()) & SIZE_EXPAND;
@@ -196,8 +196,8 @@ void SplitContainer::_compute_middle_sep(bool p_clamp) {
}
void SplitContainer::_resort() {
- Control *first = get_containable_child(0);
- Control *second = get_containable_child(1);
+ Control *first = _get_sortable_child(0);
+ Control *second = _get_sortable_child(1);
// If we have only one element.
if (!first || !second) {
@@ -258,7 +258,7 @@ Size2 SplitContainer::get_minimum_size() const {
int sep = (dragger_visibility != DRAGGER_HIDDEN_COLLAPSED) ? MAX(theme_cache.separation, vertical ? g->get_height() : g->get_width()) : 0;
for (int i = 0; i < 2; i++) {
- if (!get_containable_child(i)) {
+ if (!_get_sortable_child(i)) {
break;
}
@@ -270,7 +270,7 @@ Size2 SplitContainer::get_minimum_size() const {
}
}
- Size2 ms = get_containable_child(i)->get_combined_minimum_size();
+ Size2 ms = _get_sortable_child(i)->get_combined_minimum_size();
if (vertical) {
minimum.height += ms.height;
@@ -322,7 +322,7 @@ int SplitContainer::get_split_offset() const {
}
void SplitContainer::clamp_split_offset() {
- if (!get_containable_child(0) || !get_containable_child(1)) {
+ if (!_get_sortable_child(0) || !_get_sortable_child(1)) {
return;
}
diff --git a/scene/gui/split_container.h b/scene/gui/split_container.h
index 0f45ef166d..95f26f5e0b 100644
--- a/scene/gui/split_container.h
+++ b/scene/gui/split_container.h
@@ -82,12 +82,11 @@ private:
Ref<Texture2D> _get_grabber_icon() const;
void _compute_middle_sep(bool p_clamp);
void _resort();
+ Control *_get_sortable_child(int p_idx) const;
protected:
bool is_fixed = false;
- Control *get_containable_child(int p_idx) const;
-
void _notification(int p_what);
void _validate_property(PropertyInfo &p_property) const;
static void _bind_methods();
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index 1cd36c2632..884fc6de07 100644
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -1736,12 +1736,10 @@ Node *Node::get_node_or_null(const NodePath &p_path) const {
StringName name = p_path.get_name(i);
Node *next = nullptr;
- if (name == SceneStringName(dot)) { // .
-
+ if (name == SNAME(".")) {
next = current;
- } else if (name == SceneStringName(doubledot)) { // ..
-
+ } else if (name == SNAME("..")) {
if (current == nullptr || !current->data.parent) {
return nullptr;
}
diff --git a/scene/main/status_indicator.cpp b/scene/main/status_indicator.cpp
index 891974f68f..f0ba5db1a0 100644
--- a/scene/main/status_indicator.cpp
+++ b/scene/main/status_indicator.cpp
@@ -91,7 +91,7 @@ void StatusIndicator::_bind_methods() {
}
void StatusIndicator::_callback(MouseButton p_index, const Point2i &p_pos) {
- emit_signal(SNAME("pressed"), p_index, p_pos);
+ emit_signal(SceneStringName(pressed), p_index, p_pos);
}
void StatusIndicator::set_icon(const Ref<Texture2D> &p_icon) {
diff --git a/scene/resources/particle_process_material.cpp b/scene/resources/particle_process_material.cpp
index 81476eaa0f..01d26a8bed 100644
--- a/scene/resources/particle_process_material.cpp
+++ b/scene/resources/particle_process_material.cpp
@@ -630,7 +630,7 @@ void ParticleProcessMaterial::_update_shader() {
if (emission_shape == EMISSION_SHAPE_RING) {
code += " \n";
code += " float ring_spawn_angle = rand_from_seed(alt_seed) * 2.0 * pi;\n";
- code += " float ring_random_radius = sqrt(rand_from_seed(alt_seed) * (emission_ring_radius - emission_ring_inner_radius * emission_ring_inner_radius) + emission_ring_inner_radius * emission_ring_inner_radius);\n";
+ code += " float ring_random_radius = sqrt(rand_from_seed(alt_seed) * (emission_ring_radius * emission_ring_radius - emission_ring_inner_radius * emission_ring_inner_radius) + emission_ring_inner_radius * emission_ring_inner_radius);\n";
code += " vec3 axis = emission_ring_axis == vec3(0.0) ? vec3(0.0, 0.0, 1.0) : normalize(emission_ring_axis);\n";
code += " vec3 ortho_axis = vec3(0.0);\n";
code += " if (abs(axis) == vec3(1.0, 0.0, 0.0)) {\n";
@@ -991,13 +991,15 @@ void ParticleProcessMaterial::_update_shader() {
code += " \n";
if (collision_mode == COLLISION_RIGID) {
code += " if (COLLIDED) {\n";
- code += " if (length(VELOCITY) > 3.0) {\n";
- code += " TRANSFORM[3].xyz += COLLISION_NORMAL * COLLISION_DEPTH;\n";
- code += " VELOCITY -= COLLISION_NORMAL * dot(COLLISION_NORMAL, VELOCITY) * (1.0 + collision_bounce);\n";
- code += " VELOCITY = mix(VELOCITY,vec3(0.0),clamp(collision_friction, 0.0, 1.0));\n";
- code += " } else {\n";
- code += " VELOCITY = vec3(0.0);\n";
- code += " }\n";
+ code += " float collision_response = dot(COLLISION_NORMAL, VELOCITY);\n";
+ code += " float slide_to_bounce_trigger = step(2.0/clamp(collision_bounce + 1.0, 1.0, 2.0), abs(collision_response));\n";
+ code += " TRANSFORM[3].xyz += COLLISION_NORMAL * COLLISION_DEPTH;\n";
+ code += " // Remove all components of VELOCITY that is not tangent to COLLISION_NORMAL\n";
+ code += " VELOCITY -= COLLISION_NORMAL * collision_response;\n";
+ code += " // Apply friction only to VELOCITY across the surface (Effectively decouples friction and bounce behavior).\n";
+ code += " VELOCITY = mix(VELOCITY,vec3(0.0),clamp(collision_friction, 0.0, 1.0));\n";
+ code += " // Add bounce velocity to VELOCITY\n";
+ code += " VELOCITY -= COLLISION_NORMAL * collision_response * (collision_bounce * slide_to_bounce_trigger);\n";
code += " }\n";
} else if (collision_mode == COLLISION_HIDE_ON_CONTACT) {
code += " if (COLLIDED) {\n";
diff --git a/scene/scene_string_names.cpp b/scene/scene_string_names.cpp
index c51b2cb327..2ee27c95e1 100644
--- a/scene/scene_string_names.cpp
+++ b/scene/scene_string_names.cpp
@@ -33,20 +33,12 @@
SceneStringNames *SceneStringNames::singleton = nullptr;
SceneStringNames::SceneStringNames() {
- _estimate_cost = StaticCString::create("_estimate_cost");
- _compute_cost = StaticCString::create("_compute_cost");
-
resized = StaticCString::create("resized");
- dot = StaticCString::create(".");
- doubledot = StaticCString::create("..");
draw = StaticCString::create("draw");
- _draw = StaticCString::create("_draw");
hidden = StaticCString::create("hidden");
visibility_changed = StaticCString::create("visibility_changed");
input_event = StaticCString::create("input_event");
shader = StaticCString::create("shader");
- shader_unshaded = StaticCString::create("shader/unshaded");
- shading_mode = StaticCString::create("shader/shading_mode");
tree_entered = StaticCString::create("tree_entered");
tree_exiting = StaticCString::create("tree_exiting");
tree_exited = StaticCString::create("tree_exited");
@@ -86,98 +78,33 @@ SceneStringNames::SceneStringNames() {
area_shape_entered = StaticCString::create("area_shape_entered");
area_shape_exited = StaticCString::create("area_shape_exited");
- _body_inout = StaticCString::create("_body_inout");
- _area_inout = StaticCString::create("_area_inout");
-
- idle = StaticCString::create("idle");
- iteration = StaticCString::create("iteration");
update = StaticCString::create("update");
updated = StaticCString::create("updated");
- _physics_process = StaticCString::create("_physics_process");
- _process = StaticCString::create("_process");
-
- _enter_tree = StaticCString::create("_enter_tree");
- _exit_tree = StaticCString::create("_exit_tree");
- _enter_world = StaticCString::create("_enter_world");
- _exit_world = StaticCString::create("_exit_world");
_ready = StaticCString::create("_ready");
- _update_scroll = StaticCString::create("_update_scroll");
- _update_xform = StaticCString::create("_update_xform");
-
- _structured_text_parser = StaticCString::create("_structured_text_parser");
-
- _proxgroup_add = StaticCString::create("_proxgroup_add");
- _proxgroup_remove = StaticCString::create("_proxgroup_remove");
-
- grouped = StaticCString::create("grouped");
- ungrouped = StaticCString::create("ungrouped");
-
screen_entered = StaticCString::create("screen_entered");
screen_exited = StaticCString::create("screen_exited");
- viewport_entered = StaticCString::create("viewport_entered");
- viewport_exited = StaticCString::create("viewport_exited");
-
- camera_entered = StaticCString::create("camera_entered");
- camera_exited = StaticCString::create("camera_exited");
-
- _input = StaticCString::create("_input");
- _input_event = StaticCString::create("_input_event");
-
gui_input = StaticCString::create("gui_input");
- _gui_input = StaticCString::create("_gui_input");
-
- _unhandled_input = StaticCString::create("_unhandled_input");
- _unhandled_key_input = StaticCString::create("_unhandled_key_input");
-
- _shader_changed = StaticCString::create("_shader_changed");
_spatial_editor_group = StaticCString::create("_spatial_editor_group");
_request_gizmo = StaticCString::create("_request_gizmo");
- _set_subgizmo_selection = StaticCString::create("_set_subgizmo_selection");
- _clear_subgizmo_selection = StaticCString::create("_clear_subgizmo_selection");
offset = StaticCString::create("offset");
- unit_offset = StaticCString::create("unit_offset");
rotation_mode = StaticCString::create("rotation_mode");
rotate = StaticCString::create("rotate");
h_offset = StaticCString::create("h_offset");
v_offset = StaticCString::create("v_offset");
- _update_remote = StaticCString::create("_update_remote");
- _update_pairs = StaticCString::create("_update_pairs");
-
- _get_minimum_size = StaticCString::create("_get_minimum_size");
-
area_entered = StaticCString::create("area_entered");
area_exited = StaticCString::create("area_exited");
- _has_point = StaticCString::create("_has_point");
-
line_separation = StaticCString::create("line_separation");
- _get_drag_data = StaticCString::create("_get_drag_data");
- _drop_data = StaticCString::create("_drop_data");
- _can_drop_data = StaticCString::create("_can_drop_data");
-
- baked_light_changed = StaticCString::create("baked_light_changed");
- _baked_light_changed = StaticCString::create("_baked_light_changed");
-
- _mouse_enter = StaticCString::create("_mouse_enter");
- _mouse_exit = StaticCString::create("_mouse_exit");
- _mouse_shape_enter = StaticCString::create("_mouse_shape_enter");
- _mouse_shape_exit = StaticCString::create("_mouse_shape_exit");
-
- _pressed = StaticCString::create("_pressed");
- _toggled = StaticCString::create("_toggled");
-
frame_changed = StaticCString::create("frame_changed");
texture_changed = StaticCString::create("texture_changed");
- playback_speed = StaticCString::create("playback/speed");
- playback_active = StaticCString::create("playback/active");
autoplay = StaticCString::create("autoplay");
blend_times = StaticCString::create("blend_times");
speed = StaticCString::create("speed");
@@ -193,11 +120,7 @@ SceneStringNames::SceneStringNames() {
default_ = StaticCString::create("default");
- _window_group = StaticCString::create("_window_group");
- _window_input = StaticCString::create("_window_input");
window_input = StaticCString::create("window_input");
- _window_unhandled_input = StaticCString::create("_window_unhandled_input");
- _get_contents_minimum_size = StaticCString::create("_get_contents_minimum_size");
theme_changed = StaticCString::create("theme_changed");
parameters_base_path = "parameters/";
@@ -205,8 +128,5 @@ SceneStringNames::SceneStringNames() {
shader_overrides_group = StaticCString::create("_shader_overrides_group_");
shader_overrides_group_active = StaticCString::create("_shader_overrides_group_active_");
-#ifndef DISABLE_DEPRECATED
- use_in_baked_light = StaticCString::create("use_in_baked_light");
- use_dynamic_gi = StaticCString::create("use_dynamic_gi");
-#endif
+ pressed = StaticCString::create("pressed");
}
diff --git a/scene/scene_string_names.h b/scene/scene_string_names.h
index 38c50d2124..7ed86cde46 100644
--- a/scene/scene_string_names.h
+++ b/scene/scene_string_names.h
@@ -51,23 +51,14 @@ class SceneStringNames {
public:
_FORCE_INLINE_ static SceneStringNames *get_singleton() { return singleton; }
- StringName _estimate_cost;
- StringName _compute_cost;
-
StringName resized;
- StringName dot;
- StringName doubledot;
StringName draw;
StringName hidden;
StringName visibility_changed;
StringName input_event;
- StringName _input_event;
StringName gui_input;
- StringName _gui_input;
StringName item_rect_changed;
StringName shader;
- StringName shader_unshaded;
- StringName shading_mode;
StringName tree_entered;
StringName tree_exiting;
StringName tree_exited;
@@ -75,8 +66,6 @@ public:
StringName size_flags_changed;
StringName minimum_size_changed;
StringName sleeping_state_changed;
- StringName idle;
- StringName iteration;
StringName update;
StringName updated;
@@ -111,82 +100,26 @@ public:
StringName area_shape_entered;
StringName area_shape_exited;
- StringName _body_inout;
- StringName _area_inout;
-
- StringName _physics_process;
- StringName _process;
- StringName _enter_world;
- StringName _exit_world;
- StringName _enter_tree;
- StringName _exit_tree;
- StringName _draw;
- StringName _input;
StringName _ready;
- StringName _unhandled_input;
- StringName _unhandled_key_input;
-
- StringName _pressed;
- StringName _toggled;
-
- StringName _update_scroll;
- StringName _update_xform;
-
- StringName _structured_text_parser;
-
- StringName _proxgroup_add;
- StringName _proxgroup_remove;
-
- StringName grouped;
- StringName ungrouped;
-
- StringName _has_point;
- StringName _get_drag_data;
- StringName _can_drop_data;
- StringName _drop_data;
StringName screen_entered;
StringName screen_exited;
- StringName viewport_entered;
- StringName viewport_exited;
- StringName camera_entered;
- StringName camera_exited;
-
- StringName _shader_changed;
StringName _spatial_editor_group;
StringName _request_gizmo;
- StringName _set_subgizmo_selection;
- StringName _clear_subgizmo_selection;
StringName offset;
- StringName unit_offset;
StringName rotation_mode;
StringName rotate;
StringName v_offset;
StringName h_offset;
- StringName _update_remote;
- StringName _update_pairs;
-
StringName area_entered;
StringName area_exited;
- StringName _get_minimum_size;
-
- StringName baked_light_changed;
- StringName _baked_light_changed;
-
- StringName _mouse_enter;
- StringName _mouse_exit;
- StringName _mouse_shape_enter;
- StringName _mouse_shape_exit;
-
StringName frame_changed;
StringName texture_changed;
- StringName playback_speed;
- StringName playback_active;
StringName autoplay;
StringName blend_times;
StringName speed;
@@ -202,21 +135,13 @@ public:
StringName Master;
StringName parameters_base_path;
-
- StringName _window_group;
- StringName _window_input;
- StringName _window_unhandled_input;
StringName window_input;
- StringName _get_contents_minimum_size;
StringName theme_changed;
StringName shader_overrides_group;
StringName shader_overrides_group_active;
-#ifndef DISABLE_DEPRECATED
- StringName use_in_baked_light;
- StringName use_dynamic_gi;
-#endif
+ StringName pressed;
};
#define SceneStringName(m_name) SceneStringNames::get_singleton()->m_name
diff --git a/scene/theme/default_theme.cpp b/scene/theme/default_theme.cpp
index c92d03feaa..aa4d669238 100644
--- a/scene/theme/default_theme.cpp
+++ b/scene/theme/default_theme.cpp
@@ -161,7 +161,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_stylebox("normal", "Button", button_normal);
theme->set_stylebox("hover", "Button", button_hover);
- theme->set_stylebox("pressed", "Button", button_pressed);
+ theme->set_stylebox(SceneStringName(pressed), "Button", button_pressed);
theme->set_stylebox("disabled", "Button", button_disabled);
theme->set_stylebox("focus", "Button", focus);
@@ -190,7 +190,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
// MenuBar
theme->set_stylebox("normal", "MenuBar", button_normal);
theme->set_stylebox("hover", "MenuBar", button_hover);
- theme->set_stylebox("pressed", "MenuBar", button_pressed);
+ theme->set_stylebox(SceneStringName(pressed), "MenuBar", button_pressed);
theme->set_stylebox("disabled", "MenuBar", button_disabled);
theme->set_font("font", "MenuBar", Ref<Font>());
@@ -233,7 +233,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_stylebox("normal", "OptionButton", sb_optbutton_normal);
theme->set_stylebox("hover", "OptionButton", sb_optbutton_hover);
- theme->set_stylebox("pressed", "OptionButton", sb_optbutton_pressed);
+ theme->set_stylebox(SceneStringName(pressed), "OptionButton", sb_optbutton_pressed);
theme->set_stylebox("disabled", "OptionButton", sb_optbutton_disabled);
Ref<StyleBox> sb_optbutton_normal_mirrored = make_flat_stylebox(style_normal_color, 2 * default_margin, default_margin, 2 * default_margin, default_margin);
@@ -267,7 +267,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
// MenuButton
theme->set_stylebox("normal", "MenuButton", button_normal);
- theme->set_stylebox("pressed", "MenuButton", button_pressed);
+ theme->set_stylebox(SceneStringName(pressed), "MenuButton", button_pressed);
theme->set_stylebox("hover", "MenuButton", button_hover);
theme->set_stylebox("disabled", "MenuButton", button_disabled);
theme->set_stylebox("focus", "MenuButton", focus);
@@ -293,7 +293,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
cbx_focus->set_content_margin_all(Math::round(4 * scale));
theme->set_stylebox("normal", "CheckBox", cbx_empty);
- theme->set_stylebox("pressed", "CheckBox", cbx_empty);
+ theme->set_stylebox(SceneStringName(pressed), "CheckBox", cbx_empty);
theme->set_stylebox("disabled", "CheckBox", cbx_empty);
theme->set_stylebox("hover", "CheckBox", cbx_empty);
theme->set_stylebox("hover_pressed", "CheckBox", cbx_empty);
@@ -329,7 +329,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
cb_empty->set_content_margin_individual(Math::round(6 * scale), Math::round(4 * scale), Math::round(6 * scale), Math::round(4 * scale));
theme->set_stylebox("normal", "CheckButton", cb_empty);
- theme->set_stylebox("pressed", "CheckButton", cb_empty);
+ theme->set_stylebox(SceneStringName(pressed), "CheckButton", cb_empty);
theme->set_stylebox("disabled", "CheckButton", cb_empty);
theme->set_stylebox("hover", "CheckButton", cb_empty);
theme->set_stylebox("hover_pressed", "CheckButton", cb_empty);
@@ -374,12 +374,12 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_stylebox("normal", "FlatButton", flat_button_normal);
theme->set_stylebox("hover", "FlatButton", flat_button_normal);
- theme->set_stylebox("pressed", "FlatButton", flat_button_pressed);
+ theme->set_stylebox(SceneStringName(pressed), "FlatButton", flat_button_pressed);
theme->set_stylebox("disabled", "FlatButton", flat_button_normal);
theme->set_stylebox("normal", "FlatMenuButton", flat_button_normal);
theme->set_stylebox("hover", "FlatMenuButton", flat_button_normal);
- theme->set_stylebox("pressed", "FlatMenuButton", flat_button_pressed);
+ theme->set_stylebox(SceneStringName(pressed), "FlatMenuButton", flat_button_pressed);
theme->set_stylebox("disabled", "FlatMenuButton", flat_button_normal);
// Label
@@ -1051,7 +1051,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_icon("bg", "ColorPickerButton", icons["mini_checkerboard"]);
theme->set_stylebox("normal", "ColorPickerButton", button_normal);
- theme->set_stylebox("pressed", "ColorPickerButton", button_pressed);
+ theme->set_stylebox(SceneStringName(pressed), "ColorPickerButton", button_pressed);
theme->set_stylebox("hover", "ColorPickerButton", button_hover);
theme->set_stylebox("disabled", "ColorPickerButton", button_disabled);
theme->set_stylebox("focus", "ColorPickerButton", focus);
diff --git a/thirdparty/README.md b/thirdparty/README.md
index db7f361a66..665c188272 100644
--- a/thirdparty/README.md
+++ b/thirdparty/README.md
@@ -47,7 +47,7 @@ Files extracted from upstream source:
## astcenc
- Upstream: https://github.com/ARM-software/astc-encoder
-- Version: 4.7.0 (1a51f2915121275038677317c8bf61f1a78b590c, 2024)
+- Version: 4.8.0 (0d6c9047c5ad19640e2d60fdb8f11a16675e7938, 2024)
- License: Apache 2.0
Files extracted from upstream source:
@@ -194,7 +194,7 @@ commits.
## enet
- Upstream: https://github.com/lsalzman/enet
-- Version: git (c44b7d0f7ff21edb702745e4c019d0537928c373, 2024)
+- Version: 1.3.18 (2662c0de09e36f2a2030ccc2c528a3e4c9e8138a, 2024)
- License: MIT
Files extracted from upstream source:
@@ -377,7 +377,7 @@ Files extracted from upstream source:
## harfbuzz
- Upstream: https://github.com/harfbuzz/harfbuzz
-- Version: 8.4.0 (63973005bc07aba599b47fdd4cf788647b601ccd, 2024)
+- Version: 8.5.0 (30485ee8c3d43c553afb9d78b9924cb71c8d2f19, 2024)
- License: MIT
Files extracted from upstream source:
diff --git a/thirdparty/astcenc/astcenc_entry.cpp b/thirdparty/astcenc/astcenc_entry.cpp
index 71efe9cec4..5dc3801606 100644
--- a/thirdparty/astcenc/astcenc_entry.cpp
+++ b/thirdparty/astcenc/astcenc_entry.cpp
@@ -1167,7 +1167,7 @@ astcenc_error astcenc_decompress_image(
return ASTCENC_ERR_OUT_OF_MEM;
}
- image_block blk;
+ image_block blk {};
blk.texel_count = static_cast<uint8_t>(block_x * block_y * block_z);
// Decode mode inferred from the output data type
diff --git a/thirdparty/astcenc/astcenc_integer_sequence.cpp b/thirdparty/astcenc/astcenc_integer_sequence.cpp
index 416750374d..41dc38b74e 100644
--- a/thirdparty/astcenc/astcenc_integer_sequence.cpp
+++ b/thirdparty/astcenc/astcenc_integer_sequence.cpp
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// ----------------------------------------------------------------------------
-// Copyright 2011-2021 Arm Limited
+// Copyright 2011-2024 Arm Limited
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy
@@ -464,10 +464,10 @@ static inline void write_bits(
}
/**
- * @brief Read up to 8 bits at an arbitrary bit offset.
+ * @brief Read up to 16 bits from two bytes.
*
- * The stored value is at most 8 bits, but can be stored at an offset of between 0 and 7 bits so may
- * span two separate bytes in memory.
+ * This function reads a packed N-bit field from two bytes in memory. The stored value must exist
+ * within the two bytes, but can start at an arbitary bit offset and span the two bytes in memory.
*
* @param bitcount The number of bits to read.
* @param bitoffset The bit offset to read from, between 0 and 7.
diff --git a/thirdparty/astcenc/astcenc_internal.h b/thirdparty/astcenc/astcenc_internal.h
index 715028ac8f..df6e07f9ee 100644
--- a/thirdparty/astcenc/astcenc_internal.h
+++ b/thirdparty/astcenc/astcenc_internal.h
@@ -326,10 +326,10 @@ struct partition_info
uint8_t partition_texel_count[BLOCK_MAX_PARTITIONS];
/** @brief The partition of each texel in the block. */
- uint8_t partition_of_texel[BLOCK_MAX_TEXELS];
+ ASTCENC_ALIGNAS uint8_t partition_of_texel[BLOCK_MAX_TEXELS];
/** @brief The list of texels in each partition. */
- uint8_t texels_of_partition[BLOCK_MAX_PARTITIONS][BLOCK_MAX_TEXELS];
+ ASTCENC_ALIGNAS uint8_t texels_of_partition[BLOCK_MAX_PARTITIONS][BLOCK_MAX_TEXELS];
};
/**
@@ -367,19 +367,19 @@ struct decimation_info
* @brief The number of weights that contribute to each texel.
* Value is between 1 and 4.
*/
- uint8_t texel_weight_count[BLOCK_MAX_TEXELS];
+ ASTCENC_ALIGNAS uint8_t texel_weight_count[BLOCK_MAX_TEXELS];
/**
* @brief The weight index of the N weights that are interpolated for each texel.
* Stored transposed to improve vectorization.
*/
- uint8_t texel_weights_tr[4][BLOCK_MAX_TEXELS];
+ ASTCENC_ALIGNAS uint8_t texel_weights_tr[4][BLOCK_MAX_TEXELS];
/**
* @brief The bilinear contribution of the N weights that are interpolated for each texel.
* Value is between 0 and 16, stored transposed to improve vectorization.
*/
- uint8_t texel_weight_contribs_int_tr[4][BLOCK_MAX_TEXELS];
+ ASTCENC_ALIGNAS uint8_t texel_weight_contribs_int_tr[4][BLOCK_MAX_TEXELS];
/**
* @brief The bilinear contribution of the N weights that are interpolated for each texel.
@@ -388,13 +388,13 @@ struct decimation_info
ASTCENC_ALIGNAS float texel_weight_contribs_float_tr[4][BLOCK_MAX_TEXELS];
/** @brief The number of texels that each stored weight contributes to. */
- uint8_t weight_texel_count[BLOCK_MAX_WEIGHTS];
+ ASTCENC_ALIGNAS uint8_t weight_texel_count[BLOCK_MAX_WEIGHTS];
/**
* @brief The list of texels that use a specific weight index.
* Stored transposed to improve vectorization.
*/
- uint8_t weight_texels_tr[BLOCK_MAX_TEXELS][BLOCK_MAX_WEIGHTS];
+ ASTCENC_ALIGNAS uint8_t weight_texels_tr[BLOCK_MAX_TEXELS][BLOCK_MAX_WEIGHTS];
/**
* @brief The bilinear contribution to the N texels that use each weight.
@@ -732,7 +732,11 @@ struct block_size_descriptor
*
* The @c data_[rgba] fields store the image data in an encoded SoA float form designed for easy
* vectorization. Input data is converted to float and stored as values between 0 and 65535. LDR
- * data is stored as direct UNORM data, HDR data is stored as LNS data.
+ * data is stored as direct UNORM data, HDR data is stored as LNS data. They are allocated SIMD
+ * elements over-size to allow vectorized stores of unaligned and partial SIMD lanes (e.g. in a
+ * 6x6x6 block the final row write will read elements 210-217 (vec8) or 214-217 (vec4), which is
+ * two elements above the last real data element). The overspill values are never written to memory,
+ * and would be benign, but the padding avoids hitting undefined behavior.
*
* The @c rgb_lns and @c alpha_lns fields that assigned a per-texel use of HDR are only used during
* decompression. The current compressor will always use HDR endpoint formats when in HDR mode.
@@ -740,16 +744,16 @@ struct block_size_descriptor
struct image_block
{
/** @brief The input (compress) or output (decompress) data for the red color component. */
- ASTCENC_ALIGNAS float data_r[BLOCK_MAX_TEXELS];
+ ASTCENC_ALIGNAS float data_r[BLOCK_MAX_TEXELS + ASTCENC_SIMD_WIDTH - 1];
/** @brief The input (compress) or output (decompress) data for the green color component. */
- ASTCENC_ALIGNAS float data_g[BLOCK_MAX_TEXELS];
+ ASTCENC_ALIGNAS float data_g[BLOCK_MAX_TEXELS + ASTCENC_SIMD_WIDTH - 1];
/** @brief The input (compress) or output (decompress) data for the blue color component. */
- ASTCENC_ALIGNAS float data_b[BLOCK_MAX_TEXELS];
+ ASTCENC_ALIGNAS float data_b[BLOCK_MAX_TEXELS + ASTCENC_SIMD_WIDTH - 1];
/** @brief The input (compress) or output (decompress) data for the alpha color component. */
- ASTCENC_ALIGNAS float data_a[BLOCK_MAX_TEXELS];
+ ASTCENC_ALIGNAS float data_a[BLOCK_MAX_TEXELS + ASTCENC_SIMD_WIDTH - 1];
/** @brief The number of texels in the block. */
uint8_t texel_count;
@@ -957,7 +961,7 @@ struct ASTCENC_ALIGNAS compression_working_buffers
*
* For two planes, second plane starts at @c WEIGHTS_PLANE2_OFFSET offsets.
*/
- uint8_t dec_weights_uquant[WEIGHTS_MAX_BLOCK_MODES * BLOCK_MAX_WEIGHTS];
+ ASTCENC_ALIGNAS uint8_t dec_weights_uquant[WEIGHTS_MAX_BLOCK_MODES * BLOCK_MAX_WEIGHTS];
/** @brief Error of the best encoding combination for each block mode. */
ASTCENC_ALIGNAS float errors_of_best_combination[WEIGHTS_MAX_BLOCK_MODES];
@@ -1111,7 +1115,7 @@ struct symbolic_compressed_block
*
* If dual plane, the second plane starts at @c weights[WEIGHTS_PLANE2_OFFSET].
*/
- uint8_t weights[BLOCK_MAX_WEIGHTS];
+ ASTCENC_ALIGNAS uint8_t weights[BLOCK_MAX_WEIGHTS];
/**
* @brief Get the weight quantization used by this block mode.
diff --git a/thirdparty/astcenc/astcenc_internal_entry.h b/thirdparty/astcenc/astcenc_internal_entry.h
index 2667714781..c283c5acc6 100644
--- a/thirdparty/astcenc/astcenc_internal_entry.h
+++ b/thirdparty/astcenc/astcenc_internal_entry.h
@@ -150,6 +150,7 @@ public:
m_start_count = 0;
m_done_count = 0;
m_task_count = 0;
+ m_callback = nullptr;
m_callback_last_value = 0.0f;
m_callback_min_diff = 1.0f;
}
diff --git a/thirdparty/astcenc/astcenc_symbolic_physical.cpp b/thirdparty/astcenc/astcenc_symbolic_physical.cpp
index c4da678f1c..45d9abb64b 100644
--- a/thirdparty/astcenc/astcenc_symbolic_physical.cpp
+++ b/thirdparty/astcenc/astcenc_symbolic_physical.cpp
@@ -330,12 +330,14 @@ void physical_to_symbolic(
return;
}
+ // Low values span 3 bytes so need two read_bits calls
int vx_low_s = read_bits(8, 12, pcb) | (read_bits(5, 12 + 8, pcb) << 8);
- int vx_high_s = read_bits(8, 25, pcb) | (read_bits(5, 25 + 8, pcb) << 8);
+ int vx_high_s = read_bits(13, 25, pcb);
int vx_low_t = read_bits(8, 38, pcb) | (read_bits(5, 38 + 8, pcb) << 8);
- int vx_high_t = read_bits(8, 51, pcb) | (read_bits(5, 51 + 8, pcb) << 8);
+ int vx_high_t = read_bits(13, 51, pcb);
- int all_ones = vx_low_s == 0x1FFF && vx_high_s == 0x1FFF && vx_low_t == 0x1FFF && vx_high_t == 0x1FFF;
+ int all_ones = vx_low_s == 0x1FFF && vx_high_s == 0x1FFF &&
+ vx_low_t == 0x1FFF && vx_high_t == 0x1FFF;
if ((vx_low_s >= vx_high_s || vx_low_t >= vx_high_t) && !all_ones)
{
@@ -350,12 +352,14 @@ void physical_to_symbolic(
int vx_high_s = read_bits(9, 19, pcb);
int vx_low_t = read_bits(9, 28, pcb);
int vx_high_t = read_bits(9, 37, pcb);
- int vx_low_p = read_bits(9, 46, pcb);
- int vx_high_p = read_bits(9, 55, pcb);
+ int vx_low_r = read_bits(9, 46, pcb);
+ int vx_high_r = read_bits(9, 55, pcb);
- int all_ones = vx_low_s == 0x1FF && vx_high_s == 0x1FF && vx_low_t == 0x1FF && vx_high_t == 0x1FF && vx_low_p == 0x1FF && vx_high_p == 0x1FF;
+ int all_ones = vx_low_s == 0x1FF && vx_high_s == 0x1FF &&
+ vx_low_t == 0x1FF && vx_high_t == 0x1FF &&
+ vx_low_r == 0x1FF && vx_high_r == 0x1FF;
- if ((vx_low_s >= vx_high_s || vx_low_t >= vx_high_t || vx_low_p >= vx_high_p) && !all_ones)
+ if ((vx_low_s >= vx_high_s || vx_low_t >= vx_high_t || vx_low_r >= vx_high_r) && !all_ones)
{
scb.block_type = SYM_BTYPE_ERROR;
return;
@@ -470,8 +474,7 @@ void physical_to_symbolic(
bitpos += 2;
}
}
- scb.partition_index = static_cast<uint16_t>(read_bits(6, 13, pcb) |
- (read_bits(PARTITION_INDEX_BITS - 6, 19, pcb) << 6));
+ scb.partition_index = static_cast<uint16_t>(read_bits(10, 13, pcb));
}
for (int i = 0; i < partition_count; i++)
diff --git a/thirdparty/astcenc/astcenc_vecmathlib_none_4.h b/thirdparty/astcenc/astcenc_vecmathlib_none_4.h
index 1c95c2ff88..be7348eff1 100644
--- a/thirdparty/astcenc/astcenc_vecmathlib_none_4.h
+++ b/thirdparty/astcenc/astcenc_vecmathlib_none_4.h
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// ----------------------------------------------------------------------------
-// Copyright 2019-2023 Arm Limited
+// Copyright 2019-2024 Arm Limited
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy
@@ -556,10 +556,16 @@ ASTCENC_SIMD_INLINE vmask4 operator>(vint4 a, vint4 b)
*/
template <int s> ASTCENC_SIMD_INLINE vint4 lsl(vint4 a)
{
- return vint4(a.m[0] << s,
- a.m[1] << s,
- a.m[2] << s,
- a.m[3] << s);
+ // Cast to unsigned to avoid shift in/out of sign bit undefined behavior
+ unsigned int as0 = static_cast<unsigned int>(a.m[0]) << s;
+ unsigned int as1 = static_cast<unsigned int>(a.m[1]) << s;
+ unsigned int as2 = static_cast<unsigned int>(a.m[2]) << s;
+ unsigned int as3 = static_cast<unsigned int>(a.m[3]) << s;
+
+ return vint4(static_cast<int>(as0),
+ static_cast<int>(as1),
+ static_cast<int>(as2),
+ static_cast<int>(as3));
}
/**
@@ -567,6 +573,7 @@ template <int s> ASTCENC_SIMD_INLINE vint4 lsl(vint4 a)
*/
template <int s> ASTCENC_SIMD_INLINE vint4 lsr(vint4 a)
{
+ // Cast to unsigned to avoid shift in/out of sign bit undefined behavior
unsigned int as0 = static_cast<unsigned int>(a.m[0]) >> s;
unsigned int as1 = static_cast<unsigned int>(a.m[1]) >> s;
unsigned int as2 = static_cast<unsigned int>(a.m[2]) >> s;
diff --git a/thirdparty/enet/LICENSE b/thirdparty/enet/LICENSE
index 6906f8eb0b..ec14b3f09b 100644
--- a/thirdparty/enet/LICENSE
+++ b/thirdparty/enet/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2002-2020 Lee Salzman
+Copyright (c) 2002-2024 Lee Salzman
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
diff --git a/thirdparty/enet/enet/enet.h b/thirdparty/enet/enet/enet.h
index 5232f8a869..ed0dd65247 100644
--- a/thirdparty/enet/enet/enet.h
+++ b/thirdparty/enet/enet/enet.h
@@ -31,7 +31,7 @@ extern "C"
#define ENET_VERSION_MAJOR 1
#define ENET_VERSION_MINOR 3
-#define ENET_VERSION_PATCH 17
+#define ENET_VERSION_PATCH 18
#define ENET_VERSION_CREATE(major, minor, patch) (((major)<<16) | ((minor)<<8) | (patch))
#define ENET_VERSION_GET_MAJOR(version) (((version)>>16)&0xFF)
#define ENET_VERSION_GET_MINOR(version) (((version)>>8)&0xFF)
diff --git a/thirdparty/harfbuzz/src/OT/Color/COLR/COLR.hh b/thirdparty/harfbuzz/src/OT/Color/COLR/COLR.hh
index 623775a771..835d87f8c6 100644
--- a/thirdparty/harfbuzz/src/OT/Color/COLR/COLR.hh
+++ b/thirdparty/harfbuzz/src/OT/Color/COLR/COLR.hh
@@ -159,23 +159,35 @@ struct hb_colrv1_closure_context_t :
void add_palette_index (unsigned palette_index)
{ palette_indices->add (palette_index); }
+ void add_var_idxes (unsigned first_var_idx, unsigned num_idxes)
+ {
+ if (!num_idxes || first_var_idx == VarIdx::NO_VARIATION) return;
+ variation_indices->add_range (first_var_idx, first_var_idx + num_idxes - 1);
+ }
+
public:
const void *base;
hb_set_t visited_paint;
hb_set_t *glyphs;
hb_set_t *layer_indices;
hb_set_t *palette_indices;
+ hb_set_t *variation_indices;
+ unsigned num_var_idxes;
unsigned nesting_level_left;
hb_colrv1_closure_context_t (const void *base_,
hb_set_t *glyphs_,
hb_set_t *layer_indices_,
hb_set_t *palette_indices_,
+ hb_set_t *variation_indices_,
+ unsigned num_var_idxes_ = 1,
unsigned nesting_level_left_ = HB_MAX_NESTING_LEVEL) :
base (base_),
glyphs (glyphs_),
layer_indices (layer_indices_),
palette_indices (palette_indices_),
+ variation_indices (variation_indices_),
+ num_var_idxes (num_var_idxes_),
nesting_level_left (nesting_level_left_)
{}
};
@@ -242,7 +254,12 @@ struct Variable
}
void closurev1 (hb_colrv1_closure_context_t* c) const
- { value.closurev1 (c); }
+ {
+ c->num_var_idxes = 0;
+ // update c->num_var_idxes during value closure
+ value.closurev1 (c);
+ c->add_var_idxes (varIdxBase, c->num_var_idxes);
+ }
bool subset (hb_subset_context_t *c,
const ItemVarStoreInstancer &instancer) const
@@ -252,8 +269,18 @@ struct Variable
if (c->plan->all_axes_pinned)
return_trace (true);
- //TODO: update varIdxBase for partial-instancing
- return_trace (c->serializer->embed (varIdxBase));
+ VarIdx new_varidx;
+ new_varidx = varIdxBase;
+ if (varIdxBase != VarIdx::NO_VARIATION)
+ {
+ hb_pair_t<unsigned, int> *new_varidx_delta;
+ if (!c->plan->colrv1_variation_idx_delta_map.has (varIdxBase, &new_varidx_delta))
+ return_trace (false);
+
+ new_varidx = hb_first (*new_varidx_delta);
+ }
+
+ return_trace (c->serializer->embed (new_varidx));
}
bool sanitize (hb_sanitize_context_t *c) const
@@ -345,7 +372,10 @@ struct NoVariable
struct ColorStop
{
void closurev1 (hb_colrv1_closure_context_t* c) const
- { c->add_palette_index (paletteIndex); }
+ {
+ c->add_palette_index (paletteIndex);
+ c->num_var_idxes = 2;
+ }
bool subset (hb_subset_context_t *c,
const ItemVarStoreInstancer &instancer,
@@ -542,6 +572,9 @@ struct Affine2x3
return_trace (c->check_struct (this));
}
+ void closurev1 (hb_colrv1_closure_context_t* c) const
+ { c->num_var_idxes = 6; }
+
bool subset (hb_subset_context_t *c,
const ItemVarStoreInstancer &instancer,
uint32_t varIdxBase) const
@@ -617,7 +650,10 @@ struct PaintColrLayers
struct PaintSolid
{
void closurev1 (hb_colrv1_closure_context_t* c) const
- { c->add_palette_index (paletteIndex); }
+ {
+ c->add_palette_index (paletteIndex);
+ c->num_var_idxes = 1;
+ }
bool subset (hb_subset_context_t *c,
const ItemVarStoreInstancer &instancer,
@@ -666,7 +702,10 @@ template <template<typename> class Var>
struct PaintLinearGradient
{
void closurev1 (hb_colrv1_closure_context_t* c) const
- { (this+colorLine).closurev1 (c); }
+ {
+ (this+colorLine).closurev1 (c);
+ c->num_var_idxes = 6;
+ }
bool subset (hb_subset_context_t *c,
const ItemVarStoreInstancer &instancer,
@@ -733,7 +772,10 @@ template <template<typename> class Var>
struct PaintRadialGradient
{
void closurev1 (hb_colrv1_closure_context_t* c) const
- { (this+colorLine).closurev1 (c); }
+ {
+ (this+colorLine).closurev1 (c);
+ c->num_var_idxes = 6;
+ }
bool subset (hb_subset_context_t *c,
const ItemVarStoreInstancer &instancer,
@@ -800,7 +842,10 @@ template <template<typename> class Var>
struct PaintSweepGradient
{
void closurev1 (hb_colrv1_closure_context_t* c) const
- { (this+colorLine).closurev1 (c); }
+ {
+ (this+colorLine).closurev1 (c);
+ c->num_var_idxes = 4;
+ }
bool subset (hb_subset_context_t *c,
const ItemVarStoreInstancer &instancer,
@@ -1544,6 +1589,9 @@ struct ClipBoxFormat2 : Variable<ClipBoxFormat1>
clip_box.yMax += roundf (instancer (varIdxBase, 3));
}
}
+
+ void closurev1 (hb_colrv1_closure_context_t* c) const
+ { c->variation_indices->add_range (varIdxBase, varIdxBase + 3); }
};
struct ClipBox
@@ -1559,6 +1607,14 @@ struct ClipBox
}
}
+ void closurev1 (hb_colrv1_closure_context_t* c) const
+ {
+ switch (u.format) {
+ case 2: u.format2.closurev1 (c);
+ default:return;
+ }
+ }
+
template <typename context_t, typename ...Ts>
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
{
@@ -1606,6 +1662,12 @@ struct ClipRecord
int cmp (hb_codepoint_t g) const
{ return g < startGlyphID ? -1 : g <= endGlyphID ? 0 : +1; }
+ void closurev1 (hb_colrv1_closure_context_t* c, const void *base) const
+ {
+ if (!c->glyphs->intersects (startGlyphID, endGlyphID)) return;
+ (base+clipBox).closurev1 (c);
+ }
+
bool subset (hb_subset_context_t *c,
const void *base,
const ItemVarStoreInstancer &instancer) const
@@ -1941,6 +2003,76 @@ struct LayerList : Array32OfOffset32To<Paint>
}
};
+struct delta_set_index_map_subset_plan_t
+{
+ unsigned get_inner_bit_count () const { return inner_bit_count; }
+ unsigned get_width () const { return ((outer_bit_count + inner_bit_count + 7) / 8); }
+ hb_array_t<const uint32_t> get_output_map () const { return output_map.as_array (); }
+
+ delta_set_index_map_subset_plan_t (const hb_map_t &new_deltaset_idx_varidx_map)
+ {
+ map_count = 0;
+ outer_bit_count = 0;
+ inner_bit_count = 1;
+ output_map.init ();
+
+ /* search backwards */
+ unsigned count = new_deltaset_idx_varidx_map.get_population ();
+ if (!count) return;
+
+ unsigned last_idx = (unsigned)-1;
+ unsigned last_varidx = (unsigned)-1;
+
+ for (unsigned i = count; i; i--)
+ {
+ unsigned delta_set_idx = i - 1;
+ unsigned var_idx = new_deltaset_idx_varidx_map.get (delta_set_idx);
+ if (i == count)
+ {
+ last_idx = delta_set_idx;
+ last_varidx = var_idx;
+ continue;
+ }
+ if (var_idx != last_varidx)
+ break;
+ last_idx = delta_set_idx;
+ }
+
+ map_count = last_idx + 1;
+ }
+
+ bool remap (const hb_map_t &new_deltaset_idx_varidx_map)
+ {
+ /* recalculate bit_count */
+ outer_bit_count = 1;
+ inner_bit_count = 1;
+
+ if (unlikely (!output_map.resize (map_count, false))) return false;
+
+ for (unsigned idx = 0; idx < map_count; idx++)
+ {
+ uint32_t *var_idx;
+ if (!new_deltaset_idx_varidx_map.has (idx, &var_idx)) return false;
+ output_map.arrayZ[idx] = *var_idx;
+
+ unsigned outer = (*var_idx) >> 16;
+ unsigned bit_count = (outer == 0) ? 1 : hb_bit_storage (outer);
+ outer_bit_count = hb_max (bit_count, outer_bit_count);
+
+ unsigned inner = (*var_idx) & 0xFFFF;
+ bit_count = (inner == 0) ? 1 : hb_bit_storage (inner);
+ inner_bit_count = hb_max (bit_count, inner_bit_count);
+ }
+ return true;
+ }
+
+ private:
+ unsigned map_count;
+ unsigned outer_bit_count;
+ unsigned inner_bit_count;
+ hb_vector_t<uint32_t> output_map;
+};
+
struct COLR
{
static constexpr hb_tag_t tableTag = HB_OT_TAG_COLR;
@@ -1992,8 +2124,22 @@ struct COLR
void closure_forV1 (hb_set_t *glyphset,
hb_set_t *layer_indices,
- hb_set_t *palette_indices) const
- { colr->closure_forV1 (glyphset, layer_indices, palette_indices); }
+ hb_set_t *palette_indices,
+ hb_set_t *variation_indices,
+ hb_set_t *delta_set_indices) const
+ { colr->closure_forV1 (glyphset, layer_indices, palette_indices, variation_indices, delta_set_indices); }
+
+ bool has_var_store () const
+ { return colr->has_var_store (); }
+
+ const ItemVariationStore &get_var_store () const
+ { return colr->get_var_store (); }
+
+ bool has_delta_set_index_map () const
+ { return colr->has_delta_set_index_map (); }
+
+ const DeltaSetIndexMap &get_delta_set_index_map () const
+ { return colr->get_delta_set_index_map (); }
private:
hb_blob_ptr_t<COLR> colr;
@@ -2030,14 +2176,16 @@ struct COLR
void closure_forV1 (hb_set_t *glyphset,
hb_set_t *layer_indices,
- hb_set_t *palette_indices) const
+ hb_set_t *palette_indices,
+ hb_set_t *variation_indices,
+ hb_set_t *delta_set_indices) const
{
if (version != 1) return;
hb_barrier ();
hb_set_t visited_glyphs;
- hb_colrv1_closure_context_t c (this, &visited_glyphs, layer_indices, palette_indices);
+ hb_colrv1_closure_context_t c (this, &visited_glyphs, layer_indices, palette_indices, variation_indices);
const BaseGlyphList &baseglyph_paintrecords = this+baseGlyphList;
for (const BaseGlyphPaintRecord &baseglyph_paintrecord: baseglyph_paintrecords.iter ())
@@ -2049,6 +2197,22 @@ struct COLR
paint.dispatch (&c);
}
hb_set_union (glyphset, &visited_glyphs);
+
+ const ClipList &cliplist = this+clipList;
+ c.glyphs = glyphset;
+ for (const ClipRecord &clip_record : cliplist.clips.iter())
+ clip_record.closurev1 (&c, &cliplist);
+
+ // if a DeltaSetIndexMap is included, collected variation indices are
+ // actually delta set indices, we need to map them into variation indices
+ if (has_delta_set_index_map ())
+ {
+ const DeltaSetIndexMap &var_idx_map = this+varIdxMap;
+ delta_set_indices->set (*variation_indices);
+ variation_indices->clear ();
+ for (unsigned delta_set_idx : *delta_set_indices)
+ variation_indices->add (var_idx_map.map (delta_set_idx));
+ }
}
const LayerList& get_layerList () const
@@ -2057,6 +2221,18 @@ struct COLR
const BaseGlyphList& get_baseglyphList () const
{ return (this+baseGlyphList); }
+ bool has_var_store () const
+ { return version >= 1 && varStore != 0; }
+
+ bool has_delta_set_index_map () const
+ { return version >= 1 && varIdxMap != 0; }
+
+ const DeltaSetIndexMap &get_delta_set_index_map () const
+ { return (version == 0 || varIdxMap == 0) ? Null (DeltaSetIndexMap) : this+varIdxMap; }
+
+ const ItemVariationStore &get_var_store () const
+ { return (version == 0 || varStore == 0) ? Null (ItemVariationStore) : this+varStore; }
+
bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
@@ -2132,6 +2308,88 @@ struct COLR
return record;
}
+ bool downgrade_to_V0 (const hb_set_t &glyphset) const
+ {
+ //no more COLRv1 glyphs, downgrade to version 0
+ for (const BaseGlyphPaintRecord& _ : get_baseglyphList ())
+ if (glyphset.has (_.glyphId))
+ return false;
+
+ return true;
+ }
+
+ bool subset_varstore (hb_subset_context_t *c,
+ COLR* out /* OUT */) const
+ {
+ TRACE_SUBSET (this);
+ if (!varStore || c->plan->all_axes_pinned ||
+ !c->plan->colrv1_variation_idx_delta_map)
+ return_trace (true);
+
+ const ItemVariationStore& var_store = this+varStore;
+ if (c->plan->normalized_coords)
+ {
+ item_variations_t item_vars;
+ /* turn off varstore optimization when varIdxMap is null, so we maintain
+ * original var_idx sequence */
+ bool optimize = (varIdxMap != 0) ? true : false;
+ if (!item_vars.instantiate (var_store, c->plan,
+ optimize, /* optimization */
+ optimize, /* use_no_variation_idx = false */
+ c->plan->colrv1_varstore_inner_maps.as_array ()))
+ return_trace (false);
+
+ if (!out->varStore.serialize_serialize (c->serializer,
+ item_vars.has_long_word (),
+ c->plan->axis_tags,
+ item_vars.get_region_list (),
+ item_vars.get_vardata_encodings ()))
+ return_trace (false);
+
+ /* if varstore is optimized, update colrv1_new_deltaset_idx_varidx_map in
+ * subset plan */
+ if (optimize)
+ {
+ const hb_map_t &varidx_map = item_vars.get_varidx_map ();
+ for (auto _ : c->plan->colrv1_new_deltaset_idx_varidx_map.iter_ref ())
+ {
+ uint32_t varidx = _.second;
+ uint32_t *new_varidx;
+ if (varidx_map.has (varidx, &new_varidx))
+ _.second = *new_varidx;
+ else
+ _.second = VarIdx::NO_VARIATION;
+ }
+ }
+ }
+ else
+ {
+ if (unlikely (!out->varStore.serialize_serialize (c->serializer,
+ &var_store,
+ c->plan->colrv1_varstore_inner_maps.as_array ())))
+ return_trace (false);
+ }
+
+ return_trace (true);
+ }
+
+ bool subset_delta_set_index_map (hb_subset_context_t *c,
+ COLR* out /* OUT */) const
+ {
+ TRACE_SUBSET (this);
+ if (!varIdxMap || c->plan->all_axes_pinned ||
+ !c->plan->colrv1_new_deltaset_idx_varidx_map)
+ return_trace (true);
+
+ const hb_map_t &deltaset_idx_varidx_map = c->plan->colrv1_new_deltaset_idx_varidx_map;
+ delta_set_index_map_subset_plan_t index_map_plan (deltaset_idx_varidx_map);
+
+ if (unlikely (!index_map_plan.remap (deltaset_idx_varidx_map)))
+ return_trace (false);
+
+ return_trace (out->varIdxMap.serialize_serialize (c->serializer, index_map_plan));
+ }
+
bool subset (hb_subset_context_t *c) const
{
TRACE_SUBSET (this);
@@ -2200,34 +2458,28 @@ struct COLR
auto *colr_prime = c->serializer->start_embed<COLR> ();
if (unlikely (!c->serializer->extend_min (colr_prime))) return_trace (false);
- if (version == 0)
- return_trace (colr_prime->serialize_V0 (c->serializer, version, base_it, layer_it));
+ if (version == 0 || downgrade_to_V0 (glyphset))
+ return_trace (colr_prime->serialize_V0 (c->serializer, 0, base_it, layer_it));
- auto snap = c->serializer->snapshot ();
+ //start version 1
if (!c->serializer->allocate_size<void> (5 * HBUINT32::static_size)) return_trace (false);
+ if (!colr_prime->serialize_V0 (c->serializer, version, base_it, layer_it)) return_trace (false);
+
+ /* subset ItemVariationStore first, cause varidx_map needs to be updated
+ * after instancing */
+ if (!subset_varstore (c, colr_prime)) return_trace (false);
ItemVarStoreInstancer instancer (varStore ? &(this+varStore) : nullptr,
varIdxMap ? &(this+varIdxMap) : nullptr,
c->plan->normalized_coords.as_array ());
if (!colr_prime->baseGlyphList.serialize_subset (c, baseGlyphList, this, instancer))
- {
- if (c->serializer->in_error ()) return_trace (false);
- //no more COLRv1 glyphs: downgrade to version 0
- c->serializer->revert (snap);
- return_trace (colr_prime->serialize_V0 (c->serializer, 0, base_it, layer_it));
- }
-
- if (!colr_prime->serialize_V0 (c->serializer, version, base_it, layer_it)) return_trace (false);
+ return_trace (false);
colr_prime->layerList.serialize_subset (c, layerList, this, instancer);
colr_prime->clipList.serialize_subset (c, clipList, this, instancer);
- if (!varStore || c->plan->all_axes_pinned)
- return_trace (true);
- colr_prime->varIdxMap.serialize_copy (c->serializer, varIdxMap, this);
- colr_prime->varStore.serialize_copy (c->serializer, varStore, this);
- return_trace (true);
+ return_trace (subset_delta_set_index_map (c, colr_prime));
}
const Paint *get_base_glyph_paint (hb_codepoint_t glyph) const
diff --git a/thirdparty/harfbuzz/src/OT/Color/COLR/colrv1-closure.hh b/thirdparty/harfbuzz/src/OT/Color/COLR/colrv1-closure.hh
index 705863d4ad..9ed0aa5632 100644
--- a/thirdparty/harfbuzz/src/OT/Color/COLR/colrv1-closure.hh
+++ b/thirdparty/harfbuzz/src/OT/Color/COLR/colrv1-closure.hh
@@ -66,34 +66,64 @@ HB_INTERNAL void PaintColrGlyph::closurev1 (hb_colrv1_closure_context_t* c) cons
template <template<typename> class Var>
HB_INTERNAL void PaintTransform<Var>::closurev1 (hb_colrv1_closure_context_t* c) const
-{ (this+src).dispatch (c); }
+{
+ (this+src).dispatch (c);
+ (this+transform).closurev1 (c);
+}
HB_INTERNAL void PaintTranslate::closurev1 (hb_colrv1_closure_context_t* c) const
-{ (this+src).dispatch (c); }
+{
+ (this+src).dispatch (c);
+ c->num_var_idxes = 2;
+}
HB_INTERNAL void PaintScale::closurev1 (hb_colrv1_closure_context_t* c) const
-{ (this+src).dispatch (c); }
+{
+ (this+src).dispatch (c);
+ c->num_var_idxes = 2;
+}
HB_INTERNAL void PaintScaleAroundCenter::closurev1 (hb_colrv1_closure_context_t* c) const
-{ (this+src).dispatch (c); }
+{
+ (this+src).dispatch (c);
+ c->num_var_idxes = 4;
+}
HB_INTERNAL void PaintScaleUniform::closurev1 (hb_colrv1_closure_context_t* c) const
-{ (this+src).dispatch (c); }
+{
+ (this+src).dispatch (c);
+ c->num_var_idxes = 1;
+}
HB_INTERNAL void PaintScaleUniformAroundCenter::closurev1 (hb_colrv1_closure_context_t* c) const
-{ (this+src).dispatch (c); }
+{
+ (this+src).dispatch (c);
+ c->num_var_idxes = 3;
+}
HB_INTERNAL void PaintRotate::closurev1 (hb_colrv1_closure_context_t* c) const
-{ (this+src).dispatch (c); }
+{
+ (this+src).dispatch (c);
+ c->num_var_idxes = 1;
+}
HB_INTERNAL void PaintRotateAroundCenter::closurev1 (hb_colrv1_closure_context_t* c) const
-{ (this+src).dispatch (c); }
+{
+ (this+src).dispatch (c);
+ c->num_var_idxes = 3;
+}
HB_INTERNAL void PaintSkew::closurev1 (hb_colrv1_closure_context_t* c) const
-{ (this+src).dispatch (c); }
+{
+ (this+src).dispatch (c);
+ c->num_var_idxes = 2;
+}
HB_INTERNAL void PaintSkewAroundCenter::closurev1 (hb_colrv1_closure_context_t* c) const
-{ (this+src).dispatch (c); }
+{
+ (this+src).dispatch (c);
+ c->num_var_idxes = 4;
+}
HB_INTERNAL void PaintComposite::closurev1 (hb_colrv1_closure_context_t* c) const
{
diff --git a/thirdparty/harfbuzz/src/OT/Layout/GDEF/GDEF.hh b/thirdparty/harfbuzz/src/OT/Layout/GDEF/GDEF.hh
index 317b96c714..45baeb4ec5 100644
--- a/thirdparty/harfbuzz/src/OT/Layout/GDEF/GDEF.hh
+++ b/thirdparty/harfbuzz/src/OT/Layout/GDEF/GDEF.hh
@@ -1022,47 +1022,6 @@ struct GDEF
void collect_variation_indices (hb_collect_variation_indices_context_t *c) const
{ get_lig_caret_list ().collect_variation_indices (c); }
- void remap_layout_variation_indices (const hb_set_t *layout_variation_indices,
- const hb_vector_t<int>& normalized_coords,
- bool calculate_delta, /* not pinned at default */
- bool no_variations, /* all axes pinned */
- hb_hashmap_t<unsigned, hb_pair_t<unsigned, int>> *layout_variation_idx_delta_map /* OUT */) const
- {
- if (!has_var_store ()) return;
- const ItemVariationStore &var_store = get_var_store ();
- float *store_cache = var_store.create_cache ();
-
- unsigned new_major = 0, new_minor = 0;
- unsigned last_major = (layout_variation_indices->get_min ()) >> 16;
- for (unsigned idx : layout_variation_indices->iter ())
- {
- int delta = 0;
- if (calculate_delta)
- delta = roundf (var_store.get_delta (idx, normalized_coords.arrayZ,
- normalized_coords.length, store_cache));
-
- if (no_variations)
- {
- layout_variation_idx_delta_map->set (idx, hb_pair_t<unsigned, int> (HB_OT_LAYOUT_NO_VARIATIONS_INDEX, delta));
- continue;
- }
-
- uint16_t major = idx >> 16;
- if (major >= var_store.get_sub_table_count ()) break;
- if (major != last_major)
- {
- new_minor = 0;
- ++new_major;
- }
-
- unsigned new_idx = (new_major << 16) + new_minor;
- layout_variation_idx_delta_map->set (idx, hb_pair_t<unsigned, int> (new_idx, delta));
- ++new_minor;
- last_major = major;
- }
- var_store.destroy_cache (store_cache);
- }
-
protected:
union {
FixedVersion<> version; /* Version identifier */
diff --git a/thirdparty/harfbuzz/src/OT/Layout/GSUB/Ligature.hh b/thirdparty/harfbuzz/src/OT/Layout/GSUB/Ligature.hh
index 402ed12ae2..e0ec82a236 100644
--- a/thirdparty/harfbuzz/src/OT/Layout/GSUB/Ligature.hh
+++ b/thirdparty/harfbuzz/src/OT/Layout/GSUB/Ligature.hh
@@ -90,8 +90,17 @@ struct Ligature
unsigned int total_component_count = 0;
+ if (unlikely (count > HB_MAX_CONTEXT_LENGTH)) return false;
+ unsigned match_positions_stack[4];
+ unsigned *match_positions = match_positions_stack;
+ if (unlikely (count > ARRAY_LENGTH (match_positions_stack)))
+ {
+ match_positions = (unsigned *) hb_malloc (hb_max (count, 1u) * sizeof (unsigned));
+ if (unlikely (!match_positions))
+ return_trace (false);
+ }
+
unsigned int match_end = 0;
- unsigned int match_positions[HB_MAX_CONTEXT_LENGTH];
if (likely (!match_input (c, count,
&component[1],
@@ -102,6 +111,8 @@ struct Ligature
&total_component_count)))
{
c->buffer->unsafe_to_concat (c->buffer->idx, match_end);
+ if (match_positions != match_positions_stack)
+ hb_free (match_positions);
return_trace (false);
}
@@ -145,6 +156,8 @@ struct Ligature
pos);
}
+ if (match_positions != match_positions_stack)
+ hb_free (match_positions);
return_trace (true);
}
diff --git a/thirdparty/harfbuzz/src/hb-aat-layout-common.hh b/thirdparty/harfbuzz/src/hb-aat-layout-common.hh
index 05dd58c6df..c26f376aa6 100644
--- a/thirdparty/harfbuzz/src/hb-aat-layout-common.hh
+++ b/thirdparty/harfbuzz/src/hb-aat-layout-common.hh
@@ -46,8 +46,9 @@ struct hb_aat_apply_context_t :
hb_dispatch_context_t<hb_aat_apply_context_t, bool, HB_DEBUG_APPLY>
{
const char *get_name () { return "APPLY"; }
- template <typename T>
- return_t dispatch (const T &obj) { return obj.apply (this); }
+ template <typename T, typename ...Ts>
+ return_t dispatch (const T &obj, Ts&&... ds)
+ { return obj.apply (this, std::forward<Ts> (ds)...); }
static return_t default_return_value () { return false; }
bool stop_sublookup_iteration (return_t r) const { return r; }
@@ -59,6 +60,9 @@ struct hb_aat_apply_context_t :
const ankr *ankr_table;
const OT::GDEF *gdef_table;
const hb_sorted_vector_t<hb_aat_map_t::range_flags_t> *range_flags = nullptr;
+ hb_set_digest_t machine_glyph_set = hb_set_digest_t::full ();
+ hb_set_digest_t left_set = hb_set_digest_t::full ();
+ hb_set_digest_t right_set = hb_set_digest_t::full ();
hb_mask_t subtable_flags = 0;
/* Unused. For debug tracing only. */
@@ -81,6 +85,8 @@ struct hb_aat_apply_context_t :
* Lookup Table
*/
+enum { DELETED_GLYPH = 0xFFFF };
+
template <typename T> struct Lookup;
template <typename T>
@@ -95,6 +101,12 @@ struct LookupFormat0
return &arrayZ[glyph_id];
}
+ template <typename set_t>
+ void collect_glyphs (set_t &glyphs, unsigned num_glyphs) const
+ {
+ glyphs.add_range (0, num_glyphs - 1);
+ }
+
bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
@@ -123,6 +135,14 @@ struct LookupSegmentSingle
int cmp (hb_codepoint_t g) const
{ return g < first ? -1 : g <= last ? 0 : +1 ; }
+ template <typename set_t>
+ void collect_glyphs (set_t &glyphs) const
+ {
+ if (first == DELETED_GLYPH)
+ return;
+ glyphs.add_range (first, last);
+ }
+
bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
@@ -153,6 +173,14 @@ struct LookupFormat2
return v ? &v->value : nullptr;
}
+ template <typename set_t>
+ void collect_glyphs (set_t &glyphs) const
+ {
+ unsigned count = segments.get_length ();
+ for (unsigned int i = 0; i < count; i++)
+ segments[i].collect_glyphs (glyphs);
+ }
+
bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
@@ -184,6 +212,14 @@ struct LookupSegmentArray
return first <= glyph_id && glyph_id <= last ? &(base+valuesZ)[glyph_id - first] : nullptr;
}
+ template <typename set_t>
+ void collect_glyphs (set_t &glyphs) const
+ {
+ if (first == DELETED_GLYPH)
+ return;
+ glyphs.add_range (first, last);
+ }
+
int cmp (hb_codepoint_t g) const
{ return g < first ? -1 : g <= last ? 0 : +1; }
@@ -226,6 +262,14 @@ struct LookupFormat4
return v ? v->get_value (glyph_id, this) : nullptr;
}
+ template <typename set_t>
+ void collect_glyphs (set_t &glyphs) const
+ {
+ unsigned count = segments.get_length ();
+ for (unsigned i = 0; i < count; i++)
+ segments[i].collect_glyphs (glyphs);
+ }
+
bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
@@ -254,6 +298,14 @@ struct LookupSingle
int cmp (hb_codepoint_t g) const { return glyph.cmp (g); }
+ template <typename set_t>
+ void collect_glyphs (set_t &glyphs) const
+ {
+ if (glyph == DELETED_GLYPH)
+ return;
+ glyphs.add (glyph);
+ }
+
bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
@@ -283,6 +335,14 @@ struct LookupFormat6
return v ? &v->value : nullptr;
}
+ template <typename set_t>
+ void collect_glyphs (set_t &glyphs) const
+ {
+ unsigned count = entries.get_length ();
+ for (unsigned i = 0; i < count; i++)
+ entries[i].collect_glyphs (glyphs);
+ }
+
bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
@@ -314,6 +374,16 @@ struct LookupFormat8
&valueArrayZ[glyph_id - firstGlyph] : nullptr;
}
+ template <typename set_t>
+ void collect_glyphs (set_t &glyphs) const
+ {
+ if (unlikely (!glyphCount))
+ return;
+ if (firstGlyph == DELETED_GLYPH)
+ return;
+ glyphs.add_range (firstGlyph, firstGlyph + glyphCount - 1);
+ }
+
bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
@@ -358,6 +428,16 @@ struct LookupFormat10
return v;
}
+ template <typename set_t>
+ void collect_glyphs (set_t &glyphs) const
+ {
+ if (unlikely (!glyphCount))
+ return;
+ if (firstGlyph == DELETED_GLYPH)
+ return;
+ glyphs.add_range (firstGlyph, firstGlyph + glyphCount - 1);
+ }
+
bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
@@ -406,6 +486,20 @@ struct Lookup
}
}
+ template <typename set_t>
+ void collect_glyphs (set_t &glyphs, unsigned int num_glyphs) const
+ {
+ switch (u.format) {
+ case 0: u.format0.collect_glyphs (glyphs, num_glyphs); return;
+ case 2: u.format2.collect_glyphs (glyphs); return;
+ case 4: u.format4.collect_glyphs (glyphs); return;
+ case 6: u.format6.collect_glyphs (glyphs); return;
+ case 8: u.format8.collect_glyphs (glyphs); return;
+ case 10: u.format10.collect_glyphs (glyphs); return;
+ default:return;
+ }
+ }
+
typename T::type get_class (hb_codepoint_t glyph_id,
unsigned int num_glyphs,
unsigned int outOfRange) const
@@ -460,8 +554,6 @@ struct Lookup
};
DECLARE_NULL_NAMESPACE_BYTES_TEMPLATE1 (AAT, Lookup, 2);
-enum { DELETED_GLYPH = 0xFFFF };
-
/*
* (Extended) State Table
*/
@@ -512,6 +604,14 @@ struct Entry<void>
DEFINE_SIZE_STATIC (4);
};
+enum Class
+{
+ CLASS_END_OF_TEXT = 0,
+ CLASS_OUT_OF_BOUNDS = 1,
+ CLASS_DELETED_GLYPH = 2,
+ CLASS_END_OF_LINE = 3,
+};
+
template <typename Types, typename Extra>
struct StateTable
{
@@ -524,21 +624,24 @@ struct StateTable
STATE_START_OF_TEXT = 0,
STATE_START_OF_LINE = 1,
};
- enum Class
+
+ template <typename set_t>
+ void collect_glyphs (set_t &glyphs, unsigned num_glyphs) const
{
- CLASS_END_OF_TEXT = 0,
- CLASS_OUT_OF_BOUNDS = 1,
- CLASS_DELETED_GLYPH = 2,
- CLASS_END_OF_LINE = 3,
- };
+ (this+classTable).collect_glyphs (glyphs, num_glyphs);
+ }
int new_state (unsigned int newState) const
{ return Types::extended ? newState : ((int) newState - (int) stateArrayTable) / (int) nClasses; }
- unsigned int get_class (hb_codepoint_t glyph_id, unsigned int num_glyphs) const
+ template <typename set_t>
+ unsigned int get_class (hb_codepoint_t glyph_id,
+ unsigned int num_glyphs,
+ const set_t &glyphs) const
{
if (unlikely (glyph_id == DELETED_GLYPH)) return CLASS_DELETED_GLYPH;
- return (this+classTable).get_class (glyph_id, num_glyphs, 1);
+ if (!glyphs[glyph_id]) return CLASS_OUT_OF_BOUNDS;
+ return (this+classTable).get_class (glyph_id, num_glyphs, CLASS_OUT_OF_BOUNDS);
}
const Entry<Extra> *get_entries () const
@@ -547,7 +650,7 @@ struct StateTable
const Entry<Extra> &get_entry (int state, unsigned int klass) const
{
if (unlikely (klass >= nClasses))
- klass = StateTable::CLASS_OUT_OF_BOUNDS;
+ klass = CLASS_OUT_OF_BOUNDS;
const HBUSHORT *states = (this+stateArrayTable).arrayZ;
const Entry<Extra> *entries = (this+entryTable).arrayZ;
@@ -690,6 +793,15 @@ struct ClassTable
{
return get_class (glyph_id, outOfRange);
}
+
+ template <typename set_t>
+ void collect_glyphs (set_t &glyphs, unsigned num_glyphs) const
+ {
+ for (unsigned i = 0; i < classArray.len; i++)
+ if (classArray.arrayZ[i] != CLASS_OUT_OF_BOUNDS)
+ glyphs.add (firstGlyph + i);
+ }
+
bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
@@ -703,6 +815,38 @@ struct ClassTable
DEFINE_SIZE_ARRAY (4, classArray);
};
+struct SubtableGlyphCoverage
+{
+ bool sanitize (hb_sanitize_context_t *c, unsigned subtable_count) const
+ {
+ TRACE_SANITIZE (this);
+
+ if (unlikely (!c->check_array (&subtableOffsets, subtable_count)))
+ return_trace (false);
+
+ unsigned bytes = (c->get_num_glyphs () + CHAR_BIT - 1) / CHAR_BIT;
+ for (unsigned i = 0; i < subtable_count; i++)
+ {
+ uint32_t offset = (uint32_t) subtableOffsets[i];
+ if (offset == 0 || offset == 0xFFFFFFFF)
+ continue;
+ if (unlikely (!subtableOffsets[i].sanitize (c, this, bytes)))
+ return_trace (false);
+ }
+
+ return_trace (true);
+ }
+ protected:
+ UnsizedArrayOf<NNOffset32To<UnsizedArrayOf<HBUINT8>>> subtableOffsets;
+ /* Array of offsets from the beginning of the
+ * subtable glyph coverage table to the glyph
+ * coverage bitfield for a given subtable; there
+ * is one offset for each subtable in the chain */
+ /* UnsizedArrayOf<HBUINT8> coverageBitfields; *//* The individual coverage bitfields. */
+ public:
+ DEFINE_SIZE_ARRAY (0, subtableOffsets);
+};
+
struct ObsoleteTypes
{
static constexpr bool extended = false;
@@ -779,15 +923,15 @@ struct StateTableDriver
using EntryT = Entry<EntryData>;
StateTableDriver (const StateTableT &machine_,
- hb_buffer_t *buffer_,
hb_face_t *face_) :
machine (machine_),
- buffer (buffer_),
num_glyphs (face_->get_num_glyphs ()) {}
- template <typename context_t>
+ template <typename context_t, typename set_t = hb_set_digest_t>
void drive (context_t *c, hb_aat_apply_context_t *ac)
{
+ hb_buffer_t *buffer = ac->buffer;
+
if (!c->in_place)
buffer->clear_output ();
@@ -822,9 +966,9 @@ struct StateTableDriver
}
}
- unsigned int klass = buffer->idx < buffer->len ?
- machine.get_class (buffer->cur().codepoint, num_glyphs) :
- (unsigned) StateTableT::CLASS_END_OF_TEXT;
+ unsigned int klass = likely (buffer->idx < buffer->len) ?
+ machine.get_class (buffer->cur().codepoint, num_glyphs, ac->machine_glyph_set) :
+ (unsigned) CLASS_END_OF_TEXT;
DEBUG_MSG (APPLY, nullptr, "c%u at %u", klass, buffer->idx);
const EntryT &entry = machine.get_entry (state, klass);
const int next_state = machine.new_state (entry.newState);
@@ -862,22 +1006,22 @@ struct StateTableDriver
{
/* 2c. */
const auto wouldbe_entry = machine.get_entry(StateTableT::STATE_START_OF_TEXT, klass);
-
+
/* 2c'. */
- if (c->is_actionable (this, wouldbe_entry))
- return false;
-
+ if (c->is_actionable (buffer, this, wouldbe_entry))
+ return false;
+
/* 2c". */
return next_state == machine.new_state(wouldbe_entry.newState)
&& (entry.flags & context_t::DontAdvance) == (wouldbe_entry.flags & context_t::DontAdvance);
};
-
+
const auto is_safe_to_break = [&]()
{
/* 1. */
- if (c->is_actionable (this, entry))
+ if (c->is_actionable (buffer, this, entry))
return false;
-
+
/* 2. */
// This one is meh, I know...
const auto ok =
@@ -886,15 +1030,15 @@ struct StateTableDriver
|| is_safe_to_break_extra();
if (!ok)
return false;
-
+
/* 3. */
- return !c->is_actionable (this, machine.get_entry (state, StateTableT::CLASS_END_OF_TEXT));
+ return !c->is_actionable (buffer, this, machine.get_entry (state, CLASS_END_OF_TEXT));
};
if (!is_safe_to_break () && buffer->backtrack_len () && buffer->idx < buffer->len)
buffer->unsafe_to_break_from_outbuffer (buffer->backtrack_len () - 1, buffer->idx + 1);
- c->transition (this, entry);
+ c->transition (buffer, this, entry);
state = next_state;
DEBUG_MSG (APPLY, nullptr, "s%d", state);
@@ -912,7 +1056,6 @@ struct StateTableDriver
public:
const StateTableT &machine;
- hb_buffer_t *buffer;
unsigned int num_glyphs;
};
diff --git a/thirdparty/harfbuzz/src/hb-aat-layout-kerx-table.hh b/thirdparty/harfbuzz/src/hb-aat-layout-kerx-table.hh
index 0de54e0a02..8d0d87af02 100644
--- a/thirdparty/harfbuzz/src/hb-aat-layout-kerx-table.hh
+++ b/thirdparty/harfbuzz/src/hb-aat-layout-kerx-table.hh
@@ -30,6 +30,7 @@
#include "hb-kern.hh"
#include "hb-aat-layout-ankr-table.hh"
+#include "hb-set-digest.hh"
/*
* kerx -- Extended Kerning
@@ -82,7 +83,7 @@ struct KernPair
return_trace (c->check_struct (this));
}
- protected:
+ public:
HBGlyphID16 left;
HBGlyphID16 right;
FWORD value;
@@ -118,6 +119,16 @@ struct KerxSubTableFormat0
return_trace (true);
}
+ template <typename set_t>
+ void collect_glyphs (set_t &left_set, set_t &right_set, unsigned num_glyphs) const
+ {
+ for (const KernPair& pair : pairs)
+ {
+ left_set.add (pair.left);
+ right_set.add (pair.right);
+ }
+ }
+
struct accelerator_t
{
const KerxSubTableFormat0 &table;
@@ -128,7 +139,10 @@ struct KerxSubTableFormat0
table (table_), c (c_) {}
int get_kerning (hb_codepoint_t left, hb_codepoint_t right) const
- { return table.get_kerning (left, right, c); }
+ {
+ if (!c->left_set[left] || !c->right_set[right]) return 0;
+ return table.get_kerning (left, right, c);
+ }
};
@@ -228,13 +242,14 @@ struct KerxSubTableFormat1
depth (0),
crossStream (table->header.coverage & table->header.CrossStream) {}
- bool is_actionable (StateTableDriver<Types, EntryData> *driver HB_UNUSED,
+ bool is_actionable (hb_buffer_t *buffer HB_UNUSED,
+ StateTableDriver<Types, EntryData> *driver HB_UNUSED,
const Entry<EntryData> &entry)
{ return Format1EntryT::performAction (entry); }
- void transition (StateTableDriver<Types, EntryData> *driver,
+ void transition (hb_buffer_t *buffer,
+ StateTableDriver<Types, EntryData> *driver,
const Entry<EntryData> &entry)
{
- hb_buffer_t *buffer = driver->buffer;
unsigned int flags = entry.flags;
if (flags & Format1EntryT::Reset)
@@ -351,7 +366,7 @@ struct KerxSubTableFormat1
driver_context_t dc (this, c);
- StateTableDriver<Types, EntryData> driver (machine, c->buffer, c->font->face);
+ StateTableDriver<Types, EntryData> driver (machine, c->font->face);
driver.drive (&dc, c);
return_trace (true);
@@ -365,12 +380,21 @@ struct KerxSubTableFormat1
machine.sanitize (c)));
}
+ template <typename set_t>
+ void collect_glyphs (set_t &left_set, set_t &right_set, unsigned num_glyphs) const
+ {
+ set_t set;
+ machine.collect_glyphs (set, num_glyphs);
+ left_set.union_ (set);
+ right_set.union_ (set);
+ }
+
protected:
KernSubTableHeader header;
StateTable<Types, EntryData> machine;
NNOffsetTo<UnsizedArrayOf<FWORD>, HBUINT> kernAction;
public:
- DEFINE_SIZE_STATIC (KernSubTableHeader::static_size + 5 * sizeof (HBUINT));
+ DEFINE_SIZE_STATIC (KernSubTableHeader::static_size + (StateTable<Types, EntryData>::static_size + HBUINT::static_size));
};
template <typename KernSubTableHeader>
@@ -413,6 +437,13 @@ struct KerxSubTableFormat2
return_trace (true);
}
+ template <typename set_t>
+ void collect_glyphs (set_t &left_set, set_t &right_set, unsigned num_glyphs) const
+ {
+ (this+leftClassTable).collect_glyphs (left_set, num_glyphs);
+ (this+rightClassTable).collect_glyphs (right_set, num_glyphs);
+ }
+
struct accelerator_t
{
const KerxSubTableFormat2 &table;
@@ -423,7 +454,10 @@ struct KerxSubTableFormat2
table (table_), c (c_) {}
int get_kerning (hb_codepoint_t left, hb_codepoint_t right) const
- { return table.get_kerning (left, right, c); }
+ {
+ if (!c->left_set[left] || !c->right_set[right]) return 0;
+ return table.get_kerning (left, right, c);
+ }
};
bool sanitize (hb_sanitize_context_t *c) const
@@ -493,14 +527,14 @@ struct KerxSubTableFormat4
mark_set (false),
mark (0) {}
- bool is_actionable (StateTableDriver<Types, EntryData> *driver HB_UNUSED,
+ bool is_actionable (hb_buffer_t *buffer HB_UNUSED,
+ StateTableDriver<Types, EntryData> *driver HB_UNUSED,
const Entry<EntryData> &entry)
{ return entry.data.ankrActionIndex != 0xFFFF; }
- void transition (StateTableDriver<Types, EntryData> *driver,
+ void transition (hb_buffer_t *buffer,
+ StateTableDriver<Types, EntryData> *driver,
const Entry<EntryData> &entry)
{
- hb_buffer_t *buffer = driver->buffer;
-
if (mark_set && entry.data.ankrActionIndex != 0xFFFF && buffer->idx < buffer->len)
{
hb_glyph_position_t &o = buffer->cur_pos();
@@ -600,7 +634,7 @@ struct KerxSubTableFormat4
driver_context_t dc (this, c);
- StateTableDriver<Types, EntryData> driver (machine, c->buffer, c->font->face);
+ StateTableDriver<Types, EntryData> driver (machine, c->font->face);
driver.drive (&dc, c);
return_trace (true);
@@ -614,12 +648,21 @@ struct KerxSubTableFormat4
machine.sanitize (c)));
}
+ template <typename set_t>
+ void collect_glyphs (set_t &left_set, set_t &right_set, unsigned num_glyphs) const
+ {
+ set_t set;
+ machine.collect_glyphs (set, num_glyphs);
+ left_set.union_ (set);
+ right_set.union_ (set);
+ }
+
protected:
KernSubTableHeader header;
StateTable<Types, EntryData> machine;
HBUINT32 flags;
public:
- DEFINE_SIZE_STATIC (KernSubTableHeader::static_size + 20);
+ DEFINE_SIZE_STATIC (KernSubTableHeader::static_size + (StateTable<Types, EntryData>::static_size + HBUINT32::static_size));
};
template <typename KernSubTableHeader>
@@ -638,7 +681,7 @@ struct KerxSubTableFormat6
unsigned int num_glyphs = c->sanitizer.get_num_glyphs ();
if (is_long ())
{
- const typename U::Long &t = u.l;
+ const auto &t = u.l;
unsigned int l = (this+t.rowIndexTable).get_value_or_null (left, num_glyphs);
unsigned int r = (this+t.columnIndexTable).get_value_or_null (right, num_glyphs);
unsigned int offset = l + r;
@@ -651,7 +694,7 @@ struct KerxSubTableFormat6
}
else
{
- const typename U::Short &t = u.s;
+ const auto &t = u.s;
unsigned int l = (this+t.rowIndexTable).get_value_or_null (left, num_glyphs);
unsigned int r = (this+t.columnIndexTable).get_value_or_null (right, num_glyphs);
unsigned int offset = l + r;
@@ -698,6 +741,23 @@ struct KerxSubTableFormat6
c->check_range (this, vector))));
}
+ template <typename set_t>
+ void collect_glyphs (set_t &left_set, set_t &right_set, unsigned num_glyphs) const
+ {
+ if (is_long ())
+ {
+ const auto &t = u.l;
+ (this+t.rowIndexTable).collect_glyphs (left_set, num_glyphs);
+ (this+t.columnIndexTable).collect_glyphs (right_set, num_glyphs);
+ }
+ else
+ {
+ const auto &t = u.s;
+ (this+t.rowIndexTable).collect_glyphs (left_set, num_glyphs);
+ (this+t.columnIndexTable).collect_glyphs (right_set, num_glyphs);
+ }
+ }
+
struct accelerator_t
{
const KerxSubTableFormat6 &table;
@@ -708,7 +768,10 @@ struct KerxSubTableFormat6
table (table_), c (c_) {}
int get_kerning (hb_codepoint_t left, hb_codepoint_t right) const
- { return table.get_kerning (left, right, c); }
+ {
+ if (!c->left_set[left] || !c->right_set[right]) return 0;
+ return table.get_kerning (left, right, c);
+ }
};
protected:
@@ -794,6 +857,20 @@ struct KerxSubTable
}
}
+ template <typename set_t>
+ void collect_glyphs (set_t &left_set, set_t &right_set, unsigned num_glyphs) const
+ {
+ unsigned int subtable_type = get_type ();
+ switch (subtable_type) {
+ case 0: u.format0.collect_glyphs (left_set, right_set, num_glyphs); return;
+ case 1: u.format1.collect_glyphs (left_set, right_set, num_glyphs); return;
+ case 2: u.format2.collect_glyphs (left_set, right_set, num_glyphs); return;
+ case 4: u.format4.collect_glyphs (left_set, right_set, num_glyphs); return;
+ case 6: u.format6.collect_glyphs (left_set, right_set, num_glyphs); return;
+ default: return;
+ }
+ }
+
bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
@@ -824,6 +901,8 @@ struct KerxSubTable
* The 'kerx' Table
*/
+using kern_accelerator_data_t = hb_vector_t<hb_pair_t<hb_set_digest_t, hb_set_digest_t>>;
+
template <typename T>
struct KerxTable
{
@@ -878,7 +957,8 @@ struct KerxTable
return v;
}
- bool apply (AAT::hb_aat_apply_context_t *c) const
+ bool apply (AAT::hb_aat_apply_context_t *c,
+ const kern_accelerator_data_t *accel_data = nullptr) const
{
c->buffer->unsafe_to_concat ();
@@ -925,6 +1005,16 @@ struct KerxTable
if (reverse)
c->buffer->reverse ();
+ if (accel_data)
+ {
+ c->left_set = (*accel_data)[i].first;
+ c->right_set = (*accel_data)[i].second;
+ }
+ else
+ {
+ c->left_set = c->right_set = hb_set_digest_t::full ();
+ }
+
{
/* See comment in sanitize() for conditional here. */
hb_sanitize_with_object_t with (&c->sanitizer, i < count - 1 ? st : (const SubTable *) nullptr);
@@ -977,8 +1067,61 @@ struct KerxTable
st = &StructAfter<SubTable> (*st);
}
+ unsigned majorVersion = thiz()->version;
+ if (sizeof (thiz()->version) == 4)
+ majorVersion = majorVersion >> 16;
+ if (majorVersion >= 3)
+ {
+ const SubtableGlyphCoverage *coverage = (const SubtableGlyphCoverage *) st;
+ if (!coverage->sanitize (c, count))
+ return_trace (false);
+ }
+
return_trace (true);
}
+
+ kern_accelerator_data_t create_accelerator_data (unsigned num_glyphs) const
+ {
+ kern_accelerator_data_t accel_data;
+
+ typedef typename T::SubTable SubTable;
+
+ const SubTable *st = &thiz()->firstSubTable;
+ unsigned int count = thiz()->tableCount;
+ for (unsigned int i = 0; i < count; i++)
+ {
+ hb_set_digest_t left_set, right_set;
+ st->collect_glyphs (left_set, right_set, num_glyphs);
+ accel_data.push (hb_pair (left_set, right_set));
+ st = &StructAfter<SubTable> (*st);
+ }
+
+ return accel_data;
+ }
+
+ struct accelerator_t
+ {
+ accelerator_t (hb_face_t *face)
+ {
+ hb_sanitize_context_t sc;
+ this->table = sc.reference_table<T> (face);
+ this->accel_data = this->table->create_accelerator_data (face->get_num_glyphs ());
+ }
+ ~accelerator_t ()
+ {
+ this->table.destroy ();
+ }
+
+ hb_blob_t *get_blob () const { return table.get_blob (); }
+
+ bool apply (AAT::hb_aat_apply_context_t *c) const
+ {
+ return table->apply (c, &accel_data);
+ }
+
+ hb_blob_ptr_t<T> table;
+ kern_accelerator_data_t accel_data;
+ };
};
struct kerx : KerxTable<kerx>
@@ -1007,8 +1150,10 @@ struct kerx : KerxTable<kerx>
DEFINE_SIZE_MIN (8);
};
+struct kerx_accelerator_t : kerx::accelerator_t {
+ kerx_accelerator_t (hb_face_t *face) : kerx::accelerator_t (face) {}
+};
} /* namespace AAT */
-
#endif /* HB_AAT_LAYOUT_KERX_TABLE_HH */
diff --git a/thirdparty/harfbuzz/src/hb-aat-layout-morx-table.hh b/thirdparty/harfbuzz/src/hb-aat-layout-morx-table.hh
index 8436551324..4a94e6a8ff 100644
--- a/thirdparty/harfbuzz/src/hb-aat-layout-morx-table.hh
+++ b/thirdparty/harfbuzz/src/hb-aat-layout-morx-table.hh
@@ -74,15 +74,16 @@ struct RearrangementSubtable
ret (false),
start (0), end (0) {}
- bool is_actionable (StateTableDriver<Types, EntryData> *driver HB_UNUSED,
- const Entry<EntryData> &entry)
+ bool is_actionable (hb_buffer_t *buffer HB_UNUSED,
+ StateTableDriver<Types, EntryData> *driver HB_UNUSED,
+ const Entry<EntryData> &entry) const
{
return (entry.flags & Verb) && start < end;
}
- void transition (StateTableDriver<Types, EntryData> *driver,
+ void transition (hb_buffer_t *buffer,
+ StateTableDriver<Types, EntryData> *driver,
const Entry<EntryData> &entry)
{
- hb_buffer_t *buffer = driver->buffer;
unsigned int flags = entry.flags;
if (flags & MarkFirst)
@@ -168,7 +169,7 @@ struct RearrangementSubtable
driver_context_t dc (this);
- StateTableDriver<Types, EntryData> driver (machine, c->buffer, c->face);
+ StateTableDriver<Types, EntryData> driver (machine, c->face);
driver.drive (&dc, c);
return_trace (dc.ret);
@@ -180,10 +181,10 @@ struct RearrangementSubtable
return_trace (machine.sanitize (c));
}
- protected:
+ public:
StateTable<Types, EntryData> machine;
public:
- DEFINE_SIZE_STATIC (16);
+ DEFINE_SIZE_STATIC ((StateTable<Types, EntryData>::static_size));
};
template <typename Types>
@@ -223,21 +224,19 @@ struct ContextualSubtable
table (table_),
subs (table+table->substitutionTables) {}
- bool is_actionable (StateTableDriver<Types, EntryData> *driver,
- const Entry<EntryData> &entry)
+ bool is_actionable (hb_buffer_t *buffer,
+ StateTableDriver<Types, EntryData> *driver,
+ const Entry<EntryData> &entry) const
{
- hb_buffer_t *buffer = driver->buffer;
-
if (buffer->idx == buffer->len && !mark_set)
return false;
return entry.data.markIndex != 0xFFFF || entry.data.currentIndex != 0xFFFF;
}
- void transition (StateTableDriver<Types, EntryData> *driver,
+ void transition (hb_buffer_t *buffer,
+ StateTableDriver<Types, EntryData> *driver,
const Entry<EntryData> &entry)
{
- hb_buffer_t *buffer = driver->buffer;
-
/* Looks like CoreText applies neither mark nor current substitution for
* end-of-text if mark was not explicitly set. */
if (buffer->idx == buffer->len && !mark_set)
@@ -328,7 +327,7 @@ struct ContextualSubtable
driver_context_t dc (this, c);
- StateTableDriver<Types, EntryData> driver (machine, c->buffer, c->face);
+ StateTableDriver<Types, EntryData> driver (machine, c->face);
driver.drive (&dc, c);
return_trace (dc.ret);
@@ -361,13 +360,14 @@ struct ContextualSubtable
return_trace (substitutionTables.sanitize (c, this, num_lookups));
}
- protected:
+ public:
StateTable<Types, EntryData>
machine;
+ protected:
NNOffsetTo<UnsizedListOfOffset16To<Lookup<HBGlyphID16>, HBUINT, void, false>, HBUINT>
substitutionTables;
public:
- DEFINE_SIZE_STATIC (20);
+ DEFINE_SIZE_STATIC ((StateTable<Types, EntryData>::static_size + HBUINT::static_size));
};
@@ -464,16 +464,16 @@ struct LigatureSubtable
ligature (table+table->ligature),
match_length (0) {}
- bool is_actionable (StateTableDriver<Types, EntryData> *driver HB_UNUSED,
- const Entry<EntryData> &entry)
+ bool is_actionable (hb_buffer_t *buffer HB_UNUSED,
+ StateTableDriver<Types, EntryData> *driver HB_UNUSED,
+ const Entry<EntryData> &entry) const
{
return LigatureEntryT::performAction (entry);
}
- void transition (StateTableDriver<Types, EntryData> *driver,
+ void transition (hb_buffer_t *buffer,
+ StateTableDriver<Types, EntryData> *driver,
const Entry<EntryData> &entry)
{
- hb_buffer_t *buffer = driver->buffer;
-
DEBUG_MSG (APPLY, nullptr, "Ligature transition at %u", buffer->idx);
if (entry.flags & LigatureEntryT::SetComponent)
{
@@ -585,7 +585,7 @@ struct LigatureSubtable
driver_context_t dc (this, c);
- StateTableDriver<Types, EntryData> driver (machine, c->buffer, c->face);
+ StateTableDriver<Types, EntryData> driver (machine, c->face);
driver.drive (&dc, c);
return_trace (dc.ret);
@@ -600,9 +600,10 @@ struct LigatureSubtable
ligAction && component && ligature);
}
- protected:
+ public:
StateTable<Types, EntryData>
machine;
+ protected:
NNOffsetTo<UnsizedArrayOf<HBUINT32>, HBUINT>
ligAction; /* Offset to the ligature action table. */
NNOffsetTo<UnsizedArrayOf<HBUINT16>, HBUINT>
@@ -610,7 +611,7 @@ struct LigatureSubtable
NNOffsetTo<UnsizedArrayOf<HBGlyphID16>, HBUINT>
ligature; /* Offset to the actual ligature lists. */
public:
- DEFINE_SIZE_STATIC (28);
+ DEFINE_SIZE_STATIC ((StateTable<Types, EntryData>::static_size + 3 * HBUINT::static_size));
};
template <typename Types>
@@ -754,16 +755,17 @@ struct InsertionSubtable
mark (0),
insertionAction (table+table->insertionAction) {}
- bool is_actionable (StateTableDriver<Types, EntryData> *driver HB_UNUSED,
- const Entry<EntryData> &entry)
+ bool is_actionable (hb_buffer_t *buffer HB_UNUSED,
+ StateTableDriver<Types, EntryData> *driver HB_UNUSED,
+ const Entry<EntryData> &entry) const
{
return (entry.flags & (CurrentInsertCount | MarkedInsertCount)) &&
(entry.data.currentInsertIndex != 0xFFFF ||entry.data.markedInsertIndex != 0xFFFF);
}
- void transition (StateTableDriver<Types, EntryData> *driver,
+ void transition (hb_buffer_t *buffer,
+ StateTableDriver<Types, EntryData> *driver,
const Entry<EntryData> &entry)
{
- hb_buffer_t *buffer = driver->buffer;
unsigned int flags = entry.flags;
unsigned mark_loc = buffer->out_len;
@@ -850,7 +852,7 @@ struct InsertionSubtable
driver_context_t dc (this, c);
- StateTableDriver<Types, EntryData> driver (machine, c->buffer, c->face);
+ StateTableDriver<Types, EntryData> driver (machine, c->face);
driver.drive (&dc, c);
return_trace (dc.ret);
@@ -865,14 +867,15 @@ struct InsertionSubtable
insertionAction);
}
- protected:
+ public:
StateTable<Types, EntryData>
machine;
+ protected:
NNOffsetTo<UnsizedArrayOf<HBGlyphID16>, HBUINT>
insertionAction; /* Byte offset from stateHeader to the start of
* the insertion glyph table. */
public:
- DEFINE_SIZE_STATIC (20);
+ DEFINE_SIZE_STATIC ((StateTable<Types, EntryData>::static_size + HBUINT::static_size));
};
@@ -896,6 +899,89 @@ struct Feature
DEFINE_SIZE_STATIC (12);
};
+
+struct hb_accelerate_subtables_context_t :
+ hb_dispatch_context_t<hb_accelerate_subtables_context_t>
+{
+ struct hb_applicable_t
+ {
+ friend struct hb_accelerate_subtables_context_t;
+ friend struct hb_aat_layout_lookup_accelerator_t;
+
+ public:
+ hb_set_digest_t digest;
+
+ template <typename T>
+ auto init_ (const T &obj_, unsigned num_glyphs, hb_priority<1>) HB_AUTO_RETURN
+ (
+ obj_.machine.collect_glyphs (this->digest, num_glyphs)
+ )
+
+ template <typename T>
+ void init_ (const T &obj_, unsigned num_glyphs, hb_priority<0>)
+ {
+ digest = digest.full ();
+ }
+
+ template <typename T>
+ void init (const T &obj_, unsigned num_glyphs)
+ {
+ init_ (obj_, num_glyphs, hb_prioritize);
+ }
+ };
+
+ /* Dispatch interface. */
+ template <typename T>
+ return_t dispatch (const T &obj)
+ {
+ hb_applicable_t *entry = &array[i++];
+
+ entry->init (obj, num_glyphs);
+
+ return hb_empty_t ();
+ }
+ static return_t default_return_value () { return hb_empty_t (); }
+
+ bool stop_sublookup_iteration (return_t r) const { return false; }
+
+ hb_accelerate_subtables_context_t (hb_applicable_t *array_, unsigned num_glyphs_) :
+ hb_dispatch_context_t<hb_accelerate_subtables_context_t> (),
+ array (array_), num_glyphs (num_glyphs_) {}
+
+ hb_applicable_t *array;
+ unsigned num_glyphs;
+ unsigned i = 0;
+};
+
+struct hb_aat_layout_chain_accelerator_t
+{
+ template <typename TChain>
+ static hb_aat_layout_chain_accelerator_t *create (const TChain &chain, unsigned num_glyphs)
+ {
+ unsigned count = chain.get_subtable_count ();
+
+ unsigned size = sizeof (hb_aat_layout_chain_accelerator_t) -
+ HB_VAR_ARRAY * sizeof (hb_accelerate_subtables_context_t::hb_applicable_t) +
+ count * sizeof (hb_accelerate_subtables_context_t::hb_applicable_t);
+
+ /* The following is a calloc because when we are collecting subtables,
+ * some of them might be invalid and hence not collect; as a result,
+ * we might not fill in all the count entries of the subtables array.
+ * Zeroing it allows the set digest to gatekeep it without having to
+ * initialize it further. */
+ auto *thiz = (hb_aat_layout_chain_accelerator_t *) hb_calloc (1, size);
+ if (unlikely (!thiz))
+ return nullptr;
+
+ hb_accelerate_subtables_context_t c_accelerate_subtables (thiz->subtables, num_glyphs);
+ chain.dispatch (&c_accelerate_subtables);
+
+ return thiz;
+ }
+
+ hb_accelerate_subtables_context_t::hb_applicable_t subtables[HB_VAR_ARRAY];
+};
+
template <typename Types>
struct ChainSubtable
{
@@ -987,6 +1073,8 @@ struct Chain
{
typedef typename Types::HBUINT HBUINT;
+ unsigned get_subtable_count () const { return subtableCount; }
+
hb_mask_t compile_flags (const hb_aat_map_builder_t *map) const
{
hb_mask_t flags = defaultFlags;
@@ -1027,7 +1115,8 @@ struct Chain
return flags;
}
- void apply (hb_aat_apply_context_t *c) const
+ void apply (hb_aat_apply_context_t *c,
+ const hb_aat_layout_chain_accelerator_t *accel) const
{
const ChainSubtable<Types> *subtable = &StructAfter<ChainSubtable<Types>> (featureZ.as_array (featureCount));
unsigned int count = subtableCount;
@@ -1039,6 +1128,7 @@ struct Chain
hb_map ([&subtable] (const hb_aat_map_t::range_flags_t _) -> bool { return subtable->subFeatureFlags & (_.flags); })))
goto skip;
c->subtable_flags = subtable->subFeatureFlags;
+ c->machine_glyph_set = accel ? accel->subtables[i].digest : hb_set_digest_t::full ();
if (!(subtable->get_coverage() & ChainSubtable<Types>::AllDirections) &&
HB_DIRECTION_IS_VERTICAL (c->buffer->props.direction) !=
@@ -1100,7 +1190,22 @@ struct Chain
unsigned int get_size () const { return length; }
- bool sanitize (hb_sanitize_context_t *c, unsigned int version HB_UNUSED) const
+ template <typename context_t, typename ...Ts>
+ typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
+ {
+ const ChainSubtable<Types> *subtable = &StructAfter<ChainSubtable<Types>> (featureZ.as_array (featureCount));
+ unsigned int count = subtableCount;
+ for (unsigned int i = 0; i < count; i++)
+ {
+ typename context_t::return_t ret = subtable->dispatch (c, std::forward<Ts> (ds)...);
+ if (c->stop_sublookup_iteration (ret))
+ return ret;
+ subtable = &StructAfter<ChainSubtable<Types>> (*subtable);
+ }
+ return c->default_return_value ();
+ }
+
+ bool sanitize (hb_sanitize_context_t *c, unsigned int version) const
{
TRACE_SANITIZE (this);
if (!(length.sanitize (c) &&
@@ -1122,6 +1227,13 @@ struct Chain
subtable = &StructAfter<ChainSubtable<Types>> (*subtable);
}
+ if (version >= 3)
+ {
+ const SubtableGlyphCoverage *coverage = (const SubtableGlyphCoverage *) subtable;
+ if (!coverage->sanitize (c, count))
+ return_trace (false);
+ }
+
return_trace (true);
}
@@ -1133,7 +1245,7 @@ struct Chain
UnsizedArrayOf<Feature> featureZ; /* Features. */
/*ChainSubtable firstSubtable;*//* Subtables. */
-/*subtableGlyphCoverageArray*/ /* Only if version >= 3. We don't use. */
+/*SubtableGlyphCoverage coverages*//* Only if version >= 3. */
public:
DEFINE_SIZE_MIN (8 + 2 * sizeof (HBUINT));
@@ -1144,13 +1256,69 @@ struct Chain
* The 'mort'/'morx' Table
*/
-template <typename Types, hb_tag_t TAG>
+template <typename T, typename Types, hb_tag_t TAG>
struct mortmorx
{
static constexpr hb_tag_t tableTag = TAG;
bool has_data () const { return version != 0; }
+ struct accelerator_t
+ {
+ accelerator_t (hb_face_t *face)
+ {
+ hb_sanitize_context_t sc;
+ this->table = sc.reference_table<T> (face);
+
+ this->chain_count = table->get_chain_count ();
+
+ this->accels = (hb_atomic_ptr_t<hb_aat_layout_chain_accelerator_t> *) hb_calloc (this->chain_count, sizeof (*accels));
+ if (unlikely (!this->accels))
+ {
+ this->chain_count = 0;
+ this->table.destroy ();
+ this->table = hb_blob_get_empty ();
+ }
+ }
+ ~accelerator_t ()
+ {
+ for (unsigned int i = 0; i < this->chain_count; i++)
+ hb_free (this->accels[i]);
+ hb_free (this->accels);
+ this->table.destroy ();
+ }
+
+ hb_blob_t *get_blob () const { return table.get_blob (); }
+
+ template <typename Chain>
+ hb_aat_layout_chain_accelerator_t *get_accel (unsigned chain_index, const Chain &chain, unsigned num_glyphs) const
+ {
+ if (unlikely (chain_index >= chain_count)) return nullptr;
+
+ retry:
+ auto *accel = accels[chain_index].get_acquire ();
+ if (unlikely (!accel))
+ {
+ accel = hb_aat_layout_chain_accelerator_t::create (chain, num_glyphs);
+ if (unlikely (!accel))
+ return nullptr;
+
+ if (unlikely (!accels[chain_index].cmpexch (nullptr, accel)))
+ {
+ hb_free (accel);
+ goto retry;
+ }
+ }
+
+ return accel;
+ }
+
+ hb_blob_ptr_t<T> table;
+ unsigned int chain_count;
+ hb_atomic_ptr_t<hb_aat_layout_chain_accelerator_t> *accels;
+ };
+
+
void compile_flags (const hb_aat_map_builder_t *mapper,
hb_aat_map_t *map) const
{
@@ -1167,8 +1335,14 @@ struct mortmorx
}
}
+ unsigned get_chain_count () const
+ {
+ return chainCount;
+ }
+
void apply (hb_aat_apply_context_t *c,
- const hb_aat_map_t &map) const
+ const hb_aat_map_t &map,
+ const accelerator_t &accel) const
{
if (unlikely (!c->buffer->successful)) return;
@@ -1179,8 +1353,9 @@ struct mortmorx
unsigned int count = chainCount;
for (unsigned int i = 0; i < count; i++)
{
+ auto *chain_accel = accel.get_accel (i, *chain, c->face->get_num_glyphs ());
c->range_flags = &map.chain_flags[i];
- chain->apply (c);
+ chain->apply (c, chain_accel);
if (unlikely (!c->buffer->successful)) return;
chain = &StructAfter<Chain<Types>> (*chain);
}
@@ -1220,8 +1395,15 @@ struct mortmorx
DEFINE_SIZE_MIN (8);
};
-struct morx : mortmorx<ExtendedTypes, HB_AAT_TAG_morx> {};
-struct mort : mortmorx<ObsoleteTypes, HB_AAT_TAG_mort> {};
+struct morx : mortmorx<morx, ExtendedTypes, HB_AAT_TAG_morx> {};
+struct mort : mortmorx<mort, ObsoleteTypes, HB_AAT_TAG_mort> {};
+
+struct morx_accelerator_t : morx::accelerator_t {
+ morx_accelerator_t (hb_face_t *face) : morx::accelerator_t (face) {}
+};
+struct mort_accelerator_t : mort::accelerator_t {
+ mort_accelerator_t (hb_face_t *face) : mort::accelerator_t (face) {}
+};
} /* namespace AAT */
diff --git a/thirdparty/harfbuzz/src/hb-aat-layout.cc b/thirdparty/harfbuzz/src/hb-aat-layout.cc
index 5e4cea2224..9da29e51c9 100644
--- a/thirdparty/harfbuzz/src/hb-aat-layout.cc
+++ b/thirdparty/harfbuzz/src/hb-aat-layout.cc
@@ -211,14 +211,14 @@ void
hb_aat_layout_compile_map (const hb_aat_map_builder_t *mapper,
hb_aat_map_t *map)
{
- const AAT::morx& morx = *mapper->face->table.morx;
+ const AAT::morx& morx = *mapper->face->table.morx->table;
if (morx.has_data ())
{
morx.compile_flags (mapper, map);
return;
}
- const AAT::mort& mort = *mapper->face->table.mort;
+ const AAT::mort& mort = *mapper->face->table.mort->table;
if (mort.has_data ())
{
mort.compile_flags (mapper, map);
@@ -243,8 +243,8 @@ hb_aat_layout_compile_map (const hb_aat_map_builder_t *mapper,
hb_bool_t
hb_aat_layout_has_substitution (hb_face_t *face)
{
- return face->table.morx->has_data () ||
- face->table.mort->has_data ();
+ return face->table.morx->table->has_data () ||
+ face->table.mort->table->has_data ();
}
void
@@ -260,26 +260,30 @@ hb_aat_layout_substitute (const hb_ot_shape_plan_t *plan,
hb_aat_map_t map;
builder.compile (map);
- hb_blob_t *morx_blob = font->face->table.morx.get_blob ();
- const AAT::morx& morx = *morx_blob->as<AAT::morx> ();
- if (morx.has_data ())
{
- AAT::hb_aat_apply_context_t c (plan, font, buffer, morx_blob);
- if (!buffer->message (font, "start table morx")) return;
- morx.apply (&c, map);
- (void) buffer->message (font, "end table morx");
- return;
+ auto &accel = *font->face->table.morx;
+ const AAT::morx& morx = *accel.table;
+ if (morx.has_data ())
+ {
+ AAT::hb_aat_apply_context_t c (plan, font, buffer, accel.get_blob ());
+ if (!buffer->message (font, "start table morx")) return;
+ morx.apply (&c, map, accel);
+ (void) buffer->message (font, "end table morx");
+ return;
+ }
}
- hb_blob_t *mort_blob = font->face->table.mort.get_blob ();
- const AAT::mort& mort = *mort_blob->as<AAT::mort> ();
- if (mort.has_data ())
{
- AAT::hb_aat_apply_context_t c (plan, font, buffer, mort_blob);
- if (!buffer->message (font, "start table mort")) return;
- mort.apply (&c, map);
- (void) buffer->message (font, "end table mort");
- return;
+ auto &accel = *font->face->table.mort;
+ const AAT::mort& mort = *accel.table;
+ if (mort.has_data ())
+ {
+ AAT::hb_aat_apply_context_t c (plan, font, buffer, accel.get_blob ());
+ if (!buffer->message (font, "start table mort")) return;
+ mort.apply (&c, map, accel);
+ (void) buffer->message (font, "end table mort");
+ return;
+ }
}
}
@@ -322,7 +326,7 @@ hb_aat_layout_remove_deleted_glyphs (hb_buffer_t *buffer)
hb_bool_t
hb_aat_layout_has_positioning (hb_face_t *face)
{
- return face->table.kerx->has_data ();
+ return face->table.kerx->table->has_data ();
}
void
@@ -330,13 +334,12 @@ hb_aat_layout_position (const hb_ot_shape_plan_t *plan,
hb_font_t *font,
hb_buffer_t *buffer)
{
- hb_blob_t *kerx_blob = font->face->table.kerx.get_blob ();
- const AAT::kerx& kerx = *kerx_blob->as<AAT::kerx> ();
+ auto &accel = *font->face->table.kerx;
- AAT::hb_aat_apply_context_t c (plan, font, buffer, kerx_blob);
+ AAT::hb_aat_apply_context_t c (plan, font, buffer, accel.get_blob ());
if (!buffer->message (font, "start table kerx")) return;
c.set_ankr_table (font->face->table.ankr.get ());
- kerx.apply (&c);
+ accel.apply (&c);
(void) buffer->message (font, "end table kerx");
}
diff --git a/thirdparty/harfbuzz/src/hb-algs.hh b/thirdparty/harfbuzz/src/hb-algs.hh
index efa6074a42..b02793a09f 100644
--- a/thirdparty/harfbuzz/src/hb-algs.hh
+++ b/thirdparty/harfbuzz/src/hb-algs.hh
@@ -202,8 +202,12 @@ struct BEInt<Type, 4>
/* Floats. */
/* We want our rounding towards +infinity. */
+static inline double
+_hb_roundf (double x) { return floor (x + .5); }
+
static inline float
_hb_roundf (float x) { return floorf (x + .5f); }
+
#define roundf(x) _hb_roundf(x)
diff --git a/thirdparty/harfbuzz/src/hb-cff2-interp-cs.hh b/thirdparty/harfbuzz/src/hb-cff2-interp-cs.hh
index 55b1d3bf8d..06fbb72c61 100644
--- a/thirdparty/harfbuzz/src/hb-cff2-interp-cs.hh
+++ b/thirdparty/harfbuzz/src/hb-cff2-interp-cs.hh
@@ -76,16 +76,12 @@ struct cff2_cs_interp_env_t : cs_interp_env_t<ELEM, CFF2Subrs>
coords = coords_;
num_coords = num_coords_;
varStore = acc.varStore;
- seen_blend = false;
- seen_vsindex_ = false;
- scalars.init ();
do_blend = num_coords && coords && varStore->size;
set_ivs (acc.privateDicts[fd].ivs);
}
void fini ()
{
- scalars.fini ();
SUPER::fini ();
}
@@ -173,8 +169,8 @@ struct cff2_cs_interp_env_t : cs_interp_env_t<ELEM, CFF2Subrs>
unsigned int ivs;
hb_vector_t<float> scalars;
bool do_blend;
- bool seen_vsindex_;
- bool seen_blend;
+ bool seen_vsindex_ = false;
+ bool seen_blend = false;
typedef cs_interp_env_t<ELEM, CFF2Subrs> SUPER;
};
diff --git a/thirdparty/harfbuzz/src/hb-cplusplus.hh b/thirdparty/harfbuzz/src/hb-cplusplus.hh
index a640e192de..b6b5c8f781 100644
--- a/thirdparty/harfbuzz/src/hb-cplusplus.hh
+++ b/thirdparty/harfbuzz/src/hb-cplusplus.hh
@@ -27,9 +27,6 @@
#include "hb.h"
-HB_BEGIN_DECLS
-HB_END_DECLS
-
#ifdef __cplusplus
#include <functional>
diff --git a/thirdparty/harfbuzz/src/hb-ot-face-table-list.hh b/thirdparty/harfbuzz/src/hb-ot-face-table-list.hh
index b552dfdd9d..db1c55490c 100644
--- a/thirdparty/harfbuzz/src/hb-ot-face-table-list.hh
+++ b/thirdparty/harfbuzz/src/hb-ot-face-table-list.hh
@@ -100,7 +100,7 @@ HB_OT_CORE_TABLE (OT, MVAR)
/* Legacy kern. */
#ifndef HB_NO_OT_KERN
-HB_OT_CORE_TABLE (OT, kern)
+HB_OT_ACCELERATOR (OT, kern)
#endif
/* OpenType shaping. */
@@ -118,9 +118,9 @@ HB_OT_CORE_TABLE (OT, BASE)
/* AAT shaping. */
#ifndef HB_NO_AAT
-HB_OT_TABLE (AAT, morx)
-HB_OT_TABLE (AAT, mort)
-HB_OT_TABLE (AAT, kerx)
+HB_OT_ACCELERATOR (AAT, morx)
+HB_OT_ACCELERATOR (AAT, mort)
+HB_OT_ACCELERATOR (AAT, kerx)
HB_OT_TABLE (AAT, ankr)
HB_OT_TABLE (AAT, trak)
HB_OT_TABLE (AAT, ltag)
diff --git a/thirdparty/harfbuzz/src/hb-ot-face.cc b/thirdparty/harfbuzz/src/hb-ot-face.cc
index 2243ee0287..b0c927979e 100644
--- a/thirdparty/harfbuzz/src/hb-ot-face.cc
+++ b/thirdparty/harfbuzz/src/hb-ot-face.cc
@@ -41,6 +41,8 @@
#include "hb-ot-layout-gdef-table.hh"
#include "hb-ot-layout-gsub-table.hh"
#include "hb-ot-layout-gpos-table.hh"
+#include "hb-aat-layout-kerx-table.hh"
+#include "hb-aat-layout-morx-table.hh"
void hb_ot_face_t::init0 (hb_face_t *face)
diff --git a/thirdparty/harfbuzz/src/hb-ot-hmtx-table.hh b/thirdparty/harfbuzz/src/hb-ot-hmtx-table.hh
index 48bd536121..e259b33748 100644
--- a/thirdparty/harfbuzz/src/hb-ot-hmtx-table.hh
+++ b/thirdparty/harfbuzz/src/hb-ot-hmtx-table.hh
@@ -410,7 +410,8 @@ struct hmtxvmtx
font->coords, font->num_coords,
store_cache));
- return _glyf_get_advance_with_var_unscaled (font, glyph, T::tableTag == HB_OT_TAG_vmtx);
+ unsigned glyf_advance = _glyf_get_advance_with_var_unscaled (font, glyph, T::tableTag == HB_OT_TAG_vmtx);
+ return glyf_advance ? glyf_advance : advance;
#else
return advance;
#endif
diff --git a/thirdparty/harfbuzz/src/hb-ot-kern-table.hh b/thirdparty/harfbuzz/src/hb-ot-kern-table.hh
index 39444d803f..b87ac8f494 100644
--- a/thirdparty/harfbuzz/src/hb-ot-kern-table.hh
+++ b/thirdparty/harfbuzz/src/hb-ot-kern-table.hh
@@ -86,6 +86,16 @@ struct KernSubTableFormat3
leftClassCount * rightClassCount));
}
+ template <typename set_t>
+ void collect_glyphs (set_t &left_set, set_t &right_set, unsigned num_glyphs) const
+ {
+ set_t set;
+ if (likely (glyphCount))
+ set.add_range (0, glyphCount - 1);
+ left_set.union_ (set);
+ right_set.union_ (set);
+ }
+
protected:
KernSubTableHeader
header;
@@ -135,16 +145,29 @@ struct KernSubTable
switch (subtable_type) {
case 0: return_trace (c->dispatch (u.format0));
#ifndef HB_NO_AAT_SHAPE
- case 1: return_trace (u.header.apple ? c->dispatch (u.format1, std::forward<Ts> (ds)...) : c->default_return_value ());
+ case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
#endif
case 2: return_trace (c->dispatch (u.format2));
#ifndef HB_NO_AAT_SHAPE
- case 3: return_trace (u.header.apple ? c->dispatch (u.format3, std::forward<Ts> (ds)...) : c->default_return_value ());
+ case 3: return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
#endif
default: return_trace (c->default_return_value ());
}
}
+ template <typename set_t>
+ void collect_glyphs (set_t &left_set, set_t &right_set, unsigned num_glyphs) const
+ {
+ unsigned int subtable_type = get_type ();
+ switch (subtable_type) {
+ case 0: u.format0.collect_glyphs (left_set, right_set, num_glyphs); return;
+ case 1: u.format1.collect_glyphs (left_set, right_set, num_glyphs); return;
+ case 2: u.format2.collect_glyphs (left_set, right_set, num_glyphs); return;
+ case 3: u.format3.collect_glyphs (left_set, right_set, num_glyphs); return;
+ default: return;
+ }
+ }
+
bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
@@ -318,8 +341,9 @@ struct kern
}
}
- bool apply (AAT::hb_aat_apply_context_t *c) const
- { return dispatch (c); }
+ bool apply (AAT::hb_aat_apply_context_t *c,
+ const AAT::kern_accelerator_data_t *accel_data = nullptr) const
+ { return dispatch (c, accel_data); }
template <typename context_t, typename ...Ts>
typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
@@ -343,6 +367,41 @@ struct kern
return_trace (dispatch (c));
}
+ AAT::kern_accelerator_data_t create_accelerator_data (unsigned num_glyphs) const
+ {
+ switch (get_type ()) {
+ case 0: return u.ot.create_accelerator_data (num_glyphs);
+#ifndef HB_NO_AAT_SHAPE
+ case 1: return u.aat.create_accelerator_data (num_glyphs);
+#endif
+ default:return AAT::kern_accelerator_data_t ();
+ }
+ }
+
+ struct accelerator_t
+ {
+ accelerator_t (hb_face_t *face)
+ {
+ hb_sanitize_context_t sc;
+ this->table = sc.reference_table<kern> (face);
+ this->accel_data = this->table->create_accelerator_data (face->get_num_glyphs ());
+ }
+ ~accelerator_t ()
+ {
+ this->table.destroy ();
+ }
+
+ hb_blob_t *get_blob () const { return table.get_blob (); }
+
+ bool apply (AAT::hb_aat_apply_context_t *c) const
+ {
+ return table->apply (c, &accel_data);
+ }
+
+ hb_blob_ptr_t<kern> table;
+ AAT::kern_accelerator_data_t accel_data;
+ };
+
protected:
union {
HBUINT32 version32;
@@ -356,6 +415,10 @@ struct kern
DEFINE_SIZE_UNION (4, version32);
};
+struct kern_accelerator_t : kern::accelerator_t {
+ kern_accelerator_t (hb_face_t *face) : kern::accelerator_t (face) {}
+};
+
} /* namespace OT */
diff --git a/thirdparty/harfbuzz/src/hb-ot-layout-base-table.hh b/thirdparty/harfbuzz/src/hb-ot-layout-base-table.hh
index 0278399069..56290905ce 100644
--- a/thirdparty/harfbuzz/src/hb-ot-layout-base-table.hh
+++ b/thirdparty/harfbuzz/src/hb-ot-layout-base-table.hh
@@ -125,6 +125,20 @@ struct BaseCoordFormat3
auto *out = c->serializer->embed (*this);
if (unlikely (!out)) return_trace (false);
+ if (!c->plan->pinned_at_default)
+ {
+ unsigned var_idx = (this+deviceTable).get_variation_index ();
+ if (var_idx != VarIdx::NO_VARIATION)
+ {
+ hb_pair_t<unsigned, int> *v;
+ if (!c->plan->base_variation_idx_map.has (var_idx, &v))
+ return_trace (false);
+
+ if (unlikely (!c->serializer->check_assign (out->coordinate, coordinate + hb_second (*v),
+ HB_SERIALIZE_ERROR_INT_OVERFLOW)))
+ return_trace (false);
+ }
+ }
return_trace (out->deviceTable.serialize_copy (c->serializer, deviceTable,
this, 0,
hb_serialize_context_t::Head,
@@ -401,11 +415,12 @@ struct BaseLangSysRecord
bool has_data () const { return baseLangSysTag; }
- const MinMax &get_min_max () const { return this+minMax; }
+ const MinMax &get_min_max (const void* base) const { return base+minMax; }
- void collect_variation_indices (const hb_subset_plan_t* plan,
+ void collect_variation_indices (const void* base,
+ const hb_subset_plan_t* plan,
hb_set_t& varidx_set /* OUT */) const
- { (this+minMax).collect_variation_indices (plan, varidx_set); }
+ { (base+minMax).collect_variation_indices (plan, varidx_set); }
bool subset (hb_subset_context_t *c,
const void *base) const
@@ -438,7 +453,7 @@ struct BaseScript
const MinMax &get_min_max (hb_tag_t language_tag) const
{
const BaseLangSysRecord& record = baseLangSysRecords.bsearch (language_tag);
- return record.has_data () ? record.get_min_max () : this+defaultMinMax;
+ return record.has_data () ? record.get_min_max (this) : this+defaultMinMax;
}
const BaseCoord &get_base_coord (int baseline_tag_index) const
@@ -454,7 +469,7 @@ struct BaseScript
(this+defaultMinMax).collect_variation_indices (plan, varidx_set);
for (const BaseLangSysRecord& _ : baseLangSysRecords)
- _.collect_variation_indices (plan, varidx_set);
+ _.collect_variation_indices (this, plan, varidx_set);
}
bool subset (hb_subset_context_t *c) const
@@ -705,6 +720,46 @@ struct BASE
(this+vAxis).collect_variation_indices (plan, varidx_set);
}
+ bool subset_varstore (hb_subset_context_t *c,
+ BASE *out /* OUT */) const
+ {
+ TRACE_SUBSET (this);
+ if (!c->serializer->allocate_size<Offset32To<ItemVariationStore>> (Offset32To<ItemVariationStore>::static_size))
+ return_trace (false);
+ if (!c->plan->normalized_coords)
+ return_trace (out->varStore.serialize_subset (c, varStore, this, c->plan->base_varstore_inner_maps.as_array ()));
+
+ if (c->plan->all_axes_pinned)
+ return_trace (true);
+
+ item_variations_t item_vars;
+ if (!item_vars.instantiate (this+varStore, c->plan, true, true,
+ c->plan->base_varstore_inner_maps.as_array ()))
+ return_trace (false);
+
+ if (!out->varStore.serialize_serialize (c->serializer,
+ item_vars.has_long_word (),
+ c->plan->axis_tags,
+ item_vars.get_region_list (),
+ item_vars.get_vardata_encodings ()))
+ return_trace (false);
+
+ const hb_map_t &varidx_map = item_vars.get_varidx_map ();
+ /* base_variation_idx_map in the plan is old_varidx->(varidx, delta)
+ * mapping, new varidx is generated for subsetting, we need to remap this
+ * after instancing */
+ for (auto _ : c->plan->base_variation_idx_map.iter_ref ())
+ {
+ uint32_t varidx = _.second.first;
+ uint32_t *new_varidx;
+ if (varidx_map.has (varidx, &new_varidx))
+ _.second.first = *new_varidx;
+ else
+ _.second.first = HB_OT_LAYOUT_NO_VARIATIONS_INDEX;
+ }
+ return_trace (true);
+ }
+
bool subset (hb_subset_context_t *c) const
{
TRACE_SUBSET (this);
@@ -712,19 +767,15 @@ struct BASE
if (unlikely (!out || !c->serializer->extend_min (out))) return_trace (false);
out->version = version;
+ if (has_var_store () && !subset_varstore (c, out))
+ return_trace (false);
+
if (hAxis && !out->hAxis.serialize_subset (c, hAxis, this))
return_trace (false);
if (vAxis && !out->vAxis.serialize_subset (c, vAxis, this))
return_trace (false);
- if (has_var_store ())
- {
- if (!c->serializer->allocate_size<Offset32To<ItemVariationStore>> (Offset32To<ItemVariationStore>::static_size))
- return_trace (false);
- return_trace (out->varStore.serialize_subset (c, varStore, this, c->plan->base_varstore_inner_maps.as_array ()));
- }
-
return_trace (true);
}
diff --git a/thirdparty/harfbuzz/src/hb-ot-layout-common.hh b/thirdparty/harfbuzz/src/hb-ot-layout-common.hh
index aba427368c..65c8309573 100644
--- a/thirdparty/harfbuzz/src/hb-ot-layout-common.hh
+++ b/thirdparty/harfbuzz/src/hb-ot-layout-common.hh
@@ -2641,7 +2641,7 @@ struct VarRegionList
float max_val = axis_region->endCoord.to_float ();
if (def_val != 0.f)
- axis_tuples.set (*axis_tag, Triple (min_val, def_val, max_val));
+ axis_tuples.set (*axis_tag, Triple ((double) min_val, (double) def_val, (double) max_val));
axis_region++;
}
return !axis_tuples.in_error ();
@@ -3208,6 +3208,8 @@ struct ItemVariationStore
for (unsigned i = 0; i < count; i++)
{
hb_inc_bimap_t *map = inner_maps.push ();
+ if (!c->propagate_error(inner_maps))
+ return_trace(nullptr);
auto &data = this+dataSets[i];
unsigned itemCount = data.get_item_count ();
@@ -3326,19 +3328,19 @@ struct ConditionFormat1
return_trace (false);
const hb_hashmap_t<hb_tag_t, Triple>& normalized_axes_location = c->plan->axes_location;
- Triple axis_limit{-1.f, 0.f, 1.f};
+ Triple axis_limit{-1.0, 0.0, 1.0};
Triple *normalized_limit;
if (normalized_axes_location.has (*axis_tag, &normalized_limit))
axis_limit = *normalized_limit;
const hb_hashmap_t<hb_tag_t, TripleDistances>& axes_triple_distances = c->plan->axes_triple_distances;
- TripleDistances axis_triple_distances{1.f, 1.f};
+ TripleDistances axis_triple_distances{1.0, 1.0};
TripleDistances *triple_dists;
if (axes_triple_distances.has (*axis_tag, &triple_dists))
axis_triple_distances = *triple_dists;
- float normalized_min = renormalizeValue (filterRangeMinValue.to_float (), axis_limit, axis_triple_distances, false);
- float normalized_max = renormalizeValue (filterRangeMaxValue.to_float (), axis_limit, axis_triple_distances, false);
+ float normalized_min = renormalizeValue ((double) filterRangeMinValue.to_float (), axis_limit, axis_triple_distances, false);
+ float normalized_max = renormalizeValue ((double) filterRangeMaxValue.to_float (), axis_limit, axis_triple_distances, false);
out->filterRangeMinValue.set_float (normalized_min);
out->filterRangeMaxValue.set_float (normalized_max);
@@ -3356,7 +3358,7 @@ struct ConditionFormat1
hb_tag_t axis_tag = c->axes_index_tag_map->get (axisIndex);
- Triple axis_range (-1.f, 0.f, 1.f);
+ Triple axis_range (-1.0, 0.0, 1.0);
Triple *axis_limit;
bool axis_set_by_user = false;
if (c->axes_location->has (axis_tag, &axis_limit))
diff --git a/thirdparty/harfbuzz/src/hb-ot-layout-gsubgpos.hh b/thirdparty/harfbuzz/src/hb-ot-layout-gsubgpos.hh
index c65ea32b8a..6b760b1108 100644
--- a/thirdparty/harfbuzz/src/hb-ot-layout-gsubgpos.hh
+++ b/thirdparty/harfbuzz/src/hb-ot-layout-gsubgpos.hh
@@ -1254,7 +1254,7 @@ static bool match_input (hb_ot_apply_context_t *c,
match_func_t match_func,
const void *match_data,
unsigned int *end_position,
- unsigned int match_positions[HB_MAX_CONTEXT_LENGTH],
+ unsigned int *match_positions,
unsigned int *p_total_component_count = nullptr)
{
TRACE_APPLY (nullptr);
@@ -1378,7 +1378,7 @@ static bool match_input (hb_ot_apply_context_t *c,
}
static inline bool ligate_input (hb_ot_apply_context_t *c,
unsigned int count, /* Including the first glyph */
- const unsigned int match_positions[HB_MAX_CONTEXT_LENGTH], /* Including the first glyph */
+ const unsigned int *match_positions, /* Including the first glyph */
unsigned int match_end,
hb_codepoint_t lig_glyph,
unsigned int total_component_count)
@@ -1686,7 +1686,7 @@ static inline void recurse_lookups (context_t *c,
static inline void apply_lookup (hb_ot_apply_context_t *c,
unsigned int count, /* Including the first glyph */
- unsigned int match_positions[HB_MAX_CONTEXT_LENGTH], /* Including the first glyph */
+ unsigned int *match_positions, /* Including the first glyph */
unsigned int lookupCount,
const LookupRecord lookupRecord[], /* Array of LookupRecords--in design order */
unsigned int match_end)
@@ -1694,6 +1694,9 @@ static inline void apply_lookup (hb_ot_apply_context_t *c,
hb_buffer_t *buffer = c->buffer;
int end;
+ unsigned int *match_positions_input = match_positions;
+ unsigned int match_positions_count = count;
+
/* All positions are distance from beginning of *output* buffer.
* Adjust. */
{
@@ -1797,6 +1800,27 @@ static inline void apply_lookup (hb_ot_apply_context_t *c,
{
if (unlikely (delta + count > HB_MAX_CONTEXT_LENGTH))
break;
+ if (unlikely (delta + count > match_positions_count))
+ {
+ unsigned new_match_positions_count = hb_max (delta + count, hb_max(match_positions_count, 4u) * 1.5);
+ if (match_positions == match_positions_input)
+ {
+ match_positions = (unsigned int *) hb_malloc (new_match_positions_count * sizeof (match_positions[0]));
+ if (unlikely (!match_positions))
+ break;
+ memcpy (match_positions, match_positions_input, count * sizeof (match_positions[0]));
+ match_positions_count = new_match_positions_count;
+ }
+ else
+ {
+ unsigned int *new_match_positions = (unsigned int *) hb_realloc (match_positions, new_match_positions_count * sizeof (match_positions[0]));
+ if (unlikely (!new_match_positions))
+ break;
+ match_positions = new_match_positions;
+ match_positions_count = new_match_positions_count;
+ }
+ }
+
}
else
{
@@ -1820,6 +1844,9 @@ static inline void apply_lookup (hb_ot_apply_context_t *c,
match_positions[next] += delta;
}
+ if (match_positions != match_positions_input)
+ hb_free (match_positions);
+
(void) buffer->move_to (end);
}
@@ -1920,8 +1947,18 @@ static bool context_apply_lookup (hb_ot_apply_context_t *c,
const LookupRecord lookupRecord[],
const ContextApplyLookupContext &lookup_context)
{
+ if (unlikely (inputCount > HB_MAX_CONTEXT_LENGTH)) return false;
+ unsigned match_positions_stack[4];
+ unsigned *match_positions = match_positions_stack;
+ if (unlikely (inputCount > ARRAY_LENGTH (match_positions_stack)))
+ {
+ match_positions = (unsigned *) hb_malloc (hb_max (inputCount, 1u) * sizeof (match_positions[0]));
+ if (unlikely (!match_positions))
+ return false;
+ }
+
unsigned match_end = 0;
- unsigned match_positions[HB_MAX_CONTEXT_LENGTH];
+ bool ret = false;
if (match_input (c,
inputCount, input,
lookup_context.funcs.match, lookup_context.match_data,
@@ -1932,13 +1969,18 @@ static bool context_apply_lookup (hb_ot_apply_context_t *c,
inputCount, match_positions,
lookupCount, lookupRecord,
match_end);
- return true;
+ ret = true;
}
else
{
c->buffer->unsafe_to_concat (c->buffer->idx, match_end);
- return false;
+ ret = false;
}
+
+ if (unlikely (match_positions != match_positions_stack))
+ hb_free (match_positions);
+
+ return ret;
}
template <typename Types>
@@ -3018,9 +3060,20 @@ static bool chain_context_apply_lookup (hb_ot_apply_context_t *c,
const LookupRecord lookupRecord[],
const ChainContextApplyLookupContext &lookup_context)
{
+ if (unlikely (inputCount > HB_MAX_CONTEXT_LENGTH)) return false;
+ unsigned match_positions_stack[4];
+ unsigned *match_positions = match_positions_stack;
+ if (unlikely (inputCount > ARRAY_LENGTH (match_positions_stack)))
+ {
+ match_positions = (unsigned *) hb_malloc (hb_max (inputCount, 1u) * sizeof (match_positions[0]));
+ if (unlikely (!match_positions))
+ return false;
+ }
+
+ unsigned start_index = c->buffer->out_len;
unsigned end_index = c->buffer->idx;
unsigned match_end = 0;
- unsigned match_positions[HB_MAX_CONTEXT_LENGTH];
+ bool ret = true;
if (!(match_input (c,
inputCount, input,
lookup_context.funcs.match[1], lookup_context.match_data[1],
@@ -3031,17 +3084,18 @@ static bool chain_context_apply_lookup (hb_ot_apply_context_t *c,
match_end, &end_index)))
{
c->buffer->unsafe_to_concat (c->buffer->idx, end_index);
- return false;
+ ret = false;
+ goto done;
}
- unsigned start_index = c->buffer->out_len;
if (!match_backtrack (c,
backtrackCount, backtrack,
lookup_context.funcs.match[0], lookup_context.match_data[0],
&start_index))
{
c->buffer->unsafe_to_concat_from_outbuffer (start_index, end_index);
- return false;
+ ret = false;
+ goto done;
}
c->buffer->unsafe_to_break_from_outbuffer (start_index, end_index);
@@ -3049,7 +3103,12 @@ static bool chain_context_apply_lookup (hb_ot_apply_context_t *c,
inputCount, match_positions,
lookupCount, lookupRecord,
match_end);
- return true;
+ done:
+
+ if (unlikely (match_positions != match_positions_stack))
+ hb_free (match_positions);
+
+ return ret;
}
template <typename Types>
@@ -4328,7 +4387,7 @@ struct hb_ot_layout_lookup_accelerator_t
thiz->digest.init ();
for (auto& subtable : hb_iter (thiz->subtables, count))
- thiz->digest.add (subtable.digest);
+ thiz->digest.union_ (subtable.digest);
#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE
thiz->cache_user_idx = c_accelerate_subtables.cache_user_idx;
diff --git a/thirdparty/harfbuzz/src/hb-ot-layout.cc b/thirdparty/harfbuzz/src/hb-ot-layout.cc
index a4c13abadf..613c97fd9e 100644
--- a/thirdparty/harfbuzz/src/hb-ot-layout.cc
+++ b/thirdparty/harfbuzz/src/hb-ot-layout.cc
@@ -87,7 +87,7 @@ using OT::Layout::GPOS;
bool
hb_ot_layout_has_kerning (hb_face_t *face)
{
- return face->table.kern->has_data ();
+ return face->table.kern->table->has_data ();
}
/**
@@ -103,7 +103,7 @@ hb_ot_layout_has_kerning (hb_face_t *face)
bool
hb_ot_layout_has_machine_kerning (hb_face_t *face)
{
- return face->table.kern->has_state_machine ();
+ return face->table.kern->table->has_state_machine ();
}
/**
@@ -123,7 +123,7 @@ hb_ot_layout_has_machine_kerning (hb_face_t *face)
bool
hb_ot_layout_has_cross_kerning (hb_face_t *face)
{
- return face->table.kern->has_cross_stream ();
+ return face->table.kern->table->has_cross_stream ();
}
void
@@ -132,7 +132,7 @@ hb_ot_layout_kern (const hb_ot_shape_plan_t *plan,
hb_buffer_t *buffer)
{
hb_blob_t *blob = font->face->table.kern.get_blob ();
- const AAT::kern& kern = *blob->as<AAT::kern> ();
+ const auto& kern = *font->face->table.kern;
AAT::hb_aat_apply_context_t c (plan, font, buffer, blob);
diff --git a/thirdparty/harfbuzz/src/hb-ot-os2-table.hh b/thirdparty/harfbuzz/src/hb-ot-os2-table.hh
index 43b58d9bbf..6c91402269 100644
--- a/thirdparty/harfbuzz/src/hb-ot-os2-table.hh
+++ b/thirdparty/harfbuzz/src/hb-ot-os2-table.hh
@@ -272,7 +272,7 @@ struct OS2
Triple *axis_range;
if (c->plan->user_axes_location.has (HB_TAG ('w','g','h','t'), &axis_range))
{
- unsigned weight_class = static_cast<unsigned> (roundf (hb_clamp (axis_range->middle, 1.0f, 1000.0f)));
+ unsigned weight_class = static_cast<unsigned> (roundf (hb_clamp (axis_range->middle, 1.0, 1000.0)));
if (os2_prime->usWeightClass != weight_class)
os2_prime->usWeightClass = weight_class;
}
diff --git a/thirdparty/harfbuzz/src/hb-ot-post-table.hh b/thirdparty/harfbuzz/src/hb-ot-post-table.hh
index 8132dcfb91..4191879037 100644
--- a/thirdparty/harfbuzz/src/hb-ot-post-table.hh
+++ b/thirdparty/harfbuzz/src/hb-ot-post-table.hh
@@ -116,7 +116,7 @@ struct post
Triple *axis_range;
if (c->plan->user_axes_location.has (HB_TAG ('s','l','n','t'), &axis_range))
{
- float italic_angle = hb_max (-90.f, hb_min (axis_range->middle, 90.f));
+ float italic_angle = hb_max (-90.0, hb_min (axis_range->middle, 90.0));
if (post_prime->italicAngle.to_float () != italic_angle)
post_prime->italicAngle.set_float (italic_angle);
}
diff --git a/thirdparty/harfbuzz/src/hb-ot-stat-table.hh b/thirdparty/harfbuzz/src/hb-ot-stat-table.hh
index e88c82a13c..ea5459ef4e 100644
--- a/thirdparty/harfbuzz/src/hb-ot-stat-table.hh
+++ b/thirdparty/harfbuzz/src/hb-ot-stat-table.hh
@@ -63,8 +63,9 @@ static bool axis_value_is_outside_axis_range (hb_tag_t axis_tag, float axis_valu
if (!user_axes_location->has (axis_tag))
return false;
+ double axis_value_double = static_cast<double>(axis_value);
Triple axis_range = user_axes_location->get (axis_tag);
- return (axis_value < axis_range.minimum || axis_value > axis_range.maximum);
+ return (axis_value_double < axis_range.minimum || axis_value_double > axis_range.maximum);
}
struct StatAxisRecord
diff --git a/thirdparty/harfbuzz/src/hb-ot-tag-table.hh b/thirdparty/harfbuzz/src/hb-ot-tag-table.hh
index db92f4664a..920b06b9c9 100644
--- a/thirdparty/harfbuzz/src/hb-ot-tag-table.hh
+++ b/thirdparty/harfbuzz/src/hb-ot-tag-table.hh
@@ -2818,9 +2818,10 @@ out:
* @tag: A language tag.
*
* Converts @tag to a BCP 47 language tag if it is ambiguous (it corresponds to
- * many language tags) and the best tag is not the alphabetically first, or if
- * the best tag consists of multiple subtags, or if the best tag does not appear
- * in #ot_languages.
+ * many language tags) and the best tag is not the first (sorted alphabetically,
+ * with two-letter tags having priority over all three-letter tags), or if the
+ * best tag consists of multiple subtags, or if the best tag does not appear in
+ * #ot_languages2 or #ot_languages3.
*
* Return value: The #hb_language_t corresponding to the BCP 47 language tag,
* or #HB_LANGUAGE_INVALID if @tag is not ambiguous.
@@ -2834,8 +2835,6 @@ hb_ot_ambiguous_tag_to_language (hb_tag_t tag)
return hb_language_from_string ("alt", -1); /* Southern Altai */
case HB_TAG('A','P','P','H'): /* Phonetic transcription—Americanist conventions */
return hb_language_from_string ("und-fonnapa", -1); /* Undetermined; North American Phonetic Alphabet */
- case HB_TAG('A','R','A',' '): /* Arabic */
- return hb_language_from_string ("ar", -1); /* Arabic [macrolanguage] */
case HB_TAG('A','R','K',' '): /* Rakhine */
return hb_language_from_string ("rki", -1); /* Rakhine */
case HB_TAG('A','T','H',' '): /* Athapaskan */
@@ -2856,12 +2855,6 @@ hb_ot_ambiguous_tag_to_language (hb_tag_t tag)
return hb_language_from_string ("din", -1); /* Dinka [macrolanguage] */
case HB_TAG('D','R','I',' '): /* Dari */
return hb_language_from_string ("prs", -1); /* Dari */
- case HB_TAG('D','Z','N',' '): /* Dzongkha */
- return hb_language_from_string ("dz", -1); /* Dzongkha */
- case HB_TAG('E','T','I',' '): /* Estonian */
- return hb_language_from_string ("et", -1); /* Estonian [macrolanguage] */
- case HB_TAG('F','A','R',' '): /* Persian */
- return hb_language_from_string ("fa", -1); /* Persian [macrolanguage] */
case HB_TAG('G','O','N',' '): /* Gondi */
return hb_language_from_string ("gon", -1); /* Gondi [macrolanguage] */
case HB_TAG('H','M','A',' '): /* High Mari */
@@ -2876,10 +2869,6 @@ hb_ot_ambiguous_tag_to_language (hb_tag_t tag)
return hb_language_from_string ("iba", -1); /* Iban */
case HB_TAG('I','J','O',' '): /* Ijo */
return hb_language_from_string ("ijo", -1); /* Ijo [collection] */
- case HB_TAG('I','N','U',' '): /* Inuktitut */
- return hb_language_from_string ("iu", -1); /* Inuktitut [macrolanguage] */
- case HB_TAG('I','P','K',' '): /* Inupiat */
- return hb_language_from_string ("ik", -1); /* Inupiaq [macrolanguage] */
case HB_TAG('I','P','P','H'): /* Phonetic transcription—IPA conventions */
return hb_language_from_string ("und-fonipa", -1); /* Undetermined; International Phonetic Alphabet */
case HB_TAG('I','R','T',' '): /* Irish Traditional */
@@ -2890,36 +2879,24 @@ hb_ot_ambiguous_tag_to_language (hb_tag_t tag)
return hb_language_from_string ("kln", -1); /* Kalenjin [macrolanguage] */
case HB_TAG('K','G','E',' '): /* Khutsuri Georgian */
return hb_language_from_string ("und-Geok", -1); /* Undetermined; Khutsuri (Asomtavruli and Nuskhuri) */
- case HB_TAG('K','N','R',' '): /* Kanuri */
- return hb_language_from_string ("kr", -1); /* Kanuri [macrolanguage] */
case HB_TAG('K','O','H',' '): /* Korean Old Hangul */
return hb_language_from_string ("okm", -1); /* Middle Korean (10th-16th cent.) */
case HB_TAG('K','O','K',' '): /* Konkani */
return hb_language_from_string ("kok", -1); /* Konkani [macrolanguage] */
- case HB_TAG('K','O','M',' '): /* Komi */
- return hb_language_from_string ("kv", -1); /* Komi [macrolanguage] */
case HB_TAG('K','P','L',' '): /* Kpelle */
return hb_language_from_string ("kpe", -1); /* Kpelle [macrolanguage] */
case HB_TAG('K','R','N',' '): /* Karen */
return hb_language_from_string ("kar", -1); /* Karen [collection] */
case HB_TAG('K','U','I',' '): /* Kui */
return hb_language_from_string ("uki", -1); /* Kui (India) */
- case HB_TAG('K','U','R',' '): /* Kurdish */
- return hb_language_from_string ("ku", -1); /* Kurdish [macrolanguage] */
case HB_TAG('L','M','A',' '): /* Low Mari */
return hb_language_from_string ("mhr", -1); /* Eastern Mari */
case HB_TAG('L','U','H',' '): /* Luyia */
return hb_language_from_string ("luy", -1); /* Luyia [macrolanguage] */
- case HB_TAG('L','V','I',' '): /* Latvian */
- return hb_language_from_string ("lv", -1); /* Latvian [macrolanguage] */
case HB_TAG('M','A','W',' '): /* Marwari */
return hb_language_from_string ("mwr", -1); /* Marwari [macrolanguage] */
- case HB_TAG('M','L','G',' '): /* Malagasy */
- return hb_language_from_string ("mg", -1); /* Malagasy [macrolanguage] */
case HB_TAG('M','L','Y',' '): /* Malay */
return hb_language_from_string ("ms", -1); /* Malay [macrolanguage] */
- case HB_TAG('M','N','G',' '): /* Mongolian */
- return hb_language_from_string ("mn", -1); /* Mongolian [macrolanguage] */
case HB_TAG('M','N','K',' '): /* Maninka */
return hb_language_from_string ("man", -1); /* Mandingo [macrolanguage] */
case HB_TAG('M','O','L',' '): /* Romanian (Moldova) */
@@ -2930,26 +2907,16 @@ hb_ot_ambiguous_tag_to_language (hb_tag_t tag)
return hb_language_from_string ("myn", -1); /* Mayan [collection] */
case HB_TAG('N','A','H',' '): /* Nahuatl */
return hb_language_from_string ("nah", -1); /* Nahuatl [collection] */
- case HB_TAG('N','E','P',' '): /* Nepali */
- return hb_language_from_string ("ne", -1); /* Nepali [macrolanguage] */
case HB_TAG('N','I','S',' '): /* Nisi */
return hb_language_from_string ("njz", -1); /* Nyishi */
case HB_TAG('N','O','R',' '): /* Norwegian */
return hb_language_from_string ("no", -1); /* Norwegian [macrolanguage] */
- case HB_TAG('O','J','B',' '): /* Ojibway */
- return hb_language_from_string ("oj", -1); /* Ojibwa [macrolanguage] */
- case HB_TAG('O','R','O',' '): /* Oromo */
- return hb_language_from_string ("om", -1); /* Oromo [macrolanguage] */
- case HB_TAG('P','A','S',' '): /* Pashto */
- return hb_language_from_string ("ps", -1); /* Pashto [macrolanguage] */
case HB_TAG('P','G','R',' '): /* Polytonic Greek */
return hb_language_from_string ("el-polyton", -1); /* Modern Greek (1453-); Polytonic Greek */
case HB_TAG('P','R','O',' '): /* Provençal / Old Provençal */
return hb_language_from_string ("pro", -1); /* Old Provençal (to 1500) */
case HB_TAG('Q','U','H',' '): /* Quechua (Bolivia) */
return hb_language_from_string ("quh", -1); /* South Bolivian Quechua */
- case HB_TAG('Q','U','Z',' '): /* Quechua */
- return hb_language_from_string ("qu", -1); /* Quechua [macrolanguage] */
case HB_TAG('Q','V','I',' '): /* Quechua (Ecuador) */
return hb_language_from_string ("qvi", -1); /* Imbabura Highland Quichua */
case HB_TAG('Q','W','H',' '): /* Quechua (Peru) */
@@ -2960,10 +2927,6 @@ hb_ot_ambiguous_tag_to_language (hb_tag_t tag)
return hb_language_from_string ("ro", -1); /* Romanian */
case HB_TAG('R','O','Y',' '): /* Romany */
return hb_language_from_string ("rom", -1); /* Romany [macrolanguage] */
- case HB_TAG('S','A','N',' '): /* Sanskrit */
- return hb_language_from_string ("sa", -1); /* Sanskrit [macrolanguage] */
- case HB_TAG('S','Q','I',' '): /* Albanian */
- return hb_language_from_string ("sq", -1); /* Albanian [macrolanguage] */
case HB_TAG('S','R','B',' '): /* Serbian */
return hb_language_from_string ("sr", -1); /* Serbian */
case HB_TAG('S','X','T',' '): /* Sutu */
diff --git a/thirdparty/harfbuzz/src/hb-ot-var-avar-table.hh b/thirdparty/harfbuzz/src/hb-ot-var-avar-table.hh
index 9149959d79..75ea338e2a 100644
--- a/thirdparty/harfbuzz/src/hb-ot-var-avar-table.hh
+++ b/thirdparty/harfbuzz/src/hb-ot-var-avar-table.hh
@@ -80,7 +80,7 @@ struct AxisValueMap
bool is_outside_axis_range (const Triple& axis_range) const
{
- float from_coord = coords[0].to_float ();
+ double from_coord = (double) coords[0].to_float ();
return !axis_range.contains (from_coord);
}
@@ -100,8 +100,8 @@ struct AxisValueMap
float from_coord = coords[0].to_float ();
float to_coord = coords[1].to_float ();
- from_coord = renormalizeValue (from_coord, unmapped_range, triple_distances);
- to_coord = renormalizeValue (to_coord, axis_range, triple_distances);
+ from_coord = renormalizeValue ((double) from_coord, unmapped_range, triple_distances);
+ to_coord = renormalizeValue ((double) to_coord, axis_range, triple_distances);
coords[0].set_float (from_coord);
coords[1].set_float (to_coord);
@@ -197,7 +197,7 @@ struct SegmentMaps : Array16Of<AxisValueMap>
unmapped_val.set_int (unmap (val.to_int ()));
float unmapped_max = unmapped_val.to_float ();
- return Triple{unmapped_min, unmapped_middle, unmapped_max};
+ return Triple{(double) unmapped_min, (double) unmapped_middle, (double) unmapped_max};
}
bool subset (hb_subset_context_t *c, hb_tag_t axis_tag) const
diff --git a/thirdparty/harfbuzz/src/hb-ot-var-common.hh b/thirdparty/harfbuzz/src/hb-ot-var-common.hh
index 379e164059..08227aa1df 100644
--- a/thirdparty/harfbuzz/src/hb-ot-var-common.hh
+++ b/thirdparty/harfbuzz/src/hb-ot-var-common.hh
@@ -299,13 +299,13 @@ struct TupleVariationHeader
start = hb_min (peak, 0.f);
end = hb_max (peak, 0.f);
}
- axis_tuples.set (*axis_tag, Triple (start, peak, end));
+ axis_tuples.set (*axis_tag, Triple ((double) start, (double) peak, (double) end));
}
return true;
}
- float calculate_scalar (hb_array_t<int> coords, unsigned int coord_count,
+ double calculate_scalar (hb_array_t<int> coords, unsigned int coord_count,
const hb_array_t<const F2DOT14> shared_tuples,
const hb_vector_t<hb_pair_t<int,int>> *shared_tuple_active_idx = nullptr) const
{
@@ -321,13 +321,13 @@ struct TupleVariationHeader
{
unsigned int index = get_index ();
if (unlikely ((index + 1) * coord_count > shared_tuples.length))
- return 0.f;
+ return 0.0;
peak_tuple = shared_tuples.sub_array (coord_count * index, coord_count).arrayZ;
if (shared_tuple_active_idx)
{
if (unlikely (index >= shared_tuple_active_idx->length))
- return 0.f;
+ return 0.0;
auto _ = (*shared_tuple_active_idx).arrayZ[index];
if (_.second != -1)
{
@@ -352,7 +352,7 @@ struct TupleVariationHeader
end_tuple = get_end_tuple (coord_count).arrayZ;
}
- float scalar = 1.f;
+ double scalar = 1.0;
for (unsigned int i = start_idx; i < end_idx; i += step)
{
int peak = peak_tuple[i].to_int ();
@@ -367,15 +367,15 @@ struct TupleVariationHeader
int end = end_tuple[i].to_int ();
if (unlikely (start > peak || peak > end ||
(start < 0 && end > 0 && peak))) continue;
- if (v < start || v > end) return 0.f;
+ if (v < start || v > end) return 0.0;
if (v < peak)
- { if (peak != start) scalar *= (float) (v - start) / (peak - start); }
+ { if (peak != start) scalar *= (double) (v - start) / (peak - start); }
else
- { if (peak != end) scalar *= (float) (end - v) / (end - peak); }
+ { if (peak != end) scalar *= (double) (end - v) / (end - peak); }
}
- else if (!v || v < hb_min (0, peak) || v > hb_max (0, peak)) return 0.f;
+ else if (!v || v < hb_min (0, peak) || v > hb_max (0, peak)) return 0.0;
else
- scalar *= (float) v / peak;
+ scalar *= (double) v / peak;
}
return scalar;
}
@@ -444,10 +444,10 @@ struct tuple_delta_t
/* indices_length = point_count, indice[i] = 1 means point i is referenced */
hb_vector_t<bool> indices;
-
- hb_vector_t<float> deltas_x;
+
+ hb_vector_t<double> deltas_x;
/* empty for cvar tuples */
- hb_vector_t<float> deltas_y;
+ hb_vector_t<double> deltas_y;
/* compiled data: header and deltas
* compiled point data is saved in a hashmap within tuple_variations_t cause
@@ -513,9 +513,9 @@ struct tuple_delta_t
return *this;
}
- tuple_delta_t& operator *= (float scalar)
+ tuple_delta_t& operator *= (double scalar)
{
- if (scalar == 1.0f)
+ if (scalar == 1.0)
return *this;
unsigned num = indices.length;
@@ -546,18 +546,18 @@ struct tuple_delta_t
return out;
}
- if ((tent->minimum < 0.f && tent->maximum > 0.f) ||
+ if ((tent->minimum < 0.0 && tent->maximum > 0.0) ||
!(tent->minimum <= tent->middle && tent->middle <= tent->maximum))
return out;
- if (tent->middle == 0.f)
+ if (tent->middle == 0.0)
{
out.push (*this);
return out;
}
- result_t solutions = rebase_tent (*tent, axis_limit, axis_triple_distances);
- for (auto t : solutions)
+ rebase_tent_result_t solutions = rebase_tent (*tent, axis_limit, axis_triple_distances);
+ for (auto &t : solutions)
{
tuple_delta_t new_var = *this;
if (t.second == Triple ())
@@ -729,8 +729,8 @@ struct tuple_delta_t
{ return compile_deltas (indices, deltas_x, deltas_y, compiled_deltas); }
bool compile_deltas (const hb_vector_t<bool> &point_indices,
- const hb_vector_t<float> &x_deltas,
- const hb_vector_t<float> &y_deltas,
+ const hb_vector_t<double> &x_deltas,
+ const hb_vector_t<double> &y_deltas,
hb_vector_t<char> &compiled_deltas /* OUT */)
{
hb_vector_t<int> rounded_deltas;
@@ -1000,9 +1000,13 @@ struct tuple_delta_t
{
i = next_index (i, start_point, end_point);
if (i == next) break;
- deltas_x.arrayZ[i] = infer_delta (orig_points.arrayZ[i].x, orig_points.arrayZ[prev].x, orig_points.arrayZ[next].x,
+ deltas_x.arrayZ[i] = infer_delta ((double) orig_points.arrayZ[i].x,
+ (double) orig_points.arrayZ[prev].x,
+ (double) orig_points.arrayZ[next].x,
deltas_x.arrayZ[prev], deltas_x.arrayZ[next]);
- deltas_y.arrayZ[i] = infer_delta (orig_points.arrayZ[i].y, orig_points.arrayZ[prev].y, orig_points.arrayZ[next].y,
+ deltas_y.arrayZ[i] = infer_delta ((double) orig_points.arrayZ[i].y,
+ (double) orig_points.arrayZ[prev].y,
+ (double) orig_points.arrayZ[next].y,
deltas_y.arrayZ[prev], deltas_y.arrayZ[next]);
inferred_idxes.add (i);
if (--unref_count == 0) goto no_more_gaps;
@@ -1020,8 +1024,8 @@ struct tuple_delta_t
{
if (!inferred_idxes.has (i))
{
- deltas_x.arrayZ[i] = 0.f;
- deltas_y.arrayZ[i] = 0.f;
+ deltas_x.arrayZ[i] = 0.0;
+ deltas_y.arrayZ[i] = 0.0;
}
indices[i] = true;
}
@@ -1031,7 +1035,7 @@ struct tuple_delta_t
bool optimize (const contour_point_vector_t& contour_points,
bool is_composite,
- float tolerance = 0.5f)
+ double tolerance = 0.5 + 1e-10)
{
unsigned count = contour_points.length;
if (deltas_x.length != count ||
@@ -1062,7 +1066,7 @@ struct tuple_delta_t
if (ref_count == count) return true;
- hb_vector_t<float> opt_deltas_x, opt_deltas_y;
+ hb_vector_t<double> opt_deltas_x, opt_deltas_y;
bool is_comp_glyph_wo_deltas = (is_composite && ref_count == 0);
if (is_comp_glyph_wo_deltas)
{
@@ -1194,16 +1198,16 @@ struct tuple_delta_t
return compiled_points.resize (pos, false);
}
- static float infer_delta (float target_val, float prev_val, float next_val, float prev_delta, float next_delta)
+ static double infer_delta (double target_val, double prev_val, double next_val, double prev_delta, double next_delta)
{
if (prev_val == next_val)
- return (prev_delta == next_delta) ? prev_delta : 0.f;
+ return (prev_delta == next_delta) ? prev_delta : 0.0;
else if (target_val <= hb_min (prev_val, next_val))
return (prev_val < next_val) ? prev_delta : next_delta;
else if (target_val >= hb_max (prev_val, next_val))
return (prev_val > next_val) ? prev_delta : next_delta;
- float r = (target_val - prev_val) / (next_val - prev_val);
+ double r = (target_val - prev_val) / (next_val - prev_val);
return prev_delta + r * (next_delta - prev_delta);
}
@@ -1347,9 +1351,9 @@ struct TupleVariationData
unsigned idx = apply_to_all ? i : indices[i];
if (idx >= point_count) continue;
var.indices[idx] = true;
- var.deltas_x[idx] = static_cast<float> (deltas_x[i]);
+ var.deltas_x[idx] = deltas_x[i];
if (is_gvar)
- var.deltas_y[idx] = static_cast<float> (deltas_y[i]);
+ var.deltas_y[idx] = deltas_y[i];
}
tuple_vars.push (std::move (var));
} while (iterator.move_to_next ());
@@ -1367,15 +1371,15 @@ struct TupleVariationData
/* NULL offset, to keep original varidx valid, just return */
if (&var_data == &Null (VarData))
return true;
-
+
unsigned num_regions = var_data.get_region_index_count ();
if (!tuple_vars.alloc (num_regions)) return false;
-
+
item_count = inner_map ? inner_map->get_population () : var_data.get_item_count ();
if (!item_count) return true;
unsigned row_size = var_data.get_row_size ();
const HBUINT8 *delta_bytes = var_data.get_delta_bytes ();
-
+
for (unsigned r = 0; r < num_regions; r++)
{
/* In VarData, deltas are organized in rows, convert them into
@@ -1384,14 +1388,14 @@ struct TupleVariationData
if (!tuple.deltas_x.resize (item_count, false) ||
!tuple.indices.resize (item_count, false))
return false;
-
+
for (unsigned i = 0; i < item_count; i++)
{
tuple.indices.arrayZ[i] = true;
tuple.deltas_x.arrayZ[i] = var_data.get_item_delta_fast (inner_map ? inner_map->backward (i) : i,
r, delta_bytes, row_size);
}
-
+
unsigned region_index = var_data.get_region_index (r);
if (region_index >= regions.length) return false;
tuple.axis_tuples = regions.arrayZ[region_index];
@@ -1425,7 +1429,7 @@ struct TupleVariationData
Triple *axis_limit;
if (!normalized_axes_location.has (axis_tag, &axis_limit))
return false;
- TripleDistances axis_triple_distances{1.f, 1.f};
+ TripleDistances axis_triple_distances{1.0, 1.0};
if (axes_triple_distances.has (axis_tag))
axis_triple_distances = axes_triple_distances.get (axis_tag);
@@ -1503,11 +1507,11 @@ struct TupleVariationData
return false;
continue;
}
-
+
hb_vector_t<char> compiled_point_data;
if (!tuple_delta_t::compile_point_set (*points_set, compiled_point_data))
return false;
-
+
if (!point_data_map.set (points_set, std::move (compiled_point_data)) ||
!point_set_count_map.set (points_set, 1))
return false;
@@ -1547,7 +1551,7 @@ struct TupleVariationData
for (tuple_delta_t& var : tuple_vars)
if (!var.calc_inferred_deltas (contour_points))
return false;
-
+
return true;
}
@@ -1874,7 +1878,7 @@ struct TupleVariationData
if (!tuple_variations.serialize_var_headers (c, total_header_len))
return_trace (false);
-
+
unsigned data_offset = min_size + total_header_len;
if (!is_gvar) data_offset += 4;
if (!c->check_assign (out->data, data_offset, HB_SERIALIZE_ERROR_INT_OVERFLOW)) return_trace (false);
@@ -2335,12 +2339,12 @@ struct item_variations_t
/* just sanity check, this shouldn't happen */
if (encoding.is_empty ())
return false;
-
+
unsigned num_rows = encoding.items.length;
-
+
/* sort rows, make result deterministic */
encoding.items.qsort (_cmp_row);
-
+
/* compile old to new var_idxes mapping */
for (unsigned minor = 0; minor < num_rows; minor++)
{
diff --git a/thirdparty/harfbuzz/src/hb-ot-var-fvar-table.hh b/thirdparty/harfbuzz/src/hb-ot-var-fvar-table.hh
index 07d7586baa..2cd9afbb70 100644
--- a/thirdparty/harfbuzz/src/hb-ot-var-fvar-table.hh
+++ b/thirdparty/harfbuzz/src/hb-ot-var-fvar-table.hh
@@ -43,7 +43,7 @@ static bool axis_coord_pinned_or_within_axis_range (const hb_array_t<const F16DO
unsigned axis_index,
Triple axis_limit)
{
- float axis_coord = coords[axis_index].to_float ();
+ double axis_coord = static_cast<double>(coords[axis_index].to_float ());
if (axis_limit.is_point ())
{
if (axis_limit.minimum != axis_coord)
@@ -233,7 +233,10 @@ struct AxisRecord
{
float min, default_, max;
get_coordinates (min, default_, max);
- return TripleDistances (min, default_, max);
+ return TripleDistances (
+ static_cast<double>(min),
+ static_cast<double>(default_),
+ static_cast<double>(max));
}
bool subset (hb_subset_context_t *c) const
diff --git a/thirdparty/harfbuzz/src/hb-ot-var-gvar-table.hh b/thirdparty/harfbuzz/src/hb-ot-var-gvar-table.hh
index 59aad57e37..d713084faf 100644
--- a/thirdparty/harfbuzz/src/hb-ot-var-gvar-table.hh
+++ b/thirdparty/harfbuzz/src/hb-ot-var-gvar-table.hh
@@ -102,9 +102,8 @@ struct glyph_variations_t
}
bool is_composite_glyph = false;
-#ifdef HB_EXPERIMENTAL_API
is_composite_glyph = plan->composite_new_gids.has (new_gid);
-#endif
+
if (!p->decompile_tuple_variations (all_contour_points->length, true /* is_gvar */,
iterator, &(plan->axes_old_index_tag_map),
shared_indices, shared_tuples,
@@ -120,9 +119,7 @@ struct glyph_variations_t
{
unsigned count = plan->new_to_old_gid_list.length;
bool iup_optimize = false;
-#ifdef HB_EXPERIMENTAL_API
iup_optimize = plan->flags & HB_SUBSET_FLAGS_OPTIMIZE_IUP_DELTAS;
-#endif
for (unsigned i = 0; i < count; i++)
{
hb_codepoint_t new_gid = plan->new_to_old_gid_list[i].first;
diff --git a/thirdparty/harfbuzz/src/hb-repacker.hh b/thirdparty/harfbuzz/src/hb-repacker.hh
index ed40f271cc..cb4fdeead2 100644
--- a/thirdparty/harfbuzz/src/hb-repacker.hh
+++ b/thirdparty/harfbuzz/src/hb-repacker.hh
@@ -337,9 +337,10 @@ bool _process_overflows (const hb_vector_t<graph::overflow_record_t>& overflows,
inline bool
hb_resolve_graph_overflows (hb_tag_t table_tag,
unsigned max_rounds ,
- bool recalculate_extensions,
+ bool always_recalculate_extensions,
graph_t& sorted_graph /* IN/OUT */)
{
+ DEBUG_MSG (SUBSET_REPACK, nullptr, "Repacking %c%c%c%c.", HB_UNTAG(table_tag));
sorted_graph.sort_shortest_distance ();
if (sorted_graph.in_error ())
{
@@ -351,12 +352,12 @@ hb_resolve_graph_overflows (hb_tag_t table_tag,
if (!will_overflow)
return true;
+ bool is_gsub_or_gpos = (table_tag == HB_OT_TAG_GPOS || table_tag == HB_OT_TAG_GSUB);
graph::gsubgpos_graph_context_t ext_context (table_tag, sorted_graph);
- if ((table_tag == HB_OT_TAG_GPOS
- || table_tag == HB_OT_TAG_GSUB)
- && will_overflow)
+ if (is_gsub_or_gpos && will_overflow)
{
- if (recalculate_extensions)
+ DEBUG_MSG (SUBSET_REPACK, nullptr, "Applying GSUB/GPOS repacking specializations.");
+ if (always_recalculate_extensions)
{
DEBUG_MSG (SUBSET_REPACK, nullptr, "Splitting subtables if needed.");
if (!_presplit_subtables_if_needed (ext_context)) {
@@ -412,6 +413,13 @@ hb_resolve_graph_overflows (hb_tag_t table_tag,
if (graph::will_overflow (sorted_graph))
{
+ if (is_gsub_or_gpos && !always_recalculate_extensions) {
+ // If this a GSUB/GPOS table and we didn't try to extension promotion and table splitting then
+ // as a last ditch effort, re-run the repacker with it enabled.
+ DEBUG_MSG (SUBSET_REPACK, nullptr, "Failed to find a resolution. Re-running with extension promotion and table splitting enabled.");
+ return hb_resolve_graph_overflows (table_tag, max_rounds, true, sorted_graph);
+ }
+
DEBUG_MSG (SUBSET_REPACK, nullptr, "Offset overflow resolution failed.");
return false;
}
diff --git a/thirdparty/harfbuzz/src/hb-set-digest.hh b/thirdparty/harfbuzz/src/hb-set-digest.hh
index 5681641baa..b718b94e69 100644
--- a/thirdparty/harfbuzz/src/hb-set-digest.hh
+++ b/thirdparty/harfbuzz/src/hb-set-digest.hh
@@ -82,7 +82,9 @@ struct hb_set_digest_bits_pattern_t
void init () { mask = 0; }
- void add (const hb_set_digest_bits_pattern_t &o) { mask |= o.mask; }
+ static hb_set_digest_bits_pattern_t full () { hb_set_digest_bits_pattern_t d; d.mask = (mask_t) -1; return d; }
+
+ void union_ (const hb_set_digest_bits_pattern_t &o) { mask |= o.mask; }
void add (hb_codepoint_t g) { mask |= mask_for (g); }
@@ -129,11 +131,14 @@ struct hb_set_digest_bits_pattern_t
bool may_have (hb_codepoint_t g) const
{ return mask & mask_for (g); }
+ bool operator [] (hb_codepoint_t g) const
+ { return may_have (g); }
+
private:
static mask_t mask_for (hb_codepoint_t g)
{ return ((mask_t) 1) << ((g >> shift) & (mask_bits - 1)); }
- mask_t mask;
+ mask_t mask = 0;
};
template <typename head_t, typename tail_t>
@@ -145,10 +150,12 @@ struct hb_set_digest_combiner_t
tail.init ();
}
- void add (const hb_set_digest_combiner_t &o)
+ static hb_set_digest_combiner_t full () { hb_set_digest_combiner_t d; d.head = head_t::full(); d.tail = tail_t::full (); return d; }
+
+ void union_ (const hb_set_digest_combiner_t &o)
{
- head.add (o.head);
- tail.add (o.tail);
+ head.union_ (o.head);
+ tail.union_(o.tail);
}
void add (hb_codepoint_t g)
@@ -188,6 +195,9 @@ struct hb_set_digest_combiner_t
return head.may_have (g) && tail.may_have (g);
}
+ bool operator [] (hb_codepoint_t g) const
+ { return may_have (g); }
+
private:
head_t head;
tail_t tail;
diff --git a/thirdparty/harfbuzz/src/hb-set.hh b/thirdparty/harfbuzz/src/hb-set.hh
index ce69ea2c9b..f6013a4141 100644
--- a/thirdparty/harfbuzz/src/hb-set.hh
+++ b/thirdparty/harfbuzz/src/hb-set.hh
@@ -86,7 +86,7 @@ struct hb_sparseset_t
uint32_t hash () const { return s.hash (); }
void add (hb_codepoint_t g) { s.add (g); }
- bool add_range (hb_codepoint_t a, hb_codepoint_t b) { return s.add_range (a, b); }
+ bool add_range (hb_codepoint_t first, hb_codepoint_t last) { return s.add_range (first, last); }
template <typename T>
void add_array (const T *array, unsigned int count, unsigned int stride=sizeof(T))
diff --git a/thirdparty/harfbuzz/src/hb-subset-cff-common.hh b/thirdparty/harfbuzz/src/hb-subset-cff-common.hh
index 462e99cf8c..4039f9c959 100644
--- a/thirdparty/harfbuzz/src/hb-subset-cff-common.hh
+++ b/thirdparty/harfbuzz/src/hb-subset-cff-common.hh
@@ -115,7 +115,7 @@ struct str_encoder_t
encode_byte (OpCode_BCD);
// Based on:
- // https://github.com/fonttools/fonttools/blob/97ed3a61cde03e17b8be36f866192fbd56f1d1a7/Lib/fontTools/misc/psCharStrings.py#L265-L294
+ // https://github.com/fonttools/fonttools/blob/0738c41dfbcbc213ab9263f486ef0cccc6eb5ce5/Lib/fontTools/misc/psCharStrings.py#L267-L316
char buf[16];
/* FontTools has the following comment:
@@ -133,6 +133,10 @@ struct str_encoder_t
(void) hb_uselocale (((void) freelocale (clocale), oldlocale));
char *s = buf;
+ size_t len;
+ char *comma = strchr (s, ',');
+ if (comma) // Comma for some European locales in case no uselocale available.
+ *comma = '.';
if (s[0] == '0' && s[1] == '.')
s++;
else if (s[0] == '-' && s[1] == '0' && s[2] == '.')
@@ -140,6 +144,45 @@ struct str_encoder_t
s[1] = '-';
s++;
}
+ else if ((len = strlen (s)) > 3 && !strcmp (s + len - 3, "000"))
+ {
+ unsigned exponent = len - 3;
+ char *s2 = s + exponent - 1;
+ while (*s2 == '0' && exponent > 1)
+ {
+ s2--;
+ exponent++;
+ }
+ snprintf (s2 + 1, sizeof (buf) - (s2 + 1 - buf), "E%u", exponent);
+ }
+ else
+ {
+ char *dot = strchr (s, '.');
+ char *e = strchr (s, 'E');
+ if (dot && e)
+ {
+ memmove (dot, dot + 1, e - (dot + 1));
+ int exponent = atoi (e + 1);
+ int new_exponent = exponent - (e - (dot + 1));
+ if (new_exponent == 1)
+ {
+ e[-1] = '0';
+ e[0] = '\0';
+ }
+ else
+ snprintf (e - 1, sizeof (buf) - (e - 1 - buf), "E%d", new_exponent);
+ }
+ }
+ if ((s[0] == '.' && s[1] == '0') || (s[0] == '-' && s[1] == '.' && s[2] == '0'))
+ {
+ int sign = s[0] == '-';
+ char *s2 = s + sign + 1;
+ while (*s2 == '0')
+ s2++;
+ len = strlen (s2);
+ memmove (s + sign, s2, len);
+ snprintf (s + sign + len, sizeof (buf) - (s + sign + len - buf), "E-%u", (unsigned) (strlen (s + sign) - 1));
+ }
hb_vector_t<char> nibbles;
while (*s)
{
@@ -155,20 +198,22 @@ struct str_encoder_t
{
s++;
nibbles.push (0x0C); // E-
- continue;
+ } else {
+ if (c2 == '+')
+ s++;
+ nibbles.push (0x0B); // E
}
- if (c2 == '+')
+ if (*s == '0')
s++;
- nibbles.push (0x0B); // E
continue;
}
- case '.': case ',': // Comma for some European locales in case no uselocale available.
+ case '.':
nibbles.push (0x0A); // .
continue;
case '-':
- nibbles.push (0x0E); // .
+ nibbles.push (0x0E); // -
continue;
}
diff --git a/thirdparty/harfbuzz/src/hb-subset-cff2.cc b/thirdparty/harfbuzz/src/hb-subset-cff2.cc
index eb5cb0c625..9c9117d52f 100644
--- a/thirdparty/harfbuzz/src/hb-subset-cff2.cc
+++ b/thirdparty/harfbuzz/src/hb-subset-cff2.cc
@@ -666,6 +666,9 @@ OT::cff2::accelerator_subset_t::serialize (hb_serialize_context_t *c,
bool
OT::cff2::accelerator_subset_t::subset (hb_subset_context_t *c) const
{
+ if (c->plan->normalized_coords && !c->plan->all_axes_pinned)
+ fprintf (stdout, "warning: CFF partial instancing is not supported.\n");
+
cff2_subset_plan cff2_plan;
if (unlikely (!cff2_plan.create (*this, c->plan))) return false;
diff --git a/thirdparty/harfbuzz/src/hb-subset-input.cc b/thirdparty/harfbuzz/src/hb-subset-input.cc
index 68a3e77788..8974755a75 100644
--- a/thirdparty/harfbuzz/src/hb-subset-input.cc
+++ b/thirdparty/harfbuzz/src/hb-subset-input.cc
@@ -446,7 +446,7 @@ hb_subset_input_pin_all_axes_to_default (hb_subset_input_t *input,
for (unsigned i = 0; i < axis_count; i++)
{
hb_tag_t axis_tag = axis_infos[i].tag;
- float default_val = axis_infos[i].default_value;
+ double default_val = (double) axis_infos[i].default_value;
if (!input->axes_location.set (axis_tag, Triple (default_val, default_val, default_val)))
{
hb_free (axis_infos);
@@ -481,7 +481,7 @@ hb_subset_input_pin_axis_to_default (hb_subset_input_t *input,
if (!hb_ot_var_find_axis_info (face, axis_tag, &axis_info))
return false;
- float default_val = axis_info.default_value;
+ double default_val = (double) axis_info.default_value;
return input->axes_location.set (axis_tag, Triple (default_val, default_val, default_val));
}
@@ -511,11 +511,10 @@ hb_subset_input_pin_axis_location (hb_subset_input_t *input,
if (!hb_ot_var_find_axis_info (face, axis_tag, &axis_info))
return false;
- float val = hb_clamp(axis_value, axis_info.min_value, axis_info.max_value);
+ double val = hb_clamp((double) axis_value, (double) axis_info.min_value, (double) axis_info.max_value);
return input->axes_location.set (axis_tag, Triple (val, val, val));
}
-#ifdef HB_EXPERIMENTAL_API
/**
* hb_subset_input_set_axis_range: (skip)
* @input: a #hb_subset_input_t object.
@@ -538,7 +537,7 @@ hb_subset_input_pin_axis_location (hb_subset_input_t *input,
*
* Return value: `true` if success, `false` otherwise
*
- * XSince: EXPERIMENTAL
+ * Since: 8.5.0
**/
HB_EXTERN hb_bool_t
hb_subset_input_set_axis_range (hb_subset_input_t *input,
@@ -562,7 +561,7 @@ hb_subset_input_set_axis_range (hb_subset_input_t *input,
float new_min_val = hb_clamp(min, axis_info.min_value, axis_info.max_value);
float new_max_val = hb_clamp(max, axis_info.min_value, axis_info.max_value);
float new_default_val = hb_clamp(def, new_min_val, new_max_val);
- return input->axes_location.set (axis_tag, Triple (new_min_val, new_default_val, new_max_val));
+ return input->axes_location.set (axis_tag, Triple ((double) new_min_val, (double) new_default_val, (double) new_max_val));
}
/**
@@ -577,7 +576,7 @@ hb_subset_input_set_axis_range (hb_subset_input_t *input,
*
* Return value: `true` if a range has been set for this axis tag, `false` otherwise.
*
- * XSince: EXPERIMENTAL
+ * Since: 8.5.0
**/
HB_EXTERN hb_bool_t
hb_subset_input_get_axis_range (hb_subset_input_t *input,
@@ -598,7 +597,6 @@ hb_subset_input_get_axis_range (hb_subset_input_t *input,
return true;
}
#endif
-#endif
/**
* hb_subset_preprocess:
@@ -746,5 +744,4 @@ hb_subset_input_override_name_table (hb_subset_input_t *input,
input->name_table_overrides.set (hb_ot_name_record_ids_t (platform_id, encoding_id, language_id, name_id), name_bytes);
return true;
}
-
#endif
diff --git a/thirdparty/harfbuzz/src/hb-subset-instancer-iup.cc b/thirdparty/harfbuzz/src/hb-subset-instancer-iup.cc
index 35a964d082..074657acaf 100644
--- a/thirdparty/harfbuzz/src/hb-subset-instancer-iup.cc
+++ b/thirdparty/harfbuzz/src/hb-subset-instancer-iup.cc
@@ -38,7 +38,7 @@ static void _iup_contour_bound_forced_set (const hb_array_t<const contour_point_
const hb_array_t<const int> x_deltas,
const hb_array_t<const int> y_deltas,
hb_set_t& forced_set, /* OUT */
- float tolerance = 0.f)
+ double tolerance = 0.0)
{
unsigned len = contour_points.length;
unsigned next_i = 0;
@@ -47,28 +47,28 @@ static void _iup_contour_bound_forced_set (const hb_array_t<const contour_point_
unsigned last_i = (len + i -1) % len;
for (unsigned j = 0; j < 2; j++)
{
- float cj, lcj, ncj;
+ double cj, lcj, ncj;
int dj, ldj, ndj;
if (j == 0)
{
- cj = contour_points.arrayZ[i].x;
+ cj = static_cast<double> (contour_points.arrayZ[i].x);
dj = x_deltas.arrayZ[i];
- lcj = contour_points.arrayZ[last_i].x;
+ lcj = static_cast<double> (contour_points.arrayZ[last_i].x);
ldj = x_deltas.arrayZ[last_i];
- ncj = contour_points.arrayZ[next_i].x;
+ ncj = static_cast<double> (contour_points.arrayZ[next_i].x);
ndj = x_deltas.arrayZ[next_i];
}
else
{
- cj = contour_points.arrayZ[i].y;
+ cj = static_cast<double> (contour_points.arrayZ[i].y);
dj = y_deltas.arrayZ[i];
- lcj = contour_points.arrayZ[last_i].y;
+ lcj = static_cast<double> (contour_points.arrayZ[last_i].y);
ldj = y_deltas.arrayZ[last_i];
- ncj = contour_points.arrayZ[next_i].y;
+ ncj = static_cast<double> (contour_points.arrayZ[next_i].y);
ndj = y_deltas.arrayZ[next_i];
}
- float c1, c2;
+ double c1, c2;
int d1, d2;
if (lcj <= ncj)
{
@@ -180,8 +180,8 @@ static bool _iup_segment (const hb_array_t<const contour_point_t> contour_points
const contour_point_t& p1, const contour_point_t& p2,
int p1_dx, int p2_dx,
int p1_dy, int p2_dy,
- hb_vector_t<float>& interp_x_deltas, /* OUT */
- hb_vector_t<float>& interp_y_deltas /* OUT */)
+ hb_vector_t<double>& interp_x_deltas, /* OUT */
+ hb_vector_t<double>& interp_y_deltas /* OUT */)
{
unsigned n = contour_points.length;
if (unlikely (!interp_x_deltas.resize (n, false) ||
@@ -190,20 +190,20 @@ static bool _iup_segment (const hb_array_t<const contour_point_t> contour_points
for (unsigned j = 0; j < 2; j++)
{
- float x1, x2, d1, d2;
- float *out;
+ double x1, x2, d1, d2;
+ double *out;
if (j == 0)
{
- x1 = p1.x;
- x2 = p2.x;
+ x1 = static_cast<double> (p1.x);
+ x2 = static_cast<double> (p2.x);
d1 = p1_dx;
d2 = p2_dx;
out = interp_x_deltas.arrayZ;
}
else
{
- x1 = p1.y;
- x2 = p2.y;
+ x1 = static_cast<double> (p1.y);
+ x2 = static_cast<double> (p2.y);
d1 = p1_dy;
d2 = p2_dy;
out = interp_y_deltas.arrayZ;
@@ -219,7 +219,7 @@ static bool _iup_segment (const hb_array_t<const contour_point_t> contour_points
else
{
for (unsigned i = 0; i < n; i++)
- out[i] = 0.f;
+ out[i] = 0.0;
}
continue;
}
@@ -230,11 +230,11 @@ static bool _iup_segment (const hb_array_t<const contour_point_t> contour_points
hb_swap (d1, d2);
}
- float scale = (d2 - d1) / (x2 - x1);
+ double scale = (d2 - d1) / (x2 - x1);
for (unsigned i = 0; i < n; i++)
{
- float x = j == 0 ? contour_points.arrayZ[i].x : contour_points.arrayZ[i].y;
- float d;
+ double x = (j == 0 ? static_cast<double> (contour_points.arrayZ[i].x) : static_cast<double> (contour_points.arrayZ[i].y));
+ double d;
if (x <= x1)
d = d1;
else if (x >= x2)
@@ -254,9 +254,9 @@ static bool _can_iup_in_between (const hb_array_t<const contour_point_t> contour
const contour_point_t& p1, const contour_point_t& p2,
int p1_dx, int p2_dx,
int p1_dy, int p2_dy,
- float tolerance)
+ double tolerance)
{
- hb_vector_t<float> interp_x_deltas, interp_y_deltas;
+ hb_vector_t<double> interp_x_deltas, interp_y_deltas;
if (!_iup_segment (contour_points, x_deltas, y_deltas,
p1, p2, p1_dx, p2_dx, p1_dy, p2_dy,
interp_x_deltas, interp_y_deltas))
@@ -266,10 +266,10 @@ static bool _can_iup_in_between (const hb_array_t<const contour_point_t> contour
for (unsigned i = 0; i < num; i++)
{
- float dx = x_deltas.arrayZ[i] - interp_x_deltas.arrayZ[i];
- float dy = y_deltas.arrayZ[i] - interp_y_deltas.arrayZ[i];
+ double dx = static_cast<double> (x_deltas.arrayZ[i]) - interp_x_deltas.arrayZ[i];
+ double dy = static_cast<double> (y_deltas.arrayZ[i]) - interp_y_deltas.arrayZ[i];
- if (sqrtf ((float)dx * dx + (float)dy * dy) > tolerance)
+ if (sqrt (dx * dx + dy * dy) > tolerance)
return false;
}
return true;
@@ -279,7 +279,7 @@ static bool _iup_contour_optimize_dp (const contour_point_vector_t& contour_poin
const hb_vector_t<int>& x_deltas,
const hb_vector_t<int>& y_deltas,
const hb_set_t& forced_set,
- float tolerance,
+ double tolerance,
unsigned lookback,
hb_vector_t<unsigned>& costs, /* OUT */
hb_vector_t<int>& chain /* OUT */)
@@ -333,7 +333,7 @@ static bool _iup_contour_optimize (const hb_array_t<const contour_point_t> conto
const hb_array_t<const int> x_deltas,
const hb_array_t<const int> y_deltas,
hb_array_t<bool> opt_indices, /* OUT */
- float tolerance = 0.f)
+ double tolerance = 0.0)
{
unsigned n = contour_points.length;
if (opt_indices.length != n ||
@@ -346,7 +346,7 @@ static bool _iup_contour_optimize (const hb_array_t<const contour_point_t> conto
{
int dx = x_deltas.arrayZ[i];
int dy = y_deltas.arrayZ[i];
- if (sqrtf ((float)dx * dx + (float)dy * dy) > tolerance)
+ if (sqrt ((double) dx * dx + (double) dy * dy) > tolerance)
{
all_within_tolerance = false;
break;
@@ -443,11 +443,11 @@ static bool _iup_contour_optimize (const hb_array_t<const contour_point_t> conto
unsigned contour_point_size = hb_static_size (contour_point_t);
for (unsigned i = 0; i < n; i++)
{
- hb_memcpy ((void *) repeat_x_deltas.arrayZ, (const void *) x_deltas.arrayZ, n * sizeof (float));
- hb_memcpy ((void *) (repeat_x_deltas.arrayZ + n), (const void *) x_deltas.arrayZ, n * sizeof (float));
+ hb_memcpy ((void *) repeat_x_deltas.arrayZ, (const void *) x_deltas.arrayZ, n * sizeof (repeat_x_deltas[0]));
+ hb_memcpy ((void *) (repeat_x_deltas.arrayZ + n), (const void *) x_deltas.arrayZ, n * sizeof (repeat_x_deltas[0]));
- hb_memcpy ((void *) repeat_y_deltas.arrayZ, (const void *) y_deltas.arrayZ, n * sizeof (float));
- hb_memcpy ((void *) (repeat_y_deltas.arrayZ + n), (const void *) y_deltas.arrayZ, n * sizeof (float));
+ hb_memcpy ((void *) repeat_y_deltas.arrayZ, (const void *) y_deltas.arrayZ, n * sizeof (repeat_x_deltas[0]));
+ hb_memcpy ((void *) (repeat_y_deltas.arrayZ + n), (const void *) y_deltas.arrayZ, n * sizeof (repeat_x_deltas[0]));
hb_memcpy ((void *) repeat_points.arrayZ, (const void *) contour_points.arrayZ, n * contour_point_size);
hb_memcpy ((void *) (repeat_points.arrayZ + n), (const void *) contour_points.arrayZ, n * contour_point_size);
@@ -496,7 +496,7 @@ bool iup_delta_optimize (const contour_point_vector_t& contour_points,
const hb_vector_t<int>& x_deltas,
const hb_vector_t<int>& y_deltas,
hb_vector_t<bool>& opt_indices, /* OUT */
- float tolerance)
+ double tolerance)
{
if (!opt_indices.resize (contour_points.length))
return false;
diff --git a/thirdparty/harfbuzz/src/hb-subset-instancer-iup.hh b/thirdparty/harfbuzz/src/hb-subset-instancer-iup.hh
index 7eac5935a4..01987bd258 100644
--- a/thirdparty/harfbuzz/src/hb-subset-instancer-iup.hh
+++ b/thirdparty/harfbuzz/src/hb-subset-instancer-iup.hh
@@ -32,6 +32,6 @@ HB_INTERNAL bool iup_delta_optimize (const contour_point_vector_t& contour_point
const hb_vector_t<int>& x_deltas,
const hb_vector_t<int>& y_deltas,
hb_vector_t<bool>& opt_indices, /* OUT */
- float tolerance = 0.f);
+ double tolerance = 0.0);
#endif /* HB_SUBSET_INSTANCER_IUP_HH */
diff --git a/thirdparty/harfbuzz/src/hb-subset-instancer-solver.cc b/thirdparty/harfbuzz/src/hb-subset-instancer-solver.cc
index 70783c0a0d..ca903e2707 100644
--- a/thirdparty/harfbuzz/src/hb-subset-instancer-solver.cc
+++ b/thirdparty/harfbuzz/src/hb-subset-instancer-solver.cc
@@ -32,17 +32,17 @@
* This should be safe.
*/
-constexpr static float EPSILON = 1.f / (1 << 14);
-constexpr static float MAX_F2DOT14 = float (0x7FFF) / (1 << 14);
+constexpr static double EPSILON = 1.0 / (1 << 14);
+constexpr static double MAX_F2DOT14 = double (0x7FFF) / (1 << 14);
static inline Triple _reverse_negate(const Triple &v)
{ return {-v.maximum, -v.middle, -v.minimum}; }
-static inline float supportScalar (float coord, const Triple &tent)
+static inline double supportScalar (double coord, const Triple &tent)
{
/* Copied from VarRegionAxis::evaluate() */
- float start = tent.minimum, peak = tent.middle, end = tent.maximum;
+ double start = tent.minimum, peak = tent.middle, end = tent.maximum;
if (unlikely (start > peak || peak > end))
return 1.;
@@ -62,20 +62,20 @@ static inline float supportScalar (float coord, const Triple &tent)
return (end - coord) / (end - peak);
}
-static inline result_t
+static inline rebase_tent_result_t
_solve (Triple tent, Triple axisLimit, bool negative = false)
{
- float axisMin = axisLimit.minimum;
- float axisDef = axisLimit.middle;
- float axisMax = axisLimit.maximum;
- float lower = tent.minimum;
- float peak = tent.middle;
- float upper = tent.maximum;
+ double axisMin = axisLimit.minimum;
+ double axisDef = axisLimit.middle;
+ double axisMax = axisLimit.maximum;
+ double lower = tent.minimum;
+ double peak = tent.middle;
+ double upper = tent.maximum;
// Mirror the problem such that axisDef <= peak
if (axisDef > peak)
{
- result_t vec = _solve (_reverse_negate (tent),
+ rebase_tent_result_t vec = _solve (_reverse_negate (tent),
_reverse_negate (axisLimit),
!negative);
@@ -98,7 +98,7 @@ _solve (Triple tent, Triple axisLimit, bool negative = false)
* axisMin axisDef axisMax lower upper
*/
if (axisMax <= lower && axisMax < peak)
- return result_t{}; // No overlap
+ return rebase_tent_result_t{}; // No overlap
/* case 2: Only the peak and outermost bound fall outside the new limit;
* we keep the deltaset, update peak and outermost bound and scale deltas
@@ -130,10 +130,10 @@ _solve (Triple tent, Triple axisLimit, bool negative = false)
*/
if (axisMax < peak)
{
- float mult = supportScalar (axisMax, tent);
+ double mult = supportScalar (axisMax, tent);
tent = Triple{lower, axisMax, axisMax};
- result_t vec = _solve (tent, axisLimit);
+ rebase_tent_result_t vec = _solve (tent, axisLimit);
for (auto &p : vec)
p = hb_pair (p.first * mult, p.second);
@@ -143,13 +143,13 @@ _solve (Triple tent, Triple axisLimit, bool negative = false)
// lower <= axisDef <= peak <= axisMax
- float gain = supportScalar (axisDef, tent);
- result_t out {hb_pair (gain, Triple{})};
+ double gain = supportScalar (axisDef, tent);
+ rebase_tent_result_t out {hb_pair (gain, Triple{})};
// First, the positive side
// outGain is the scalar of axisMax at the tent.
- float outGain = supportScalar (axisMax, tent);
+ double outGain = supportScalar (axisMax, tent);
/* Case 3a: Gain is more than outGain. The tent down-slope crosses
* the axis into negative. We have to split it into multiples.
@@ -173,10 +173,10 @@ _solve (Triple tent, Triple axisLimit, bool negative = false)
// Note that this is the branch taken if both gain and outGain are 0.
// Crossing point on the axis.
- float crossing = peak + (1 - gain) * (upper - peak);
+ double crossing = peak + (1 - gain) * (upper - peak);
Triple loc{hb_max (lower, axisDef), peak, crossing};
- float scalar = 1.f;
+ double scalar = 1.0;
// The part before the crossing point.
out.push (hb_pair (scalar - gain, loc));
@@ -191,7 +191,7 @@ _solve (Triple tent, Triple axisLimit, bool negative = false)
if (upper >= axisMax)
{
Triple loc {crossing, axisMax, axisMax};
- float scalar = outGain;
+ double scalar = outGain;
out.push (hb_pair (scalar - gain, loc));
}
@@ -221,11 +221,11 @@ _solve (Triple tent, Triple axisLimit, bool negative = false)
// Downslope.
Triple loc1 {crossing, upper, axisMax};
- float scalar1 = 0.f;
+ double scalar1 = 0.0;
// Eternity justify.
Triple loc2 {upper, axisMax, axisMax};
- float scalar2 = 0.f;
+ double scalar2 = 0.0;
out.push (hb_pair (scalar1 - gain, loc1));
out.push (hb_pair (scalar2 - gain, loc2));
@@ -254,11 +254,11 @@ _solve (Triple tent, Triple axisLimit, bool negative = false)
* | | newUpper
* axisDef axisMax
*/
- float newUpper = peak + (1 - gain) * (upper - peak);
+ double newUpper = peak + (1 - gain) * (upper - peak);
assert (axisMax <= newUpper); // Because outGain > gain
/* Disabled because ots doesn't like us:
* https://github.com/fonttools/fonttools/issues/3350 */
-
+
if (false && (newUpper <= axisDef + (axisMax - axisDef) * 2))
{
upper = newUpper;
@@ -270,7 +270,7 @@ _solve (Triple tent, Triple axisLimit, bool negative = false)
}
Triple loc {hb_max (axisDef, lower), peak, upper};
- float scalar = 1.f;
+ double scalar = 1.0;
out.push (hb_pair (scalar - gain, loc));
}
@@ -294,10 +294,10 @@ _solve (Triple tent, Triple axisLimit, bool negative = false)
else
{
Triple loc1 {hb_max (axisDef, lower), peak, axisMax};
- float scalar1 = 1.f;
+ double scalar1 = 1.0;
Triple loc2 {peak, axisMax, axisMax};
- float scalar2 = outGain;
+ double scalar2 = outGain;
out.push (hb_pair (scalar1 - gain, loc1));
// Don't add a dirac delta!
@@ -325,7 +325,7 @@ _solve (Triple tent, Triple axisLimit, bool negative = false)
if (lower <= axisMin)
{
Triple loc {axisMin, axisMin, axisDef};
- float scalar = supportScalar (axisMin, tent);
+ double scalar = supportScalar (axisMin, tent);
out.push (hb_pair (scalar - gain, loc));
}
@@ -353,11 +353,11 @@ _solve (Triple tent, Triple axisLimit, bool negative = false)
// Downslope.
Triple loc1 {axisMin, lower, axisDef};
- float scalar1 = 0.f;
+ double scalar1 = 0.0;
// Eternity justify.
Triple loc2 {axisMin, axisMin, lower};
- float scalar2 = 0.f;
+ double scalar2 = 0.0;
out.push (hb_pair (scalar1 - gain, loc1));
out.push (hb_pair (scalar2 - gain, loc2));
@@ -369,19 +369,19 @@ _solve (Triple tent, Triple axisLimit, bool negative = false)
static inline TripleDistances _reverse_triple_distances (const TripleDistances &v)
{ return TripleDistances (v.positive, v.negative); }
-float renormalizeValue (float v, const Triple &triple,
- const TripleDistances &triple_distances, bool extrapolate)
+double renormalizeValue (double v, const Triple &triple,
+ const TripleDistances &triple_distances, bool extrapolate)
{
- float lower = triple.minimum, def = triple.middle, upper = triple.maximum;
+ double lower = triple.minimum, def = triple.middle, upper = triple.maximum;
assert (lower <= def && def <= upper);
if (!extrapolate)
v = hb_max (hb_min (v, upper), lower);
if (v == def)
- return 0.f;
+ return 0.0;
- if (def < 0.f)
+ if (def < 0.0)
return -renormalizeValue (-v, _reverse_negate (triple),
_reverse_triple_distances (triple_distances), extrapolate);
@@ -390,14 +390,14 @@ float renormalizeValue (float v, const Triple &triple,
return (v - def) / (upper - def);
/* v < def */
- if (lower >= 0.f)
+ if (lower >= 0.0)
return (v - def) / (def - lower);
/* lower < 0 and v < default */
- float total_distance = triple_distances.negative * (-lower) + triple_distances.positive * def;
+ double total_distance = triple_distances.negative * (-lower) + triple_distances.positive * def;
- float v_distance;
- if (v >= 0.f)
+ double v_distance;
+ if (v >= 0.0)
v_distance = (def - v) * triple_distances.positive;
else
v_distance = (-v) * triple_distances.negative + triple_distances.positive * def;
@@ -405,18 +405,18 @@ float renormalizeValue (float v, const Triple &triple,
return (-v_distance) /total_distance;
}
-result_t
+rebase_tent_result_t
rebase_tent (Triple tent, Triple axisLimit, TripleDistances axis_triple_distances)
{
- assert (-1.f <= axisLimit.minimum && axisLimit.minimum <= axisLimit.middle && axisLimit.middle <= axisLimit.maximum && axisLimit.maximum <= +1.f);
- assert (-2.f <= tent.minimum && tent.minimum <= tent.middle && tent.middle <= tent.maximum && tent.maximum <= +2.f);
- assert (tent.middle != 0.f);
+ assert (-1.0 <= axisLimit.minimum && axisLimit.minimum <= axisLimit.middle && axisLimit.middle <= axisLimit.maximum && axisLimit.maximum <= +1.0);
+ assert (-2.0 <= tent.minimum && tent.minimum <= tent.middle && tent.middle <= tent.maximum && tent.maximum <= +2.0);
+ assert (tent.middle != 0.0);
- result_t sols = _solve (tent, axisLimit);
+ rebase_tent_result_t sols = _solve (tent, axisLimit);
- auto n = [&axisLimit, &axis_triple_distances] (float v) { return renormalizeValue (v, axisLimit, axis_triple_distances); };
+ auto n = [&axisLimit, &axis_triple_distances] (double v) { return renormalizeValue (v, axisLimit, axis_triple_distances); };
- result_t out;
+ rebase_tent_result_t out;
for (auto &p : sols)
{
if (!p.first) continue;
diff --git a/thirdparty/harfbuzz/src/hb-subset-instancer-solver.hh b/thirdparty/harfbuzz/src/hb-subset-instancer-solver.hh
index 563fccbb59..9aac9fcc7e 100644
--- a/thirdparty/harfbuzz/src/hb-subset-instancer-solver.hh
+++ b/thirdparty/harfbuzz/src/hb-subset-instancer-solver.hh
@@ -30,24 +30,24 @@
/* pre-normalized distances */
struct TripleDistances
{
- TripleDistances (): negative (1.f), positive (1.f) {}
- TripleDistances (float neg_, float pos_): negative (neg_), positive (pos_) {}
- TripleDistances (float min, float default_, float max)
+ TripleDistances (): negative (1.0), positive (1.0) {}
+ TripleDistances (double neg_, double pos_): negative (neg_), positive (pos_) {}
+ TripleDistances (double min, double default_, double max)
{
negative = default_ - min;
positive = max - default_;
}
- float negative;
- float positive;
+ double negative;
+ double positive;
};
struct Triple {
Triple () :
- minimum (0.f), middle (0.f), maximum (0.f) {}
+ minimum (0.0), middle (0.0), maximum (0.0) {}
- Triple (float minimum_, float middle_, float maximum_) :
+ Triple (double minimum_, double middle_, double maximum_) :
minimum (minimum_), middle (middle_), maximum (maximum_) {}
bool operator == (const Triple &o) const
@@ -63,7 +63,7 @@ struct Triple {
bool is_point () const
{ return minimum == middle && middle == maximum; }
- bool contains (float point) const
+ bool contains (double point) const
{ return minimum <= point && point <= maximum; }
/* from hb_array_t hash ()*/
@@ -82,18 +82,18 @@ struct Triple {
}
- float minimum;
- float middle;
- float maximum;
+ double minimum;
+ double middle;
+ double maximum;
};
-using result_item_t = hb_pair_t<float, Triple>;
-using result_t = hb_vector_t<result_item_t>;
+using rebase_tent_result_item_t = hb_pair_t<double, Triple>;
+using rebase_tent_result_t = hb_vector_t<rebase_tent_result_item_t>;
/* renormalize a normalized value v to the range of an axis,
* considering the prenormalized distances as well as the new axis limits.
* Ported from fonttools */
-HB_INTERNAL float renormalizeValue (float v, const Triple &triple,
+HB_INTERNAL double renormalizeValue (double v, const Triple &triple,
const TripleDistances &triple_distances,
bool extrapolate = true);
/* Given a tuple (lower,peak,upper) "tent" and new axis limits
@@ -107,6 +107,8 @@ HB_INTERNAL float renormalizeValue (float v, const Triple &triple,
* If tent value is Triple{}, that is a special deltaset that should
* be always-enabled (called "gain").
*/
-HB_INTERNAL result_t rebase_tent (Triple tent, Triple axisLimit, TripleDistances axis_triple_distances);
+HB_INTERNAL rebase_tent_result_t rebase_tent (Triple tent,
+ Triple axisLimit,
+ TripleDistances axis_triple_distances);
#endif /* HB_SUBSET_INSTANCER_SOLVER_HH */
diff --git a/thirdparty/harfbuzz/src/hb-subset-plan-member-list.hh b/thirdparty/harfbuzz/src/hb-subset-plan-member-list.hh
index 74416b92f9..ade8278c40 100644
--- a/thirdparty/harfbuzz/src/hb-subset-plan-member-list.hh
+++ b/thirdparty/harfbuzz/src/hb-subset-plan-member-list.hh
@@ -102,6 +102,12 @@ HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<unsigned, hb_pair_t E(<const void*, const
//active layers/palettes we'd like to retain
HB_SUBSET_PLAN_MEMBER (hb_map_t, colrv1_layers)
HB_SUBSET_PLAN_MEMBER (hb_map_t, colr_palettes)
+//colrv1 varstore retained varidx mapping
+HB_SUBSET_PLAN_MEMBER (hb_vector_t<hb_inc_bimap_t>, colrv1_varstore_inner_maps)
+//colrv1 retained varidx -> (new varidx, delta) mapping
+HB_SUBSET_PLAN_MEMBER (mutable hb_hashmap_t E(<unsigned, hb_pair_t E(<unsigned, int>)>), colrv1_variation_idx_delta_map)
+//colrv1 retained new delta set index -> new varidx mapping
+HB_SUBSET_PLAN_MEMBER (hb_map_t, colrv1_new_deltaset_idx_varidx_map)
//Old layout item variation index -> (New varidx, delta) mapping
HB_SUBSET_PLAN_MEMBER (mutable hb_hashmap_t E(<unsigned, hb_pair_t E(<unsigned, int>)>), layout_variation_idx_delta_map)
@@ -144,7 +150,7 @@ HB_SUBSET_PLAN_MEMBER (mutable hb_hashmap_t E(<hb_codepoint_t, contour_point_vec
HB_SUBSET_PLAN_MEMBER (hb_set_t, composite_new_gids)
//Old BASE item variation index -> (New varidx, 0) mapping
-HB_SUBSET_PLAN_MEMBER (hb_hashmap_t E(<unsigned, hb_pair_t E(<unsigned, int>)>), base_variation_idx_map)
+HB_SUBSET_PLAN_MEMBER (mutable hb_hashmap_t E(<unsigned, hb_pair_t E(<unsigned, int>)>), base_variation_idx_map)
//BASE table varstore retained varidx mapping
HB_SUBSET_PLAN_MEMBER (hb_vector_t<hb_inc_bimap_t>, base_varstore_inner_maps)
diff --git a/thirdparty/harfbuzz/src/hb-subset-plan.cc b/thirdparty/harfbuzz/src/hb-subset-plan.cc
index 068fddaedd..d657790d54 100644
--- a/thirdparty/harfbuzz/src/hb-subset-plan.cc
+++ b/thirdparty/harfbuzz/src/hb-subset-plan.cc
@@ -399,12 +399,55 @@ _get_hb_font_with_variations (const hb_subset_plan_t *plan)
}
static inline void
+_remap_variation_indices (const OT::ItemVariationStore &var_store,
+ const hb_set_t &variation_indices,
+ const hb_vector_t<int>& normalized_coords,
+ bool calculate_delta, /* not pinned at default */
+ bool no_variations, /* all axes pinned */
+ hb_hashmap_t<unsigned, hb_pair_t<unsigned, int>> &variation_idx_delta_map /* OUT */)
+{
+ if (&var_store == &Null (OT::ItemVariationStore)) return;
+ unsigned subtable_count = var_store.get_sub_table_count ();
+ float *store_cache = var_store.create_cache ();
+
+ unsigned new_major = 0, new_minor = 0;
+ unsigned last_major = (variation_indices.get_min ()) >> 16;
+ for (unsigned idx : variation_indices)
+ {
+ int delta = 0;
+ if (calculate_delta)
+ delta = roundf (var_store.get_delta (idx, normalized_coords.arrayZ,
+ normalized_coords.length, store_cache));
+
+ if (no_variations)
+ {
+ variation_idx_delta_map.set (idx, hb_pair_t<unsigned, int> (HB_OT_LAYOUT_NO_VARIATIONS_INDEX, delta));
+ continue;
+ }
+
+ uint16_t major = idx >> 16;
+ if (major >= subtable_count) break;
+ if (major != last_major)
+ {
+ new_minor = 0;
+ ++new_major;
+ }
+
+ unsigned new_idx = (new_major << 16) + new_minor;
+ variation_idx_delta_map.set (idx, hb_pair_t<unsigned, int> (new_idx, delta));
+ ++new_minor;
+ last_major = major;
+ }
+ var_store.destroy_cache (store_cache);
+}
+
+static inline void
_collect_layout_variation_indices (hb_subset_plan_t* plan)
{
hb_blob_ptr_t<OT::GDEF> gdef = plan->source_table<OT::GDEF> ();
hb_blob_ptr_t<GPOS> gpos = plan->source_table<GPOS> ();
- if (!gdef->has_data ())
+ if (!gdef->has_data () || !gdef->has_var_store ())
{
gdef.destroy ();
gpos.destroy ();
@@ -420,13 +463,13 @@ _collect_layout_variation_indices (hb_subset_plan_t* plan)
if (hb_ot_layout_has_positioning (plan->source))
gpos->collect_variation_indices (&c);
- gdef->remap_layout_variation_indices (&varidx_set,
- plan->normalized_coords,
- !plan->pinned_at_default,
- plan->all_axes_pinned,
- &plan->layout_variation_idx_delta_map);
+ _remap_variation_indices (gdef->get_var_store (),
+ varidx_set, plan->normalized_coords,
+ !plan->pinned_at_default,
+ plan->all_axes_pinned,
+ plan->layout_variation_idx_delta_map);
- unsigned subtable_count = gdef->has_var_store () ? gdef->get_var_store ().get_sub_table_count () : 0;
+ unsigned subtable_count = gdef->get_var_store ().get_sub_table_count ();
_generate_varstore_inner_maps (varidx_set, subtable_count, plan->gdef_varstore_inner_maps);
gdef.destroy ();
@@ -434,31 +477,6 @@ _collect_layout_variation_indices (hb_subset_plan_t* plan)
}
#ifndef HB_NO_BASE
-/* used by BASE table only, delta is always set to 0 in the output map */
-static inline void
-_remap_variation_indices (const hb_set_t& indices,
- unsigned subtable_count,
- hb_hashmap_t<unsigned, hb_pair_t<unsigned, int>>& variation_idx_delta_map /* OUT */)
-{
- unsigned new_major = 0, new_minor = 0;
- unsigned last_major = (indices.get_min ()) >> 16;
- for (unsigned idx : indices)
- {
- uint16_t major = idx >> 16;
- if (major >= subtable_count) break;
- if (major != last_major)
- {
- new_minor = 0;
- ++new_major;
- }
-
- unsigned new_idx = (new_major << 16) + new_minor;
- variation_idx_delta_map.set (idx, hb_pair_t<unsigned, int> (new_idx, 0));
- ++new_minor;
- last_major = major;
- }
-}
-
static inline void
_collect_base_variation_indices (hb_subset_plan_t* plan)
{
@@ -471,12 +489,20 @@ _collect_base_variation_indices (hb_subset_plan_t* plan)
hb_set_t varidx_set;
base->collect_variation_indices (plan, varidx_set);
- unsigned subtable_count = base->get_var_store ().get_sub_table_count ();
- base.destroy ();
-
- _remap_variation_indices (varidx_set, subtable_count, plan->base_variation_idx_map);
+ const OT::ItemVariationStore &var_store = base->get_var_store ();
+ unsigned subtable_count = var_store.get_sub_table_count ();
+
+
+ _remap_variation_indices (var_store, varidx_set,
+ plan->normalized_coords,
+ !plan->pinned_at_default,
+ plan->all_axes_pinned,
+ plan->base_variation_idx_map);
_generate_varstore_inner_maps (varidx_set, subtable_count, plan->base_varstore_inner_maps);
+
+ base.destroy ();
}
+
#endif
#endif
@@ -489,12 +515,43 @@ _cmap_closure (hb_face_t *face,
cmap.table->closure_glyphs (unicodes, glyphset);
}
-static void _colr_closure (hb_face_t *face,
- hb_map_t *layers_map,
- hb_map_t *palettes_map,
+static void
+_remap_colrv1_delta_set_index_indices (const OT::DeltaSetIndexMap &index_map,
+ const hb_set_t &delta_set_idxes,
+ hb_hashmap_t<unsigned, hb_pair_t<unsigned, int>> &variation_idx_delta_map, /* IN/OUT */
+ hb_map_t &new_deltaset_idx_varidx_map /* OUT */)
+{
+ if (!index_map.get_map_count ())
+ return;
+
+ hb_hashmap_t<unsigned, hb_pair_t<unsigned, int>> delta_set_idx_delta_map;
+ unsigned new_delta_set_idx = 0;
+ for (unsigned delta_set_idx : delta_set_idxes)
+ {
+ unsigned var_idx = index_map.map (delta_set_idx);
+ unsigned new_varidx = HB_OT_LAYOUT_NO_VARIATIONS_INDEX;
+ int delta = 0;
+
+ if (var_idx != HB_OT_LAYOUT_NO_VARIATIONS_INDEX)
+ {
+ hb_pair_t<unsigned, int> *new_varidx_delta;
+ if (!variation_idx_delta_map.has (var_idx, &new_varidx_delta)) continue;
+
+ new_varidx = hb_first (*new_varidx_delta);
+ delta = hb_second (*new_varidx_delta);
+ }
+
+ new_deltaset_idx_varidx_map.set (new_delta_set_idx, new_varidx);
+ delta_set_idx_delta_map.set (delta_set_idx, hb_pair_t<unsigned, int> (new_delta_set_idx, delta));
+ new_delta_set_idx++;
+ }
+ variation_idx_delta_map = std::move (delta_set_idx_delta_map);
+}
+
+static void _colr_closure (hb_subset_plan_t* plan,
hb_set_t *glyphs_colred)
{
- OT::COLR::accelerator_t colr (face);
+ OT::COLR::accelerator_t colr (plan->source);
if (!colr.is_valid ()) return;
hb_set_t palette_indices, layer_indices;
@@ -506,11 +563,43 @@ static void _colr_closure (hb_face_t *face,
glyphs_colred->union_ (glyphset_colrv0);
//closure for COLRv1
- colr.closure_forV1 (glyphs_colred, &layer_indices, &palette_indices);
+ hb_set_t variation_indices, delta_set_indices;
+ colr.closure_forV1 (glyphs_colred, &layer_indices, &palette_indices, &variation_indices, &delta_set_indices);
colr.closure_V0palette_indices (glyphs_colred, &palette_indices);
- _remap_indexes (&layer_indices, layers_map);
- _remap_palette_indexes (&palette_indices, palettes_map);
+ _remap_indexes (&layer_indices, &plan->colrv1_layers);
+ _remap_palette_indexes (&palette_indices, &plan->colr_palettes);
+
+ if (!colr.has_var_store () || !variation_indices) return;
+
+ const OT::ItemVariationStore &var_store = colr.get_var_store ();
+ // generated inner_maps is used by ItemVariationStore serialize(), which is subset only
+ unsigned subtable_count = var_store.get_sub_table_count ();
+ _generate_varstore_inner_maps (variation_indices, subtable_count, plan->colrv1_varstore_inner_maps);
+
+ /* colr variation indices mapping during planning phase:
+ * generate colrv1_variation_idx_delta_map. When delta set index map is not
+ * included, it's a mapping from varIdx-> (new varIdx,delta). Otherwise, it's
+ * a mapping from old delta set idx-> (new delta set idx, delta). Mapping
+ * delta set indices is the same as gid mapping.
+ * Besides, we need to generate a delta set idx-> new var_idx map for updating
+ * delta set index map if exists. This map will be updated again after
+ * instancing. */
+ if (!plan->all_axes_pinned)
+ {
+ _remap_variation_indices (var_store,
+ variation_indices,
+ plan->normalized_coords,
+ false, /* no need to calculate delta for COLR during planning */
+ plan->all_axes_pinned,
+ plan->colrv1_variation_idx_delta_map);
+
+ if (colr.has_delta_set_index_map ())
+ _remap_colrv1_delta_set_index_indices (colr.get_delta_set_index_map (),
+ delta_set_indices,
+ plan->colrv1_variation_idx_delta_map,
+ plan->colrv1_new_deltaset_idx_varidx_map);
+ }
}
static inline void
@@ -821,7 +910,7 @@ _populate_gids_to_retain (hb_subset_plan_t* plan,
hb_set_t cur_glyphset = plan->_glyphset_mathed;
if (!drop_tables->has (HB_OT_TAG_COLR))
{
- _colr_closure (plan->source, &plan->colrv1_layers, &plan->colr_palettes, &cur_glyphset);
+ _colr_closure (plan, &cur_glyphset);
_remove_invalid_gids (&cur_glyphset, plan->source->get_num_glyphs ());
}
@@ -1016,9 +1105,9 @@ _normalize_axes_location (hb_face_t *face, hb_subset_plan_t *plan)
normalized_default = seg_maps->map (normalized_default);
normalized_max = seg_maps->map (normalized_max);
}
- plan->axes_location.set (axis_tag, Triple (static_cast<float> (normalized_min / 16384.f),
- static_cast<float> (normalized_default / 16384.f),
- static_cast<float> (normalized_max / 16384.f)));
+ plan->axes_location.set (axis_tag, Triple (static_cast<double> (normalized_min / 16384.0),
+ static_cast<double> (normalized_default / 16384.0),
+ static_cast<double> (normalized_max / 16384.0)));
if (normalized_default != 0)
plan->pinned_at_default = false;
@@ -1145,11 +1234,9 @@ _get_instance_glyphs_contour_points (hb_subset_plan_t *plan)
if (unlikely (!plan->new_gid_contour_points_map.set (new_gid, all_points)))
return false;
-#ifdef HB_EXPERIMENTAL_API
/* composite new gids are only needed by iup delta optimization */
if ((plan->flags & HB_SUBSET_FLAGS_OPTIMIZE_IUP_DELTAS) && glyph.is_composite ())
plan->composite_new_gids.add (new_gid);
-#endif
}
return true;
}
diff --git a/thirdparty/harfbuzz/src/hb-subset.h b/thirdparty/harfbuzz/src/hb-subset.h
index 73dcae4660..365c21a630 100644
--- a/thirdparty/harfbuzz/src/hb-subset.h
+++ b/thirdparty/harfbuzz/src/hb-subset.h
@@ -73,11 +73,11 @@ typedef struct hb_subset_plan_t hb_subset_plan_t;
* OS/2 will not be recalculated.
* @HB_SUBSET_FLAGS_NO_LAYOUT_CLOSURE: If set don't perform glyph closure on layout
* substitution rules (GSUB). Since: 7.2.0.
+ * @HB_SUBSET_FLAGS_OPTIMIZE_IUP_DELTAS: If set perform IUP delta optimization on the
+ * remaining gvar table's deltas. Since: 8.5.0
* @HB_SUBSET_FLAGS_IFTB_REQUIREMENTS: If set enforce requirements on the output subset
* to allow it to be used with incremental font transfer IFTB patches. Primarily,
* this forces all outline data to use long (32 bit) offsets. Since: EXPERIMENTAL
- * @HB_SUBSET_FLAGS_OPTIMIZE_IUP_DELTAS: If set perform IUP delta optimization on the
- * remaining gvar table's deltas. Since: EXPERIMENTAL
*
* List of boolean properties that can be configured on the subset input.
*
@@ -95,9 +95,9 @@ typedef enum { /*< flags >*/
HB_SUBSET_FLAGS_GLYPH_NAMES = 0x00000080u,
HB_SUBSET_FLAGS_NO_PRUNE_UNICODE_RANGES = 0x00000100u,
HB_SUBSET_FLAGS_NO_LAYOUT_CLOSURE = 0x00000200u,
+ HB_SUBSET_FLAGS_OPTIMIZE_IUP_DELTAS = 0x00000400u,
#ifdef HB_EXPERIMENTAL_API
- HB_SUBSET_FLAGS_IFTB_REQUIREMENTS = 0x00000400u,
- HB_SUBSET_FLAGS_OPTIMIZE_IUP_DELTAS = 0x00000800u,
+ HB_SUBSET_FLAGS_IFTB_REQUIREMENTS = 0x00000800u,
#endif
} hb_subset_flags_t;
@@ -188,7 +188,6 @@ hb_subset_input_pin_axis_location (hb_subset_input_t *input,
hb_tag_t axis_tag,
float axis_value);
-#ifdef HB_EXPERIMENTAL_API
HB_EXTERN hb_bool_t
hb_subset_input_get_axis_range (hb_subset_input_t *input,
hb_tag_t axis_tag,
@@ -204,6 +203,7 @@ hb_subset_input_set_axis_range (hb_subset_input_t *input,
float axis_max_value,
float axis_def_value);
+#ifdef HB_EXPERIMENTAL_API
HB_EXTERN hb_bool_t
hb_subset_input_override_name_table (hb_subset_input_t *input,
hb_ot_name_id_t name_id,
@@ -212,7 +212,6 @@ hb_subset_input_override_name_table (hb_subset_input_t *input,
unsigned language_id,
const char *name_str,
int str_len);
-
#endif
HB_EXTERN hb_face_t *
diff --git a/thirdparty/harfbuzz/src/hb-version.h b/thirdparty/harfbuzz/src/hb-version.h
index 68681874ca..abffbdae9c 100644
--- a/thirdparty/harfbuzz/src/hb-version.h
+++ b/thirdparty/harfbuzz/src/hb-version.h
@@ -47,7 +47,7 @@ HB_BEGIN_DECLS
*
* The minor component of the library version available at compile-time.
*/
-#define HB_VERSION_MINOR 4
+#define HB_VERSION_MINOR 5
/**
* HB_VERSION_MICRO:
*
@@ -60,7 +60,7 @@ HB_BEGIN_DECLS
*
* A string literal containing the library version available at compile-time.
*/
-#define HB_VERSION_STRING "8.4.0"
+#define HB_VERSION_STRING "8.5.0"
/**
* HB_VERSION_ATLEAST: