summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/android_builds.yml2
-rw-r--r--.github/workflows/ios_builds.yml2
-rw-r--r--.github/workflows/linux_builds.yml2
-rw-r--r--.github/workflows/macos_builds.yml2
-rw-r--r--.github/workflows/web_builds.yml2
-rw-r--r--.github/workflows/windows_builds.yml2
-rw-r--r--SConstruct11
-rw-r--r--core/input/input_map.cpp5
-rw-r--r--core/object/ref_counted.h5
-rw-r--r--doc/classes/EditorSettings.xml168
-rw-r--r--doc/classes/LineEdit.xml18
-rw-r--r--doc/classes/ProjectSettings.xml4
-rw-r--r--drivers/vulkan/rendering_device_driver_vulkan.cpp9
-rw-r--r--drivers/vulkan/rendering_device_driver_vulkan.h3
-rw-r--r--editor/debugger/debug_adapter/debug_adapter_server.cpp1
-rw-r--r--editor/debugger/editor_file_server.cpp3
-rw-r--r--editor/debugger/editor_profiler.cpp18
-rw-r--r--editor/debugger/editor_profiler.h3
-rw-r--r--editor/debugger/editor_visual_profiler.cpp19
-rw-r--r--editor/debugger/editor_visual_profiler.h3
-rw-r--r--editor/debugger/script_editor_debugger.cpp12
-rw-r--r--editor/editor_help.cpp2
-rw-r--r--editor/editor_native_shader_source_visualizer.cpp2
-rw-r--r--editor/editor_properties.cpp13
-rw-r--r--editor/editor_settings.cpp76
-rw-r--r--editor/export/editor_export_plugin.cpp5
-rw-r--r--editor/export/editor_export_plugin.h2
-rw-r--r--editor/plugins/abstract_polygon_2d_editor.cpp4
-rw-r--r--editor/plugins/asset_library_editor_plugin.cpp3
-rw-r--r--editor/plugins/bone_map_editor_plugin.cpp6
-rw-r--r--editor/plugins/gizmos/audio_stream_player_3d_gizmo_plugin.cpp2
-rw-r--r--editor/plugins/gizmos/camera_3d_gizmo_plugin.cpp2
-rw-r--r--editor/plugins/gizmos/cpu_particles_3d_gizmo_plugin.cpp2
-rw-r--r--editor/plugins/gizmos/decal_gizmo_plugin.cpp2
-rw-r--r--editor/plugins/gizmos/fog_volume_gizmo_plugin.cpp2
-rw-r--r--editor/plugins/gizmos/gpu_particles_3d_gizmo_plugin.cpp2
-rw-r--r--editor/plugins/gizmos/gpu_particles_collision_3d_gizmo_plugin.cpp4
-rw-r--r--editor/plugins/gizmos/joint_3d_gizmo_plugin.cpp4
-rw-r--r--editor/plugins/gizmos/lightmap_gi_gizmo_plugin.cpp2
-rw-r--r--editor/plugins/gizmos/lightmap_probe_gizmo_plugin.cpp2
-rw-r--r--editor/plugins/gizmos/mesh_instance_3d_gizmo_plugin.cpp18
-rw-r--r--editor/plugins/gizmos/occluder_instance_3d_gizmo_plugin.cpp2
-rw-r--r--editor/plugins/gizmos/reflection_probe_gizmo_plugin.cpp2
-rw-r--r--editor/plugins/gizmos/visible_on_screen_notifier_3d_gizmo_plugin.cpp2
-rw-r--r--editor/plugins/gizmos/voxel_gi_gizmo_plugin.cpp2
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp7
-rw-r--r--editor/plugins/path_3d_editor_plugin.cpp7
-rw-r--r--editor/plugins/script_editor_plugin.cpp16
-rw-r--r--editor/plugins/skeleton_3d_editor_plugin.cpp7
-rw-r--r--editor/plugins/version_control_editor_plugin.cpp6
-rw-r--r--editor/scene_tree_dock.cpp4
-rw-r--r--modules/csg/editor/csg_gizmos.cpp2
-rw-r--r--modules/gdscript/editor/gdscript_highlighter.cpp1
-rw-r--r--modules/gdscript/language_server/gdscript_language_server.cpp1
-rw-r--r--modules/gridmap/editor/grid_map_editor_plugin.cpp7
-rw-r--r--modules/mono/csharp_script.cpp3
-rw-r--r--modules/multiplayer/editor/editor_network_profiler.cpp40
-rw-r--r--modules/multiplayer/editor/editor_network_profiler.h6
-rw-r--r--modules/multiplayer/editor/multiplayer_editor_plugin.cpp2
-rw-r--r--modules/multiplayer/scene_rpc_interface.cpp12
-rw-r--r--modules/multiplayer/scene_rpc_interface.h2
-rw-r--r--modules/openxr/editor/openxr_select_runtime.cpp1
-rw-r--r--platform/android/export/export.cpp1
-rw-r--r--platform/ios/export/export.cpp1
-rw-r--r--platform/macos/export/export.cpp1
-rw-r--r--platform/web/export/export.cpp1
-rw-r--r--platform/windows/export/export.cpp1
-rw-r--r--scene/gui/graph_edit.cpp32
-rw-r--r--scene/gui/line_edit.cpp233
-rw-r--r--scene/gui/line_edit.h8
-rw-r--r--scene/gui/text_edit.cpp134
-rw-r--r--scene/gui/text_edit.h1
-rw-r--r--scene/resources/bit_map.cpp5
73 files changed, 778 insertions, 221 deletions
diff --git a/.github/workflows/android_builds.yml b/.github/workflows/android_builds.yml
index 69ab830829..2f49f84e90 100644
--- a/.github/workflows/android_builds.yml
+++ b/.github/workflows/android_builds.yml
@@ -6,7 +6,7 @@ on:
env:
# Used for the cache key. Add version suffix to force clean build.
GODOT_BASE_BRANCH: master
- SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no module_text_server_fb_enabled=yes
+ SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no module_text_server_fb_enabled=yes strict_checks=yes
concurrency:
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-android
diff --git a/.github/workflows/ios_builds.yml b/.github/workflows/ios_builds.yml
index 8da6d1311e..207219f9f4 100644
--- a/.github/workflows/ios_builds.yml
+++ b/.github/workflows/ios_builds.yml
@@ -6,7 +6,7 @@ on:
env:
# Used for the cache key. Add version suffix to force clean build.
GODOT_BASE_BRANCH: master
- SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no module_text_server_fb_enabled=yes
+ SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no module_text_server_fb_enabled=yes strict_checks=yes
concurrency:
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-ios
diff --git a/.github/workflows/linux_builds.yml b/.github/workflows/linux_builds.yml
index 10389dc9da..010a13d921 100644
--- a/.github/workflows/linux_builds.yml
+++ b/.github/workflows/linux_builds.yml
@@ -6,7 +6,7 @@ on:
env:
# Used for the cache key. Add version suffix to force clean build.
GODOT_BASE_BRANCH: master
- SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes
+ SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes strict_checks=yes
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
TSAN_OPTIONS: suppressions=misc/error_suppressions/tsan.txt
diff --git a/.github/workflows/macos_builds.yml b/.github/workflows/macos_builds.yml
index 4db7462b3a..938b25f134 100644
--- a/.github/workflows/macos_builds.yml
+++ b/.github/workflows/macos_builds.yml
@@ -6,7 +6,7 @@ on:
env:
# Used for the cache key. Add version suffix to force clean build.
GODOT_BASE_BRANCH: master
- SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes
+ SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes strict_checks=yes
concurrency:
group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-macos
diff --git a/.github/workflows/web_builds.yml b/.github/workflows/web_builds.yml
index d3a6b5b8b8..11ef7f01c9 100644
--- a/.github/workflows/web_builds.yml
+++ b/.github/workflows/web_builds.yml
@@ -6,7 +6,7 @@ on:
env:
# Used for the cache key. Add version suffix to force clean build.
GODOT_BASE_BRANCH: master
- SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no use_closure_compiler=yes
+ SCONSFLAGS: verbose=yes warnings=extra werror=yes debug_symbols=no use_closure_compiler=yes strict_checks=yes
EM_VERSION: 3.1.64
EM_CACHE_FOLDER: "emsdk-cache"
diff --git a/.github/workflows/windows_builds.yml b/.github/workflows/windows_builds.yml
index 0c21576517..0d2e258308 100644
--- a/.github/workflows/windows_builds.yml
+++ b/.github/workflows/windows_builds.yml
@@ -7,7 +7,7 @@ on:
env:
# Used for the cache key. Add version suffix to force clean build.
GODOT_BASE_BRANCH: master
- SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes d3d12=yes "angle_libs=${{github.workspace}}/"
+ SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes d3d12=yes strict_checks=yes "angle_libs=${{github.workspace}}/"
SCONS_CACHE_MSVC_CONFIG: true
concurrency:
diff --git a/SConstruct b/SConstruct
index b1819a1dab..0245531b45 100644
--- a/SConstruct
+++ b/SConstruct
@@ -230,7 +230,11 @@ opts.Add("custom_modules", "A list of comma-separated directory paths containing
opts.Add(BoolVariable("custom_modules_recursive", "Detect custom modules recursively for each specified path.", True))
# Advanced options
-opts.Add(BoolVariable("dev_mode", "Alias for dev options: verbose=yes warnings=extra werror=yes tests=yes", False))
+opts.Add(
+ BoolVariable(
+ "dev_mode", "Alias for dev options: verbose=yes warnings=extra werror=yes tests=yes strict_checks=yes", False
+ )
+)
opts.Add(BoolVariable("tests", "Build the unit tests", False))
opts.Add(BoolVariable("fast_unsafe", "Enable unsafe options for faster rebuilds", False))
opts.Add(BoolVariable("ninja", "Use the ninja backend for faster rebuilds", False))
@@ -262,6 +266,7 @@ opts.Add(
"",
)
opts.Add(BoolVariable("use_precise_math_checks", "Math checks use very precise epsilon (debug option)", False))
+opts.Add(BoolVariable("strict_checks", "Enforce stricter checks (debug option)", False))
opts.Add(BoolVariable("scu_build", "Use single compilation unit build", False))
opts.Add("scu_limit", "Max includes per SCU file when using scu_build (determines RAM use)", "0")
opts.Add(BoolVariable("engine_update_check", "Enable engine update checks in the Project Manager", True))
@@ -602,12 +607,16 @@ if env["dev_mode"]:
env["warnings"] = ARGUMENTS.get("warnings", "extra")
env["werror"] = methods.get_cmdline_bool("werror", True)
env["tests"] = methods.get_cmdline_bool("tests", True)
+ env["strict_checks"] = methods.get_cmdline_bool("strict_checks", True)
if env["production"]:
env["use_static_cpp"] = methods.get_cmdline_bool("use_static_cpp", True)
env["debug_symbols"] = methods.get_cmdline_bool("debug_symbols", False)
# LTO "auto" means we handle the preferred option in each platform detect.py.
env["lto"] = ARGUMENTS.get("lto", "auto")
+if env["strict_checks"]:
+ env.Append(CPPDEFINES=["STRICT_CHECKS"])
+
# Run SCU file generation script if in a SCU build.
if env["scu_build"]:
max_includes_per_scu = 8
diff --git a/core/input/input_map.cpp b/core/input/input_map.cpp
index ddeee9d765..9a772c87c9 100644
--- a/core/input/input_map.cpp
+++ b/core/input/input_map.cpp
@@ -400,6 +400,7 @@ static const _BuiltinActionDisplayName _builtin_action_display_names[] = {
{ "ui_filedialog_refresh", TTRC("Refresh") },
{ "ui_filedialog_show_hidden", TTRC("Show Hidden") },
{ "ui_swap_input_direction ", TTRC("Swap Input Direction") },
+ { "ui_unicode_start", TTRC("Start Unicode Character Input") },
{ "", ""}
/* clang-format on */
};
@@ -754,6 +755,10 @@ const HashMap<String, List<Ref<InputEvent>>> &InputMap::get_builtins() {
inputs.push_back(InputEventKey::create_reference(Key::KP_ENTER));
default_builtin_cache.insert("ui_text_submit", inputs);
+ inputs = List<Ref<InputEvent>>();
+ inputs.push_back(InputEventKey::create_reference(Key::U | KeyModifierMask::CTRL | KeyModifierMask::SHIFT));
+ default_builtin_cache.insert("ui_unicode_start", inputs);
+
// ///// UI Graph Shortcuts /////
inputs = List<Ref<InputEvent>>();
diff --git a/core/object/ref_counted.h b/core/object/ref_counted.h
index 5b358135c4..f0706b4d08 100644
--- a/core/object/ref_counted.h
+++ b/core/object/ref_counted.h
@@ -86,6 +86,11 @@ public:
_FORCE_INLINE_ bool operator!=(const T *p_ptr) const {
return reference != p_ptr;
}
+#ifdef STRICT_CHECKS
+ // Delete these to prevent raw comparisons with `nullptr`.
+ bool operator==(std::nullptr_t) const = delete;
+ bool operator!=(std::nullptr_t) const = delete;
+#endif // STRICT_CHECKS
_FORCE_INLINE_ bool operator<(const Ref<T> &p_r) const {
return reference < p_r.reference;
diff --git a/doc/classes/EditorSettings.xml b/doc/classes/EditorSettings.xml
index 1de63b4a39..389d65e05a 100644
--- a/doc/classes/EditorSettings.xml
+++ b/doc/classes/EditorSettings.xml
@@ -181,6 +181,9 @@
</method>
</methods>
<members>
+ <member name="asset_library/use_threads" type="bool" setter="" getter="">
+ If [code]true[/code], the Asset Library uses multiple threads for its HTTP requests. This prevents the Asset Library from blocking the main thread for every loaded asset.
+ </member>
<member name="debugger/auto_switch_to_remote_scene_tree" type="bool" setter="" getter="">
If [code]true[/code], automatically switches to the [b]Remote[/b] scene tree when running the project from the editor. If [code]false[/code], stays on the [b]Local[/b] scene tree when running the project from the editor.
</member>
@@ -222,6 +225,12 @@
<member name="docks/property_editor/subresource_hue_tint" type="float" setter="" getter="">
The tint intensity to use for the subresources background in the Inspector dock. The tint is used to distinguish between different subresources in the inspector. Higher values result in a more noticeable background color difference.
</member>
+ <member name="docks/scene_tree/ask_before_deleting_related_animation_tracks" type="bool" setter="" getter="">
+ If [code]true[/code], when a node is deleted with animation tracks referencing it, a confirmation dialog appears before the tracks are deleted. The dialog will appear even when using the "Delete (No Confirm)" shortcut.
+ </member>
+ <member name="docks/scene_tree/ask_before_revoking_unique_name" type="bool" setter="" getter="">
+ If [code]true[/code], displays a confirmation dialog before left-clicking the "percent" icon next to a node name in the Scene tree dock. When clicked, this icon revokes the node's scene-unique name, which can impact the behavior of scripts that rely on this scene-unique name due to identifiers not being found anymore.
+ </member>
<member name="docks/scene_tree/auto_expand_to_selected" type="bool" setter="" getter="">
If [code]true[/code], the scene tree dock will automatically unfold nodes when a node that has folded parents is selected.
</member>
@@ -327,6 +336,12 @@
<member name="editors/3d/grid_yz_plane" type="bool" setter="" getter="">
If [code]true[/code], renders the grid on the YZ plane in perspective view. This can be useful for 3D side-scrolling games.
</member>
+ <member name="editors/3d/manipulator_gizmo_opacity" type="float" setter="" getter="">
+ Opacity of the default gizmo for moving, rotating, and scaling 3D nodes.
+ </member>
+ <member name="editors/3d/manipulator_gizmo_size" type="int" setter="" getter="">
+ Size of the default gizmo for moving, rotating, and scaling 3D nodes.
+ </member>
<member name="editors/3d/navigation/emulate_3_button_mouse" type="bool" setter="" getter="">
If [code]true[/code], enables 3-button mouse emulation mode. This is useful on laptops when using a trackpad.
When 3-button mouse emulation mode is enabled, the pan, zoom and orbit modifiers can always be used in the 3D editor viewport, even when not holding down any mouse button.
@@ -355,6 +370,12 @@
<member name="editors/3d/navigation/pan_mouse_button" type="int" setter="" getter="">
The mouse button that needs to be held down to pan in the 3D editor viewport.
</member>
+ <member name="editors/3d/navigation/show_viewport_navigation_gizmo" type="bool" setter="" getter="">
+ If [code]true[/code], shows gizmos for moving and rotating the camera in the bottom corners of the 3D editor's viewport. Useful for devices that use touch screen.
+ </member>
+ <member name="editors/3d/navigation/show_viewport_rotation_gizmo" type="bool" setter="" getter="">
+ If [code]true[/code], shows a small orientation gizmo in the top-right corner of the 3D editor's viewports.
+ </member>
<member name="editors/3d/navigation/warped_mouse_panning" type="bool" setter="" getter="">
If [code]true[/code], warps the mouse around the 3D viewport while panning in the 3D editor. This makes it possible to pan over a large area without having to exit panning and adjust the mouse cursor.
</member>
@@ -391,12 +412,78 @@
<member name="editors/3d_gizmos/gizmo_colors/aabb" type="Color" setter="" getter="">
The color to use for the AABB gizmo that displays the [GeometryInstance3D]'s custom [AABB].
</member>
+ <member name="editors/3d_gizmos/gizmo_colors/camera" type="Color" setter="" getter="">
+ The 3D editor gizmo color for [Camera3D]s.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/csg" type="Color" setter="" getter="">
+ The 3D editor gizmo color for CSG nodes (such as [CSGShape3D] or [CSGBox3D]).
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/decal" type="Color" setter="" getter="">
+ The 3D editor gizmo color for [Decal] nodes.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/fog_volume" type="Color" setter="" getter="">
+ The 3D editor gizmo color for [FogVolume] nodes.
+ </member>
<member name="editors/3d_gizmos/gizmo_colors/instantiated" type="Color" setter="" getter="">
The color override to use for 3D editor gizmos if the [Node3D] in question is part of an instantiated scene file (from the perspective of the current scene).
</member>
<member name="editors/3d_gizmos/gizmo_colors/joint" type="Color" setter="" getter="">
The 3D editor gizmo color for [Joint3D]s and [PhysicalBone3D]s.
</member>
+ <member name="editors/3d_gizmos/gizmo_colors/joint_body_a" type="Color" setter="" getter="">
+ Color for representing [member Joint3D.node_a] for some [Joint3D] types.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/joint_body_b" type="Color" setter="" getter="">
+ Color for representing [member Joint3D.node_b] for some [Joint3D] types.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/lightmap_lines" type="Color" setter="" getter="">
+ Color of lines displayed in baked [LightmapGI] node's grid.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/lightprobe_lines" type="Color" setter="" getter="">
+ The 3D editor gizmo color used for [LightmapProbe] nodes.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/occluder" type="Color" setter="" getter="">
+ The 3D editor gizmo color used for [OccluderInstance3D] nodes.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/particle_attractor" type="Color" setter="" getter="">
+ The 3D editor gizmo color used for [GPUParticlesAttractor3D] nodes.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/particle_collision" type="Color" setter="" getter="">
+ The 3D editor gizmo color used for [GPUParticlesCollision3D] nodes.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/particles" type="Color" setter="" getter="">
+ The 3D editor gizmo color used for [CPUParticles3D] and [GPUParticles3D] nodes.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/path_tilt" type="Color" setter="" getter="">
+ The 3D editor gizmo color used for [Path3D] tilt circles, which indicate the direction the [Curve3D] is tilted towards.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/reflection_probe" type="Color" setter="" getter="">
+ The 3D editor gizmo color used for [ReflectionProbe] nodes.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/selected_bone" type="Color" setter="" getter="">
+ The 3D editor gizmo color used for the currently selected [Skeleton3D] bone.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/skeleton" type="Color" setter="" getter="">
+ The 3D editor gizmo color used for [Skeleton3D] nodes.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/stream_player_3d" type="Color" setter="" getter="">
+ The 3D editor gizmo color used for [AudioStreamPlayer3D]'s emission angle.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/visibility_notifier" type="Color" setter="" getter="">
+ The 3D editor gizmo color used for [VisibleOnScreenNotifier3D] and [VisibleOnScreenEnabler3D] nodes.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_colors/voxel_gi" type="Color" setter="" getter="">
+ The 3D editor gizmo color used for [VoxelGI] nodes.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_settings/bone_axis_length" type="float" setter="" getter="">
+ The length of [Skeleton3D] bone gizmos in the 3D editor.
+ </member>
+ <member name="editors/3d_gizmos/gizmo_settings/bone_shape" type="int" setter="" getter="">
+ The shape of [Skeleton3D] bone gizmos in the 3D editor. [b]Wire[/b] is a thin line, while [b]Octahedron[/b] is a set of lines that represent a thicker hollow line pointing in a specific direction (similar to most 3D animation software).
+ </member>
+ <member name="editors/3d_gizmos/gizmo_settings/path3d_tilt_disk_size" type="float" setter="" getter="">
+ Size of the disk gizmo displayed when editing [Path3D]'s tilt handles.
+ </member>
<member name="editors/animation/autorename_animation_tracks" type="bool" setter="" getter="">
If [code]true[/code], automatically updates animation tracks' target paths when renaming or reparenting nodes in the Scene tree dock.
</member>
@@ -416,9 +503,26 @@
<member name="editors/animation/onion_layers_past_color" type="Color" setter="" getter="">
The modulate color to use for "past" frames displayed in the animation editor's onion skinning feature.
</member>
+ <member name="editors/bone_mapper/handle_colors/error" type="Color" setter="" getter="">
+ </member>
+ <member name="editors/bone_mapper/handle_colors/missing" type="Color" setter="" getter="">
+ </member>
+ <member name="editors/bone_mapper/handle_colors/set" type="Color" setter="" getter="">
+ </member>
+ <member name="editors/bone_mapper/handle_colors/unset" type="Color" setter="" getter="">
+ </member>
+ <member name="editors/grid_map/editor_side" type="int" setter="" getter="">
+ Specifies the side of 3D editor's viewport where GridMap's mesh palette will appear.
+ </member>
+ <member name="editors/grid_map/palette_min_width" type="int" setter="" getter="">
+ Minimum width of GridMap's mesh palette side panel.
+ </member>
<member name="editors/grid_map/pick_distance" type="float" setter="" getter="">
The maximum distance at which tiles can be placed on a GridMap, relative to the camera position (in 3D units).
</member>
+ <member name="editors/grid_map/preview_size" type="int" setter="" getter="">
+ Texture size of mesh previews generated for GridMap's MeshLibrary.
+ </member>
<member name="editors/panning/2d_editor_pan_speed" type="int" setter="" getter="">
The panning speed when using the mouse wheel or touchscreen events in the 2D editor. This setting does not apply to panning by holding down the middle or right mouse buttons.
</member>
@@ -528,6 +632,13 @@
<member name="editors/visual_editors/visual_shader/port_preview_size" type="int" setter="" getter="">
The size to use for port previews in the visual shader uniforms (toggled by clicking the "eye" icon next to an output). The value is defined in pixels at 100% zoom, and will scale with zoom automatically.
</member>
+ <member name="export/ssh/scp" type="String" setter="" getter="">
+ Path to the SCP (secure copy) executable (used for remote deploy to desktop platforms). If left empty, the editor will attempt to run [code]scp[/code] from [code]PATH[/code].
+ [b]Note:[/b] SCP is not the same as SFTP. Specifying the SFTP executable here will not work.
+ </member>
+ <member name="export/ssh/ssh" type="String" setter="" getter="">
+ Path to the SSH executable (used for remote deploy to desktop platforms). If left empty, the editor will attempt to run [code]ssh[/code] from [code]PATH[/code].
+ </member>
<member name="filesystem/directories/autoscan_project_path" type="String" setter="" getter="">
The folder where projects should be scanned for (recursively), in a way similar to the project manager's [b]Scan[/b] button. This can be set to the same value as [member filesystem/directories/default_project_path] for convenience.
[b]Note:[/b] Setting this path to a folder with very large amounts of files/folders can slow down the project manager startup significantly. To keep the project manager quick to start up, it is recommended to set this value to a folder as "specific" as possible.
@@ -573,6 +684,12 @@
<member name="filesystem/file_dialog/thumbnail_size" type="int" setter="" getter="">
The thumbnail size to use in the editor's file dialogs (in pixels). See also [member docks/filesystem/thumbnail_size].
</member>
+ <member name="filesystem/file_server/password" type="String" setter="" getter="">
+ Password used for file server when exporting project with remote file system.
+ </member>
+ <member name="filesystem/file_server/port" type="int" setter="" getter="">
+ Port used for file server when exporting project with remote file system.
+ </member>
<member name="filesystem/import/blender/blender_path" type="String" setter="" getter="">
The path to the directory containing the Blender executable used for converting the Blender 3D scene files [code].blend[/code] to glTF 2.0 format during import. Blender 3.0 or later is required.
To enable this feature for your specific project, use [member ProjectSettings.filesystem/import/blender/enabled].
@@ -759,6 +876,12 @@
Depending on the platform and used renderer, the engine will fall back to [b]Enabled[/b] if the desired mode is not supported.
[b]Note:[/b] V-Sync modes other than [b]Enabled[/b] are only supported in the Forward+ and Mobile rendering methods, not Compatibility.
</member>
+ <member name="interface/editors/derive_script_globals_by_name" type="bool" setter="" getter="">
+ If [code]true[/code], when extending a script, the global class name of the script is inserted in the script creation dialog, if it exists. If [code]false[/code], the script's file path is always inserted.
+ </member>
+ <member name="interface/editors/show_scene_tree_root_selection" type="bool" setter="" getter="">
+ If [code]true[/code], the Scene dock will display buttons to quickly add a root node to a newly created scene.
+ </member>
<member name="interface/inspector/auto_unfold_foreign_scenes" type="bool" setter="" getter="">
If [code]true[/code], automatically expands property groups in the Inspector dock when opening a scene that hasn't been opened previously. If [code]false[/code], all groups remain collapsed by default.
</member>
@@ -1052,6 +1175,9 @@
<member name="text_editor/appearance/whitespace/line_spacing" type="int" setter="" getter="">
The space to add between lines (in pixels). Greater line spacing can help improve readability at the cost of displaying fewer lines on screen.
</member>
+ <member name="text_editor/behavior/files/auto_reload_and_parse_scripts_on_save" type="bool" setter="" getter="">
+ If [code]true[/code], tool scripts will be automatically soft-reloaded after they are saved.
+ </member>
<member name="text_editor/behavior/files/auto_reload_scripts_on_external_change" type="bool" setter="" getter="">
If [code]true[/code], automatically reloads scripts in the editor when they have been modified and saved by external editors.
</member>
@@ -1061,6 +1187,9 @@
<member name="text_editor/behavior/files/convert_indent_on_save" type="bool" setter="" getter="">
If [code]true[/code], converts indentation to match the script editor's indentation settings when saving a script. See also [member text_editor/behavior/indent/type].
</member>
+ <member name="text_editor/behavior/files/open_dominant_script_on_scene_change" type="bool" setter="" getter="">
+ If [code]true[/code], opening a scene automatically opens the script attached to the root node, or the topmost node if the root has no script.
+ </member>
<member name="text_editor/behavior/files/restore_scripts_on_load" type="bool" setter="" getter="">
If [code]true[/code], reopens scripts that were opened in the last session when the editor is reopened on a given project.
</member>
@@ -1148,6 +1277,15 @@
<member name="text_editor/completion/use_single_quotes" type="bool" setter="" getter="">
If [code]true[/code], performs string autocompletion with single quotes. If [code]false[/code], performs string autocompletion with double quotes (which matches the [url=$DOCS_URL/tutorials/scripting/gdscript/gdscript_styleguide.html]GDScript style guide[/url]).
</member>
+ <member name="text_editor/external/exec_flags" type="String" setter="" getter="">
+ The command-line arguments to pass to the external text editor that is run when [member text_editor/external/use_external_editor] is [code]true[/code]. See also [member text_editor/external/exec_path].
+ </member>
+ <member name="text_editor/external/exec_path" type="String" setter="" getter="">
+ The path to the text editor executable used to edit text files if [member text_editor/external/use_external_editor] is [code]true[/code].
+ </member>
+ <member name="text_editor/external/use_external_editor" type="bool" setter="" getter="">
+ If [code]true[/code], uses an external editor instead of the built-in Script Editor. See also [member text_editor/external/exec_path] and [member text_editor/external/exec_flags].
+ </member>
<member name="text_editor/help/class_reference_examples" type="int" setter="" getter="">
Controls which multi-line code blocks should be displayed in the editor help. This setting does not affect single-line code literals in the editor help.
</member>
@@ -1163,6 +1301,21 @@
<member name="text_editor/help/show_help_index" type="bool" setter="" getter="">
If [code]true[/code], displays a table of contents at the left of the editor help (at the location where the members overview would appear when editing a script).
</member>
+ <member name="text_editor/help/sort_functions_alphabetically" type="bool" setter="" getter="">
+ If [code]true[/code], the script's method list in the Script Editor is sorted alphabetically.
+ </member>
+ <member name="text_editor/script_list/group_help_pages" type="bool" setter="" getter="">
+ If [code]true[/code], class reference pages are grouped together at the bottom of the Script Editor's script list.
+ </member>
+ <member name="text_editor/script_list/list_script_names_as" type="int" setter="" getter="">
+ Specifies how script paths should be displayed in Script Editor's script list. If using the "Name" option and some scripts share the same file name, more parts of their paths are revealed to avoid conflicts.
+ </member>
+ <member name="text_editor/script_list/script_temperature_enabled" type="bool" setter="" getter="">
+ If [code]true[/code], the names of recently opened scripts in the Script Editor are highlighted with the accent color, with its intensity based on how recently they were opened.
+ </member>
+ <member name="text_editor/script_list/script_temperature_history_size" type="int" setter="" getter="">
+ How many script names can be highlighted at most, if [member text_editor/script_list/script_temperature_enabled] is [code]true[/code]. Scripts older than this value use the default font color.
+ </member>
<member name="text_editor/script_list/show_members_overview" type="bool" setter="" getter="">
If [code]true[/code], displays an overview of the current script's member variables and functions at the left of the script editor. See also [member text_editor/script_list/sort_members_outline_alphabetically].
</member>
@@ -1170,6 +1323,9 @@
If [code]true[/code], sorts the members outline (located at the left of the script editor) using alphabetical order. If [code]false[/code], sorts the members outline depending on the order in which members are found in the script.
[b]Note:[/b] Only effective if [member text_editor/script_list/show_members_overview] is [code]true[/code].
</member>
+ <member name="text_editor/script_list/sort_scripts_by" type="int" setter="" getter="">
+ Specifies sorting used for Script Editor's open script list.
+ </member>
<member name="text_editor/theme/color_theme" type="String" setter="" getter="">
The syntax theme to use in the script editor.
You can save your own syntax theme from your current settings by using [b]File &gt; Theme &gt; Save As...[/b] at the top of the script editor. The syntax theme will then be available locally in the list of color themes.
@@ -1294,6 +1450,18 @@
<member name="text_editor/theme/highlighting/word_highlighted_color" type="Color" setter="" getter="">
The script editor's color for words highlighted by selecting them. Only visible if [member text_editor/appearance/caret/highlight_all_occurrences] is [code]true[/code].
</member>
+ <member name="text_editor/theme/line_spacing" type="int" setter="" getter="">
+ The vertical line separation used in text editors, in pixels.
+ </member>
+ <member name="version_control/ssh_private_key_path" type="String" setter="" getter="">
+ Path to private SSH key file for the editor's Version Control integration credentials.
+ </member>
+ <member name="version_control/ssh_public_key_path" type="String" setter="" getter="">
+ Path to public SSH key file for the editor's Version Control integration credentials.
+ </member>
+ <member name="version_control/username" type="String" setter="" getter="">
+ Default username for editor's Version Control integration.
+ </member>
</members>
<signals>
<signal name="settings_changed">
diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml
index a37dd47914..d218f720a3 100644
--- a/doc/classes/LineEdit.xml
+++ b/doc/classes/LineEdit.xml
@@ -37,6 +37,18 @@
<tutorials>
</tutorials>
<methods>
+ <method name="apply_ime">
+ <return type="void" />
+ <description>
+ Applies text from the [url=https://en.wikipedia.org/wiki/Input_method]Input Method Editor[/url] (IME) and closes the IME if it is open.
+ </description>
+ </method>
+ <method name="cancel_ime">
+ <return type="void" />
+ <description>
+ Closes the [url=https://en.wikipedia.org/wiki/Input_method]Input Method Editor[/url] (IME) if it is open. Any text in the IME will be lost.
+ </description>
+ </method>
<method name="clear">
<return type="void" />
<description>
@@ -133,6 +145,12 @@
Returns the selection end column.
</description>
</method>
+ <method name="has_ime_text" qualifiers="const">
+ <return type="bool" />
+ <description>
+ Returns [code]true[/code] if the user has text in the [url=https://en.wikipedia.org/wiki/Input_method]Input Method Editor[/url] (IME).
+ </description>
+ </method>
<method name="has_selection" qualifiers="const">
<return type="bool" />
<description>
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index 80a4ca9a8a..b205b862a3 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -1386,6 +1386,10 @@
Default [InputEventAction] to undo the most recent action.
[b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified.
</member>
+ <member name="input/ui_unicode_start" type="Dictionary" setter="" getter="">
+ Default [InputEventAction] to start Unicode character hexadecimal code input in a text field.
+ [b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified.
+ </member>
<member name="input/ui_up" type="Dictionary" setter="" getter="">
Default [InputEventAction] to move up in the UI.
[b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are necessary for the internal logic of several [Control]s. The events assigned to the action can however be modified.
diff --git a/drivers/vulkan/rendering_device_driver_vulkan.cpp b/drivers/vulkan/rendering_device_driver_vulkan.cpp
index 4ea46e8214..bd395f41e2 100644
--- a/drivers/vulkan/rendering_device_driver_vulkan.cpp
+++ b/drivers/vulkan/rendering_device_driver_vulkan.cpp
@@ -1772,16 +1772,17 @@ RDD::TextureID RenderingDeviceDriverVulkan::texture_create_from_extension(uint64
tex_info->vk_view = vk_image_view;
tex_info->rd_format = p_format;
tex_info->vk_view_create_info = image_view_create_info;
-
+#ifdef DEBUG_ENABLED
+ tex_info->created_from_extension = true;
+#endif
return TextureID(tex_info);
}
RDD::TextureID RenderingDeviceDriverVulkan::texture_create_shared(TextureID p_original_texture, const TextureView &p_view) {
const TextureInfo *owner_tex_info = (const TextureInfo *)p_original_texture.id;
#ifdef DEBUG_ENABLED
- ERR_FAIL_COND_V(!owner_tex_info->allocation.handle, TextureID());
+ ERR_FAIL_COND_V(!owner_tex_info->allocation.handle && !owner_tex_info->created_from_extension, TextureID());
#endif
-
VkImageViewCreateInfo image_view_create_info = owner_tex_info->vk_view_create_info;
image_view_create_info.format = RD_TO_VK_FORMAT[p_view.format];
image_view_create_info.components.r = (VkComponentSwizzle)p_view.swizzle_r;
@@ -1837,7 +1838,7 @@ RDD::TextureID RenderingDeviceDriverVulkan::texture_create_shared(TextureID p_or
RDD::TextureID RenderingDeviceDriverVulkan::texture_create_shared_from_slice(TextureID p_original_texture, const TextureView &p_view, TextureSliceType p_slice_type, uint32_t p_layer, uint32_t p_layers, uint32_t p_mipmap, uint32_t p_mipmaps) {
const TextureInfo *owner_tex_info = (const TextureInfo *)p_original_texture.id;
#ifdef DEBUG_ENABLED
- ERR_FAIL_COND_V(!owner_tex_info->allocation.handle, TextureID());
+ ERR_FAIL_COND_V(!owner_tex_info->allocation.handle && !owner_tex_info->created_from_extension, TextureID());
#endif
VkImageViewCreateInfo image_view_create_info = owner_tex_info->vk_view_create_info;
diff --git a/drivers/vulkan/rendering_device_driver_vulkan.h b/drivers/vulkan/rendering_device_driver_vulkan.h
index 2615d9824d..81f4256941 100644
--- a/drivers/vulkan/rendering_device_driver_vulkan.h
+++ b/drivers/vulkan/rendering_device_driver_vulkan.h
@@ -213,6 +213,9 @@ public:
VmaAllocation handle = nullptr;
VmaAllocationInfo info = {};
} allocation; // All 0/null if just a view.
+#ifdef DEBUG_ENABLED
+ bool created_from_extension = false;
+#endif
};
VkSampleCountFlagBits _ensure_supported_sample_count(TextureSamples p_requested_sample_count);
diff --git a/editor/debugger/debug_adapter/debug_adapter_server.cpp b/editor/debugger/debug_adapter/debug_adapter_server.cpp
index 6041fec06c..0f4be147cf 100644
--- a/editor/debugger/debug_adapter/debug_adapter_server.cpp
+++ b/editor/debugger/debug_adapter/debug_adapter_server.cpp
@@ -38,6 +38,7 @@
int DebugAdapterServer::port_override = -1;
DebugAdapterServer::DebugAdapterServer() {
+ // TODO: Move to editor_settings.cpp
_EDITOR_DEF("network/debug_adapter/remote_port", remote_port);
_EDITOR_DEF("network/debug_adapter/request_timeout", protocol._request_timeout);
_EDITOR_DEF("network/debug_adapter/sync_breakpoints", protocol._sync_breakpoints);
diff --git a/editor/debugger/editor_file_server.cpp b/editor/debugger/editor_file_server.cpp
index 1092b07054..116e6681ae 100644
--- a/editor/debugger/editor_file_server.cpp
+++ b/editor/debugger/editor_file_server.cpp
@@ -271,9 +271,6 @@ void EditorFileServer::stop() {
EditorFileServer::EditorFileServer() {
server.instantiate();
-
- EDITOR_DEF("filesystem/file_server/port", 6010);
- EDITOR_DEF("filesystem/file_server/password", "");
}
EditorFileServer::~EditorFileServer() {
diff --git a/editor/debugger/editor_profiler.cpp b/editor/debugger/editor_profiler.cpp
index 24bb694860..d244b6b4cd 100644
--- a/editor/debugger/editor_profiler.cpp
+++ b/editor/debugger/editor_profiler.cpp
@@ -35,6 +35,7 @@
#include "editor/editor_string_names.h"
#include "editor/themes/editor_scale.h"
#include "editor/themes/editor_theme_manager.h"
+#include "scene/gui/check_box.h"
#include "scene/resources/image_texture.h"
void EditorProfiler::_make_metric_ptrs(Metric &m) {
@@ -177,8 +178,8 @@ void EditorProfiler::_item_edited() {
}
void EditorProfiler::_update_plot() {
- const int w = graph->get_size().width;
- const int h = graph->get_size().height;
+ const int w = MAX(1, graph->get_size().width); // Clamp to 1 to prevent from crashing when profiler is autostarted.
+ const int h = MAX(1, graph->get_size().height);
bool reset_texture = false;
const int desired_len = w * h * 4;
@@ -416,6 +417,10 @@ void EditorProfiler::_internal_profiles_pressed() {
_combo_changed(0);
}
+void EditorProfiler::_autostart_toggled(bool p_toggled_on) {
+ EditorSettings::get_singleton()->set_project_metadata("debug_options", "autostart_profiler", p_toggled_on);
+}
+
void EditorProfiler::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE:
@@ -539,9 +544,10 @@ void EditorProfiler::set_enabled(bool p_enable, bool p_clear) {
}
}
-void EditorProfiler::set_pressed(bool p_pressed) {
+void EditorProfiler::set_profiling(bool p_pressed) {
activate->set_pressed(p_pressed);
_update_button_text();
+ emit_signal(SNAME("enable_profiling"), activate->is_pressed());
}
bool EditorProfiler::is_profiling() {
@@ -633,6 +639,12 @@ EditorProfiler::EditorProfiler() {
clear_button->set_disabled(true);
hb->add_child(clear_button);
+ CheckBox *autostart_checkbox = memnew(CheckBox);
+ autostart_checkbox->set_text(TTR("Autostart"));
+ autostart_checkbox->set_pressed(EditorSettings::get_singleton()->get_project_metadata("debug_options", "autostart_profiler", false));
+ autostart_checkbox->connect(SceneStringName(toggled), callable_mp(this, &EditorProfiler::_autostart_toggled));
+ hb->add_child(autostart_checkbox);
+
hb->add_child(memnew(Label(TTR("Measure:"))));
display_mode = memnew(OptionButton);
diff --git a/editor/debugger/editor_profiler.h b/editor/debugger/editor_profiler.h
index 64253070b1..8de276be43 100644
--- a/editor/debugger/editor_profiler.h
+++ b/editor/debugger/editor_profiler.h
@@ -138,6 +138,7 @@ private:
void _activate_pressed();
void _clear_pressed();
+ void _autostart_toggled(bool p_toggled_on);
void _internal_profiles_pressed();
@@ -168,7 +169,7 @@ protected:
public:
void add_frame_metric(const Metric &p_metric, bool p_final = false);
void set_enabled(bool p_enable, bool p_clear = true);
- void set_pressed(bool p_pressed);
+ void set_profiling(bool p_pressed);
bool is_profiling();
bool is_seeking() { return seeking; }
void disable_seeking();
diff --git a/editor/debugger/editor_visual_profiler.cpp b/editor/debugger/editor_visual_profiler.cpp
index 56c9db44cd..d4859fbe4d 100644
--- a/editor/debugger/editor_visual_profiler.cpp
+++ b/editor/debugger/editor_visual_profiler.cpp
@@ -148,8 +148,8 @@ void EditorVisualProfiler::_item_selected() {
}
void EditorVisualProfiler::_update_plot() {
- const int w = graph->get_size().width;
- const int h = graph->get_size().height;
+ const int w = graph->get_size().width + 1; // `+1` is to prevent from crashing when visual profiler is auto started.
+ const int h = graph->get_size().height + 1;
bool reset_texture = false;
@@ -427,6 +427,10 @@ void EditorVisualProfiler::_clear_pressed() {
_update_plot();
}
+void EditorVisualProfiler::_autostart_toggled(bool p_toggled_on) {
+ EditorSettings::get_singleton()->set_project_metadata("debug_options", "autostart_visual_profiler", p_toggled_on);
+}
+
void EditorVisualProfiler::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE:
@@ -668,9 +672,10 @@ void EditorVisualProfiler::set_enabled(bool p_enable) {
activate->set_disabled(!p_enable);
}
-void EditorVisualProfiler::set_pressed(bool p_pressed) {
- activate->set_pressed(p_pressed);
+void EditorVisualProfiler::set_profiling(bool p_profiling) {
+ activate->set_pressed(p_profiling);
_update_button_text();
+ emit_signal(SNAME("enable_profiling"), activate->is_pressed());
}
bool EditorVisualProfiler::is_profiling() {
@@ -747,6 +752,12 @@ EditorVisualProfiler::EditorVisualProfiler() {
clear_button->connect(SceneStringName(pressed), callable_mp(this, &EditorVisualProfiler::_clear_pressed));
hb->add_child(clear_button);
+ CheckBox *autostart_checkbox = memnew(CheckBox);
+ autostart_checkbox->set_text(TTR("Autostart"));
+ autostart_checkbox->set_pressed(EditorSettings::get_singleton()->get_project_metadata("debug_options", "autostart_visual_profiler", false));
+ autostart_checkbox->connect(SceneStringName(toggled), callable_mp(this, &EditorVisualProfiler::_autostart_toggled));
+ hb->add_child(autostart_checkbox);
+
hb->add_child(memnew(Label(TTR("Measure:"))));
display_mode = memnew(OptionButton);
diff --git a/editor/debugger/editor_visual_profiler.h b/editor/debugger/editor_visual_profiler.h
index 492985506a..a8ed58132e 100644
--- a/editor/debugger/editor_visual_profiler.h
+++ b/editor/debugger/editor_visual_profiler.h
@@ -109,6 +109,7 @@ private:
void _activate_pressed();
void _clear_pressed();
+ void _autostart_toggled(bool p_toggled_on);
String _get_time_as_text(float p_time);
@@ -137,7 +138,7 @@ protected:
public:
void add_frame_metric(const Metric &p_metric);
void set_enabled(bool p_enable);
- void set_pressed(bool p_pressed);
+ void set_profiling(bool p_profiling);
bool is_profiling();
bool is_seeking() { return seeking; }
void disable_seeking();
diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp
index 5e96daf69c..b798bdf9c1 100644
--- a/editor/debugger/script_editor_debugger.cpp
+++ b/editor/debugger/script_editor_debugger.cpp
@@ -1012,6 +1012,14 @@ void ScriptEditorDebugger::start(Ref<RemoteDebuggerPeer> p_peer) {
_set_reason_text(TTR("Debug session started."), MESSAGE_SUCCESS);
_update_buttons_state();
emit_signal(SNAME("started"));
+
+ if (EditorSettings::get_singleton()->get_project_metadata("debug_options", "autostart_profiler", false)) {
+ profiler->set_profiling(true);
+ }
+
+ if (EditorSettings::get_singleton()->get_project_metadata("debug_options", "autostart_visual_profiler", false)) {
+ visual_profiler->set_profiling(true);
+ }
}
void ScriptEditorDebugger::_update_buttons_state() {
@@ -1076,10 +1084,10 @@ void ScriptEditorDebugger::stop() {
profiler_signature.clear();
profiler->set_enabled(false, false);
- profiler->set_pressed(false);
+ profiler->set_profiling(false);
visual_profiler->set_enabled(false);
- visual_profiler->set_pressed(false);
+ visual_profiler->set_profiling(false);
inspector->edit(nullptr);
_update_buttons_state();
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp
index f5f7b8f51c..cfe257fcfc 100644
--- a/editor/editor_help.cpp
+++ b/editor/editor_help.cpp
@@ -3134,8 +3134,6 @@ void EditorHelp::init_gdext_pointers() {
EditorHelp::EditorHelp() {
set_custom_minimum_size(Size2(150 * EDSCALE, 0));
- EDITOR_DEF("text_editor/help/sort_functions_alphabetically", true);
-
class_desc = memnew(RichTextLabel);
class_desc->set_tab_size(8);
add_child(class_desc);
diff --git a/editor/editor_native_shader_source_visualizer.cpp b/editor/editor_native_shader_source_visualizer.cpp
index 3d7d37c94e..9ebf7d680e 100644
--- a/editor/editor_native_shader_source_visualizer.cpp
+++ b/editor/editor_native_shader_source_visualizer.cpp
@@ -98,7 +98,7 @@ void EditorNativeShaderSourceVisualizer::_inspect_shader(RID p_shader) {
code_edit->set_syntax_highlighter(syntax_highlighter);
code_edit->add_theme_font_override(SceneStringName(font), get_theme_font("source", EditorStringName(EditorFonts)));
code_edit->add_theme_font_size_override(SceneStringName(font_size), get_theme_font_size("source_size", EditorStringName(EditorFonts)));
- code_edit->add_theme_constant_override("line_spacing", EDITOR_DEF("text_editor/theme/line_spacing", 6));
+ code_edit->add_theme_constant_override("line_spacing", EDITOR_GET("text_editor/theme/line_spacing"));
// Appearance: Caret
code_edit->set_caret_type((TextEdit::CaretType)EDITOR_GET("text_editor/appearance/caret/type").operator int());
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index 2e46068e07..0fb57ce40e 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -687,16 +687,21 @@ void EditorPropertyEnum::update_property() {
void EditorPropertyEnum::setup(const Vector<String> &p_options) {
options->clear();
+ HashMap<int64_t, Vector<String>> items;
int64_t current_val = 0;
- for (int i = 0; i < p_options.size(); i++) {
- Vector<String> text_split = p_options[i].split(":");
+ for (const String &option : p_options) {
+ Vector<String> text_split = option.split(":");
if (text_split.size() != 1) {
current_val = text_split[1].to_int();
}
- options->add_item(text_split[0]);
- options->set_item_metadata(i, current_val);
+ items[current_val].push_back(text_split[0]);
current_val += 1;
}
+
+ for (const KeyValue<int64_t, Vector<String>> &K : items) {
+ options->add_item(String(", ").join(K.value));
+ options->set_item_metadata(-1, K.key);
+ }
}
void EditorPropertyEnum::set_option_button_clip(bool p_enable) {
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index d0c89c49c4..96a7700c34 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -400,6 +400,9 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
EDITOR_SETTING_USAGE(Variant::STRING, PROPERTY_HINT_ENUM, "interface/editor/editor_language", best, lang_hint, PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
}
+ // Asset library
+ _initial_set("asset_library/use_threads", true);
+
/* Interface */
// Editor
@@ -481,6 +484,10 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "interface/editor/vsync_mode", 1, "Disabled,Enabled,Adaptive,Mailbox")
EDITOR_SETTING(Variant::BOOL, PROPERTY_HINT_NONE, "interface/editor/update_continuously", false, "")
+ _initial_set("interface/editors/show_scene_tree_root_selection", true);
+ _initial_set("interface/editors/derive_script_globals_by_name", true);
+ _initial_set("docks/scene_tree/ask_before_revoking_unique_name", true);
+
// Inspector
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "interface/inspector/max_array_dictionary_items_per_page", 20, "10,100,1")
EDITOR_SETTING(Variant::BOOL, PROPERTY_HINT_NONE, "interface/inspector/show_low_level_opentype_features", false, "")
@@ -571,6 +578,10 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
_initial_set("filesystem/on_save/compress_binary_resources", true);
_initial_set("filesystem/on_save/safe_save_on_backup_then_rename", true);
+ // EditorFileServer
+ _initial_set("filesystem/file_server/port", 6010);
+ _initial_set("filesystem/file_server/password", "");
+
// File dialog
_initial_set("filesystem/file_dialog/show_hidden_files", false);
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "filesystem/file_dialog/display_mode", 0, "Thumbnails,List")
@@ -588,6 +599,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
/* Docks */
// SceneTree
+ _initial_set("docks/scene_tree/ask_before_deleting_related_animation_tracks", true);
_initial_set("docks/scene_tree/start_create_dialog_fully_expanded", false);
_initial_set("docks/scene_tree/auto_expand_to_selected", true);
_initial_set("docks/scene_tree/center_node_on_reparent", false);
@@ -605,6 +617,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
/* Text editor */
// Theme
+ _initial_set("text_editor/theme/line_spacing", 6);
EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_ENUM, "text_editor/theme/color_theme", "Default", "Default,Godot 2,Custom")
// Theme: Highlighting
@@ -669,10 +682,19 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
_initial_set("text_editor/behavior/files/restore_scripts_on_load", true);
_initial_set("text_editor/behavior/files/convert_indent_on_save", true);
_initial_set("text_editor/behavior/files/auto_reload_scripts_on_external_change", false);
+ _initial_set("text_editor/behavior/files/auto_reload_and_parse_scripts_on_save", true);
+ _initial_set("text_editor/behavior/files/open_dominant_script_on_scene_change", false);
// Script list
_initial_set("text_editor/script_list/show_members_overview", true);
_initial_set("text_editor/script_list/sort_members_outline_alphabetically", false);
+ _initial_set("text_editor/script_list/script_temperature_enabled", true);
+ _initial_set("text_editor/script_list/script_temperature_history_size", 15);
+ _initial_set("text_editor/script_list/group_help_pages", true);
+ EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "text_editor/script_list/sort_scripts_by", 0, "Name,Path,None");
+ EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "text_editor/script_list/list_script_names_as", 0, "Name,Parent Directory And Name,Full Path");
+ EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_GLOBAL_FILE, "text_editor/external/exec_path", "", "");
+ EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_PLACEHOLDER_TEXT, "text_editor/external/exec_flags", "{file}", "Call flags with placeholders: {project}, {file}, {col}, {line}.");
// Completion
EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "text_editor/completion/idle_parse_delay", 1.5, "0.1,10,0.01")
@@ -687,17 +709,28 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
_initial_set("text_editor/completion/use_single_quotes", false);
_initial_set("text_editor/completion/colorize_suggestions", true);
+ // External editor (ScriptEditorPlugin)
+ _initial_set("text_editor/external/use_external_editor", false);
+ _initial_set("text_editor/external/exec_path", "");
+
// Help
_initial_set("text_editor/help/show_help_index", true);
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "text_editor/help/help_font_size", 16, "8,48,1")
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "text_editor/help/help_source_font_size", 15, "8,48,1")
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "text_editor/help/help_title_font_size", 23, "8,64,1")
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "text_editor/help/class_reference_examples", 0, "GDScript,C#,GDScript and C#")
+ _initial_set("text_editor/help/sort_functions_alphabetically", true);
/* Editors */
// GridMap
+ // GridMapEditor
_initial_set("editors/grid_map/pick_distance", 5000.0);
+ _initial_set("editors/grid_map/palette_min_width", 230);
+ set_restart_if_changed("editors/grid_map/palette_min_width", true);
+ _initial_set("editors/grid_map/preview_size", 64);
+ // GridMapEditorPlugin
+ EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "editors/grid_map/editor_side", 1, "Left,Right");
// 3D
EDITOR_SETTING(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d/primary_grid_color", Color(0.56, 0.56, 0.56, 0.5), "")
@@ -708,6 +741,28 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/instantiated", Color(0.7, 0.7, 0.7, 0.6), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/joint", Color(0.5, 0.8, 1), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/aabb", Color(0.28, 0.8, 0.82), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
+ EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/stream_player_3d", Color(0.4, 0.8, 1), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
+ EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/camera", Color(0.8, 0.4, 0.8), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
+ EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/decal", Color(0.6, 0.5, 1.0), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
+ EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/fog_volume", Color(0.5, 0.7, 1), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
+ EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/particles", Color(0.8, 0.7, 0.4), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
+ EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/particle_attractor", Color(1, 0.7, 0.5), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
+ EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/particle_collision", Color(0.5, 0.7, 1), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
+ EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/joint_body_a", Color(0.6, 0.8, 1), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
+ EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/joint_body_b", Color(0.6, 0.9, 1), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
+ EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/lightmap_lines", Color(0.5, 0.6, 1), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
+ EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/lightprobe_lines", Color(0.5, 0.6, 1), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
+ EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/occluder", Color(0.8, 0.5, 1), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
+ EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/reflection_probe", Color(0.6, 1, 0.5), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
+ EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/visibility_notifier", Color(0.8, 0.5, 0.7), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
+ EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/voxel_gi", Color(0.5, 1, 0.6), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
+ EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/path_tilt", Color(1.0, 1.0, 0.4, 0.9), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
+ EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/skeleton", Color(1, 0.8, 0.4), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
+ EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/selected_bone", Color(0.8, 0.3, 0.0), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
+ EDITOR_SETTING_USAGE(Variant::COLOR, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_colors/csg", Color(0.0, 0.4, 1, 0.15), "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
+ _initial_set("editors/3d_gizmos/gizmo_settings/bone_axis_length", (float)0.1);
+ EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "editors/3d_gizmos/gizmo_settings/bone_shape", 1, "Wire,Octahedron");
+ EDITOR_SETTING_USAGE(Variant::FLOAT, PROPERTY_HINT_NONE, "editors/3d_gizmos/gizmo_settings/path3d_tilt_disk_size", 0.8, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
// If a line is a multiple of this, it uses the primary grid color.
// Use a power of 2 value by default as it's more common to use powers of 2 in level design.
@@ -750,6 +805,8 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/navigation_feel/orbit_inertia", 0.0, "0,1,0.001")
EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/navigation_feel/translation_inertia", 0.05, "0,1,0.001")
EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/navigation_feel/zoom_inertia", 0.05, "0,1,0.001")
+ _initial_set("editors/3d/navigation/show_viewport_rotation_gizmo", true);
+ _initial_set("editors/3d/navigation/show_viewport_navigation_gizmo", DisplayServer::get_singleton()->is_touchscreen_available());
// 3D: Freelook
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "editors/3d/freelook/freelook_navigation_scheme", 0, "Default,Partially Axis-Locked (id Tech),Fully Axis-Locked (Minecraft)")
@@ -759,6 +816,10 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "editors/3d/freelook/freelook_activation_modifier", 0, "None,Shift,Alt,Meta,Ctrl")
_initial_set("editors/3d/freelook/freelook_speed_zoom_link", false);
+ // 3D: Manipulator
+ EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "editors/3d/manipulator_gizmo_size", 80, "16,160,1");
+ EDITOR_SETTING_USAGE(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/3d/manipulator_gizmo_opacity", 0.9, "0,1,0.01", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
+
// 2D
_initial_set("editors/2d/grid_color", Color(1.0, 1.0, 1.0, 0.07));
_initial_set("editors/2d/guides_color", Color(0.6, 0.0, 0.8));
@@ -774,6 +835,12 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
_initial_set("editors/2d/use_integer_zoom_by_default", false);
EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "editors/2d/zoom_speed_factor", 1.1, "1.01,2,0.01")
+ // Bone mapper (BoneMapEditorPlugin)
+ _initial_set("editors/bone_mapper/handle_colors/unset", Color(0.3, 0.3, 0.3));
+ _initial_set("editors/bone_mapper/handle_colors/set", Color(0.1, 0.6, 0.25));
+ _initial_set("editors/bone_mapper/handle_colors/missing", Color(0.8, 0.2, 0.8));
+ _initial_set("editors/bone_mapper/handle_colors/error", Color(0.8, 0.2, 0.2));
+
// Panning
// Enum should be in sync with ControlScheme in ViewPanner.
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "editors/panning/2d_editor_panning_scheme", 0, "Scroll Zooms,Scroll Pans");
@@ -814,6 +881,10 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_ENUM, "editors/visual_editors/grid_pattern", 1, "Lines,Dots")
EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "editors/visual_editors/visual_shader/port_preview_size", 160, "100,400,0.01")
+ // Export (EditorExportPlugin)
+ _initial_set("export/ssh/ssh", "");
+ _initial_set("export/ssh/scp", "");
+
/* Run */
// Window placement
@@ -880,6 +951,11 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
EDITOR_SETTING(Variant::FLOAT, PROPERTY_HINT_RANGE, "debugger/remote_inspect_refresh_interval", 0.2, "0.02,10,0.01,or_greater")
EDITOR_SETTING(Variant::BOOL, PROPERTY_HINT_NONE, "debugger/profile_native_calls", false, "")
+ // Version control (VersionControlEditorPlugin)
+ _initial_set("version_control/username", "");
+ _initial_set("version_control/ssh_public_key_path", "");
+ _initial_set("version_control/ssh_private_key_path", "");
+
/* Extra config */
EDITOR_SETTING_USAGE(Variant::BOOL, PROPERTY_HINT_NONE, "input/buffering/agile_event_flushing", false, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)
diff --git a/editor/export/editor_export_plugin.cpp b/editor/export/editor_export_plugin.cpp
index 6bb21d7fd4..3f1b8aa863 100644
--- a/editor/export/editor_export_plugin.cpp
+++ b/editor/export/editor_export_plugin.cpp
@@ -364,8 +364,3 @@ void EditorExportPlugin::_bind_methods() {
GDVIRTUAL_BIND(_get_android_manifest_application_element_contents, "platform", "debug");
GDVIRTUAL_BIND(_get_android_manifest_element_contents, "platform", "debug");
}
-
-EditorExportPlugin::EditorExportPlugin() {
- EDITOR_DEF("export/ssh/ssh", "");
- EDITOR_DEF("export/ssh/scp", "");
-}
diff --git a/editor/export/editor_export_plugin.h b/editor/export/editor_export_plugin.h
index 7a355614c7..ae186d4425 100644
--- a/editor/export/editor_export_plugin.h
+++ b/editor/export/editor_export_plugin.h
@@ -183,8 +183,6 @@ public:
String get_ios_cpp_code() const;
const Vector<String> &get_macos_plugin_files() const;
Variant get_option(const StringName &p_name) const;
-
- EditorExportPlugin();
};
#endif // EDITOR_EXPORT_PLUGIN_H
diff --git a/editor/plugins/abstract_polygon_2d_editor.cpp b/editor/plugins/abstract_polygon_2d_editor.cpp
index 60d808952e..804f9c607e 100644
--- a/editor/plugins/abstract_polygon_2d_editor.cpp
+++ b/editor/plugins/abstract_polygon_2d_editor.cpp
@@ -748,7 +748,9 @@ AbstractPolygon2DEditor::AbstractPolygon2DEditor(bool p_wip_destructive) {
}
void AbstractPolygon2DEditorPlugin::edit(Object *p_object) {
- polygon_editor->edit(Object::cast_to<Node>(p_object));
+ Node *polygon_node = Object::cast_to<Node>(p_object);
+ polygon_editor->edit(polygon_node);
+ make_visible(polygon_node != nullptr);
}
bool AbstractPolygon2DEditorPlugin::handles(Object *p_object) const {
diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp
index f31346fe67..af4b3a1643 100644
--- a/editor/plugins/asset_library_editor_plugin.cpp
+++ b/editor/plugins/asset_library_editor_plugin.cpp
@@ -47,7 +47,7 @@
#include "scene/resources/image_texture.h"
static inline void setup_http_request(HTTPRequest *request) {
- request->set_use_threads(EDITOR_DEF("asset_library/use_threads", true));
+ request->set_use_threads(EDITOR_GET("asset_library/use_threads"));
const String proxy_host = EDITOR_GET("network/http_proxy/host");
const int proxy_port = EDITOR_GET("network/http_proxy/port");
@@ -703,6 +703,7 @@ void EditorAssetLibrary::_notification(int p_what) {
}
void EditorAssetLibrary::_update_repository_options() {
+ // TODO: Move to editor_settings.cpp
Dictionary default_urls;
default_urls["godotengine.org (Official)"] = "https://godotengine.org/asset-library/api";
Dictionary available_urls = _EDITOR_DEF("asset_library/available_urls", default_urls, true);
diff --git a/editor/plugins/bone_map_editor_plugin.cpp b/editor/plugins/bone_map_editor_plugin.cpp
index 32ff478c33..d81ec21705 100644
--- a/editor/plugins/bone_map_editor_plugin.cpp
+++ b/editor/plugins/bone_map_editor_plugin.cpp
@@ -1477,12 +1477,6 @@ void EditorInspectorPluginBoneMap::parse_begin(Object *p_object) {
}
BoneMapEditorPlugin::BoneMapEditorPlugin() {
- // Register properties in editor settings.
- EDITOR_DEF("editors/bone_mapper/handle_colors/unset", Color(0.3, 0.3, 0.3));
- EDITOR_DEF("editors/bone_mapper/handle_colors/set", Color(0.1, 0.6, 0.25));
- EDITOR_DEF("editors/bone_mapper/handle_colors/missing", Color(0.8, 0.2, 0.8));
- EDITOR_DEF("editors/bone_mapper/handle_colors/error", Color(0.8, 0.2, 0.2));
-
Ref<EditorInspectorPluginBoneMap> inspector_plugin;
inspector_plugin.instantiate();
add_inspector_plugin(inspector_plugin);
diff --git a/editor/plugins/gizmos/audio_stream_player_3d_gizmo_plugin.cpp b/editor/plugins/gizmos/audio_stream_player_3d_gizmo_plugin.cpp
index 9d4b5e9d70..577f2b6b8e 100644
--- a/editor/plugins/gizmos/audio_stream_player_3d_gizmo_plugin.cpp
+++ b/editor/plugins/gizmos/audio_stream_player_3d_gizmo_plugin.cpp
@@ -38,7 +38,7 @@
#include "scene/3d/audio_stream_player_3d.h"
AudioStreamPlayer3DGizmoPlugin::AudioStreamPlayer3DGizmoPlugin() {
- Color gizmo_color = EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/stream_player_3d", Color(0.4, 0.8, 1));
+ Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/stream_player_3d");
create_icon_material("stream_player_3d_icon", EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("Gizmo3DSamplePlayer"), EditorStringName(EditorIcons)));
create_material("stream_player_3d_material_primary", gizmo_color);
diff --git a/editor/plugins/gizmos/camera_3d_gizmo_plugin.cpp b/editor/plugins/gizmos/camera_3d_gizmo_plugin.cpp
index 8d0222215c..63a48d4165 100644
--- a/editor/plugins/gizmos/camera_3d_gizmo_plugin.cpp
+++ b/editor/plugins/gizmos/camera_3d_gizmo_plugin.cpp
@@ -39,7 +39,7 @@
#include "scene/3d/camera_3d.h"
Camera3DGizmoPlugin::Camera3DGizmoPlugin() {
- Color gizmo_color = EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/camera", Color(0.8, 0.4, 0.8));
+ Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/camera");
create_material("camera_material", gizmo_color);
create_icon_material("camera_icon", EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("GizmoCamera3D"), EditorStringName(EditorIcons)));
diff --git a/editor/plugins/gizmos/cpu_particles_3d_gizmo_plugin.cpp b/editor/plugins/gizmos/cpu_particles_3d_gizmo_plugin.cpp
index fe5d8e92d1..2a5d8cb2a9 100644
--- a/editor/plugins/gizmos/cpu_particles_3d_gizmo_plugin.cpp
+++ b/editor/plugins/gizmos/cpu_particles_3d_gizmo_plugin.cpp
@@ -37,7 +37,7 @@
#include "scene/3d/cpu_particles_3d.h"
CPUParticles3DGizmoPlugin::CPUParticles3DGizmoPlugin() {
- Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/particles", Color(0.8, 0.7, 0.4));
+ Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/particles");
create_material("particles_material", gizmo_color);
gizmo_color.a = MAX((gizmo_color.a - 0.2) * 0.02, 0.0);
create_material("particles_solid_material", gizmo_color);
diff --git a/editor/plugins/gizmos/decal_gizmo_plugin.cpp b/editor/plugins/gizmos/decal_gizmo_plugin.cpp
index f2b44790ee..b619c3a1dd 100644
--- a/editor/plugins/gizmos/decal_gizmo_plugin.cpp
+++ b/editor/plugins/gizmos/decal_gizmo_plugin.cpp
@@ -40,7 +40,7 @@
DecalGizmoPlugin::DecalGizmoPlugin() {
helper.instantiate();
- Color gizmo_color = EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/decal", Color(0.6, 0.5, 1.0));
+ Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/decal");
create_icon_material("decal_icon", EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("GizmoDecal"), EditorStringName(EditorIcons)));
diff --git a/editor/plugins/gizmos/fog_volume_gizmo_plugin.cpp b/editor/plugins/gizmos/fog_volume_gizmo_plugin.cpp
index dd91d7dfe3..5c2f942519 100644
--- a/editor/plugins/gizmos/fog_volume_gizmo_plugin.cpp
+++ b/editor/plugins/gizmos/fog_volume_gizmo_plugin.cpp
@@ -40,7 +40,7 @@
FogVolumeGizmoPlugin::FogVolumeGizmoPlugin() {
helper.instantiate();
- Color gizmo_color = EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/fog_volume", Color(0.5, 0.7, 1));
+ Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/fog_volume");
create_material("shape_material", gizmo_color);
gizmo_color.a = 0.15;
create_material("shape_material_internal", gizmo_color);
diff --git a/editor/plugins/gizmos/gpu_particles_3d_gizmo_plugin.cpp b/editor/plugins/gizmos/gpu_particles_3d_gizmo_plugin.cpp
index 39bfed93b0..d2a90ae57c 100644
--- a/editor/plugins/gizmos/gpu_particles_3d_gizmo_plugin.cpp
+++ b/editor/plugins/gizmos/gpu_particles_3d_gizmo_plugin.cpp
@@ -38,7 +38,7 @@
#include "scene/3d/gpu_particles_3d.h"
GPUParticles3DGizmoPlugin::GPUParticles3DGizmoPlugin() {
- Color gizmo_color = EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/particles", Color(0.8, 0.7, 0.4));
+ Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/particles");
create_material("particles_material", gizmo_color);
gizmo_color.a = MAX((gizmo_color.a - 0.2) * 0.02, 0.0);
create_icon_material("particles_icon", EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("GizmoGPUParticles3D"), EditorStringName(EditorIcons)));
diff --git a/editor/plugins/gizmos/gpu_particles_collision_3d_gizmo_plugin.cpp b/editor/plugins/gizmos/gpu_particles_collision_3d_gizmo_plugin.cpp
index 6f20a53459..78acbc4d23 100644
--- a/editor/plugins/gizmos/gpu_particles_collision_3d_gizmo_plugin.cpp
+++ b/editor/plugins/gizmos/gpu_particles_collision_3d_gizmo_plugin.cpp
@@ -39,12 +39,12 @@
GPUParticlesCollision3DGizmoPlugin::GPUParticlesCollision3DGizmoPlugin() {
helper.instantiate();
- Color gizmo_color_attractor = EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/particle_attractor", Color(1, 0.7, 0.5));
+ Color gizmo_color_attractor = EDITOR_GET("editors/3d_gizmos/gizmo_colors/particle_attractor");
create_material("shape_material_attractor", gizmo_color_attractor);
gizmo_color_attractor.a = 0.15;
create_material("shape_material_attractor_internal", gizmo_color_attractor);
- Color gizmo_color_collision = EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/particle_collision", Color(0.5, 0.7, 1));
+ Color gizmo_color_collision = EDITOR_GET("editors/3d_gizmos/gizmo_colors/particle_collision");
create_material("shape_material_collision", gizmo_color_collision);
gizmo_color_collision.a = 0.15;
create_material("shape_material_collision_internal", gizmo_color_collision);
diff --git a/editor/plugins/gizmos/joint_3d_gizmo_plugin.cpp b/editor/plugins/gizmos/joint_3d_gizmo_plugin.cpp
index c277ec8cd3..8c0192a961 100644
--- a/editor/plugins/gizmos/joint_3d_gizmo_plugin.cpp
+++ b/editor/plugins/gizmos/joint_3d_gizmo_plugin.cpp
@@ -280,8 +280,8 @@ void JointGizmosDrawer::draw_cone(const Transform3D &p_offset, const Basis &p_ba
Joint3DGizmoPlugin::Joint3DGizmoPlugin() {
create_material("joint_material", EDITOR_GET("editors/3d_gizmos/gizmo_colors/joint"));
- create_material("joint_body_a_material", EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/joint_body_a", Color(0.6, 0.8, 1)));
- create_material("joint_body_b_material", EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/joint_body_b", Color(0.6, 0.9, 1)));
+ create_material("joint_body_a_material", EDITOR_GET("editors/3d_gizmos/gizmo_colors/joint_body_a"));
+ create_material("joint_body_b_material", EDITOR_GET("editors/3d_gizmos/gizmo_colors/joint_body_b"));
update_timer = memnew(Timer);
update_timer->set_name("JointGizmoUpdateTimer");
diff --git a/editor/plugins/gizmos/lightmap_gi_gizmo_plugin.cpp b/editor/plugins/gizmos/lightmap_gi_gizmo_plugin.cpp
index 64913dc779..748f770d4d 100644
--- a/editor/plugins/gizmos/lightmap_gi_gizmo_plugin.cpp
+++ b/editor/plugins/gizmos/lightmap_gi_gizmo_plugin.cpp
@@ -37,7 +37,7 @@
#include "scene/3d/lightmap_gi.h"
LightmapGIGizmoPlugin::LightmapGIGizmoPlugin() {
- Color gizmo_color = EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/lightmap_lines", Color(0.5, 0.6, 1));
+ Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/lightmap_lines");
gizmo_color.a = 0.1;
create_material("lightmap_lines", gizmo_color);
diff --git a/editor/plugins/gizmos/lightmap_probe_gizmo_plugin.cpp b/editor/plugins/gizmos/lightmap_probe_gizmo_plugin.cpp
index 5fd8ad2235..cc8649d2d1 100644
--- a/editor/plugins/gizmos/lightmap_probe_gizmo_plugin.cpp
+++ b/editor/plugins/gizmos/lightmap_probe_gizmo_plugin.cpp
@@ -39,7 +39,7 @@
LightmapProbeGizmoPlugin::LightmapProbeGizmoPlugin() {
create_icon_material("lightmap_probe_icon", EditorNode::get_singleton()->get_editor_theme()->get_icon(SNAME("GizmoLightmapProbe"), EditorStringName(EditorIcons)));
- Color gizmo_color = EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/lightprobe_lines", Color(0.5, 0.6, 1));
+ Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/lightprobe_lines");
gizmo_color.a = 0.3;
create_material("lightprobe_lines", gizmo_color);
diff --git a/editor/plugins/gizmos/mesh_instance_3d_gizmo_plugin.cpp b/editor/plugins/gizmos/mesh_instance_3d_gizmo_plugin.cpp
index e54f429b8d..251fb6892e 100644
--- a/editor/plugins/gizmos/mesh_instance_3d_gizmo_plugin.cpp
+++ b/editor/plugins/gizmos/mesh_instance_3d_gizmo_plugin.cpp
@@ -33,6 +33,7 @@
#include "editor/plugins/node_3d_editor_plugin.h"
#include "scene/3d/mesh_instance_3d.h"
#include "scene/3d/soft_body_3d.h"
+#include "scene/resources/3d/primitive_meshes.h"
MeshInstance3DGizmoPlugin::MeshInstance3DGizmoPlugin() {
}
@@ -64,7 +65,22 @@ void MeshInstance3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
return; //none
}
- Ref<TriangleMesh> tm = m->generate_triangle_mesh();
+ Ref<TriangleMesh> tm;
+
+ Ref<PlaneMesh> plane_mesh = mesh->get_mesh();
+ if (plane_mesh.is_valid() && (plane_mesh->get_subdivide_depth() > 0 || plane_mesh->get_subdivide_width() > 0)) {
+ // PlaneMesh subdiv makes gizmo redraw very slow due to TriangleMesh BVH calculation for every face.
+ // For gizmo collision this is very much unnecessary since a PlaneMesh is always flat, 2 faces is enough.
+ Ref<PlaneMesh> simple_plane_mesh;
+ simple_plane_mesh.instantiate();
+ simple_plane_mesh->set_orientation(plane_mesh->get_orientation());
+ simple_plane_mesh->set_size(plane_mesh->get_size());
+ simple_plane_mesh->set_center_offset(plane_mesh->get_center_offset());
+ tm = simple_plane_mesh->generate_triangle_mesh();
+ } else {
+ tm = m->generate_triangle_mesh();
+ }
+
if (tm.is_valid()) {
p_gizmo->add_collision_triangles(tm);
}
diff --git a/editor/plugins/gizmos/occluder_instance_3d_gizmo_plugin.cpp b/editor/plugins/gizmos/occluder_instance_3d_gizmo_plugin.cpp
index d6f649ab9c..29f060d795 100644
--- a/editor/plugins/gizmos/occluder_instance_3d_gizmo_plugin.cpp
+++ b/editor/plugins/gizmos/occluder_instance_3d_gizmo_plugin.cpp
@@ -36,7 +36,7 @@
#include "scene/3d/occluder_instance_3d.h"
OccluderInstance3DGizmoPlugin::OccluderInstance3DGizmoPlugin() {
- create_material("line_material", EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/occluder", Color(0.8, 0.5, 1)));
+ create_material("line_material", EDITOR_GET("editors/3d_gizmos/gizmo_colors/occluder"));
create_handle_material("handles");
}
diff --git a/editor/plugins/gizmos/reflection_probe_gizmo_plugin.cpp b/editor/plugins/gizmos/reflection_probe_gizmo_plugin.cpp
index eb7e668f41..7b91dac2eb 100644
--- a/editor/plugins/gizmos/reflection_probe_gizmo_plugin.cpp
+++ b/editor/plugins/gizmos/reflection_probe_gizmo_plugin.cpp
@@ -40,7 +40,7 @@
ReflectionProbeGizmoPlugin::ReflectionProbeGizmoPlugin() {
helper.instantiate();
- Color gizmo_color = EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/reflection_probe", Color(0.6, 1, 0.5));
+ Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/reflection_probe");
create_material("reflection_probe_material", gizmo_color);
diff --git a/editor/plugins/gizmos/visible_on_screen_notifier_3d_gizmo_plugin.cpp b/editor/plugins/gizmos/visible_on_screen_notifier_3d_gizmo_plugin.cpp
index d3ae823fdc..2d40e66811 100644
--- a/editor/plugins/gizmos/visible_on_screen_notifier_3d_gizmo_plugin.cpp
+++ b/editor/plugins/gizmos/visible_on_screen_notifier_3d_gizmo_plugin.cpp
@@ -36,7 +36,7 @@
#include "scene/3d/visible_on_screen_notifier_3d.h"
VisibleOnScreenNotifier3DGizmoPlugin::VisibleOnScreenNotifier3DGizmoPlugin() {
- Color gizmo_color = EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/visibility_notifier", Color(0.8, 0.5, 0.7));
+ Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/visibility_notifier");
create_material("visibility_notifier_material", gizmo_color);
gizmo_color.a = 0.1;
create_material("visibility_notifier_solid_material", gizmo_color);
diff --git a/editor/plugins/gizmos/voxel_gi_gizmo_plugin.cpp b/editor/plugins/gizmos/voxel_gi_gizmo_plugin.cpp
index 8d09400f78..0123b9d84a 100644
--- a/editor/plugins/gizmos/voxel_gi_gizmo_plugin.cpp
+++ b/editor/plugins/gizmos/voxel_gi_gizmo_plugin.cpp
@@ -41,7 +41,7 @@
VoxelGIGizmoPlugin::VoxelGIGizmoPlugin() {
helper.instantiate();
- Color gizmo_color = EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/voxel_gi", Color(0.5, 1, 0.6));
+ Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/voxel_gi");
create_material("voxel_gi_material", gizmo_color);
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index f58dfbb5a5..d0d4f6098c 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -8999,13 +8999,6 @@ Node3DEditor::Node3DEditor() {
set_process_shortcut_input(true);
add_to_group(SceneStringName(_spatial_editor_group));
- EDITOR_DEF("editors/3d/manipulator_gizmo_size", 80);
- EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT, "editors/3d/manipulator_gizmo_size", PROPERTY_HINT_RANGE, "16,160,1"));
- EDITOR_DEF("editors/3d/manipulator_gizmo_opacity", 0.9);
- EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::FLOAT, "editors/3d/manipulator_gizmo_opacity", PROPERTY_HINT_RANGE, "0,1,0.01"));
- EDITOR_DEF("editors/3d/navigation/show_viewport_rotation_gizmo", true);
- EDITOR_DEF("editors/3d/navigation/show_viewport_navigation_gizmo", DisplayServer::get_singleton()->is_touchscreen_available());
-
current_hover_gizmo_handle = -1;
current_hover_gizmo_handle_secondary = false;
{
diff --git a/editor/plugins/path_3d_editor_plugin.cpp b/editor/plugins/path_3d_editor_plugin.cpp
index 890035e6a6..4fdcb79696 100644
--- a/editor/plugins/path_3d_editor_plugin.cpp
+++ b/editor/plugins/path_3d_editor_plugin.cpp
@@ -817,7 +817,10 @@ void Path3DEditorPlugin::_bind_methods() {
Path3DEditorPlugin::Path3DEditorPlugin() {
singleton = this;
- disk_size = EDITOR_DEF_RST("editors/3d_gizmos/gizmo_settings/path3d_tilt_disk_size", 0.8);
+ mirror_handle_angle = true;
+ mirror_handle_length = true;
+
+ disk_size = EDITOR_GET("editors/3d_gizmos/gizmo_settings/path3d_tilt_disk_size");
Ref<Path3DGizmoPlugin> gizmo_plugin = memnew(Path3DGizmoPlugin(disk_size));
Node3DEditor::get_singleton()->add_gizmo_plugin(gizmo_plugin);
@@ -1061,7 +1064,7 @@ int Path3DGizmoPlugin::get_priority() const {
Path3DGizmoPlugin::Path3DGizmoPlugin(float p_disk_size) {
Color path_color = SceneTree::get_singleton()->get_debug_paths_color();
- Color path_tilt_color = EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/path_tilt", Color(1.0, 1.0, 0.4, 0.9));
+ Color path_tilt_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/path_tilt");
disk_size = p_disk_size;
create_material("path_material", path_color);
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 253005c5ce..25198e00bf 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -4624,21 +4624,7 @@ ScriptEditorPlugin::ScriptEditorPlugin() {
window_wrapper->hide();
window_wrapper->connect("window_visibility_changed", callable_mp(this, &ScriptEditorPlugin::_window_visibility_changed));
- EDITOR_GET("text_editor/behavior/files/auto_reload_scripts_on_external_change");
- ScriptServer::set_reload_scripts_on_save(EDITOR_DEF("text_editor/behavior/files/auto_reload_and_parse_scripts_on_save", true));
- EDITOR_DEF("text_editor/behavior/files/open_dominant_script_on_scene_change", false);
- EDITOR_DEF("text_editor/external/use_external_editor", false);
- EDITOR_DEF("text_editor/external/exec_path", "");
- EDITOR_DEF("text_editor/script_list/script_temperature_enabled", true);
- EDITOR_DEF("text_editor/script_list/script_temperature_history_size", 15);
- EDITOR_DEF("text_editor/script_list/group_help_pages", true);
- EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT, "text_editor/script_list/sort_scripts_by", PROPERTY_HINT_ENUM, "Name,Path,None"));
- EDITOR_DEF("text_editor/script_list/sort_scripts_by", 0);
- EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT, "text_editor/script_list/list_script_names_as", PROPERTY_HINT_ENUM, "Name,Parent Directory And Name,Full Path"));
- EDITOR_DEF("text_editor/script_list/list_script_names_as", 0);
- EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "text_editor/external/exec_path", PROPERTY_HINT_GLOBAL_FILE));
- EDITOR_DEF("text_editor/external/exec_flags", "{file}");
- EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "text_editor/external/exec_flags", PROPERTY_HINT_PLACEHOLDER_TEXT, "Call flags with placeholders: {project}, {file}, {col}, {line}."));
+ ScriptServer::set_reload_scripts_on_save(EDITOR_GET("text_editor/behavior/files/auto_reload_and_parse_scripts_on_save"));
}
ScriptEditorPlugin::~ScriptEditorPlugin() {
diff --git a/editor/plugins/skeleton_3d_editor_plugin.cpp b/editor/plugins/skeleton_3d_editor_plugin.cpp
index 9fc88b3a6a..99cb03cdcd 100644
--- a/editor/plugins/skeleton_3d_editor_plugin.cpp
+++ b/editor/plugins/skeleton_3d_editor_plugin.cpp
@@ -1379,13 +1379,6 @@ void fragment() {
}
)");
selection_materials.selected_mat->set_shader(selected_sh);
-
- // Register properties in editor settings.
- EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/skeleton", Color(1, 0.8, 0.4));
- EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/selected_bone", Color(0.8, 0.3, 0.0));
- EDITOR_DEF("editors/3d_gizmos/gizmo_settings/bone_axis_length", (float)0.1);
- EDITOR_DEF("editors/3d_gizmos/gizmo_settings/bone_shape", 1);
- EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT, "editors/3d_gizmos/gizmo_settings/bone_shape", PROPERTY_HINT_ENUM, "Wire,Octahedron"));
}
Skeleton3DGizmoPlugin::~Skeleton3DGizmoPlugin() {
diff --git a/editor/plugins/version_control_editor_plugin.cpp b/editor/plugins/version_control_editor_plugin.cpp
index 1df84cb0a7..4f0df1d5fc 100644
--- a/editor/plugins/version_control_editor_plugin.cpp
+++ b/editor/plugins/version_control_editor_plugin.cpp
@@ -1032,7 +1032,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() {
set_up_username = memnew(LineEdit);
set_up_username->set_h_size_flags(Control::SIZE_EXPAND_FILL);
- set_up_username->set_text(EDITOR_DEF("version_control/username", ""));
+ set_up_username->set_text(EDITOR_GET("version_control/username"));
set_up_username->connect(SceneStringName(text_changed), callable_mp(this, &VersionControlEditorPlugin::_update_set_up_warning));
set_up_username_input->add_child(set_up_username);
@@ -1068,7 +1068,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() {
set_up_ssh_public_key_path = memnew(LineEdit);
set_up_ssh_public_key_path->set_h_size_flags(Control::SIZE_EXPAND_FILL);
- set_up_ssh_public_key_path->set_text(EDITOR_DEF("version_control/ssh_public_key_path", ""));
+ set_up_ssh_public_key_path->set_text(EDITOR_GET("version_control/ssh_public_key_path"));
set_up_ssh_public_key_path->connect(SceneStringName(text_changed), callable_mp(this, &VersionControlEditorPlugin::_update_set_up_warning));
set_up_ssh_public_key_input_hbc->add_child(set_up_ssh_public_key_path);
@@ -1101,7 +1101,7 @@ VersionControlEditorPlugin::VersionControlEditorPlugin() {
set_up_ssh_private_key_path = memnew(LineEdit);
set_up_ssh_private_key_path->set_h_size_flags(Control::SIZE_EXPAND_FILL);
- set_up_ssh_private_key_path->set_text(EDITOR_DEF("version_control/ssh_private_key_path", ""));
+ set_up_ssh_private_key_path->set_text(EDITOR_GET("version_control/ssh_private_key_path"));
set_up_ssh_private_key_path->connect(SceneStringName(text_changed), callable_mp(this, &VersionControlEditorPlugin::_update_set_up_warning));
set_up_ssh_private_key_input_hbc->add_child(set_up_ssh_private_key_path);
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 9f56c586a2..62706a6ae8 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -4683,10 +4683,6 @@ SceneTreeDock::SceneTreeDock(Node *p_scene_root, EditorSelection *p_editor_selec
set_process_input(true);
set_process(true);
- EDITOR_DEF("interface/editors/show_scene_tree_root_selection", true);
- EDITOR_DEF("interface/editors/derive_script_globals_by_name", true);
- EDITOR_DEF("docks/scene_tree/ask_before_deleting_related_animation_tracks", true);
- EDITOR_DEF("docks/scene_tree/ask_before_revoking_unique_name", true);
EDITOR_DEF("_use_favorites_root_selection", false);
Resource::_update_configuration_warning = _update_configuration_warning;
diff --git a/modules/csg/editor/csg_gizmos.cpp b/modules/csg/editor/csg_gizmos.cpp
index 3712441e51..95ffeed6c3 100644
--- a/modules/csg/editor/csg_gizmos.cpp
+++ b/modules/csg/editor/csg_gizmos.cpp
@@ -173,7 +173,7 @@ CSGShapeEditor::CSGShapeEditor() {
CSGShape3DGizmoPlugin::CSGShape3DGizmoPlugin() {
helper.instantiate();
- Color gizmo_color = EDITOR_DEF_RST("editors/3d_gizmos/gizmo_colors/csg", Color(0.0, 0.4, 1, 0.15));
+ Color gizmo_color = EDITOR_GET("editors/3d_gizmos/gizmo_colors/csg");
create_material("shape_union_material", gizmo_color);
create_material("shape_union_solid_material", gizmo_color);
gizmo_color.invert();
diff --git a/modules/gdscript/editor/gdscript_highlighter.cpp b/modules/gdscript/editor/gdscript_highlighter.cpp
index eecce70202..d765cfa1ea 100644
--- a/modules/gdscript/editor/gdscript_highlighter.cpp
+++ b/modules/gdscript/editor/gdscript_highlighter.cpp
@@ -852,6 +852,7 @@ void GDScriptSyntaxHighlighter::_update_cache() {
comment_marker_colors[COMMENT_MARKER_NOTICE] = Color(0.24, 0.54, 0.09);
}
+ // TODO: Move to editor_settings.cpp
EDITOR_DEF("text_editor/theme/highlighting/gdscript/function_definition_color", function_definition_color);
EDITOR_DEF("text_editor/theme/highlighting/gdscript/global_function_color", global_function_color);
EDITOR_DEF("text_editor/theme/highlighting/gdscript/node_path_color", node_path_color);
diff --git a/modules/gdscript/language_server/gdscript_language_server.cpp b/modules/gdscript/language_server/gdscript_language_server.cpp
index 3df26ea576..731988148d 100644
--- a/modules/gdscript/language_server/gdscript_language_server.cpp
+++ b/modules/gdscript/language_server/gdscript_language_server.cpp
@@ -39,6 +39,7 @@
int GDScriptLanguageServer::port_override = -1;
GDScriptLanguageServer::GDScriptLanguageServer() {
+ // TODO: Move to editor_settings.cpp
_EDITOR_DEF("network/language_server/remote_host", host);
_EDITOR_DEF("network/language_server/remote_port", port);
_EDITOR_DEF("network/language_server/enable_smart_resolve", true);
diff --git a/modules/gridmap/editor/grid_map_editor_plugin.cpp b/modules/gridmap/editor/grid_map_editor_plugin.cpp
index 6b010335e6..1c658b9e9b 100644
--- a/modules/gridmap/editor/grid_map_editor_plugin.cpp
+++ b/modules/gridmap/editor/grid_map_editor_plugin.cpp
@@ -1199,7 +1199,7 @@ GridMapEditor::GridMapEditor() {
ED_SHORTCUT("grid_map/clear_selection", TTR("Clear Selection"), Key::KEY_DELETE);
ED_SHORTCUT("grid_map/fill_selection", TTR("Fill Selection"), KeyModifierMask::CTRL + Key::F);
- int mw = EDITOR_DEF("editors/grid_map/palette_min_width", 230);
+ int mw = EDITOR_GET("editors/grid_map/palette_min_width");
Control *ec = memnew(Control);
ec->set_custom_minimum_size(Size2(mw, 0) * EDSCALE);
add_child(ec);
@@ -1309,8 +1309,6 @@ GridMapEditor::GridMapEditor() {
size_slider->connect(SceneStringName(value_changed), callable_mp(this, &GridMapEditor::_icon_size_changed));
add_child(size_slider);
- EDITOR_DEF("editors/grid_map/preview_size", 64);
-
mesh_library_palette = memnew(ItemList);
mesh_library_palette->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
add_child(mesh_library_palette);
@@ -1533,9 +1531,6 @@ void GridMapEditorPlugin::make_visible(bool p_visible) {
}
GridMapEditorPlugin::GridMapEditorPlugin() {
- EDITOR_DEF("editors/grid_map/editor_side", 1);
- EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT, "editors/grid_map/editor_side", PROPERTY_HINT_ENUM, "Left,Right"));
-
grid_map_editor = memnew(GridMapEditor);
switch ((int)EDITOR_GET("editors/grid_map/editor_side")) {
case 0: { // Left.
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp
index 177859f270..5d59c33636 100644
--- a/modules/mono/csharp_script.cpp
+++ b/modules/mono/csharp_script.cpp
@@ -1524,9 +1524,10 @@ void CSharpInstance::get_property_list(List<PropertyInfo> *p_properties) const {
}
}
+ props.reverse();
for (PropertyInfo &prop : props) {
validate_property(prop);
- p_properties->push_back(prop);
+ p_properties->push_front(prop);
}
}
diff --git a/modules/multiplayer/editor/editor_network_profiler.cpp b/modules/multiplayer/editor/editor_network_profiler.cpp
index 212fd1ef6b..3a51712c70 100644
--- a/modules/multiplayer/editor/editor_network_profiler.cpp
+++ b/modules/multiplayer/editor/editor_network_profiler.cpp
@@ -34,6 +34,7 @@
#include "editor/editor_settings.h"
#include "editor/editor_string_names.h"
#include "editor/themes/editor_scale.h"
+#include "scene/gui/check_box.h"
void EditorNetworkProfiler::_bind_methods() {
ADD_SIGNAL(MethodInfo("enable_profiling", PropertyInfo(Variant::BOOL, "enable")));
@@ -170,15 +171,42 @@ void EditorNetworkProfiler::add_node_data(const NodeInfo &p_info) {
}
void EditorNetworkProfiler::_activate_pressed() {
+ _update_button_text();
+
if (activate->is_pressed()) {
refresh_timer->start();
+ } else {
+ refresh_timer->stop();
+ }
+
+ emit_signal(SNAME("enable_profiling"), activate->is_pressed());
+}
+
+void EditorNetworkProfiler::_update_button_text() {
+ if (activate->is_pressed()) {
activate->set_icon(theme_cache.stop_icon);
activate->set_text(TTR("Stop"));
} else {
- refresh_timer->stop();
activate->set_icon(theme_cache.play_icon);
activate->set_text(TTR("Start"));
}
+}
+
+void EditorNetworkProfiler::started() {
+ if (EditorSettings::get_singleton()->get_project_metadata("debug_options", "autostart_network_profiler", false)) {
+ set_profiling(true);
+ refresh_timer->start();
+ }
+}
+
+void EditorNetworkProfiler::stopped() {
+ set_profiling(false);
+ refresh_timer->stop();
+}
+
+void EditorNetworkProfiler::set_profiling(bool p_pressed) {
+ activate->set_pressed(p_pressed);
+ _update_button_text();
emit_signal(SNAME("enable_profiling"), activate->is_pressed());
}
@@ -192,6 +220,10 @@ void EditorNetworkProfiler::_clear_pressed() {
refresh_replication_data();
}
+void EditorNetworkProfiler::_autostart_toggled(bool p_toggled_on) {
+ EditorSettings::get_singleton()->set_project_metadata("debug_options", "autostart_network_profiler", p_toggled_on);
+}
+
void EditorNetworkProfiler::_replication_button_clicked(TreeItem *p_item, int p_column, int p_idx, MouseButton p_button) {
if (!p_item) {
return;
@@ -268,6 +300,12 @@ EditorNetworkProfiler::EditorNetworkProfiler() {
clear_button->connect(SceneStringName(pressed), callable_mp(this, &EditorNetworkProfiler::_clear_pressed));
hb->add_child(clear_button);
+ CheckBox *autostart_checkbox = memnew(CheckBox);
+ autostart_checkbox->set_text(TTR("Autostart"));
+ autostart_checkbox->set_pressed(EditorSettings::get_singleton()->get_project_metadata("debug_options", "autostart_network_profiler", false));
+ autostart_checkbox->connect(SceneStringName(toggled), callable_mp(this, &EditorNetworkProfiler::_autostart_toggled));
+ hb->add_child(autostart_checkbox);
+
hb->add_spacer();
Label *lb = memnew(Label);
diff --git a/modules/multiplayer/editor/editor_network_profiler.h b/modules/multiplayer/editor/editor_network_profiler.h
index b4f8ffa724..46931c9fc9 100644
--- a/modules/multiplayer/editor/editor_network_profiler.h
+++ b/modules/multiplayer/editor/editor_network_profiler.h
@@ -92,7 +92,9 @@ private:
void _activate_pressed();
void _clear_pressed();
+ void _autostart_toggled(bool p_toggled_on);
void _refresh();
+ void _update_button_text();
void _replication_button_clicked(TreeItem *p_item, int p_column, int p_idx, MouseButton p_button);
protected:
@@ -112,6 +114,10 @@ public:
void set_bandwidth(int p_incoming, int p_outgoing);
bool is_profiling();
+ void set_profiling(bool p_pressed);
+ void started();
+ void stopped();
+
EditorNetworkProfiler();
};
diff --git a/modules/multiplayer/editor/multiplayer_editor_plugin.cpp b/modules/multiplayer/editor/multiplayer_editor_plugin.cpp
index a496f5dfa2..817d503aec 100644
--- a/modules/multiplayer/editor/multiplayer_editor_plugin.cpp
+++ b/modules/multiplayer/editor/multiplayer_editor_plugin.cpp
@@ -106,6 +106,8 @@ void MultiplayerEditorDebugger::setup_session(int p_session_id) {
profiler->connect("enable_profiling", callable_mp(this, &MultiplayerEditorDebugger::_profiler_activate).bind(p_session_id));
profiler->connect("open_request", callable_mp(this, &MultiplayerEditorDebugger::_open_request));
profiler->set_name(TTR("Network Profiler"));
+ session->connect("started", callable_mp(profiler, &EditorNetworkProfiler::started));
+ session->connect("stopped", callable_mp(profiler, &EditorNetworkProfiler::stopped));
session->add_session_tab(profiler);
profilers[p_session_id] = profiler;
}
diff --git a/modules/multiplayer/scene_rpc_interface.cpp b/modules/multiplayer/scene_rpc_interface.cpp
index 592bb18a71..69bb19c01c 100644
--- a/modules/multiplayer/scene_rpc_interface.cpp
+++ b/modules/multiplayer/scene_rpc_interface.cpp
@@ -73,6 +73,16 @@ int get_packet_len(uint32_t p_node_target, int p_packet_len) {
}
}
+bool SceneRPCInterface::_sort_rpc_names(const Variant &p_l, const Variant &p_r) {
+ if (likely(p_l.is_string() && p_r.is_string())) {
+ return p_l.operator String() < p_r.operator String();
+ }
+ bool valid = false;
+ Variant res;
+ Variant::evaluate(Variant::OP_LESS, p_l, p_r, res, valid);
+ return valid ? res.operator bool() : false;
+}
+
void SceneRPCInterface::_parse_rpc_config(const Variant &p_config, bool p_for_node, RPCConfigCache &r_cache) {
if (p_config.get_type() == Variant::NIL) {
return;
@@ -80,7 +90,7 @@ void SceneRPCInterface::_parse_rpc_config(const Variant &p_config, bool p_for_no
ERR_FAIL_COND(p_config.get_type() != Variant::DICTIONARY);
const Dictionary config = p_config;
Array names = config.keys();
- names.sort(); // Ensure ID order
+ names.sort_custom(callable_mp_static(&SceneRPCInterface::_sort_rpc_names)); // Ensure ID order
for (int i = 0; i < names.size(); i++) {
ERR_CONTINUE(!names[i].is_string());
String name = names[i].operator String();
diff --git a/modules/multiplayer/scene_rpc_interface.h b/modules/multiplayer/scene_rpc_interface.h
index 5c9b66d5f5..852cef7830 100644
--- a/modules/multiplayer/scene_rpc_interface.h
+++ b/modules/multiplayer/scene_rpc_interface.h
@@ -91,6 +91,8 @@ private:
#endif
protected:
+ static bool _sort_rpc_names(const Variant &p_l, const Variant &p_r);
+
void _process_rpc(Node *p_node, const uint16_t p_rpc_method_id, int p_from, const uint8_t *p_packet, int p_packet_len, int p_offset);
void _send_rpc(Node *p_from, int p_to, uint16_t p_rpc_id, const RPCConfig &p_config, const StringName &p_name, const Variant **p_arg, int p_argcount);
diff --git a/modules/openxr/editor/openxr_select_runtime.cpp b/modules/openxr/editor/openxr_select_runtime.cpp
index 4d95b079e2..4a2a87cb88 100644
--- a/modules/openxr/editor/openxr_select_runtime.cpp
+++ b/modules/openxr/editor/openxr_select_runtime.cpp
@@ -119,6 +119,7 @@ OpenXRSelectRuntime::OpenXRSelectRuntime() {
default_runtimes["SteamVR"] = "~/.steam/steam/steamapps/common/SteamVR/steamxr_linux64.json";
#endif
+ // TODO: Move to editor_settings.cpp
EDITOR_DEF_RST("xr/openxr/runtime_paths", default_runtimes);
set_flat(true);
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp
index 3f4624d09c..1bc600c56f 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -42,6 +42,7 @@ void register_android_exporter_types() {
}
void register_android_exporter() {
+ // TODO: Move to editor_settings.cpp
EDITOR_DEF("export/android/debug_keystore", EditorPaths::get_singleton()->get_debug_keystore_path());
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/android/debug_keystore", PROPERTY_HINT_GLOBAL_FILE, "*.keystore,*.jks"));
EDITOR_DEF("export/android/debug_keystore_user", DEFAULT_ANDROID_KEYSTORE_DEBUG_USER);
diff --git a/platform/ios/export/export.cpp b/platform/ios/export/export.cpp
index 98cc80e4a0..5e9ca3e025 100644
--- a/platform/ios/export/export.cpp
+++ b/platform/ios/export/export.cpp
@@ -39,6 +39,7 @@ void register_ios_exporter_types() {
}
void register_ios_exporter() {
+ // TODO: Move to editor_settings.cpp
#ifdef MACOS_ENABLED
EDITOR_DEF("export/ios/ios_deploy", "");
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/ios/ios_deploy", PROPERTY_HINT_GLOBAL_FILE, "*"));
diff --git a/platform/macos/export/export.cpp b/platform/macos/export/export.cpp
index 8930974df9..df31ccfb56 100644
--- a/platform/macos/export/export.cpp
+++ b/platform/macos/export/export.cpp
@@ -37,6 +37,7 @@ void register_macos_exporter_types() {
}
void register_macos_exporter() {
+ // TODO: Move to editor_settings.cpp
#ifndef ANDROID_ENABLED
EDITOR_DEF("export/macos/rcodesign", "");
#ifdef WINDOWS_ENABLED
diff --git a/platform/web/export/export.cpp b/platform/web/export/export.cpp
index 306ec624a0..ee6d02e68f 100644
--- a/platform/web/export/export.cpp
+++ b/platform/web/export/export.cpp
@@ -40,6 +40,7 @@ void register_web_exporter_types() {
}
void register_web_exporter() {
+ // TODO: Move to editor_settings.cpp
EDITOR_DEF("export/web/http_host", "localhost");
EDITOR_DEF("export/web/http_port", 8060);
EDITOR_DEF("export/web/use_tls", false);
diff --git a/platform/windows/export/export.cpp b/platform/windows/export/export.cpp
index 7a65f74f0d..a062963c2e 100644
--- a/platform/windows/export/export.cpp
+++ b/platform/windows/export/export.cpp
@@ -39,6 +39,7 @@ void register_windows_exporter_types() {
}
void register_windows_exporter() {
+ // TODO: Move to editor_settings.cpp
#ifndef ANDROID_ENABLED
EDITOR_DEF("export/windows/rcedit", "");
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/windows/rcedit", PROPERTY_HINT_GLOBAL_FILE, "*.exe"));
diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp
index 60b3e371a0..11a6411e65 100644
--- a/scene/gui/graph_edit.cpp
+++ b/scene/gui/graph_edit.cpp
@@ -1646,24 +1646,34 @@ void GraphEdit::_draw_grid() {
Color transparent_grid_minor = theme_cache.grid_minor;
transparent_grid_minor.a *= CLAMP(1.0 * (zoom - 0.4), 0, 1);
- for (int i = from_pos.x; i < from_pos.x + len.x; i++) {
- for (int j = from_pos.y; j < from_pos.y + len.y; j++) {
- Color color = transparent_grid_minor;
+ // Minor dots.
+ if (transparent_grid_minor.a != 0) {
+ for (int i = from_pos.x; i < from_pos.x + len.x; i++) {
+ for (int j = from_pos.y; j < from_pos.y + len.y; j++) {
+ if (ABS(i) % GRID_MINOR_STEPS_PER_MAJOR_DOT == 0 && ABS(j) % GRID_MINOR_STEPS_PER_MAJOR_DOT == 0) {
+ continue;
+ }
- if (ABS(i) % GRID_MINOR_STEPS_PER_MAJOR_DOT == 0 && ABS(j) % GRID_MINOR_STEPS_PER_MAJOR_DOT == 0) {
- color = theme_cache.grid_major;
- }
+ float base_offset_x = i * snapping_distance * zoom - offset.x * zoom;
+ float base_offset_y = j * snapping_distance * zoom - offset.y * zoom;
- if (color.a == 0) {
- continue;
+ draw_rect(Rect2(base_offset_x - 1, base_offset_y - 1, 3, 3), transparent_grid_minor);
}
+ }
+ }
- float base_offset_x = i * snapping_distance * zoom - offset.x * zoom;
- float base_offset_y = j * snapping_distance * zoom - offset.y * zoom;
+ // Major dots.
+ if (theme_cache.grid_major.a != 0) {
+ for (int i = from_pos.x - from_pos.x % GRID_MINOR_STEPS_PER_MAJOR_DOT; i < from_pos.x + len.x; i += GRID_MINOR_STEPS_PER_MAJOR_DOT) {
+ for (int j = from_pos.y - from_pos.y % GRID_MINOR_STEPS_PER_MAJOR_DOT; j < from_pos.y + len.y; j += GRID_MINOR_STEPS_PER_MAJOR_DOT) {
+ float base_offset_x = i * snapping_distance * zoom - offset.x * zoom;
+ float base_offset_y = j * snapping_distance * zoom - offset.y * zoom;
- draw_rect(Rect2(base_offset_x - 1, base_offset_y - 1, 3, 3), color);
+ draw_rect(Rect2(base_offset_x - 1, base_offset_y - 1, 3, 3), theme_cache.grid_major);
+ }
}
}
+
} break;
}
}
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 3b5d4fc33e..1a066b0728 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -61,16 +61,6 @@ void LineEdit::_edit() {
editing = true;
_validate_caret_can_draw();
- DisplayServer::WindowID wid = get_window() ? get_window()->get_window_id() : DisplayServer::INVALID_WINDOW_ID;
- if (wid != DisplayServer::INVALID_WINDOW_ID && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_IME)) {
- DisplayServer::get_singleton()->window_set_ime_active(true, wid);
- Point2 pos = Point2(get_caret_pixel_pos().x, (get_size().y + theme_cache.font->get_height(theme_cache.font_size)) / 2) + get_global_position();
- if (get_window()->get_embedder()) {
- pos += get_viewport()->get_popup_base_transform().get_origin();
- }
- DisplayServer::get_singleton()->window_set_ime_position(pos, wid);
- }
-
show_virtual_keyboard();
queue_redraw();
emit_signal(SNAME("editing_toggled"), true);
@@ -84,14 +74,7 @@ void LineEdit::_unedit() {
editing = false;
_validate_caret_can_draw();
- DisplayServer::WindowID wid = get_window() ? get_window()->get_window_id() : DisplayServer::INVALID_WINDOW_ID;
- if (wid != DisplayServer::INVALID_WINDOW_ID && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_IME)) {
- DisplayServer::get_singleton()->window_set_ime_position(Point2(), wid);
- DisplayServer::get_singleton()->window_set_ime_active(false, wid);
- }
- ime_text = "";
- ime_selection = Point2();
- _shape();
+ apply_ime();
set_caret_column(caret_column); // Update scroll_offset.
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_VIRTUAL_KEYBOARD) && virtual_keyboard_enabled) {
@@ -109,6 +92,64 @@ bool LineEdit::is_editing() const {
return editing;
}
+void LineEdit::_close_ime_window() {
+ DisplayServer::WindowID wid = get_window() ? get_window()->get_window_id() : DisplayServer::INVALID_WINDOW_ID;
+ if (wid == DisplayServer::INVALID_WINDOW_ID || !DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_IME)) {
+ return;
+ }
+ DisplayServer::get_singleton()->window_set_ime_position(Point2(), wid);
+ DisplayServer::get_singleton()->window_set_ime_active(false, wid);
+}
+
+void LineEdit::_update_ime_window_position() {
+ DisplayServer::WindowID wid = get_window() ? get_window()->get_window_id() : DisplayServer::INVALID_WINDOW_ID;
+ if (wid == DisplayServer::INVALID_WINDOW_ID || !DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_IME)) {
+ return;
+ }
+ DisplayServer::get_singleton()->window_set_ime_active(true, wid);
+ Point2 pos = Point2(get_caret_pixel_pos().x, (get_size().y + theme_cache.font->get_height(theme_cache.font_size)) / 2) + get_global_position();
+ if (get_window()->get_embedder()) {
+ pos += get_viewport()->get_popup_base_transform().get_origin();
+ }
+ // The window will move to the updated position the next time the IME is updated, not immediately.
+ DisplayServer::get_singleton()->window_set_ime_position(pos, wid);
+}
+
+bool LineEdit::has_ime_text() const {
+ return !ime_text.is_empty();
+}
+
+void LineEdit::cancel_ime() {
+ if (!has_ime_text()) {
+ return;
+ }
+ ime_text = String();
+ ime_selection = Vector2i();
+ alt_start = false;
+ alt_start_no_hold = false;
+ _close_ime_window();
+ _shape();
+}
+
+void LineEdit::apply_ime() {
+ if (!has_ime_text()) {
+ return;
+ }
+
+ // Force apply the current IME text.
+ if (alt_start || alt_start_no_hold) {
+ cancel_ime();
+ if ((alt_code > 0x31 && alt_code < 0xd800) || (alt_code > 0xdfff && alt_code <= 0x10ffff)) {
+ char32_t ucodestr[2] = { (char32_t)alt_code, 0 };
+ insert_text_at_caret(ucodestr);
+ }
+ } else {
+ String insert_ime_text = ime_text;
+ cancel_ime();
+ insert_text_at_caret(insert_ime_text);
+ }
+}
+
void LineEdit::_swap_current_input_direction() {
if (input_direction == TEXT_DIRECTION_LTR) {
input_direction = TEXT_DIRECTION_RTL;
@@ -333,9 +374,10 @@ void LineEdit::gui_input(const Ref<InputEvent> &p_event) {
Ref<InputEventMouseButton> b = p_event;
- // Ignore mouse clicks in IME input mode.
- if (b.is_valid() && ime_text.is_empty()) {
+ if (b.is_valid()) {
if (b->is_pressed() && b->get_button_index() == MouseButton::RIGHT) {
+ apply_ime();
+
if (editable && !selection.enabled) {
set_caret_at_pixel_pos(b->get_position().x);
}
@@ -356,6 +398,8 @@ void LineEdit::gui_input(const Ref<InputEvent> &p_event) {
}
if (editable && is_middle_mouse_paste_enabled() && b->is_pressed() && b->get_button_index() == MouseButton::MIDDLE && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_CLIPBOARD_PRIMARY)) {
+ apply_ime();
+
String paste_buffer = DisplayServer::get_singleton()->clipboard_get_primary().strip_escapes();
deselect();
@@ -388,6 +432,8 @@ void LineEdit::gui_input(const Ref<InputEvent> &p_event) {
}
if (b->is_pressed()) {
+ apply_ime();
+
accept_event(); // Don't pass event further when clicked on text field.
if (editable && !text.is_empty() && _is_over_clear_button(b->get_position())) {
clear_button_status.press_attempt = true;
@@ -561,46 +607,111 @@ void LineEdit::gui_input(const Ref<InputEvent> &p_event) {
return;
}
- if (!k->is_pressed()) {
- if (alt_start && k->get_keycode() == Key::ALT) {
- alt_start = false;
- if ((alt_code > 0x31 && alt_code < 0xd800) || (alt_code > 0xdfff && alt_code <= 0x10ffff)) {
- char32_t ucodestr[2] = { (char32_t)alt_code, 0 };
- insert_text_at_caret(ucodestr);
- }
- accept_event();
- return;
+ // Start Unicode input (hold).
+ if (k->is_alt_pressed() && k->get_keycode() == Key::KP_ADD && !alt_start && !alt_start_no_hold) {
+ if (selection.enabled) {
+ selection_delete();
}
+ alt_start = true;
+ alt_code = 0;
+ ime_text = "u";
+ ime_selection = Vector2i(0, -1);
+ _shape();
+ queue_redraw();
+ accept_event();
return;
}
- // Alt + Unicode input:
- if (k->is_alt_pressed()) {
- if (!alt_start) {
- if (k->get_keycode() == Key::KP_ADD) {
- alt_start = true;
- alt_code = 0;
- accept_event();
- return;
- }
+ // Start Unicode input (press).
+ if (k->is_action("ui_unicode_start", true) && !alt_start && !alt_start_no_hold) {
+ if (selection.enabled) {
+ selection_delete();
+ }
+ alt_start_no_hold = true;
+ alt_code = 0;
+ ime_text = "u";
+ ime_selection = Vector2i(0, -1);
+ _shape();
+ queue_redraw();
+ accept_event();
+ return;
+ }
+
+ // Update Unicode input.
+ if (k->is_pressed() && ((k->is_alt_pressed() && alt_start) || alt_start_no_hold)) {
+ if (k->get_keycode() >= Key::KEY_0 && k->get_keycode() <= Key::KEY_9) {
+ alt_code = alt_code << 4;
+ alt_code += (uint32_t)(k->get_keycode() - Key::KEY_0);
+ } else if (k->get_keycode() >= Key::KP_0 && k->get_keycode() <= Key::KP_9) {
+ alt_code = alt_code << 4;
+ alt_code += (uint32_t)(k->get_keycode() - Key::KP_0);
+ } else if (k->get_keycode() >= Key::A && k->get_keycode() <= Key::F) {
+ alt_code = alt_code << 4;
+ alt_code += (uint32_t)(k->get_keycode() - Key::A) + 10;
+ } else if ((Key)k->get_unicode() >= Key::KEY_0 && (Key)k->get_unicode() <= Key::KEY_9) {
+ alt_code = alt_code << 4;
+ alt_code += (uint32_t)((Key)k->get_unicode() - Key::KEY_0);
+ } else if ((Key)k->get_unicode() >= Key::A && (Key)k->get_unicode() <= Key::F) {
+ alt_code = alt_code << 4;
+ alt_code += (uint32_t)((Key)k->get_unicode() - Key::A) + 10;
+ } else if (k->get_physical_keycode() >= Key::KEY_0 && k->get_physical_keycode() <= Key::KEY_9) {
+ alt_code = alt_code << 4;
+ alt_code += (uint32_t)(k->get_physical_keycode() - Key::KEY_0);
+ }
+ if (k->get_keycode() == Key::BACKSPACE) {
+ alt_code = alt_code >> 4;
+ }
+ if (alt_code > 0x10ffff) {
+ alt_code = 0x10ffff;
+ }
+ if (alt_code > 0) {
+ ime_text = vformat("u%s", String::num_int64(alt_code, 16, true));
} else {
- if (k->get_keycode() >= Key::KEY_0 && k->get_keycode() <= Key::KEY_9) {
- alt_code = alt_code << 4;
- alt_code += (uint32_t)(k->get_keycode() - Key::KEY_0);
- }
- if (k->get_keycode() >= Key::KP_0 && k->get_keycode() <= Key::KP_9) {
- alt_code = alt_code << 4;
- alt_code += (uint32_t)(k->get_keycode() - Key::KP_0);
- }
- if (k->get_keycode() >= Key::A && k->get_keycode() <= Key::F) {
- alt_code = alt_code << 4;
- alt_code += (uint32_t)(k->get_keycode() - Key::A) + 10;
- }
- accept_event();
- return;
+ ime_text = "u";
+ }
+ ime_selection = Vector2i(0, -1);
+ _shape();
+ queue_redraw();
+ accept_event();
+ return;
+ }
+
+ // Submit Unicode input.
+ if ((!k->is_pressed() && alt_start && k->get_keycode() == Key::ALT) || (alt_start_no_hold && (k->is_action("ui_text_submit", true) || k->is_action("ui_accept", true)))) {
+ alt_start = false;
+ alt_start_no_hold = false;
+ if ((alt_code > 0x31 && alt_code < 0xd800) || (alt_code > 0xdfff && alt_code <= 0x10ffff)) {
+ ime_text = String();
+ ime_selection = Vector2i();
+ char32_t ucodestr[2] = { (char32_t)alt_code, 0 };
+ insert_text_at_caret(ucodestr);
+ } else {
+ ime_text = String();
+ ime_selection = Vector2i();
+ _shape();
}
+ queue_redraw();
+ accept_event();
+ return;
}
+ // Cancel Unicode input.
+ if (alt_start_no_hold && k->is_action("ui_cancel", true)) {
+ alt_start = false;
+ alt_start_no_hold = false;
+ ime_text = String();
+ ime_selection = Vector2i();
+ _shape();
+ queue_redraw();
+ accept_event();
+ return;
+ }
+
+ if (!k->is_pressed()) {
+ return;
+ }
+
+ // Open context menu.
if (context_menu_enabled) {
if (k->is_action("ui_menu", true)) {
_update_context_menu();
@@ -830,6 +941,8 @@ void LineEdit::drop_data(const Point2 &p_point, const Variant &p_data) {
Control::drop_data(p_point, p_data);
if (p_data.is_string() && is_editable()) {
+ apply_ime();
+
set_caret_at_pixel_pos(p_point.x);
int caret_column_tmp = caret_column;
bool is_inside_sel = selection.enabled && caret_column >= selection.begin && caret_column <= selection.end;
@@ -1213,15 +1326,7 @@ void LineEdit::_notification(int p_what) {
}
if (editing) {
- DisplayServer::WindowID wid = get_window() ? get_window()->get_window_id() : DisplayServer::INVALID_WINDOW_ID;
- if (wid != DisplayServer::INVALID_WINDOW_ID && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_IME)) {
- DisplayServer::get_singleton()->window_set_ime_active(true, wid);
- Point2 pos = Point2(get_caret_pixel_pos().x, (get_size().y + theme_cache.font->get_height(theme_cache.font_size)) / 2) + get_global_position();
- if (get_window()->get_embedder()) {
- pos += get_viewport()->get_popup_base_transform().get_origin();
- }
- DisplayServer::get_singleton()->window_set_ime_position(pos, wid);
- }
+ _update_ime_window_position();
}
} break;
@@ -1745,6 +1850,8 @@ void LineEdit::clear() {
}
void LineEdit::show_virtual_keyboard() {
+ _update_ime_window_position();
+
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_VIRTUAL_KEYBOARD) && virtual_keyboard_enabled) {
if (selection.enabled) {
DisplayServer::get_singleton()->virtual_keyboard_show(text, get_global_rect(), DisplayServer::VirtualKeyboardType(virtual_keyboard_type), max_length, selection.begin, selection.end);
@@ -2644,6 +2751,10 @@ void LineEdit::_validate_property(PropertyInfo &p_property) const {
}
void LineEdit::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("has_ime_text"), &LineEdit::has_ime_text);
+ ClassDB::bind_method(D_METHOD("cancel_ime"), &LineEdit::cancel_ime);
+ ClassDB::bind_method(D_METHOD("apply_ime"), &LineEdit::apply_ime);
+
ClassDB::bind_method(D_METHOD("set_horizontal_alignment", "alignment"), &LineEdit::set_horizontal_alignment);
ClassDB::bind_method(D_METHOD("get_horizontal_alignment"), &LineEdit::get_horizontal_alignment);
diff --git a/scene/gui/line_edit.h b/scene/gui/line_edit.h
index 984512745a..ac7436646b 100644
--- a/scene/gui/line_edit.h
+++ b/scene/gui/line_edit.h
@@ -92,6 +92,7 @@ private:
bool text_changed_dirty = false;
bool alt_start = false;
+ bool alt_start_no_hold = false;
uint32_t alt_code = 0;
String undo_text;
@@ -209,6 +210,9 @@ private:
void _edit();
void _unedit();
+ void _close_ime_window();
+ void _update_ime_window_position();
+
void _clear_undo_stack();
void _clear_redo();
void _create_undo_state();
@@ -263,6 +267,10 @@ protected:
public:
bool is_editing() const;
+ bool has_ime_text() const;
+ void cancel_ime();
+ void apply_ime();
+
void set_horizontal_alignment(HorizontalAlignment p_alignment);
HorizontalAlignment get_horizontal_alignment() const;
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index ab0ad2f4b7..d7799588ea 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -1557,7 +1557,7 @@ void TextEdit::_notification(int p_what) {
carets.write[c].draw_pos.x = rect.position.x;
}
}
- {
+ if (ime_selection.y > 0) {
// IME caret.
const Vector<Vector2> sel = TS->shaped_text_get_selection(rid, get_caret_column(c) + ime_selection.x, get_caret_column(c) + ime_selection.x + ime_selection.y);
for (int j = 0; j < sel.size(); j++) {
@@ -1688,39 +1688,93 @@ void TextEdit::unhandled_key_input(const Ref<InputEvent> &p_event) {
bool TextEdit::alt_input(const Ref<InputEvent> &p_gui_input) {
Ref<InputEventKey> k = p_gui_input;
if (k.is_valid()) {
- if (!k->is_pressed()) {
- if (alt_start && k->get_keycode() == Key::ALT) {
- alt_start = false;
- if ((alt_code > 0x31 && alt_code < 0xd800) || (alt_code > 0xdfff && alt_code <= 0x10ffff)) {
- handle_unicode_input(alt_code);
- }
- return true;
+ // Start Unicode input (hold).
+ if (k->is_alt_pressed() && k->get_keycode() == Key::KP_ADD && !alt_start && !alt_start_no_hold) {
+ if (has_selection()) {
+ delete_selection();
}
- return false;
+ alt_start = true;
+ alt_code = 0;
+ ime_text = "u";
+ ime_selection = Vector2i(0, -1);
+ _update_ime_text();
+ return true;
}
- if (k->is_alt_pressed()) {
- if (!alt_start) {
- if (k->get_keycode() == Key::KP_ADD) {
- alt_start = true;
- alt_code = 0;
- return true;
- }
+ // Start Unicode input (press).
+ if (k->is_action("ui_unicode_start", true) && !alt_start && !alt_start_no_hold) {
+ if (has_selection()) {
+ delete_selection();
+ }
+ alt_start_no_hold = true;
+ alt_code = 0;
+ ime_text = "u";
+ ime_selection = Vector2i(0, -1);
+ _update_ime_text();
+ return true;
+ }
+
+ // Update Unicode input.
+ if (k->is_pressed() && ((k->is_alt_pressed() && alt_start) || alt_start_no_hold)) {
+ if (k->get_keycode() >= Key::KEY_0 && k->get_keycode() <= Key::KEY_9) {
+ alt_code = alt_code << 4;
+ alt_code += (uint32_t)(k->get_keycode() - Key::KEY_0);
+ } else if (k->get_keycode() >= Key::KP_0 && k->get_keycode() <= Key::KP_9) {
+ alt_code = alt_code << 4;
+ alt_code += (uint32_t)(k->get_keycode() - Key::KP_0);
+ } else if (k->get_keycode() >= Key::A && k->get_keycode() <= Key::F) {
+ alt_code = alt_code << 4;
+ alt_code += (uint32_t)(k->get_keycode() - Key::A) + 10;
+ } else if ((Key)k->get_unicode() >= Key::KEY_0 && (Key)k->get_unicode() <= Key::KEY_9) {
+ alt_code = alt_code << 4;
+ alt_code += (uint32_t)((Key)k->get_unicode() - Key::KEY_0);
+ } else if ((Key)k->get_unicode() >= Key::A && (Key)k->get_unicode() <= Key::F) {
+ alt_code = alt_code << 4;
+ alt_code += (uint32_t)((Key)k->get_unicode() - Key::A) + 10;
+ } else if (k->get_physical_keycode() >= Key::KEY_0 && k->get_physical_keycode() <= Key::KEY_9) {
+ alt_code = alt_code << 4;
+ alt_code += (uint32_t)(k->get_physical_keycode() - Key::KEY_0);
+ }
+ if (k->get_keycode() == Key::BACKSPACE) {
+ alt_code = alt_code >> 4;
+ }
+ if (alt_code > 0x10ffff) {
+ alt_code = 0x10ffff;
+ }
+ if (alt_code > 0) {
+ ime_text = vformat("u%s", String::num_int64(alt_code, 16, true));
} else {
- if (k->get_keycode() >= Key::KEY_0 && k->get_keycode() <= Key::KEY_9) {
- alt_code = alt_code << 4;
- alt_code += (uint32_t)(k->get_keycode() - Key::KEY_0);
- }
- if (k->get_keycode() >= Key::KP_0 && k->get_keycode() <= Key::KP_9) {
- alt_code = alt_code << 4;
- alt_code += (uint32_t)(k->get_keycode() - Key::KP_0);
- }
- if (k->get_keycode() >= Key::A && k->get_keycode() <= Key::F) {
- alt_code = alt_code << 4;
- alt_code += (uint32_t)(k->get_keycode() - Key::A) + 10;
- }
- return true;
+ ime_text = "u";
}
+ ime_selection = Vector2i(0, -1);
+ _update_ime_text();
+ return true;
+ }
+
+ // Submit Unicode input.
+ if ((!k->is_pressed() && alt_start && k->get_keycode() == Key::ALT) || (alt_start_no_hold && (k->is_action("ui_text_submit", true) || k->is_action("ui_accept", true)))) {
+ alt_start = false;
+ alt_start_no_hold = false;
+ if ((alt_code > 0x31 && alt_code < 0xd800) || (alt_code > 0xdfff && alt_code <= 0x10ffff)) {
+ ime_text = String();
+ ime_selection = Vector2i();
+ handle_unicode_input(alt_code);
+ } else {
+ ime_text = String();
+ ime_selection = Vector2i();
+ }
+ _update_ime_text();
+ return true;
+ }
+
+ // Cancel Unicode input.
+ if (alt_start_no_hold && k->is_action("ui_cancel", true)) {
+ alt_start = false;
+ alt_start_no_hold = false;
+ ime_text = String();
+ ime_selection = Vector2i();
+ _update_ime_text();
+ return true;
}
}
return false;
@@ -3117,7 +3171,9 @@ void TextEdit::cancel_ime() {
return;
}
ime_text = String();
- ime_selection = Point2();
+ ime_selection = Vector2i();
+ alt_start = false;
+ alt_start_no_hold = false;
_close_ime_window();
_update_ime_text();
}
@@ -3126,10 +3182,18 @@ void TextEdit::apply_ime() {
if (!has_ime_text()) {
return;
}
+
// Force apply the current IME text.
- String insert_ime_text = ime_text;
- cancel_ime();
- insert_text_at_caret(insert_ime_text);
+ if (alt_start || alt_start_no_hold) {
+ cancel_ime();
+ if ((alt_code > 0x31 && alt_code < 0xd800) || (alt_code > 0xdfff && alt_code <= 0x10ffff)) {
+ handle_unicode_input(alt_code);
+ }
+ } else {
+ String insert_ime_text = ime_text;
+ cancel_ime();
+ insert_text_at_caret(insert_ime_text);
+ }
}
void TextEdit::set_editable(bool p_editable) {
@@ -5966,7 +6030,7 @@ void TextEdit::adjust_viewport_to_caret(int p_caret) {
// Get position of the end of caret.
if (has_ime_text()) {
- if (ime_selection.y != 0) {
+ if (ime_selection.y > 0) {
caret_pos.y = _get_column_x_offset_for_line(get_caret_column(p_caret) + ime_selection.x + ime_selection.y, get_caret_line(p_caret), get_caret_column(p_caret));
} else {
caret_pos.y = _get_column_x_offset_for_line(get_caret_column(p_caret) + ime_text.size(), get_caret_line(p_caret), get_caret_column(p_caret));
@@ -6018,7 +6082,7 @@ void TextEdit::center_viewport_to_caret(int p_caret) {
// Get position of the end of caret.
if (has_ime_text()) {
- if (ime_selection.y != 0) {
+ if (ime_selection.y > 0) {
caret_pos.y = _get_column_x_offset_for_line(get_caret_column(p_caret) + ime_selection.x + ime_selection.y, get_caret_line(p_caret), get_caret_column(p_caret));
} else {
caret_pos.y = _get_column_x_offset_for_line(get_caret_column(p_caret) + ime_text.size(), get_caret_line(p_caret), get_caret_column(p_caret));
diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h
index a448e185b1..c5f838020b 100644
--- a/scene/gui/text_edit.h
+++ b/scene/gui/text_edit.h
@@ -276,6 +276,7 @@ private:
bool setting_text = false;
bool alt_start = false;
+ bool alt_start_no_hold = false;
uint32_t alt_code = 0;
// Text properties.
diff --git a/scene/resources/bit_map.cpp b/scene/resources/bit_map.cpp
index 653a4f4949..53f97fefc9 100644
--- a/scene/resources/bit_map.cpp
+++ b/scene/resources/bit_map.cpp
@@ -559,6 +559,7 @@ void BitMap::grow_mask(int p_pixels, const Rect2i &p_rect) {
bool bit_value = p_pixels > 0;
p_pixels = Math::abs(p_pixels);
+ const int pixels2 = p_pixels * p_pixels;
Rect2i r = Rect2i(0, 0, width, height).intersection(p_rect);
@@ -588,8 +589,8 @@ void BitMap::grow_mask(int p_pixels, const Rect2i &p_rect) {
}
}
- float d = Point2(j, i).distance_to(Point2(x, y)) - CMP_EPSILON;
- if (d > p_pixels) {
+ float d = Point2(j, i).distance_squared_to(Point2(x, y)) - CMP_EPSILON2;
+ if (d > pixels2) {
continue;
}