Class PluginManager
The manager class for all plugins.
Inherited Members
Namespace: IPA.Loader
Assembly: IPA.Loader.dll
Syntax
public static class PluginManager
Properties
| Improve this Doc View SourceAllPlugins
Gets a list of all enabled BSIPA plugins. Use EnabledPlugins instead of this.
Declaration
[Obsolete("This is an old name that no longer accurately represents its value. Use EnabledPlugins instead.")]
public static IEnumerable<PluginMetadata> AllPlugins { get; }
Property Value
Type | Description |
---|---|
IEnumerable<PluginMetadata> | a collection of all enabled plugins as PluginMetadatas |
DisabledPlugins
Gets a list of disabled BSIPA plugins.
Declaration
public static IEnumerable<PluginMetadata> DisabledPlugins { get; }
Property Value
Type | Description |
---|---|
IEnumerable<PluginMetadata> | a collection of all disabled plugins as PluginMetadata |
EnabledPlugins
Gets a collection of all enabled plugins, as represented by PluginMetadata.
Declaration
public static IEnumerable<PluginMetadata> EnabledPlugins { get; }
Property Value
Type | Description |
---|---|
IEnumerable<PluginMetadata> | a collection of all enabled plugins |
IgnoredPlugins
Gets a read-only dictionary of an ignored plugin to the reason it was ignored, as an IgnoreReason.
Declaration
public static IReadOnlyDictionary<PluginMetadata, IgnoreReason> IgnoredPlugins { get; }
Property Value
Type | Description |
---|---|
IReadOnlyDictionary<PluginMetadata, IgnoreReason> | a dictionary of PluginMetadata to IgnoreReason of ignored plugins |
Plugins
An IEnumerable<T> of old IPA plugins.
Declaration
[Obsolete("This exists only to provide support for legacy IPA plugins based on the IPlugin interface.")]
public static IEnumerable<IPlugin> Plugins { get; }
Property Value
Type | Description |
---|---|
IEnumerable<IPlugin> | all legacy plugin instances |
Methods
| Improve this Doc View SourceGetDisabledPlugin(String)
Gets a disabled plugin's metadata by its name.
Declaration
public static PluginMetadata GetDisabledPlugin(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | the name of the disabled plugin to get |
Returns
Type | Description |
---|---|
PluginMetadata | the metadata for the corresponding plugin |
GetDisabledPluginFromId(String)
Gets a disabled plugin's metadata by its ID.
Declaration
public static PluginMetadata GetDisabledPluginFromId(string id)
Parameters
Type | Name | Description |
---|---|---|
String | id | the ID of the disabled plugin to get |
Returns
Type | Description |
---|---|
PluginMetadata | the metadata for the corresponding plugin |
GetPlugin(String)
Gets info about the enabled plugin with the specified name.
Declaration
public static PluginMetadata GetPlugin(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | the name of the plugin to get (must be an exact match) |
Returns
Type | Description |
---|---|
PluginMetadata | the plugin metadata for the requested plugin or null if it doesn't exist or is disabled |
GetPluginFromId(String)
Gets info about the enabled plugin with the specified ID.
Declaration
public static PluginMetadata GetPluginFromId(string id)
Parameters
Type | Name | Description |
---|---|---|
String | id | the ID name of the plugin to get (must be an exact match) |
Returns
Type | Description |
---|---|
PluginMetadata | the plugin metadata for the requested plugin or null if it doesn't exist or is disabled |
IsDisabled(PluginMetadata)
Checks if a given plugin is disabled.
Declaration
public static bool IsDisabled(PluginMetadata meta)
Parameters
Type | Name | Description |
---|---|---|
PluginMetadata | meta | the plugin to check |
Returns
Type | Description |
---|---|
Boolean | true if the plugin is disabled, false otherwise. |
IsEnabled(PluginMetadata)
Checks if a given plugin is enabled.
Declaration
public static bool IsEnabled(PluginMetadata meta)
Parameters
Type | Name | Description |
---|---|---|
PluginMetadata | meta | the plugin to check |
Returns
Type | Description |
---|---|
Boolean | true if the plugin is enabled, false otherwise. |
PluginStateTransaction()
Creates a new transaction for mod enabling and disabling mods simultaneously.
Declaration
public static StateTransitionTransaction PluginStateTransaction()
Returns
Type | Description |
---|---|
StateTransitionTransaction | a new StateTransitionTransaction that captures the current state of loaded mods |
Events
| Improve this Doc View SourceOnAnyPluginsStateChanged
Called whenever any plugins, regardless of whether or not their change occurs during runtime, have their state changed.
Declaration
public static event PluginManager.OnAnyPluginsStateChangedDelegate OnAnyPluginsStateChanged
Event Type
Type | Description |
---|---|
PluginManager.OnAnyPluginsStateChangedDelegate |
Remarks
Note that this is called on the Unity main thread, and cannot therefore block, as the Task provided represents operations that also run on the Unity main thread.
OnPluginsStateChanged
Called whenever any plugins have their state changed at runtime with the Task representing that state change.
Declaration
public static event Action<Task> OnPluginsStateChanged
Event Type
Type | Description |
---|---|
Action<Task> |
Remarks
Note that this is called on the Unity main thread, and cannot therefore block, as the Task provided represents operations that also run on the Unity main thread.
PluginDisabled
Called whenever a plugin is disabled, before the plugin in question is enabled.
Declaration
public static event PluginManager.PluginDisableDelegate PluginDisabled
Event Type
Type | Description |
---|---|
PluginManager.PluginDisableDelegate |
PluginEnabled
Called whenever a plugin is enabled, before the plugin in question is enabled.
Declaration
public static event PluginManager.PluginEnableDelegate PluginEnabled
Event Type
Type | Description |
---|---|
PluginManager.PluginEnableDelegate |