Instead of having to first click the button, then drag the item into the
new slot, this allows just dragging the item onto the button directly.
The button is highlighted as a valid drop target to signal this.
The most common scenario is dragging a file from the filesystem dock,
which drags it as type "file", not "resource". This already worked. This
change also makes it possible to drag a resource from another property
editor.
For example, an Array[MyScript] property now accepts any node with the
script MyScript on it. This works for Node and NodePath arrays alike,
and also with the @export_node_path annotation.
This duplicates some of the logic in EditorResourcePicker, but that's
unavoidable: EditorResourcePicker works on a single, loaded resource,
whereas we'd like this to be efficient and not need to load all
(potentially many) dragged resources. Instead, we use the
EditorFileSystem cache to get the information we need.
Note that EditorResourcePicker also supports some automatic conversions,
such as from Shader to ShaderMaterial. This change does not attempt to
make that work for arrays as well.
See discussion on #102534. Before this fix, it was possible to drag a
file `CustomResource.gd` with `class_name CustomResource` onto a
property of type `CustomResource`. Of course, the intention is that only
`Resource`s with the `CustomResource` script attached are accepted.
(Actually accepting the script, but creating a resource from it
automatically, is left as a future improvement.)
- Changed slot_y_cache calculations in _resort function so ports will be drawn correctly for expanded children.
- Similarly calculate the port_cache.pos in _port_pos_update function so the connection matches the port's position.
The function update_perf_report() is expensive and is called every
frame.
Most of it is not necessary unless the user calls get_perf_report
Affects #102173
"Replace" and "Replace All" buttons now do not change their position depending on the availability of search results.
Additional changes:
- `VBoxContainer *vbc_lineedit` declaration has been removed from the header because it is not used outside the `FindReplaceBar` constructor.
- `hide_button` was changed from `TextureButton` to `Button` for consistency - this allows to visually see the feedback when hovering and pressing and also not set its icon 3 times instead of 1.
Building with the following params (note: scu_build is enabled):
```
platform=linuxbsd builtin_embree=yes builtin_enet=no
builtin_freetype=yes builtin_graphite=yes builtin_harfbuzz=yes
builtin_libogg=no builtin_libpng=yes builtin_libtheora=no
builtin_libvorbis=no builtin_libwebp=no builtin_miniupnpc=no
builtin_pcre2=no builtin_zlib=yes builtin_zstd=no linker=mold
optimize=none debug_symbols=True tests=True dev_mode=True dev_build=True
use_llvm=yes use_lld=yes opengl3=no openxr=no disable_xr=yes -j 24
scu_build=yes scu_limit=256
```
Results in compiler errors:
```
In file included from servers/register_server_types.cpp:99:
servers/xr/xr_interface.h:52:7: error: redefinition of 'RefCounted'
52 | class XRInterface : public RefCounted {
| ^
./servers/rendering/rendering_method.h:40:21: note: expanded from macro
'XRInterface'
40 | #define XRInterface RefCounted
| ^
./core/object/ref_counted.h:37:7: note: previous definition is here
37 | class RefCounted : public Object {
| ^
```
This happens because of:
```
#ifdef XR_DISABLED
// RendererSceneCull::render_camera is empty when 3D is disabled, but
// it and RenderingMethod::render_camera have a parameter for
XRInterface.
#define XRInterface RefCounted
#else
#include "servers/xr/xr_interface.h"
#endif // XR_DISABLED
```
In rendering_method.h
This batches together a couple of micro-optimizations that were discovered in profiling and analyzing disassembly.
Importantly, this reduces the amount of instructions in a heavy loop. This has the biggest impact when there are lots of objects and lights in the scene as the function is called once per objects + once per light that touches the object