[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 |
raulsntos
left a comment
There was a problem hiding this comment.
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! |
[C#] Change generated On{SignalName} to EmitSignal{SignalName}
[C#] Change generated On{SignalName} to EmitSignal{SignalName}
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 namefor 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: