chore: fix incorrect parameters for certain errors

This commit is contained in:
bd_ 2023-02-08 22:33:48 +09:00
parent c2e6bb53cd
commit 13e009b6fc
3 changed files with 15 additions and 8 deletions

View File

@ -78,8 +78,11 @@ namespace nadena.dev.modular_avatar.core.editor
{
if (acp.type != param.type)
{
BuildReport.LogFatal("error.merge_animator.param_type_mismatch", param.name, acp.type,
param.type);
BuildReport.LogFatal("error.merge_animator.param_type_mismatch", new[]
{
param.name, acp.type.ToString(),
param.type.ToString()
});
}
continue;

View File

@ -291,9 +291,9 @@ namespace nadena.dev.modular_avatar.editor.ErrorReporting
return new AvatarReportScope();
}
internal static void Log(ReportLevel level, string code, params object[] objects)
internal static void Log(ReportLevel level, string code, object[] strings, params Object[] objects)
{
ErrorLog errorLog = new ErrorLog(level, code, objects);
ErrorLog errorLog = new ErrorLog(level, code, strings, objects);
var avatarReport = CurrentReport._currentAvatar;
if (avatarReport == null)
@ -305,9 +305,9 @@ namespace nadena.dev.modular_avatar.editor.ErrorReporting
avatarReport.logs.Add(errorLog);
}
internal static void LogFatal(string code, params object[] objects)
internal static void LogFatal(string code, object[] strings, params Object[] objects)
{
Log(ReportLevel.Error, code, objects);
Log(ReportLevel.Error, code, strings, objects);
if (CurrentReport._currentAvatar != null)
{
CurrentReport._currentAvatar.successful = false;

View File

@ -72,8 +72,12 @@ namespace nadena.dev.modular_avatar.core.editor
expParams.parameters = parameters.ToArray();
if (expParams.CalcTotalCost() > VRCExpressionParameters.MAX_PARAMETER_COST)
{
BuildReport.LogFatal("error.rename_params.too_many_synced_params", expParams.CalcTotalCost(),
VRCExpressionParameters.MAX_PARAMETER_COST);
BuildReport.LogFatal("error.rename_params.too_many_synced_params", new[]
{
"" + expParams.CalcTotalCost(),
"" + VRCExpressionParameters.MAX_PARAMETER_COST,
}
);
}
avatar.expressionParameters = expParams;