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>
|
/// </summary>
|
||||||
public abstract class Module : PluginFeature
|
public abstract class Module : PluginFeature
|
||||||
{
|
{
|
||||||
private readonly List<(DefaultCategoryName, string)> _pendingDefaultProfilePaths = new();
|
|
||||||
private readonly List<(DefaultCategoryName, string)> _defaultProfilePaths = new();
|
private readonly List<(DefaultCategoryName, string)> _defaultProfilePaths = new();
|
||||||
|
private readonly List<(DefaultCategoryName, string)> _pendingDefaultProfilePaths = new();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a list of all properties ignored at runtime using <c>IgnoreProperty(x => x.y)</c>
|
/// 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;
|
public ActivationRequirementType ActivationRequirementMode { get; set; } = ActivationRequirementType.Any;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets a boolean indicating whether this module is always available to profiles or only when profiles
|
/// Gets a boolean indicating whether this module is always available to profiles or only to profiles that specifically
|
||||||
/// specifically target this module.
|
/// target this module.
|
||||||
/// <para>Note: If set to <see langword="true" />, <see cref="ActivationRequirements" /> are not evaluated.</para>
|
/// <para>
|
||||||
|
/// Note: <see langword="true" /> if there are any <see cref="ActivationRequirements" />; otherwise
|
||||||
|
/// <see langword="false" />
|
||||||
|
/// </para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsAlwaysAvailable { get; set; }
|
public bool IsAlwaysAvailable => ActivationRequirements.Count == 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets whether updating this module is currently allowed
|
/// Gets whether updating this module is currently allowed
|
||||||
@ -265,7 +268,7 @@ namespace Artemis.Core.Modules
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
internal override void InternalEnable()
|
internal override void InternalEnable()
|
||||||
{
|
{
|
||||||
foreach ((DefaultCategoryName categoryName, var path) in _pendingDefaultProfilePaths)
|
foreach ((DefaultCategoryName categoryName, var path) in _pendingDefaultProfilePaths)
|
||||||
AddDefaultProfile(categoryName, path);
|
AddDefaultProfile(categoryName, path);
|
||||||
_pendingDefaultProfilePaths.Clear();
|
_pendingDefaultProfilePaths.Clear();
|
||||||
|
|
||||||
|
|||||||
@ -66,6 +66,11 @@ namespace Artemis.Core.Services
|
|||||||
OnCopyingBuildInPlugins();
|
OnCopyingBuildInPlugins();
|
||||||
DirectoryInfo pluginDirectory = new(Path.Combine(Constants.DataFolder, "plugins"));
|
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
|
// Iterate built-in plugins
|
||||||
DirectoryInfo builtInPluginDirectory = new(Path.Combine(Directory.GetCurrentDirectory(), "Plugins"));
|
DirectoryInfo builtInPluginDirectory = new(Path.Combine(Directory.GetCurrentDirectory(), "Plugins"));
|
||||||
if (!builtInPluginDirectory.Exists)
|
if (!builtInPluginDirectory.Exists)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user