Add maintenance and deprecation message flags to plugins

This commit is contained in:
Thorsten Sommer 2025-03-22 12:21:00 +01:00
parent 24f5127785
commit ff788b33f2
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
3 changed files with 32 additions and 0 deletions

View File

@ -28,6 +28,12 @@ CATEGORIES = { "CORE" }
-- The target groups for the plugin:
TARGET_GROUPS = { "EVERYONE" }
-- The flag for whether the plugin is maintained:
IS_MAINTAINED = true
-- When the plugin is deprecated, this message will be shown to users:
DEPRECATION_MESSAGE = nil
CONTENT = {
Home_LetsGetStarted = "Lass uns anfangen",
}

View File

@ -30,6 +30,12 @@ CATEGORIES = { "CORE" }
-- The target groups for the plugin:
TARGET_GROUPS = { "EVERYONE" }
-- The flag for whether the plugin is maintained:
IS_MAINTAINED = true
-- When the plugin is deprecated, this message will be shown to users:
DEPRECATION_MESSAGE = nil
CONTENT = {
HOME = CONTENT_HOME,
}

View File

@ -63,6 +63,16 @@ public abstract class PluginBase
/// The target groups of this plugin.
/// </summary>
public PluginTargetGroup[] TargetGroups { get; } = [];
/// <summary>
/// True, when the plugin is maintained.
/// </summary>
public bool IsMaintained { get; }
/// <summary>
/// The message that should be displayed when the plugin is deprecated.
/// </summary>
public string? DeprecationMessage { get; }
/// <summary>
/// The issues that occurred during the initialization of this plugin.
@ -146,6 +156,16 @@ public abstract class PluginBase
else if(this is not NoPlugin)
issues.Add(issue);
if(this.TryInitIsMaintained(out issue, out var isMaintained))
this.IsMaintained = isMaintained;
else if(this is not NoPlugin)
issues.Add(issue);
if(this.TryInitDeprecationMessage(out issue, out var deprecationMessage))
this.DeprecationMessage = deprecationMessage;
else if(this is not NoPlugin)
issues.Add(issue);
this.baseIssues = issues;
}