-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
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
[C#] Change generated On{SignalName} to EmitSignal{SignalName} #97588
Conversation
Although I'm not entirely sure of the |
According to the guidelines it should be However, I think it's still worth considering if all the C# event guidelines should be followed as strictly. For me signals are not exactly the same as C# events. So using 'emit' instead of 'on' might be more in line with the Godot naming. |
Oh... |
e46bddf
to
fa48ed9
Compare
Or we just tread that |
I don't think it's appropriate. |
EmitSignal{SignalName} seemed a good choice. |
@raulsntos Can you check this PR? |
This PR could resolve the compatibility issue mentioned in #97781, I honestly don't know why no one has reviewed this PR yet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have discussed this and we think the On{SignalName}
conflicts too much with existing projects. As others have mentioned in this thread, our own documentation recommends naming signal callbacks with the On{SignalName}
pattern, so the chances to conflict are too high.
Renaming to EmitSignal{SignalName}
is a lot less disruptive. We think we should avoid breaking existing user projects unnecessarily, so we're approving this change. Thanks for the contribution!
Thanks! |
Change the generated
On{SignalName}
, which is introduced in #68233 , toEmitSignal{SignalName}
Editor already generates
_on_{signal_name}
for signal callbacks.Having
On{SignalName}
introduces confusion and will likely break user code, since Godot users are already familiar withon signal name
for signal callback functions.Using
EmitSignal{SignalName}
conforms to Godot's name of raising signalsemit_signal
.The terms and names are consistent between defining signals (using [Signal] attribute) and emitting signals (using EmitSignalName methods). Also it kinda looks great in the intellisense list, like: