Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix internal plugins not enabled #454

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions MacroDeck/Plugins/PluginManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,16 @@ public static void Load()
}

// Add internal plugins
AddPlugin(new ActionButtonPlugin(), true);
AddPlugin(new VariablesPlugin(), true);
AddPlugin(new FolderPlugin(), true);
AddPlugin(new DevicePlugin(), true);
AddAndEnablePlugin(new ActionButtonPlugin(), true);
AddAndEnablePlugin(new VariablesPlugin(), true);
AddAndEnablePlugin(new FolderPlugin(), true);
AddAndEnablePlugin(new DevicePlugin(), true);
}

private static void AddAndEnablePlugin(MacroDeckPlugin macroDeckPlugin, bool protect = false)
{
AddPlugin(macroDeckPlugin, protect);
macroDeckPlugin.Enable();
}

private static MacroDeckPlugin? LoadPlugin(ExtensionManifestModel extensionManifest, string pluginDirectory)
Expand Down Expand Up @@ -378,7 +384,7 @@ internal static void InstallPlugin(string directory, string packageName)
/// </summary>
/// <param name="macroDeckPlugin">Instance of the plugin</param>
/// <param name="protect">true = plugin cannot be uninstalled by the user</param>
internal static void AddPlugin(MacroDeckPlugin macroDeckPlugin, bool protect = false)
private static void AddPlugin(MacroDeckPlugin macroDeckPlugin, bool protect = false)
{
if (!Plugins.ContainsKey(macroDeckPlugin.Name))
{
Expand Down