Merge pull request #64911 from raulsntos/dotnet/no-more-signal-events

Remove `[Signal]` attribute from events
This commit is contained in:
Ignacio Roldán Etcheverry 2022-08-26 08:27:40 +02:00 committed by GitHub
commit 961a5c642e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 7 deletions

View file

@ -117,10 +117,6 @@ namespace Godot.SourceGenerators
source.Append(symbol.NameWithTypeParameters());
source.Append("\n{\n");
// TODO:
// The delegate name already needs to end with 'Signal' to avoid collision with the event name.
// Requiring SignalAttribute is redundant. Should we remove it to make declaration shorter?
var members = symbol.GetMembers();
var signalDelegateSymbols = members

View file

@ -2257,7 +2257,7 @@ Error BindingsGenerator::_generate_cs_signal(const BindingsGenerator::TypeInterf
}
String delegate_name = p_isignal.proxy_name;
delegate_name += "Handler"; // Delegate name is [SignalName]Handler
delegate_name += "EventHandler"; // Delegate name is [SignalName]EventHandler
// Generate delegate
p_output.append(MEMBER_BEGIN "public delegate void ");
@ -2271,7 +2271,7 @@ Error BindingsGenerator::_generate_cs_signal(const BindingsGenerator::TypeInterf
// If so, we could store the pointer we get from `data_unique_pointer()` instead of allocating StringName here.
// Generate event
p_output.append(MEMBER_BEGIN "[Signal]" MEMBER_BEGIN "public ");
p_output.append(MEMBER_BEGIN "public ");
if (p_itype.is_singleton) {
p_output.append("static ");

View file

@ -2,6 +2,6 @@ using System;
namespace Godot
{
[AttributeUsage(AttributeTargets.Delegate | AttributeTargets.Event)]
[AttributeUsage(AttributeTargets.Delegate)]
public class SignalAttribute : Attribute { }
}