Plugins: Add ICorePlugin, enable by default
This commit is contained in:
14
Il2CppInspector.Common/Plugins/Internal/ICorePlugin.cs
Normal file
14
Il2CppInspector.Common/Plugins/Internal/ICorePlugin.cs
Normal 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 { }
|
||||||
|
}
|
||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user