Skip to main content
Version: 15.x (API 15) [Current]

Interface IDalamudPluginInterface

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

Assembly: Dalamud.dll​
Declaration
public interface IDalamudPluginInterface : IServiceProvider

Properties​

Reason​

Gets the reason this plugin was loaded.

Declaration
PluginLoadReason Reason { get; }

IsAutoUpdateComplete​

Gets a value indicating whether auto-updates have already completed this session.

Declaration
bool IsAutoUpdateComplete { get; }

SourceRepository​

Gets the repository from which this plugin was installed.

If a plugin was installed from the official/main repository, this will return the value of Dalamud.Plugin.Internal.Types.Manifest.SpecialPluginSource.MainRepo. Developer plugins will return the value of Dalamud.Plugin.Internal.Types.Manifest.SpecialPluginSource.DevPlugin.

Declaration
string SourceRepository { get; }

InternalName​

Gets the current internal plugin name.

Declaration
string InternalName { get; }

WorkingPluginId​

Gets the unique working plugin ID set by Dalamud.

Declaration
Guid WorkingPluginId { get; }

Manifest​

Gets the plugin's manifest.

Declaration
IPluginManifest Manifest { get; }

IsDev​

Gets a value indicating whether this is a dev plugin.

Declaration
bool IsDev { get; }

IsTesting​

Gets a value indicating whether this is a testing release of a plugin.

Declaration
bool IsTesting { get; }
Remarks​

Dev plugins have undefined behavior for this value, but can be expected to return false.

IsInProfile​

Gets a value indicating whether this plugin's load status is controlled by a profile/collection.

Declaration
bool IsInProfile { get; }

LoadTime​

Gets the time that this plugin was loaded.

Declaration
DateTime LoadTime { get; }

LoadTimeUTC​

Gets the UTC time that this plugin was loaded.

Declaration
DateTime LoadTimeUTC { get; }

LoadTimeDelta​

Gets the timespan delta from when this plugin was loaded.

Declaration
TimeSpan LoadTimeDelta { get; }

DalamudAssetDirectory​

Gets the directory Dalamud assets are stored in.

Declaration
DirectoryInfo DalamudAssetDirectory { get; }

Assembly​

Gets your plugin's Assembly.

Declaration
Assembly Assembly { get; }

AssemblyLocation​

Gets the location of your plugin assembly.

Declaration
FileInfo AssemblyLocation { get; }

ConfigDirectory​

Gets the directory your plugin configurations are stored in.

Declaration
DirectoryInfo ConfigDirectory { get; }

ConfigFile​

Gets the config file of your plugin.

Declaration
FileInfo ConfigFile { get; }

UiBuilder​

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

Declaration
IUiBuilder UiBuilder { get; }

IsDevMenuOpen​

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

Declaration
bool IsDevMenuOpen { get; }

IsDebugging​

Gets a value indicating whether a debugger is attached.

Declaration
bool IsDebugging { get; }

AllowSeasonalEvents​

Gets a value indicating whether the user wants to allow seasonal events, such as April Fools, to be to run. Certain users may not wish to be affected by these and may disable them globally. We recommend that plugins check this value before running any seasonal event code, and disable or hide such features if this is false.

Declaration
bool AllowSeasonalEvents { get; }

UiLanguage​

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

Declaration
string UiLanguage { get; }

Sanitizer​

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

Declaration
ISanitizer Sanitizer { get; }

GeneralChatType​

Gets the chat type used by default for plugin messages.

Declaration
XivChatType GeneralChatType { get; }

InstalledPlugins​

Gets a list of installed plugins along with their current state.

Declaration
IEnumerable<IExposedPlugin> InstalledPlugins { get; }

Methods​

OpenPluginInstallerTo(PluginInstallerOpenKind, string?)​

Opens the Dalamud.Interface.Internal.Windows.PluginInstaller.PluginInstallerWindow, with an optional search term.

Declaration
bool OpenPluginInstallerTo(PluginInstallerOpenKind openTo = PluginInstallerOpenKind.AllPlugins, string? searchText = null)
Returns​

System.Boolean: Returns false if the DalamudInterface was null.

Parameters​
TypeNameDescription
Dalamud.Interface.PluginInstallerOpenKindopenToThe page to open the installer to. Defaults to the "All Plugins" page.
System.StringsearchTextAn optional search text to input in the search box.

OpenDalamudSettingsTo(SettingsOpenKind, string?)​

Opens the Dalamud.Interface.Internal.Windows.Settings.SettingsWindow, with an optional search term.

Declaration
bool OpenDalamudSettingsTo(SettingsOpenKind openTo = SettingsOpenKind.General, string? searchText = null)
Returns​

System.Boolean: Returns false if the DalamudInterface was null.

Parameters​
TypeNameDescription
Dalamud.Interface.SettingsOpenKindopenToThe tab to open the settings to. Defaults to the "General" tab.
System.StringsearchTextAn optional search text to input in the search box.

OpenDeveloperMenu()​

Opens the dev menu bar.

Declaration
bool OpenDeveloperMenu()
Returns​

System.Boolean: Returns false if the DalamudInterface was null.

GetPlugin(Assembly)​

Gets the plugin the given assembly is part of.

Declaration
IExposedPlugin? GetPlugin(Assembly assembly)
Returns​

Dalamud.Plugin.IExposedPlugin: The plugin the given assembly is part of, or null if this is a shared assembly or if this information cannot be determined.

Parameters​
TypeNameDescription
System.Reflection.AssemblyassemblyThe assembly to check.

GetPlugin(AssemblyLoadContext)​

Gets the plugin that loads in the given context.

Declaration
IExposedPlugin? GetPlugin(AssemblyLoadContext context)
Returns​

Dalamud.Plugin.IExposedPlugin: The plugin that loads in the given context, or null if this isn't a plugin's context or if this information cannot be determined.

Parameters​
TypeNameDescription
System.Runtime.Loader.AssemblyLoadContextcontextThe context to check.

GetDalamudVersion()​

Gets information about the version of Dalamud this plugin is loaded into.

Declaration
IDalamudVersionInfo GetDalamudVersion()
Returns​

Dalamud.Plugin.VersionInfo.IDalamudVersionInfo: Class containing version information.

GetOrCreateData<T>(string, Func<T>)​

If a data cache for <code class="paramref">tag</code> exists, return the data. Otherwise, call the function <code class="paramref">dataGenerator</code> to create data and store it as a new cache. In either case, the calling assembly will be added to the current consumers on success.

Declaration
T GetOrCreateData<T>(string tag, Func<T> dataGenerator) where T : class
Returns​

<T>: Either the existing data for <code class="paramref">tag</code> or the data generated by <code class="paramref">dataGenerator</code>.

Parameters​
TypeNameDescription
System.StringtagThe name for the data cache.
System.Func<<T>>dataGeneratorThe function that generates the data if it does not already exist.
Type Parameters​
NameDescription
TThe type of the stored data - needs to be a reference type that is shared through Dalamud itself, not loaded by the plugin.
Exceptions​

Dalamud.Plugin.Ipc.Exceptions.DataCacheTypeMismatchError
Thrown if a cache for <code class="paramref">tag</code> exists, but contains data of a type not assignable to <code class="typeparamref">T>></code>. Dalamud.Plugin.Ipc.Exceptions.DataCacheValueNullError
Thrown if the stored data for a cache is null. Dalamud.Plugin.Ipc.Exceptions.DataCacheCreationError
Thrown if <code class="paramref">dataGenerator</code> throws an exception or returns null.

RelinquishData(string)​

Notifies the DataShare that the calling assembly no longer uses the data stored for <code class="paramref">tag</code> (or uses it one time fewer). If no assembly uses the data anymore, the cache will be removed from the data share and if it is an IDisposable, Dispose will be called on it.

Declaration
void RelinquishData(string tag)
Parameters​
TypeNameDescription
System.StringtagThe name for the data cache.

TryGetData<T>(string, out T?)​

Obtain the data for the given <code class="paramref">tag</code>, if it exists and has the correct type. Add the calling assembly to the current consumers if true is returned.

Declaration
bool TryGetData<T>(string tag, out T? data) where T : class
Returns​

System.Boolean: True if the requested data exists and is assignable to the requested type.

Parameters​
TypeNameDescription
System.StringtagThe name for the data cache.
<T>dataThe requested data on success, null otherwise.
Type Parameters​
NameDescription
TThe type of the stored data - needs to be a reference type that is shared through Dalamud itself, not loaded by the plugin.

GetData<T>(string)​

Obtain the data for the given <code class="paramref">tag</code>, if it exists and has the correct type. Add the calling assembly to the current consumers if non-null is returned.

Declaration
T? GetData<T>(string tag) where T : class
Returns​

<T>: The requested data.

Parameters​
TypeNameDescription
System.StringtagThe name for the data cache.
Type Parameters​
NameDescription
TThe type of the stored data - needs to be a reference type that is shared through Dalamud itself, not loaded by the plugin.
Exceptions​

System.Collections.Generic.KeyNotFoundException
Thrown if <code class="paramref">tag</code> is not registered. Dalamud.Plugin.Ipc.Exceptions.DataCacheTypeMismatchError
Thrown if a cache for <code class="paramref">tag</code> exists, but contains data of a type not assignable to <code class="typeparamref">T>></code>. Dalamud.Plugin.Ipc.Exceptions.DataCacheValueNullError
Thrown if the stored data for a cache is null.

GetIpcProvider<TRet>(string)​

Gets an IPC provider.

Declaration
ICallGateProvider<TRet> GetIpcProvider<TRet>(string name)
Returns​

Dalamud.Plugin.Ipc.ICallGateProvider<TRet>: An IPC provider.

Parameters​
TypeNameDescription
System.StringnameThe name of the IPC registration.
Type Parameters​
NameDescription
TRetThe return type for funcs. Use object if this is unused.
Exceptions​

Dalamud.Plugin.Ipc.Exceptions.IpcTypeMismatchError
This is thrown when the requested types do not match the previously registered types are different.

GetIpcProvider<T1, TRet>(string)​

The backing interface for the provider ("server") half of an IPC channel. This interface is used to expose methods to other plugins via RPC, as well as to allow other plugins to subscribe to notifications from this plugin.

Declaration
ICallGateProvider<T1, TRet> GetIpcProvider<T1, TRet>(string name)
Returns​

Dalamud.Plugin.Ipc.ICallGateProvider<TRet>

Parameters​
TypeName
System.Stringname
Type Parameters​
  • T1
  • TRet

GetIpcProvider<T1, T2, TRet>(string)​

The backing interface for the provider ("server") half of an IPC channel. This interface is used to expose methods to other plugins via RPC, as well as to allow other plugins to subscribe to notifications from this plugin.

Declaration
ICallGateProvider<T1, T2, TRet> GetIpcProvider<T1, T2, TRet>(string name)
Returns​

Dalamud.Plugin.Ipc.ICallGateProvider<TRet>

Parameters​
TypeName
System.Stringname
Type Parameters​
  • T1
  • T2
  • TRet

GetIpcProvider<T1, T2, T3, TRet>(string)​

The backing interface for the provider ("server") half of an IPC channel. This interface is used to expose methods to other plugins via RPC, as well as to allow other plugins to subscribe to notifications from this plugin.

Declaration
ICallGateProvider<T1, T2, T3, TRet> GetIpcProvider<T1, T2, T3, TRet>(string name)
Returns​

Dalamud.Plugin.Ipc.ICallGateProvider<TRet>

Parameters​
TypeName
System.Stringname
Type Parameters​
  • T1
  • T2
  • T3
  • TRet

GetIpcProvider<T1, T2, T3, T4, TRet>(string)​

The backing interface for the provider ("server") half of an IPC channel. This interface is used to expose methods to other plugins via RPC, as well as to allow other plugins to subscribe to notifications from this plugin.

Declaration
ICallGateProvider<T1, T2, T3, T4, TRet> GetIpcProvider<T1, T2, T3, T4, TRet>(string name)
Returns​

Dalamud.Plugin.Ipc.ICallGateProvider<TRet>

Parameters​
TypeName
System.Stringname
Type Parameters​
  • T1
  • T2
  • T3
  • T4
  • TRet

GetIpcProvider<T1, T2, T3, T4, T5, TRet>(string)​

The backing interface for the provider ("server") half of an IPC channel. This interface is used to expose methods to other plugins via RPC, as well as to allow other plugins to subscribe to notifications from this plugin.

Declaration
ICallGateProvider<T1, T2, T3, T4, T5, TRet> GetIpcProvider<T1, T2, T3, T4, T5, TRet>(string name)
Returns​

Dalamud.Plugin.Ipc.ICallGateProvider<TRet>

Parameters​
TypeName
System.Stringname
Type Parameters​
  • T1
  • T2
  • T3
  • T4
  • T5
  • TRet

GetIpcProvider<T1, T2, T3, T4, T5, T6, TRet>(string)​

The backing interface for the provider ("server") half of an IPC channel. This interface is used to expose methods to other plugins via RPC, as well as to allow other plugins to subscribe to notifications from this plugin.

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

Dalamud.Plugin.Ipc.ICallGateProvider<TRet>

Parameters​
TypeName
System.Stringname
Type Parameters​
  • T1
  • T2
  • T3
  • T4
  • T5
  • T6
  • TRet

GetIpcProvider<T1, T2, T3, T4, T5, T6, T7, TRet>(string)​

The backing interface for the provider ("server") half of an IPC channel. This interface is used to expose methods to other plugins via RPC, as well as to allow other plugins to subscribe to notifications from this plugin.

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

Dalamud.Plugin.Ipc.ICallGateProvider<TRet>

Parameters​
TypeName
System.Stringname
Type Parameters​
  • T1
  • T2
  • T3
  • T4
  • T5
  • T6
  • T7
  • TRet

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

The backing interface for the provider ("server") half of an IPC channel. This interface is used to expose methods to other plugins via RPC, as well as to allow other plugins to subscribe to notifications from this plugin.

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

Dalamud.Plugin.Ipc.ICallGateProvider<TRet>

Parameters​
TypeName
System.Stringname
Type Parameters​
  • T1
  • T2
  • T3
  • T4
  • T5
  • T6
  • T7
  • T8
  • TRet

GetIpcSubscriber<TRet>(string)​

Gets an IPC subscriber.

Declaration
ICallGateSubscriber<TRet> GetIpcSubscriber<TRet>(string name)
Returns​

Dalamud.Plugin.Ipc.ICallGateSubscriber<TRet>: An IPC subscriber.

Parameters​
TypeNameDescription
System.StringnameThe name of the IPC registration.
Type Parameters​
NameDescription
TRetThe return type for funcs. Use object if this is unused.

GetIpcSubscriber<T1, TRet>(string)​

This class facilitates inter-plugin communication.

Declaration
ICallGateSubscriber<T1, TRet> GetIpcSubscriber<T1, TRet>(string name)
Returns​

Dalamud.Plugin.Ipc.ICallGateSubscriber<TRet>

Parameters​
TypeName
System.Stringname
Type Parameters​
  • T1
  • TRet

GetIpcSubscriber<T1, T2, TRet>(string)​

This class facilitates inter-plugin communication.

Declaration
ICallGateSubscriber<T1, T2, TRet> GetIpcSubscriber<T1, T2, TRet>(string name)
Returns​

Dalamud.Plugin.Ipc.ICallGateSubscriber<TRet>

Parameters​
TypeName
System.Stringname
Type Parameters​
  • T1
  • T2
  • TRet

GetIpcSubscriber<T1, T2, T3, TRet>(string)​

This class facilitates inter-plugin communication.

Declaration
ICallGateSubscriber<T1, T2, T3, TRet> GetIpcSubscriber<T1, T2, T3, TRet>(string name)
Returns​

Dalamud.Plugin.Ipc.ICallGateSubscriber<TRet>

Parameters​
TypeName
System.Stringname
Type Parameters​
  • T1
  • T2
  • T3
  • TRet

GetIpcSubscriber<T1, T2, T3, T4, TRet>(string)​

This class facilitates inter-plugin communication.

Declaration
ICallGateSubscriber<T1, T2, T3, T4, TRet> GetIpcSubscriber<T1, T2, T3, T4, TRet>(string name)
Returns​

Dalamud.Plugin.Ipc.ICallGateSubscriber<TRet>

Parameters​
TypeName
System.Stringname
Type Parameters​
  • T1
  • T2
  • T3
  • T4
  • TRet

GetIpcSubscriber<T1, T2, T3, T4, T5, TRet>(string)​

This class facilitates inter-plugin communication.

Declaration
ICallGateSubscriber<T1, T2, T3, T4, T5, TRet> GetIpcSubscriber<T1, T2, T3, T4, T5, TRet>(string name)
Returns​

Dalamud.Plugin.Ipc.ICallGateSubscriber<TRet>

Parameters​
TypeName
System.Stringname
Type Parameters​
  • T1
  • T2
  • T3
  • T4
  • T5
  • TRet

GetIpcSubscriber<T1, T2, T3, T4, T5, T6, TRet>(string)​

This class facilitates inter-plugin communication.

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

Dalamud.Plugin.Ipc.ICallGateSubscriber<TRet>

Parameters​
TypeName
System.Stringname
Type Parameters​
  • T1
  • T2
  • T3
  • T4
  • T5
  • T6
  • TRet

GetIpcSubscriber<T1, T2, T3, T4, T5, T6, T7, TRet>(string)​

This class facilitates inter-plugin communication.

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

Dalamud.Plugin.Ipc.ICallGateSubscriber<TRet>

Parameters​
TypeName
System.Stringname
Type Parameters​
  • T1
  • T2
  • T3
  • T4
  • T5
  • T6
  • T7
  • TRet

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

This class facilitates inter-plugin communication.

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

Dalamud.Plugin.Ipc.ICallGateSubscriber<TRet>

Parameters​
TypeName
System.Stringname
Type Parameters​
  • T1
  • T2
  • T3
  • T4
  • T5
  • T6
  • T7
  • T8
  • TRet

SavePluginConfig(IPluginConfiguration?)​

Save a plugin configuration(inheriting IPluginConfiguration).

Declaration
void SavePluginConfig(IPluginConfiguration? currentConfig)
Parameters​
TypeNameDescription
Dalamud.Configuration.IPluginConfigurationcurrentConfigThe current configuration.

GetPluginConfig()​

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

Declaration
IPluginConfiguration? GetPluginConfig()
Returns​

Dalamud.Configuration.IPluginConfiguration: A previously saved config or null if none was saved before.

GetPluginConfigDirectory()​

Get the config directory.

Declaration
string GetPluginConfigDirectory()
Returns​

System.String: directory with path of AppData/XIVLauncher/pluginConfig/PluginInternalName.

GetPluginLocDirectory()​

Get the loc directory.

Declaration
string GetPluginLocDirectory()
Returns​

System.String: directory with path of AppData/XIVLauncher/pluginConfig/PluginInternalName/loc.

Create<T>(params object[])​

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

Declaration
T? Create<T>(params object[] scopedObjects) where T : class
Returns​

<T>: The created and initialized type, or null on failure.

Parameters​
TypeNameDescription
System.Object[]scopedObjectsObjects to inject additionally.
Type Parameters​
NameDescription
TThe type to create.

CreateAsync<T>(params object[])​

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

Declaration
Task<T> CreateAsync<T>(params object[] scopedObjects) where T : class
Returns​

System.Threading.Tasks.Task<<T>>: A task representing the created and initialized type.

Parameters​
TypeNameDescription
System.Object[]scopedObjectsObjects to inject additionally.
Type Parameters​
NameDescription
TThe type to create.

Inject(object, params object[])​

Inject services into properties on the provided object instance.

Declaration
bool Inject(object instance, params object[] scopedObjects)
Returns​

System.Boolean: Whether the injection succeeded.

Parameters​
TypeNameDescription
System.ObjectinstanceThe instance to inject services into.
System.Object[]scopedObjectsObjects to inject additionally.

InjectAsync(object, params object[])​

Inject services into properties on the provided object instance.

Declaration
Task InjectAsync(object instance, params object[] scopedObjects)
Returns​

System.Threading.Tasks.Task: A System.Threading.Tasks.ValueTask representing the status of the operation.

Parameters​
TypeNameDescription
System.ObjectinstanceThe instance to inject services into.
System.Object[]scopedObjectsObjects to inject additionally.

CheckForUpdateAsync()​

Check for updates for this plugin, returning information about the latest version if available. Does not actually re-request data from the remote repository, but will wait for a pending reload if one is in progress. Reloads happen at periodic intervals (10 minutes) so data will stay relatively fresh.

Declaration
Task<PluginUpdate?> CheckForUpdateAsync()
Returns​

System.Threading.Tasks.Task<Dalamud.Plugin.PluginUpdate>: A record containing details about the update, or null if no update is available.

Events​

LanguageChanged​

Event that gets fired when loc is changed

Declaration
event IDalamudPluginInterface.LanguageChangedDelegate LanguageChanged
Event Type​

Dalamud.Plugin.IDalamudPluginInterface.LanguageChangedDelegate

ActivePluginsChanged​

Event that is fired when the active list of plugins is changed.

Declaration
event IDalamudPluginInterface.ActivePluginsChangedDelegate ActivePluginsChanged
Event Type​

Dalamud.Plugin.IDalamudPluginInterface.ActivePluginsChangedDelegate