Browse Source

Removed old plugin interface stuff

pull/46/head
Anairkoen Schno 5 years ago
parent
commit
751462098c
6 changed files with 1 additions and 135 deletions
  1. +0
    -3
      IPA.Loader/IPA.Loader.csproj
  2. +0
    -23
      IPA.Loader/Loader/PluginLoader.cs
  3. +1
    -2
      IPA.Loader/Loader/PluginManager.cs
  4. +0
    -22
      IPA.Loader/PluginInterfaces/BeatSaber/IDisablablePlugin.cs
  5. +0
    -32
      IPA.Loader/PluginInterfaces/BeatSaber/IEnhancedPlugin.cs
  6. +0
    -53
      IPA.Loader/PluginInterfaces/BeatSaber/IPlugin.cs

+ 0
- 3
IPA.Loader/IPA.Loader.csproj View File

@ -128,9 +128,6 @@
<Compile Include="Logging\StdoutInterceptor.cs" />
<Compile Include="PluginInterfaces\Attributes\LifecycleAttributes.cs" />
<Compile Include="PluginInterfaces\Attributes\PluginAttribute.cs" />
<Compile Include="PluginInterfaces\BeatSaber\IDisablablePlugin.cs" />
<Compile Include="PluginInterfaces\BeatSaber\IEnhancedPlugin.cs" />
<Compile Include="PluginInterfaces\BeatSaber\IPlugin.cs" />
<Compile Include="Config\IniFile.cs" />
<Compile Include="PluginInterfaces\IPA\IEnhancedPlugin.cs" />
<Compile Include="PluginInterfaces\IPA\IPlugin.cs" />


+ 0
- 23
IPA.Loader/Loader/PluginLoader.cs View File

@ -44,21 +44,6 @@ namespace IPA.Loader
ResolveDependencies();
});
/// <summary>
/// A container object for all the data relating to a plugin.
/// </summary>
[Obsolete("No longer useful as a construct")]
public class PluginInfo
{
internal IPlugin Plugin { get; set; }
/// <summary>
/// Metadata for the plugin.
/// </summary>
/// <value>the metadata for this plugin</value>
public PluginMetadata Metadata { get; internal set; } = new PluginMetadata();
}
internal static void YeetIfNeeded()
{
string pluginDir = BeatSaber.PluginsPath;
@ -197,14 +182,6 @@ namespace IPA.Loader
return;
}
}
if (type.HasInterface(typeof(IPlugin).FullName))
{
Logger.loader.Warn("Interface-based plugin found");
meta.IsAttributePlugin = false;
meta.PluginType = type;
return;
}
}
}


+ 1
- 2
IPA.Loader/Loader/PluginManager.cs View File

@ -222,12 +222,11 @@ namespace IPA.Loader
/// <returns><see langword="true"/> if the plugin is enabled, <see langword="false"/> otherwise.</returns>
public static bool IsEnabled(PluginMetadata meta) => BSMetas.Any(p => p.Metadata == meta);
private static readonly List<PluginInfo> runtimeDisabled = new List<PluginInfo>();
/// <summary>
/// Gets a list of disabled BSIPA plugins.
/// </summary>
/// <value>a collection of all disabled plugins as <see cref="PluginMetadata"/></value>
public static IEnumerable<PluginMetadata> DisabledPlugins => PluginLoader.DisabledPlugins.Concat(runtimeDisabled.Select(p => p.Metadata));
public static IEnumerable<PluginMetadata> DisabledPlugins => PluginLoader.DisabledPlugins;
/// <summary>
/// An invoker for the <see cref="PluginEnabled"/> event.


+ 0
- 22
IPA.Loader/PluginInterfaces/BeatSaber/IDisablablePlugin.cs View File

@ -1,22 +0,0 @@
using System;
namespace IPA
{
/// <summary>
/// Provides methods to allow runtime disabling of a plugin.
/// </summary>
[Obsolete("Use the attribute-based system instead.")]
public interface IDisablablePlugin : IPlugin
{
/// <summary>
/// Called when a plugin is disabled at runtime. This should disable things like Harmony patches and unsubscribe
/// from events. After this is called there should be no lingering effects of the mod.
/// </summary>
/// <remarks>
/// This will get called at shutdown, after <see cref="IPlugin.OnApplicationQuit"/>, as well as when the
/// plugin is disabled at runtime.
/// </remarks>
void OnDisable();
}
}

+ 0
- 32
IPA.Loader/PluginInterfaces/BeatSaber/IEnhancedPlugin.cs View File

@ -1,32 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IPA
{
/// <inheritdoc cref="IPlugin" />
/// <summary>
/// An enhanced version of a standard BeatSaber plugin.
/// </summary>
[Obsolete("Use the attribute-based system instead.")]
public interface IEnhancedPlugin : IPlugin
{
/// <summary>
/// Gets invoked on every graphic update.
/// </summary>
void OnUpdate();
/// <summary>
/// Gets invoked on ever physics update.
/// </summary>
void OnFixedUpdate();
/// <summary>
/// Called after Update.
/// </summary>
void OnLateUpdate();
}
}

+ 0
- 53
IPA.Loader/PluginInterfaces/BeatSaber/IPlugin.cs View File

@ -1,53 +0,0 @@
using System;
using UnityEngine.SceneManagement;
namespace IPA
{
/// <summary>
/// Interface for BSIPA plugins. Every class that implements this will be loaded if the DLL is placed at
/// &lt;install dir&gt;/Plugins.
/// </summary>
/// <remarks>
/// Mods implemented with this interface should handle being enabled at runtime properly, unless marked
/// with the "no-runtime-enable" feature.
/// </remarks>
[Obsolete("Use the attribute-based system instead.")]
public interface IPlugin
{
/// <summary>
/// Called when a plugin is enabled. This is where you should set up Harmony patches and the like.
/// </summary>
/// <remarks>
/// This will be called after <c>Init</c>, and will be called when the plugin loads normally too.
/// When a plugin is disabled at startup, neither this nor Init will be called until it is enabled.
///
/// Init will only ever be called once.
/// </remarks>
void OnEnable();
/// <summary>
/// Gets invoked when the application is closed.
/// </summary>
void OnApplicationQuit();
/// <summary>
/// Gets invoked whenever a scene is loaded.
/// </summary>
/// <param name="scene">The scene currently loaded</param>
/// <param name="sceneMode">The type of loading</param>
void OnSceneLoaded(Scene scene, LoadSceneMode sceneMode);
/// <summary>
/// Gets invoked whenever a scene is unloaded
/// </summary>
/// <param name="scene">The unloaded scene</param>
void OnSceneUnloaded(Scene scene);
/// <summary>
/// Gets invoked whenever a scene is changed
/// </summary>
/// <param name="prevScene">The Scene that was previously loaded</param>
/// <param name="nextScene">The Scene being loaded</param>
void OnActiveSceneChanged(Scene prevScene, Scene nextScene);
}
}

Loading…
Cancel
Save