Search Results for

    Show / Hide Table of Contents

    Class Feature

    The root interface for a mod Feature.

    Inheritance
    System.Object
    Feature
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: IPA.Loader.Features
    Assembly: IPA.Loader.dll
    Syntax
    public abstract class Feature
    Remarks

    Avoid storing any data in any subclasses. If you do, it may result in a failure to load the feature.

    Properties

    | Improve this Doc View Source

    InvalidMessage

    The message to be logged when the feature is not valid for a plugin. This should also be set whenever either BeforeInit(PluginMetadata) returns false.

    Declaration
    public virtual string InvalidMessage { get; protected set; }
    Property Value
    Type Description
    System.String

    the message to show when the feature is marked invalid

    Methods

    | Improve this Doc View Source

    AfterDisable(PluginMetadata)

    Called after a plugin with this feature appplied is disabled.

    Declaration
    public virtual void AfterDisable(PluginMetadata plugin)
    Parameters
    Type Name Description
    PluginMetadata plugin

    the plugin that was disabled

    | Improve this Doc View Source

    AfterInit(PluginMetadata)

    Called after a plugin has been fully initialized, whether or not there is an Init method. This should never throw an exception.

    Declaration
    public virtual void AfterInit(PluginMetadata plugin)
    Parameters
    Type Name Description
    PluginMetadata plugin

    the plugin that was just initialized

    | Improve this Doc View Source

    AfterInit(PluginMetadata, Object)

    Called after a plugin has been fully initialized, whether or not there is an Init method. This should never throw an exception.

    Declaration
    public virtual void AfterInit(PluginMetadata plugin, object pluginInstance)
    Parameters
    Type Name Description
    PluginMetadata plugin

    the plugin that was just initialized

    System.Object pluginInstance

    the instance of the plugin being initialized

    | Improve this Doc View Source

    BeforeInit(PluginMetadata)

    Called before a plugin's Init method is called. This will not be called if there is no Init method. This should never throw an exception. An exception will abort the loading of the plugin with an error.

    Declaration
    public virtual void BeforeInit(PluginMetadata plugin)
    Parameters
    Type Name Description
    PluginMetadata plugin

    the plugin to be initialized

    | Improve this Doc View Source

    Initialize(PluginMetadata, JObject)

    Initializes the feature with the data provided in the definition.

    Declaration
    protected abstract bool Initialize(PluginMetadata meta, JObject featureData)
    Parameters
    Type Name Description
    PluginMetadata meta

    the metadata of the plugin that is being prepared

    Newtonsoft.Json.Linq.JObject featureData

    the data provided with the feature

    Returns
    Type Description
    System.Boolean

    true if the feature is valid for the plugin, false otherwise

    Remarks

    This gets called AFTER your Init method, but BEFORE the target's Init method. If it is applied to the defining plugin, BeforeInit is not called.

    Returning false does not prevent the plugin from being loaded. It simply prevents the feature from being used.

    Extension Methods

    ReflectionUtil.SetField<T, U>(T, String, U)
    ReflectionUtil.GetField<U, T>(T, String)
    ReflectionUtil.SetProperty<T, U>(T, String, U)
    ReflectionUtil.GetProperty<U, T>(T, String)
    ReflectionUtil.InvokeMethod<U, T>(T, String, Object[])
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX