This commit is contained in:
CortexCore
2024-03-11 02:16:25 +08:00
parent 605ccbcf8d
commit 6ef7c5f005
16 changed files with 832 additions and 45 deletions

View File

@@ -175,10 +175,29 @@ namespace BITFactory.Cutting
var button = _brushFieldsContainer.Create<Button>();
button.text =string.IsNullOrEmpty(exportAttribute.Name) ? methodInfo.Name:exportAttribute.Name;
button.clicked += () =>
button.clicked += OnClicked;
return;
void OnClicked()
{
methodInfo.Invoke(arg2, null);
};
try
{
methodInfo.Invoke(arg2, null);
}
catch (TargetInvocationException targetInvocationException)
{
if (targetInvocationException.InnerException is InGameException e is false) return;
switch (e)
{
case {InnerException:not null}:
Alert.Print(e.Message,e.InnerException.Message);
break;
default:
Alert.Print(e.Message,e.Source);
break;
}
}
}
}
}
}