Show / Hide Table of Contents

# Class DalamudPluginInterface

This class acts as an interface to various objects needed to interact with Dalamud and the game.

##### Inheritance

System.Object
DalamudPluginInterface

##### Implements

System.IDisposable

##### Inherited Members

System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()

###### Namespace: Dalamud.Plugin

###### Assembly: Dalamud.dll

##### Syntax

    public sealed class DalamudPluginInterface : IDisposable

### Properties

| Improve this Doc View Source

#### AssemblyLocation

Gets the location of your plugin assembly.

##### Declaration

    public FileInfo AssemblyLocation { get; }

##### Property Value

Type | Description
--- | ---
System.IO.FileInfo |

| Improve this Doc View Source

#### ConfigDirectory

Gets the directory your plugin configurations are stored in.

##### Declaration

    public DirectoryInfo ConfigDirectory { get; }

##### Property Value

Type | Description
--- | ---
System.IO.DirectoryInfo |

| Improve this Doc View Source

#### ConfigFile

Gets the config file of your plugin.

##### Declaration

    public FileInfo ConfigFile { get; }

##### Property Value

Type | Description
--- | ---
System.IO.FileInfo |

| Improve this Doc View Source

#### DalamudAssetDirectory

Gets the directory Dalamud assets are stored in.

##### Declaration

    public DirectoryInfo DalamudAssetDirectory { get; }

##### Property Value

Type | Description
--- | ---
System.IO.DirectoryInfo |

| Improve this Doc View Source

#### GeneralChatType

Gets the chat type used by default for plugin messages.

##### Declaration

    public XivChatType GeneralChatType { get; }

##### Property Value

Type | Description
--- | ---
XivChatType |

| Improve this Doc View Source

#### IsDebugging

Gets a value indicating whether Dalamud is running in Debug mode or the /xldev menu is open. This can occur on release builds.

##### Declaration

    public bool IsDebugging { get; }

##### Property Value

Type | Description
--- | ---
System.Boolean |

| Improve this Doc View Source

#### IsDev

Gets a value indicating whether this is a dev plugin.

##### Declaration

    public bool IsDev { get; }

##### Property Value

Type | Description
--- | ---
System.Boolean |

| Improve this Doc View Source

#### LoadTime

Gets the time that this plugin was loaded.

##### Declaration

    public DateTime LoadTime { get; }

##### Property Value

Type | Description
--- | ---
System.DateTime |

| Improve this Doc View Source

#### LoadTimeDelta

Gets the timespan delta from when this plugin was loaded.

##### Declaration

    public TimeSpan LoadTimeDelta { get; }

##### Property Value

Type | Description
--- | ---
System.TimeSpan |

| Improve this Doc View Source

#### LoadTimeUTC

Gets the UTC time that this plugin was loaded.

##### Declaration

    public DateTime LoadTimeUTC { get; }

##### Property Value

Type | Description
--- | ---
System.DateTime |

| Improve this Doc View Source

#### PluginInternalNames

Gets a list of installed plugin internal names.

##### Declaration

    public List<string> PluginInternalNames { get; }

##### Property Value

Type | Description
--- | ---
System.Collections.Generic.List<System.String> |

| Improve this Doc View Source

#### PluginNames

Gets a list of installed plugin names.

##### Declaration

    public List<string> PluginNames { get; }

##### Property Value

Type | Description
--- | ---
System.Collections.Generic.List<System.String> |

| Improve this Doc View Source

#### Reason

Gets the reason this plugin was loaded.

##### Declaration

    public PluginLoadReason Reason { get; }

##### Property Value

Type | Description
--- | ---
PluginLoadReason |

| Improve this Doc View Source

#### Sanitizer

Gets serializer class with functions to remove special characters from strings.

##### Declaration

    public ISanitizer Sanitizer { get; }

##### Property Value

Type | Description
--- | ---
ISanitizer |

| Improve this Doc View Source

#### UiBuilder

Gets the UiBuilder instance which allows you to draw UI into the game via ImGui draw calls.

##### Declaration

    public UiBuilder UiBuilder { get; }

##### Property Value

Type | Description
--- | ---
UiBuilder |

| Improve this Doc View Source

#### UiLanguage

Gets the current UI language in two-letter iso format.

##### Declaration

    public string UiLanguage { get; }

##### Property Value

Type | Description
--- | ---
System.String |

### Methods

| Improve this Doc View Source

#### AddChatLinkHandler(UInt32, Action<UInt32, SeString>)

Register a chat link handler.

##### Declaration

    public DalamudLinkPayload AddChatLinkHandler(uint commandId, Action<uint, SeString> commandAction)

##### Parameters

Type | Name | Description
--- | --- | ---
System.UInt32 | commandId | The ID of the command.
System.Action<System.UInt32, SeString> | commandAction | The action to be executed.

##### Returns

Type | Description
--- | ---
DalamudLinkPayload | Returns an SeString payload for the link.

| Improve this Doc View Source

#### Create<T>(Object[])

Create a new object of the provided type using its default constructor, then inject objects and properties.

##### Declaration

    public T Create<T>(params object[] scopedObjects)
        where T : class

##### Parameters

Type | Name | Description
--- | --- | ---
System.Object[] | scopedObjects | Objects to inject additionally.

##### Returns

Type | Description
--- | ---
T | The created and initialized type.

##### Type Parameters

Name | Description
--- | ---
T | The type to create.

| Improve this Doc View Source

#### Dispose()

Unregister your plugin and dispose all references.

##### Declaration

    public void Dispose()

| Improve this Doc View Source

#### GetIpcProvider<TRet>(String)

Gets an IPC provider.

##### Declaration

    public ICallGateProvider<TRet> GetIpcProvider<TRet>(string name)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | name | The name of the IPC registration.

##### Returns

Type | Description
--- | ---
ICallGateProvider<TRet> | An IPC provider.

##### Type Parameters

Name | Description
--- | ---
TRet | The return type for funcs. Use object if this is unused.

##### Exceptions

Type | Condition
--- | ---
IpcTypeMismatchError | This is thrown when the requested types do not match the previously registered types are different.

| Improve this Doc View Source

#### GetIpcProvider<T1, TRet>(String)

##### Declaration

    public ICallGateProvider<T1, TRet> GetIpcProvider<T1, TRet>(string name)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | name |

##### Returns

Type | Description
--- | ---
ICallGateProvider<T1, TRet> |

##### Type Parameters

Name | Description
--- | ---
T1 |
TRet |

| Improve this Doc View Source

#### GetIpcProvider<T1, T2, TRet>(String)

##### Declaration

    public ICallGateProvider<T1, T2, TRet> GetIpcProvider<T1, T2, TRet>(string name)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | name |

##### Returns

Type | Description
--- | ---
ICallGateProvider<T1, T2, TRet> |

##### Type Parameters

Name | Description
--- | ---
T1 |
T2 |
TRet |

| Improve this Doc View Source

#### GetIpcProvider<T1, T2, T3, TRet>(String)

##### Declaration

    public ICallGateProvider<T1, T2, T3, TRet> GetIpcProvider<T1, T2, T3, TRet>(string name)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | name |

##### Returns

Type | Description
--- | ---
ICallGateProvider<T1, T2, T3, TRet> |

##### Type Parameters

Name | Description
--- | ---
T1 |
T2 |
T3 |
TRet |

| Improve this Doc View Source

#### GetIpcProvider<T1, T2, T3, T4, TRet>(String)

##### Declaration

    public ICallGateProvider<T1, T2, T3, T4, TRet> GetIpcProvider<T1, T2, T3, T4, TRet>(string name)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | name |

##### Returns

Type | Description
--- | ---
ICallGateProvider<T1, T2, T3, T4, TRet> |

##### Type Parameters

Name | Description
--- | ---
T1 |
T2 |
T3 |
T4 |
TRet |

| Improve this Doc View Source

#### GetIpcProvider<T1, T2, T3, T4, T5, TRet>(String)

##### Declaration

    public ICallGateProvider<T1, T2, T3, T4, T5, TRet> GetIpcProvider<T1, T2, T3, T4, T5, TRet>(string name)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | name |

##### Returns

Type | Description
--- | ---
ICallGateProvider<T1, T2, T3, T4, T5, TRet> |

##### Type Parameters

Name | Description
--- | ---
T1 |
T2 |
T3 |
T4 |
T5 |
TRet |

| Improve this Doc View Source

#### GetIpcProvider<T1, T2, T3, T4, T5, T6, TRet>(String)

##### Declaration

    public ICallGateProvider<T1, T2, T3, T4, T5, T6, TRet> GetIpcProvider<T1, T2, T3, T4, T5, T6, TRet>(string name)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | name |

##### Returns

Type | Description
--- | ---
ICallGateProvider<T1, T2, T3, T4, T5, T6, TRet> |

##### Type Parameters

Name | Description
--- | ---
T1 |
T2 |
T3 |
T4 |
T5 |
T6 |
TRet |

| Improve this Doc View Source

#### GetIpcProvider<T1, T2, T3, T4, T5, T6, T7, TRet>(String)

##### Declaration

    public ICallGateProvider<T1, T2, T3, T4, T5, T6, T7, TRet> GetIpcProvider<T1, T2, T3, T4, T5, T6, T7, TRet>(string name)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | name |

##### Returns

Type | Description
--- | ---
ICallGateProvider<T1, T2, T3, T4, T5, T6, T7, TRet> |

##### Type Parameters

Name | Description
--- | ---
T1 |
T2 |
T3 |
T4 |
T5 |
T6 |
T7 |
TRet |

| Improve this Doc View Source

#### GetIpcProvider<T1, T2, T3, T4, T5, T6, T7, T8, TRet>(String)

##### Declaration

    public ICallGateProvider<T1, T2, T3, T4, T5, T6, T7, T8, TRet> GetIpcProvider<T1, T2, T3, T4, T5, T6, T7, T8, TRet>(string name)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | name |

##### Returns

Type | Description
--- | ---
ICallGateProvider<T1, T2, T3, T4, T5, T6, T7, T8, TRet> |

##### Type Parameters

Name | Description
--- | ---
T1 |
T2 |
T3 |
T4 |
T5 |
T6 |
T7 |
T8 |
TRet |

| Improve this Doc View Source

#### GetIpcSubscriber<TRet>(String)

Gets an IPC subscriber.

##### Declaration

    public ICallGateSubscriber<TRet> GetIpcSubscriber<TRet>(string name)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | name | The name of the IPC registration.

##### Returns

Type | Description
--- | ---
ICallGateSubscriber<TRet> | An IPC subscriber.

##### Type Parameters

Name | Description
--- | ---
TRet | The return type for funcs. Use object if this is unused.

| Improve this Doc View Source

#### GetIpcSubscriber<T1, TRet>(String)

##### Declaration

    public ICallGateSubscriber<T1, TRet> GetIpcSubscriber<T1, TRet>(string name)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | name |

##### Returns

Type | Description
--- | ---
ICallGateSubscriber<T1, TRet> |

##### Type Parameters

Name | Description
--- | ---
T1 |
TRet |

| Improve this Doc View Source

#### GetIpcSubscriber<T1, T2, TRet>(String)

##### Declaration

    public ICallGateSubscriber<T1, T2, TRet> GetIpcSubscriber<T1, T2, TRet>(string name)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | name |

##### Returns

Type | Description
--- | ---
ICallGateSubscriber<T1, T2, TRet> |

##### Type Parameters

Name | Description
--- | ---
T1 |
T2 |
TRet |

| Improve this Doc View Source

#### GetIpcSubscriber<T1, T2, T3, TRet>(String)

##### Declaration

    public ICallGateSubscriber<T1, T2, T3, TRet> GetIpcSubscriber<T1, T2, T3, TRet>(string name)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | name |

##### Returns

Type | Description
--- | ---
ICallGateSubscriber<T1, T2, T3, TRet> |

##### Type Parameters

Name | Description
--- | ---
T1 |
T2 |
T3 |
TRet |

| Improve this Doc View Source

#### GetIpcSubscriber<T1, T2, T3, T4, TRet>(String)

##### Declaration

    public ICallGateSubscriber<T1, T2, T3, T4, TRet> GetIpcSubscriber<T1, T2, T3, T4, TRet>(string name)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | name |

##### Returns

Type | Description
--- | ---
ICallGateSubscriber<T1, T2, T3, T4, TRet> |

##### Type Parameters

Name | Description
--- | ---
T1 |
T2 |
T3 |
T4 |
TRet |

| Improve this Doc View Source

#### GetIpcSubscriber<T1, T2, T3, T4, T5, TRet>(String)

##### Declaration

    public ICallGateSubscriber<T1, T2, T3, T4, T5, TRet> GetIpcSubscriber<T1, T2, T3, T4, T5, TRet>(string name)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | name |

##### Returns

Type | Description
--- | ---
ICallGateSubscriber<T1, T2, T3, T4, T5, TRet> |

##### Type Parameters

Name | Description
--- | ---
T1 |
T2 |
T3 |
T4 |
T5 |
TRet |

| Improve this Doc View Source

#### GetIpcSubscriber<T1, T2, T3, T4, T5, T6, TRet>(String)

##### Declaration

    public ICallGateSubscriber<T1, T2, T3, T4, T5, T6, TRet> GetIpcSubscriber<T1, T2, T3, T4, T5, T6, TRet>(string name)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | name |

##### Returns

Type | Description
--- | ---
ICallGateSubscriber<T1, T2, T3, T4, T5, T6, TRet> |

##### Type Parameters

Name | Description
--- | ---
T1 |
T2 |
T3 |
T4 |
T5 |
T6 |
TRet |

| Improve this Doc View Source

#### GetIpcSubscriber<T1, T2, T3, T4, T5, T6, T7, TRet>(String)

##### Declaration

    public ICallGateSubscriber<T1, T2, T3, T4, T5, T6, T7, TRet> GetIpcSubscriber<T1, T2, T3, T4, T5, T6, T7, TRet>(string name)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | name |

##### Returns

Type | Description
--- | ---
ICallGateSubscriber<T1, T2, T3, T4, T5, T6, T7, TRet> |

##### Type Parameters

Name | Description
--- | ---
T1 |
T2 |
T3 |
T4 |
T5 |
T6 |
T7 |
TRet |

| Improve this Doc View Source

#### GetIpcSubscriber<T1, T2, T3, T4, T5, T6, T7, T8, TRet>(String)

##### Declaration

    public ICallGateSubscriber<T1, T2, T3, T4, T5, T6, T7, T8, TRet> GetIpcSubscriber<T1, T2, T3, T4, T5, T6, T7, T8, TRet>(string name)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | name |

##### Returns

Type | Description
--- | ---
ICallGateSubscriber<T1, T2, T3, T4, T5, T6, T7, T8, TRet> |

##### Type Parameters

Name | Description
--- | ---
T1 |
T2 |
T3 |
T4 |
T5 |
T6 |
T7 |
T8 |
TRet |

| Improve this Doc View Source

#### GetPluginConfig()

Get a previously saved plugin configuration or null if none was saved before.

##### Declaration

    public IPluginConfiguration GetPluginConfig()

##### Returns

Type | Description
--- | ---
IPluginConfiguration | A previously saved config or null if none was saved before.

| Improve this Doc View Source

#### GetPluginConfigDirectory()

Get the config directory.

##### Declaration

    public string GetPluginConfigDirectory()

##### Returns

Type | Description
--- | ---
System.String | directory with path of AppData/XIVLauncher/pluginConfig/PluginInternalName.

| Improve this Doc View Source

#### GetPluginLocDirectory()

Get the loc directory.

##### Declaration

    public string GetPluginLocDirectory()

##### Returns

Type | Description
--- | ---
System.String | directory with path of AppData/XIVLauncher/pluginConfig/PluginInternalName/loc.

| Improve this Doc View Source

#### Inject(Object, Object[])

Inject services into properties on the provided object instance.

##### Declaration

    public bool Inject(object instance, params object[] scopedObjects)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Object | instance | The instance to inject services into.
System.Object[] | scopedObjects | Objects to inject additionally.

##### Returns

Type | Description
--- | ---
System.Boolean | Whether or not the injection succeeded.

| Improve this Doc View Source

#### RemoveChatLinkHandler()

Removes all chat link handlers registered by the plugin.

##### Declaration

    public void RemoveChatLinkHandler()

| Improve this Doc View Source

#### RemoveChatLinkHandler(UInt32)

Remove a chat link handler.

##### Declaration

    public void RemoveChatLinkHandler(uint commandId)

##### Parameters

Type | Name | Description
--- | --- | ---
System.UInt32 | commandId | The ID of the command.

| Improve this Doc View Source

#### SavePluginConfig(IPluginConfiguration)

Save a plugin configuration(inheriting IPluginConfiguration).

##### Declaration

    public void SavePluginConfig(IPluginConfiguration currentConfig)

##### Parameters

Type | Name | Description
--- | --- | ---
IPluginConfiguration | currentConfig | The current configuration.

### Events

| Improve this Doc View Source

#### LanguageChanged

Event that gets fired when loc is changed

##### Declaration

    public event DalamudPluginInterface.LanguageChangedDelegate LanguageChanged

##### Event Type

Type | Description
--- | ---
DalamudPluginInterface.LanguageChangedDelegate |

### Implements

System.IDisposable