Plugins: Add ICorePlugin, enable by default

This commit is contained in:
Katy Coe
2021-01-12 00:15:59 +01:00
parent 5fdea13859
commit 92451e26ef
2 changed files with 18 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
/*
Copyright 2021 Katy Coe - http://www.djkaty.com - https://github.com/djkaty
All rights reserved.
*/
namespace Il2CppInspector.PluginAPI.V100
{
/// <summary>
/// Interface denoting a plugin that is an internal part of Il2CppInspector
/// For internal use only
/// </summary>
public interface ICorePlugin : IPlugin { }
}

View File

@@ -214,7 +214,10 @@ namespace Il2CppInspector
if (AsInstance.ManagedPlugins.Any(p => p.Plugin.Id == plugin.Id)) if (AsInstance.ManagedPlugins.Any(p => p.Plugin.Id == plugin.Id))
throw new Exception($"Multiple copies of {plugin.Name} were found. Please ensure the plugins folder only contains one copy of each plugin."); throw new Exception($"Multiple copies of {plugin.Name} were found. Please ensure the plugins folder only contains one copy of each plugin.");
AsInstance.ManagedPlugins.Add(new ManagedPlugin { Plugin = plugin, Available = true, Enabled = false }); // Enable internal plugins by default
var enabled = typeof(ICorePlugin).IsAssignableFrom(type);
AsInstance.ManagedPlugins.Add(new ManagedPlugin { Plugin = plugin, Available = true, Enabled = enabled });
} }
// Add older versions here with adapters // Add older versions here with adapters