Skip to main content

Interface IDalamudPluginInterface

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

Assembly: Dalamud.dll
View Source
Declaration
public interface IDalamudPluginInterface

Properties

Reason

Gets the reason this plugin was loaded.

View Source
Declaration
PluginLoadReason Reason { get; }

IsAutoUpdateComplete

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

View Source
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.

View Source
Declaration
string SourceRepository { get; }

InternalName

Gets the current internal plugin name.

View Source
Declaration
string InternalName { get; }

Manifest

Gets the plugin's manifest.

View Source
Declaration
IPluginManifest Manifest { get; }

IsDev

Gets a value indicating whether this is a dev plugin.

View Source
Declaration
bool IsDev { get; }

IsTesting

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

View Source
Declaration
bool IsTesting { get; }

LoadTime

Gets the time that this plugin was loaded.

View Source
Declaration
DateTime LoadTime { get; }

LoadTimeUTC

Gets the UTC time that this plugin was loaded.

View Source
Declaration
DateTime LoadTimeUTC { get; }

LoadTimeDelta

Gets the timespan delta from when this plugin was loaded.

View Source
Declaration
TimeSpan LoadTimeDelta { get; }

DalamudAssetDirectory

Gets the directory Dalamud assets are stored in.

View Source
Declaration
DirectoryInfo DalamudAssetDirectory { get; }

AssemblyLocation

Gets the location of your plugin assembly.

View Source
Declaration
FileInfo AssemblyLocation { get; }

ConfigDirectory

Gets the directory your plugin configurations are stored in.

View Source
Declaration
DirectoryInfo ConfigDirectory { get; }

ConfigFile

Gets the config file of your plugin.

View Source
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.

View Source
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.

View Source
Declaration
bool IsDevMenuOpen { get; }

IsDebugging

Gets a value indicating whether a debugger is attached.

View Source
Declaration
bool IsDebugging { get; }

UiLanguage

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

View Source
Declaration
string UiLanguage { get; }

Sanitizer

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

View Source
Declaration
ISanitizer Sanitizer { get; }

GeneralChatType

Gets the chat type used by default for plugin messages.

View Source
Declaration
XivChatType GeneralChatType { get; }

InstalledPlugins

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

View Source
Declaration
IEnumerable<IExposedPlugin> InstalledPlugins { get; }

Methods

OpenPluginInstallerTo(PluginInstallerOpenKind, string?)

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

View Source
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.

View Source
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.

View Source
Declaration
bool OpenDeveloperMenu()
Returns

System.Boolean: Returns false if the DalamudInterface was null.### 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.

View Source
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.

View Source
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.

View Source
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.

View Source
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.

View Source
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)

This class facilitates inter-plugin communication.

View Source
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)

This class facilitates inter-plugin communication.

View Source
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)

This class facilitates inter-plugin communication.

View Source
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)

This class facilitates inter-plugin communication.

View Source
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)

This class facilitates inter-plugin communication.

View Source
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)

This class facilitates inter-plugin communication.

View Source
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)

This class facilitates inter-plugin communication.

View Source
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)

This class facilitates inter-plugin communication.

View Source
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.

View Source
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.

View Source
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.

View Source
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.

View Source
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.

View Source
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.

View Source
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.

View Source
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.

View Source
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.

View Source
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).

View Source
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.

View Source
Declaration
IPluginConfiguration? GetPluginConfig()
Returns

Dalamud.Configuration.IPluginConfiguration: A previously saved config or null if none was saved before.### GetPluginConfigDirectory() Get the config directory.

View Source
Declaration
string GetPluginConfigDirectory()
Returns

System.String: directory with path of AppData/XIVLauncher/pluginConfig/PluginInternalName.### GetPluginLocDirectory() Get the loc directory.

View Source
Declaration
string GetPluginLocDirectory()
Returns

System.String: directory with path of AppData/XIVLauncher/pluginConfig/PluginInternalName/loc.### AddChatLinkHandler(uint, Action<uint, SeString>) Register a chat link handler.

View Source
Declaration
DalamudLinkPayload AddChatLinkHandler(uint commandId, Action<uint, SeString> commandAction)
Returns

Dalamud.Game.Text.SeStringHandling.Payloads.DalamudLinkPayload: Returns an SeString payload for the link.

Parameters
TypeNameDescription
System.UInt32commandIdThe ID of the command.
System.Action<System.UInt32,Dalamud.Game.Text.SeStringHandling.SeString>commandActionThe action to be executed.

RemoveChatLinkHandler(uint)

Remove a chat link handler.

View Source
Declaration
void RemoveChatLinkHandler(uint commandId)
Parameters
TypeNameDescription
System.UInt32commandIdThe ID of the command.

RemoveChatLinkHandler()

Removes all chat link handlers registered by the plugin.

View Source
Declaration
void RemoveChatLinkHandler()

Create<T>(params object[])

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

View Source
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.

View Source
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.

View Source
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.

View Source
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.

Events

LanguageChanged

Event that gets fired when loc is changed

View Source
Declaration
event IDalamudPluginInterface.LanguageChangedDelegate LanguageChanged
Event Type

Dalamud.Plugin.IDalamudPluginInterface.LanguageChangedDelegate

ActivePluginsChanged

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

View Source
Declaration
event IDalamudPluginInterface.ActivePluginsChangedDelegate ActivePluginsChanged
Event Type

Dalamud.Plugin.IDalamudPluginInterface.ActivePluginsChangedDelegate