From ff788b33f26d37682749441fbed54ce054cf32b5 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Sat, 22 Mar 2025 12:21:00 +0100 Subject: [PATCH] Add maintenance and deprecation message flags to plugins --- .../plugin.lua | 6 ++++++ .../plugin.lua | 6 ++++++ .../Tools/PluginSystem/PluginBase.cs | 20 +++++++++++++++++++ 3 files changed, 32 insertions(+) diff --git a/app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/plugin.lua b/app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/plugin.lua index 10836117..82d00914 100644 --- a/app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/plugin.lua +++ b/app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/plugin.lua @@ -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", } \ No newline at end of file diff --git a/app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/plugin.lua b/app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/plugin.lua index ab23db62..99ca6dc4 100644 --- a/app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/plugin.lua +++ b/app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/plugin.lua @@ -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, } \ No newline at end of file diff --git a/app/MindWork AI Studio/Tools/PluginSystem/PluginBase.cs b/app/MindWork AI Studio/Tools/PluginSystem/PluginBase.cs index 71549b33..d66c73c8 100644 --- a/app/MindWork AI Studio/Tools/PluginSystem/PluginBase.cs +++ b/app/MindWork AI Studio/Tools/PluginSystem/PluginBase.cs @@ -63,6 +63,16 @@ public abstract class PluginBase /// The target groups of this plugin. /// public PluginTargetGroup[] TargetGroups { get; } = []; + + /// + /// True, when the plugin is maintained. + /// + public bool IsMaintained { get; } + + /// + /// The message that should be displayed when the plugin is deprecated. + /// + public string? DeprecationMessage { get; } /// /// 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; }