Change generated On{SignalName} to EmitSignal{SignalName}

This commit is contained in:
TML 2024-09-28 21:01:36 +08:00
parent 76a135926a
commit fa48ed9945
3 changed files with 5 additions and 5 deletions

View File

@ -32,7 +32,7 @@ partial class EventSignals
add => backing_MySignal += value;
remove => backing_MySignal -= value;
}
protected void OnMySignal(string str, int num)
protected void EmitSignalMySignal(string str, int num)
{
EmitSignal(SignalName.MySignal, str, num);
}

View File

@ -282,7 +282,7 @@ namespace Godot.SourceGenerators
.Append(" -= value;\n")
.Append("}\n");
// Generate On{EventName} method to raise the event
// Generate EmitSignal{EventName} method to raise the event
var invokeMethodSymbol = signalDelegate.InvokeMethodData.Method;
int paramCount = invokeMethodSymbol.Parameters.Length;
@ -291,7 +291,7 @@ namespace Godot.SourceGenerators
"private" :
"protected";
source.Append($" {raiseMethodModifiers} void On{signalName}(");
source.Append($" {raiseMethodModifiers} void EmitSignal{signalName}(");
for (int i = 0; i < paramCount; i++)
{
var paramSymbol = invokeMethodSymbol.Parameters[i];

View File

@ -3228,10 +3228,10 @@ Error BindingsGenerator::_generate_cs_signal(const BindingsGenerator::TypeInterf
p_output.append(CLOSE_BLOCK_L1);
// Generate On{EventName} method to raise the event.
// Generate EmitSignal{EventName} method to raise the event.
if (!p_itype.is_singleton) {
p_output.append(MEMBER_BEGIN "protected void ");
p_output << "On" << p_isignal.proxy_name;
p_output << "EmitSignal" << p_isignal.proxy_name;
if (is_parameterless) {
p_output.append("()\n" OPEN_BLOCK_L1 INDENT2);
p_output << "EmitSignal(SignalName." << p_isignal.proxy_name << ");\n";