allow loading dev plugins with the wrong API level, but add a validation error

This commit is contained in:
goat 2024-06-28 23:45:12 +02:00
parent d628be9536
commit 7283e634e9
4 changed files with 26 additions and 2 deletions

View file

@ -93,6 +93,9 @@ internal static class PluginValidator
if (string.IsNullOrEmpty(plugin.Manifest.Author))
problems.Add(new NoAuthorProblem());
if (plugin.IsOutdated)
problems.Add(new WrongApiLevelProblem());
return problems;
}
@ -192,4 +195,17 @@ internal static class PluginValidator
/// <inheritdoc/>
public string GetLocalizedDescription() => "Your plugin does not have an author in its manifest.";
}
/// <summary>
/// Representing a problem where a plugin has an outdated API level.
/// </summary>
public class WrongApiLevelProblem : IValidationProblem
{
/// <inheritdoc/>
public ValidationSeverity Severity => ValidationSeverity.Fatal;
/// <inheritdoc/>
public string GetLocalizedDescription() => "Your plugin specifies an outdated API level. " +
"Please update it by updating DalamudPackager or Dalamud.NET.Sdk.";
}
}