Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from godotengine:master #80

Merged
merged 49 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
d1891ad
Enable `BUTTON_FORWARD` and `BUTTON_BACK` mouse buttons on Android
m4gr3d Aug 13, 2024
c6cfed4
Docs: Update AStar3D examples
tetrapod00 Nov 8, 2024
a72157c
Fix undo redo for the texture region editor
Arnklit Nov 20, 2024
e35189e
Improve run instances UX, avoid removing things and add clear popup.
ckaiser Oct 6, 2024
c831f63
[Web] Implement dummy IPWeb instead of IPUnix
Faless Nov 28, 2024
14e4e34
[Web] Implement dummy NetSocketWeb
Faless Dec 3, 2024
652db79
Make `backward` be parameter of the AnimationTree in the NodeAnimation
TokageItLab Dec 5, 2024
d526d52
[.NET] Fix gradle builds for multiple ABIs
raulsntos Dec 13, 2024
f2a993a
Reduce slider range for Particles preprocess to discourage setting a …
clayjohn Dec 13, 2024
d54229d
Fix Sync in BlendSpace1D/2D with BlendModeDiscrete
TokageItLab Dec 13, 2024
c098556
Fix GridMap freeing edge connection debug mesh too early
smix8 Dec 14, 2024
3720de4
Add `activate_feed` and `deactivate_feed` virtual bind to CameraFeed
j20001970 Sep 28, 2024
293be04
Implement `window_start_drag` on Windows and Linux.
bruvzg Dec 16, 2024
4047e4b
.NET: Downgrade Microsoft.CodeAnalysis.CSharp to 4.8.0 for compat wit…
akien-mga Dec 17, 2024
df6ac39
SCons: Fix minor `show_progress` issues
Repiteo Nov 15, 2024
7c61252
Optimize PointLight2D shadow rendering by reducing draw calls and RD …
clayjohn Dec 12, 2024
5b19f72
Fix errors when undoing collision generation for multiple meshes with…
MajorMcDoom Dec 17, 2024
46b02f0
Update the warnings for CSGShape3D.
fire Dec 17, 2024
7a04d85
Only allow valid types in Decal, Light3D projector, PointLight2D text…
Calinou Feb 14, 2024
9ea97c0
Fix a command buffer leak that occurs in dx12
alessand10 Dec 7, 2024
70b24c3
Android: Support for base color retrieval
syntaxerror247 Dec 9, 2024
2d3f696
Update the visibility for the custom templates for all platforms
m4gr3d Jun 24, 2024
0ffdb6b
Fix Timer error on startup
KoBeWi Dec 17, 2024
2c304a7
Merge pull request #88349 from Calinou/decal-light-projector-only-all…
akien-mga Dec 17, 2024
6244d8f
Merge pull request #93867 from m4gr3d/move_custom_templates_in_advanc…
akien-mga Dec 17, 2024
66b8101
Merge pull request #95460 from m4gr3d/enable_mouse_forward_back_buttons
akien-mga Dec 17, 2024
d4f4129
Merge pull request #98978 from tetrapod00/astar-nonsense
akien-mga Dec 17, 2024
24f88bb
Merge pull request #99292 from Repiteo/scons/show_progress-tweaks
akien-mga Dec 17, 2024
55a3c6b
Merge pull request #99471 from Arnklit/fix_undo_redo_for_texture_regi…
akien-mga Dec 17, 2024
45d8c21
Merge pull request #99649 from ckaiser/run-instances-data
akien-mga Dec 17, 2024
f08fe52
Merge pull request #99963 from Faless/web/no_ip
akien-mga Dec 17, 2024
f1eb2f9
Merge pull request #100039 from TokageItLab/ping-pong-param
akien-mga Dec 17, 2024
7a70efc
Merge pull request #100151 from alessand10/fix-dx12-command-buffer-leak
akien-mga Dec 17, 2024
190ae9f
Merge pull request #100302 from clayjohn/light2d-optimize
akien-mga Dec 17, 2024
cb0d731
Merge pull request #100351 from raulsntos/dotnet/android-gradle-fix
akien-mga Dec 17, 2024
382b0df
Merge pull request #100373 from TokageItLab/fix-blendspace-discrete-sync
akien-mga Dec 17, 2024
3dd60ba
Merge pull request #100406 from smix8/gridmap_edge_debug
akien-mga Dec 17, 2024
7170a41
Merge pull request #100500 from MajorMcDoom/collision-gen-undo-fix
akien-mga Dec 17, 2024
f1cf8eb
Merge pull request #100506 from akien-mga/dotnet-8.0-fix-GodotSharp-b…
akien-mga Dec 17, 2024
32c634a
Merge pull request #100526 from fire/vsk-csg-warnings-update
akien-mga Dec 17, 2024
abf4796
Merge pull request #100530 from KoBeWi/fix_hack…_with_a_hack😎
akien-mga Dec 17, 2024
eb948bc
Fix a crash trying to save an empty AudioStream
hpvb Dec 15, 2024
5bbdb4a
Stop reporting contacts for sleeping bodies when using Jolt Physics
mihe Dec 17, 2024
d0a0f58
Merge pull request #97571 from j20001970/camerafeed-virtual
akien-mga Dec 17, 2024
cb5b1ec
Merge pull request #100200 from syntaxerror247/android-base-color
akien-mga Dec 17, 2024
90555e6
Merge pull request #100378 from clayjohn/particles-preprocess
akien-mga Dec 17, 2024
7b90590
Merge pull request #100422 from hpvb/from-the-depth-of-despair
akien-mga Dec 17, 2024
4e46e8b
Merge pull request #100464 from bruvzg/start_drag_port
akien-mga Dec 17, 2024
6e2cf2a
Merge pull request #100533 from mihe/jolt/sleeping-contacts
akien-mga Dec 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/linux_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,18 @@ jobs:
python-version: 3.8
scons-version: 4.0

- name: Force remove preinstalled .NET SDKs
if: matrix.build-mono
run: |
sudo rm -rf /usr/share/dotnet/sdk/*

- name: Setup older .NET SDK as baseline
if: matrix.build-mono
uses: actions/setup-dotnet@v4
with:
# Targeting the oldest version we want to support to ensure it still builds.
dotnet-version: '8.0.100'

- name: Compilation
uses: ./.github/actions/godot-build
with:
Expand All @@ -163,6 +175,7 @@ jobs:
- name: Build .NET solutions
if: matrix.build-mono
run: |
dotnet --info
./modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin --godot-platform=linuxbsd

- name: Prepare artifact
Expand Down
2 changes: 1 addition & 1 deletion core/object/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ enum PropertyHint {
PROPERTY_HINT_DIR, ///< a directory path must be passed
PROPERTY_HINT_GLOBAL_FILE, ///< a file path must be passed, hint_text (optionally) is a filter "*.png,*.wav,*.doc,"
PROPERTY_HINT_GLOBAL_DIR, ///< a directory path must be passed
PROPERTY_HINT_RESOURCE_TYPE, ///< a resource object type
PROPERTY_HINT_RESOURCE_TYPE, ///< a comma-separated resource object type, e.g. "NoiseTexture,GradientTexture2D". Subclasses can be excluded with a "-" prefix if placed *after* the base class, e.g. "Texture2D,-MeshTexture".
PROPERTY_HINT_MULTILINE_TEXT, ///< used for string properties that can contain multiple lines
PROPERTY_HINT_EXPRESSION, ///< used for string properties that can contain multiple lines
PROPERTY_HINT_PLACEHOLDER_TEXT, ///< used to set a placeholder text for string properties
Expand Down
6 changes: 3 additions & 3 deletions doc/classes/@GlobalScope.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2030,16 +2030,16 @@
Help key.
</constant>
<constant name="KEY_BACK" value="4194376" enum="Key">
Media back key. Not to be confused with the Back button on an Android device.
Back key.
</constant>
<constant name="KEY_FORWARD" value="4194377" enum="Key">
Media forward key.
Forward key.
</constant>
<constant name="KEY_STOP" value="4194378" enum="Key">
Media stop key.
</constant>
<constant name="KEY_REFRESH" value="4194379" enum="Key">
Media refresh key.
Refresh key.
</constant>
<constant name="KEY_VOLUMEDOWN" value="4194380" enum="Key">
Volume down key.
Expand Down
33 changes: 23 additions & 10 deletions doc/classes/AStar3D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,42 @@
<description>
A* (A star) is a computer algorithm used in pathfinding and graph traversal, the process of plotting short paths among vertices (points), passing through a given set of edges (segments). It enjoys widespread use due to its performance and accuracy. Godot's A* implementation uses points in 3D space and Euclidean distances by default.
You must add points manually with [method add_point] and create segments manually with [method connect_points]. Once done, you can test if there is a path between two points with the [method are_points_connected] function, get a path containing indices by [method get_id_path], or one containing actual coordinates with [method get_point_path].
It is also possible to use non-Euclidean distances. To do so, create a class that extends [AStar3D] and override methods [method _compute_cost] and [method _estimate_cost]. Both take two indices and return a length, as is shown in the following example.
It is also possible to use non-Euclidean distances. To do so, create a script that extends [AStar3D] and override the methods [method _compute_cost] and [method _estimate_cost]. Both should take two point IDs and return the distance between the corresponding points.
[b]Example:[/b] Use Manhattan distance instead of Euclidean distance:
[codeblocks]
[gdscript]
class MyAStar:
extends AStar3D
class_name MyAStar3D
extends AStar3D

func _compute_cost(u, v):
return abs(u - v)
func _compute_cost(u, v):
var u_pos = get_point_position(u)
var v_pos = get_point_position(v)
return abs(u_pos.x - v_pos.x) + abs(u_pos.y - v_pos.y) + abs(u_pos.z - v_pos.z)

func _estimate_cost(u, v):
return min(0, abs(u - v) - 1)
func _estimate_cost(u, v):
var u_pos = get_point_position(u)
var v_pos = get_point_position(v)
return abs(u_pos.x - v_pos.x) + abs(u_pos.y - v_pos.y) + abs(u_pos.z - v_pos.z)
[/gdscript]
[csharp]
public partial class MyAStar : AStar3D
using Godot;

[GlobalClass]
public partial class MyAStar3D : AStar3D
{
public override float _ComputeCost(long fromId, long toId)
{
return Mathf.Abs((int)(fromId - toId));
Vector3 fromPoint = GetPointPosition(fromId);
Vector3 toPoint = GetPointPosition(toId);

return Mathf.Abs(fromPoint.X - toPoint.X) + Mathf.Abs(fromPoint.Y - toPoint.Y) + Mathf.Abs(fromPoint.Z - toPoint.Z);
}

public override float _EstimateCost(long fromId, long toId)
{
return Mathf.Min(0, Mathf.Abs((int)(fromId - toId)) - 1);
Vector3 fromPoint = GetPointPosition(fromId);
Vector3 toPoint = GetPointPosition(toId);
return Mathf.Abs(fromPoint.X - toPoint.X) + Mathf.Abs(fromPoint.Y - toPoint.Y) + Mathf.Abs(fromPoint.Z - toPoint.Z);
}
}
[/csharp]
Expand Down
12 changes: 12 additions & 0 deletions doc/classes/CameraFeed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@
<tutorials>
</tutorials>
<methods>
<method name="_activate_feed" qualifiers="virtual">
<return type="bool" />
<description>
Called when the camera feed is activated.
</description>
</method>
<method name="_deactivate_feed" qualifiers="virtual">
<return type="void" />
<description>
Called when the camera feed is deactivated.
</description>
</method>
<method name="get_datatype" qualifiers="const">
<return type="int" enum="CameraFeed.FeedDataType" />
<description>
Expand Down
4 changes: 2 additions & 2 deletions doc/classes/DisplayServer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
<return type="Color" />
<description>
Returns the OS theme base color (default control background). Returns [code]Color(0, 0, 0, 0)[/code] if the base color is unknown.
[b]Note:[/b] This method is implemented on macOS and Windows.
[b]Note:[/b] This method is implemented on macOS, Windows, and Android.
</description>
</method>
<method name="get_display_cutouts" qualifiers="const">
Expand Down Expand Up @@ -1836,7 +1836,7 @@
<param index="0" name="window_id" type="int" default="0" />
<description>
Starts a drag operation on the window with the given [param window_id], using the current mouse position. Call this method when handling a mouse button being pressed to simulate a pressed event on the window's title bar. Using this method allows the window to participate in space switching, tiling, and other system features.
[b]Note:[/b] This method is implemented only on macOS.
[b]Note:[/b] This method is implemented on Linux(X11/Wayland), macOS, and Windows.
</description>
</method>
</methods>
Expand Down
1 change: 1 addition & 0 deletions doc/classes/GPUParticles2D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
</member>
<member name="preprocess" type="float" setter="set_pre_process_time" getter="get_pre_process_time" default="0.0">
Particle system starts as if it had already run for this many seconds.
[b]Note:[/b] This can be very expensive if set to a high number as it requires running the particle shader a number of times equal to the [member fixed_fps] (or 30, if [member fixed_fps] is 0) for every second. In extreme cases it can even lead to a GPU crash due to the volume of work done in a single frame.
</member>
<member name="process_material" type="Material" setter="set_process_material" getter="get_process_material">
[Material] for processing particles. Can be a [ParticleProcessMaterial] or a [ShaderMaterial].
Expand Down
1 change: 1 addition & 0 deletions doc/classes/GPUParticles3D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
</member>
<member name="preprocess" type="float" setter="set_pre_process_time" getter="get_pre_process_time" default="0.0">
Amount of time to preprocess the particles before animation starts. Lets you start the animation some time after particles have started emitting.
[b]Note:[/b] This can be very expensive if set to a high number as it requires running the particle shader a number of times equal to the [member fixed_fps] (or 30, if [member fixed_fps] is 0) for every second. In extreme cases it can even lead to a GPU crash due to the volume of work done in a single frame.
</member>
<member name="process_material" type="Material" setter="set_process_material" getter="get_process_material">
[Material] for processing particles. Can be a [ParticleProcessMaterial] or a [ShaderMaterial].
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/Texture2D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
<description>
Returns an [Image] that is a copy of data from this [Texture2D] (a new [Image] is created each time). [Image]s can be accessed and manipulated directly.
[b]Note:[/b] This will return [code]null[/code] if this [Texture2D] is invalid.
[b]Note:[/b] This will fetch the texture data from the GPU, which might cause performance problems when overused.
[b]Note:[/b] This will fetch the texture data from the GPU, which might cause performance problems when overused. Avoid calling [method get_image] every frame, especially on large textures.
</description>
</method>
<method name="get_size" qualifiers="const">
Expand Down
3 changes: 2 additions & 1 deletion doc/classes/ViewportTexture.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
To get a [ViewportTexture] in code, use the [method Viewport.get_texture] method on the target viewport.
[b]Note:[/b] A [ViewportTexture] is always local to its scene (see [member Resource.resource_local_to_scene]). If the scene root is not ready, it may return incorrect data (see [signal Node.ready]).
[b]Note:[/b] Instantiating scenes containing a high-resolution [ViewportTexture] may cause noticeable stutter.
[b]Note:[/b] When using a [Viewport] with [member Viewport.use_hdr_2d] set to [code]true[/code] the returned texture will be an HDR image encoded in linear space. This may look darker than normal when displayed directly on screen. To convert to gamma space, you can do the following:
[b]Note:[/b] When using a [Viewport] with [member Viewport.use_hdr_2d] set to [code]true[/code], the returned texture will be an HDR image encoded in linear space. This may look darker than normal when displayed directly on screen. To convert to gamma space, you can do the following:
[codeblock]
img.convert(Image.FORMAT_RGBA8)
imb.linear_to_srgb()
[/codeblock]
[b]Note:[/b] Some nodes such as [Decal], [Light3D], and [PointLight2D] do not support using [ViewportTexture] directly. To use texture data from a [ViewportTexture] in these nodes, you need to create an [ImageTexture] by calling [method Texture2D.get_image] on the [ViewportTexture] and passing the result to [method ImageTexture.create_from_image]. This conversion is a slow operation, so it should not be performed every frame.
</description>
<tutorials>
<link title="GUI in 3D Viewport Demo">https://godotengine.org/asset-library/asset/2807</link>
Expand Down
18 changes: 17 additions & 1 deletion drivers/d3d12/rendering_device_driver_d3d12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2292,6 +2292,19 @@ bool RenderingDeviceDriverD3D12::command_pool_reset(CommandPoolID p_cmd_pool) {

void RenderingDeviceDriverD3D12::command_pool_free(CommandPoolID p_cmd_pool) {
CommandPoolInfo *command_pool = (CommandPoolInfo *)(p_cmd_pool.id);

// Destroy all command buffers associated with this command pool, mirroring Vulkan's behavior.
SelfList<CommandBufferInfo> *cmd_buf_elem = command_pool->command_buffers.first();
while (cmd_buf_elem != nullptr) {
CommandBufferInfo *cmd_buf_info = cmd_buf_elem->self();
cmd_buf_elem = cmd_buf_elem->next();

cmd_buf_info->cmd_list.Reset();
cmd_buf_info->cmd_allocator.Reset();

VersatileResource::free(resources_allocator, cmd_buf_info);
}

memdelete(command_pool);
}

Expand All @@ -2300,7 +2313,7 @@ void RenderingDeviceDriverD3D12::command_pool_free(CommandPoolID p_cmd_pool) {
RDD::CommandBufferID RenderingDeviceDriverD3D12::command_buffer_create(CommandPoolID p_cmd_pool) {
DEV_ASSERT(p_cmd_pool);

const CommandPoolInfo *command_pool = (CommandPoolInfo *)(p_cmd_pool.id);
CommandPoolInfo *command_pool = (CommandPoolInfo *)(p_cmd_pool.id);
D3D12_COMMAND_LIST_TYPE list_type;
if (command_pool->buffer_type == COMMAND_BUFFER_TYPE_SECONDARY) {
list_type = D3D12_COMMAND_LIST_TYPE_BUNDLE;
Expand Down Expand Up @@ -2336,6 +2349,9 @@ RDD::CommandBufferID RenderingDeviceDriverD3D12::command_buffer_create(CommandPo
cmd_buf_info->cmd_allocator = cmd_allocator;
cmd_buf_info->cmd_list = cmd_list;

// Add this command buffer to the command pool's list of command buffers.
command_pool->command_buffers.add(&cmd_buf_info->command_buffer_info_elem);

return CommandBufferID(cmd_buf_info);
}

Expand Down
6 changes: 6 additions & 0 deletions drivers/d3d12/rendering_device_driver_d3d12.h
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,9 @@ class RenderingDeviceDriverD3D12 : public RenderingDeviceDriver {
struct CommandPoolInfo {
CommandQueueFamilyID queue_family;
CommandBufferType buffer_type = COMMAND_BUFFER_TYPE_PRIMARY;
// Since there are no command pools in D3D12, we need to track the command buffers created by this pool
// so that we can free them when the pool is freed.
SelfList<CommandBufferInfo>::List command_buffers;
};

public:
Expand Down Expand Up @@ -458,6 +461,9 @@ class RenderingDeviceDriverD3D12 : public RenderingDeviceDriver {
// Leveraging knowledge of actual usage and D3D12 specifics (namely, command lists from the same allocator
// can't be freely begun and ended), an allocator per list works better.
struct CommandBufferInfo {
// Store a self list reference to be used by the command pool.
SelfList<CommandBufferInfo> command_buffer_info_elem{ this };

ComPtr<ID3D12CommandAllocator> cmd_allocator;
ComPtr<ID3D12GraphicsCommandList> cmd_list;

Expand Down
2 changes: 1 addition & 1 deletion drivers/gles3/rasterizer_canvas_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1636,7 +1636,7 @@ void RasterizerCanvasGLES3::light_set_use_shadow(RID p_rid, bool p_enable) {
cl->shadow.enabled = p_enable;
}

void RasterizerCanvasGLES3::light_update_shadow(RID p_rid, int p_shadow_index, const Transform2D &p_light_xform, int p_light_mask, float p_near, float p_far, LightOccluderInstance *p_occluders) {
void RasterizerCanvasGLES3::light_update_shadow(RID p_rid, int p_shadow_index, const Transform2D &p_light_xform, int p_light_mask, float p_near, float p_far, LightOccluderInstance *p_occluders, const Rect2 &p_light_rect) {
GLES3::Config *config = GLES3::Config::get_singleton();

CanvasLight *cl = canvas_light_owner.get_or_null(p_rid);
Expand Down
2 changes: 1 addition & 1 deletion drivers/gles3/rasterizer_canvas_gles3.h
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ class RasterizerCanvasGLES3 : public RendererCanvasRender {
RID light_create() override;
void light_set_texture(RID p_rid, RID p_texture) override;
void light_set_use_shadow(RID p_rid, bool p_enable) override;
void light_update_shadow(RID p_rid, int p_shadow_index, const Transform2D &p_light_xform, int p_light_mask, float p_near, float p_far, LightOccluderInstance *p_occluders) override;
void light_update_shadow(RID p_rid, int p_shadow_index, const Transform2D &p_light_xform, int p_light_mask, float p_near, float p_far, LightOccluderInstance *p_occluders, const Rect2 &p_light_rect) override;
void light_update_directional_shadow(RID p_rid, int p_shadow_index, const Transform2D &p_light_xform, int p_light_mask, float p_cull_distance, const Rect2 &p_clip_rect, LightOccluderInstance *p_occluders) override;

void render_sdf(RID p_render_target, LightOccluderInstance *p_occluders) override;
Expand Down
2 changes: 1 addition & 1 deletion drivers/unix/ip_unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/

#if defined(UNIX_ENABLED)
#if defined(UNIX_ENABLED) && !defined(UNIX_SOCKET_UNAVAILABLE)

#include "ip_unix.h"

Expand Down
2 changes: 1 addition & 1 deletion drivers/unix/ip_unix.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#ifndef IP_UNIX_H
#define IP_UNIX_H

#if defined(UNIX_ENABLED)
#if defined(UNIX_ENABLED) && !defined(UNIX_SOCKET_UNAVAILABLE)

#include "core/io/ip.h"

Expand Down
2 changes: 1 addition & 1 deletion drivers/unix/os_unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ void OS_Unix::initialize_core() {

#ifndef UNIX_SOCKET_UNAVAILABLE
NetSocketUnix::make_default();
#endif
IPUnix::make_default();
#endif
process_map = memnew((HashMap<ProcessID, ProcessInfo>));

_setup_clock();
Expand Down
11 changes: 5 additions & 6 deletions editor/code_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1119,12 +1119,8 @@ void CodeTextEditor::update_editor_settings() {
text_editor->set_code_hint_draw_below(EDITOR_GET("text_editor/completion/put_callhint_tooltip_below_current_line"));
code_complete_enabled = EDITOR_GET("text_editor/completion/code_complete_enabled");
code_complete_timer->set_wait_time(EDITOR_GET("text_editor/completion/code_complete_delay"));
bool first_time = idle_time == 0.0;
idle_time = EDITOR_GET("text_editor/completion/idle_parse_delay");
idle_time_with_errors = EDITOR_GET("text_editor/completion/idle_parse_delay_with_errors_found");
if (first_time) {
idle->set_wait_time(idle_time);
}

// Appearance: Guidelines
if (EDITOR_GET("text_editor/appearance/guidelines/show_line_length_guidelines")) {
Expand Down Expand Up @@ -1604,6 +1600,11 @@ void CodeTextEditor::_error_pressed(const Ref<InputEvent> &p_event) {

void CodeTextEditor::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_READY: {
set_error_count(0);
set_warning_count(0);
} break;

case NOTIFICATION_THEME_CHANGED: {
if (toggle_scripts_button->is_visible()) {
update_toggle_scripts_button();
Expand Down Expand Up @@ -1845,7 +1846,6 @@ CodeTextEditor::CodeTextEditor() {
error_button->set_default_cursor_shape(CURSOR_POINTING_HAND);
error_button->connect(SceneStringName(pressed), callable_mp(this, &CodeTextEditor::_error_button_pressed));
error_button->set_tooltip_text(TTR("Errors"));
set_error_count(0);

// Warnings
warning_button = memnew(Button);
Expand All @@ -1855,7 +1855,6 @@ CodeTextEditor::CodeTextEditor() {
warning_button->set_default_cursor_shape(CURSOR_POINTING_HAND);
warning_button->connect(SceneStringName(pressed), callable_mp(this, &CodeTextEditor::_warning_button_pressed));
warning_button->set_tooltip_text(TTR("Warnings"));
set_warning_count(0);

status_bar->add_child(memnew(VSeparator));

Expand Down
26 changes: 18 additions & 8 deletions editor/editor_resource_picker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -578,17 +578,17 @@ String EditorResourcePicker::_get_resource_type(const Ref<Resource> &p_resource)
return res_type;
}

static void _add_allowed_type(const StringName &p_type, HashSet<StringName> *p_vector) {
if (p_vector->has(p_type)) {
// Already added
static void _add_allowed_type(const StringName &p_type, List<StringName> *p_vector) {
if (p_vector->find(p_type)) {
// Already added.
return;
}

if (ClassDB::class_exists(p_type)) {
// Engine class,

if (!ClassDB::is_virtual(p_type)) {
p_vector->insert(p_type);
p_vector->push_back(p_type);
}

List<StringName> inheriters;
Expand All @@ -598,7 +598,7 @@ static void _add_allowed_type(const StringName &p_type, HashSet<StringName> *p_v
}
} else {
// Script class.
p_vector->insert(p_type);
p_vector->push_back(p_type);
}

List<StringName> inheriters;
Expand All @@ -613,12 +613,22 @@ void EditorResourcePicker::_ensure_allowed_types() const {
return;
}

List<StringName> final_allowed;

Vector<String> allowed_types = base_type.split(",");
int size = allowed_types.size();

for (int i = 0; i < size; i++) {
const String base = allowed_types[i].strip_edges();
_add_allowed_type(base, &allowed_types_without_convert);
for (const String &S : allowed_types) {
const String base = S.strip_edges();
if (base.begins_with("-")) {
final_allowed.erase(base.right(-1));
continue;
}
_add_allowed_type(base, &final_allowed);
}

for (const StringName &SN : final_allowed) {
allowed_types_without_convert.insert(SN);
}

allowed_types_with_convert = HashSet<StringName>(allowed_types_without_convert);
Expand Down
Loading
Loading