mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Modules - Automatically determine IsAlwaysAvailable
Plugins - Clean up old files
This commit is contained in:
parent
ceeaa4bf6d
commit
4c3e9b2784
@ -67,8 +67,8 @@ namespace Artemis.Core.Modules
|
||||
/// </summary>
|
||||
public abstract class Module : PluginFeature
|
||||
{
|
||||
private readonly List<(DefaultCategoryName, string)> _pendingDefaultProfilePaths = new();
|
||||
private readonly List<(DefaultCategoryName, string)> _defaultProfilePaths = new();
|
||||
private readonly List<(DefaultCategoryName, string)> _pendingDefaultProfilePaths = new();
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of all properties ignored at runtime using <c>IgnoreProperty(x => x.y)</c>
|
||||
@ -126,11 +126,14 @@ namespace Artemis.Core.Modules
|
||||
public ActivationRequirementType ActivationRequirementMode { get; set; } = ActivationRequirementType.Any;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether this module is always available to profiles or only when profiles
|
||||
/// specifically target this module.
|
||||
/// <para>Note: If set to <see langword="true" />, <see cref="ActivationRequirements" /> are not evaluated.</para>
|
||||
/// Gets a boolean indicating whether this module is always available to profiles or only to profiles that specifically
|
||||
/// target this module.
|
||||
/// <para>
|
||||
/// Note: <see langword="true" /> if there are any <see cref="ActivationRequirements" />; otherwise
|
||||
/// <see langword="false" />
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public bool IsAlwaysAvailable { get; set; }
|
||||
public bool IsAlwaysAvailable => ActivationRequirements.Count == 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets whether updating this module is currently allowed
|
||||
@ -265,7 +268,7 @@ namespace Artemis.Core.Modules
|
||||
/// <inheritdoc />
|
||||
internal override void InternalEnable()
|
||||
{
|
||||
foreach ((DefaultCategoryName categoryName, var path) in _pendingDefaultProfilePaths)
|
||||
foreach ((DefaultCategoryName categoryName, var path) in _pendingDefaultProfilePaths)
|
||||
AddDefaultProfile(categoryName, path);
|
||||
_pendingDefaultProfilePaths.Clear();
|
||||
|
||||
|
||||
@ -66,6 +66,11 @@ namespace Artemis.Core.Services
|
||||
OnCopyingBuildInPlugins();
|
||||
DirectoryInfo pluginDirectory = new(Path.Combine(Constants.DataFolder, "plugins"));
|
||||
|
||||
if (Directory.Exists(Path.Combine(pluginDirectory.FullName, "Artemis.Plugins.Modules.Overlay-29e3ff97")))
|
||||
Directory.Delete(Path.Combine(pluginDirectory.FullName, "Artemis.Plugins.Modules.Overlay-29e3ff97"), true);
|
||||
if (Directory.Exists(Path.Combine(pluginDirectory.FullName, "Artemis.Plugins.DataModelExpansions.TestData-ab41d601")))
|
||||
Directory.Delete(Path.Combine(pluginDirectory.FullName, "Artemis.Plugins.DataModelExpansions.TestData-ab41d601"), true);
|
||||
|
||||
// Iterate built-in plugins
|
||||
DirectoryInfo builtInPluginDirectory = new(Path.Combine(Directory.GetCurrentDirectory(), "Plugins"));
|
||||
if (!builtInPluginDirectory.Exists)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user