Interface IDalamudPluginInterface
This interface acts as an interface to various objects needed to interact with Dalamud and the game.
Assembly: Dalamud.dll
public interface IDalamudPluginInterface : IServiceProvider
Properties
Reason
Gets the reason this plugin was loaded.
PluginLoadReason Reason { get; }
IsAutoUpdateComplete
Gets a value indicating whether auto-updates have already completed this session.
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.
string SourceRepository { get; }
InternalName
Gets the current internal plugin name.
string InternalName { get; }
Manifest
Gets the plugin's manifest.
IPluginManifest Manifest { get; }
IsDev
Gets a value indicating whether this is a dev plugin.
bool IsDev { get; }
IsTesting
Gets a value indicating whether this is a testing release of a plugin.
bool IsTesting { get; }
LoadTime
Gets the time that this plugin was loaded.
DateTime LoadTime { get; }
LoadTimeUTC
Gets the UTC time that this plugin was loaded.
DateTime LoadTimeUTC { get; }
LoadTimeDelta
Gets the timespan delta from when this plugin was loaded.
TimeSpan LoadTimeDelta { get; }
DalamudAssetDirectory
Gets the directory Dalamud assets are stored in.
DirectoryInfo DalamudAssetDirectory { get; }
AssemblyLocation
Gets the location of your plugin assembly.
FileInfo AssemblyLocation { get; }
ConfigDirectory
Gets the directory your plugin configurations are stored in.
DirectoryInfo ConfigDirectory { get; }
ConfigFile
Gets the config file of your plugin.
FileInfo ConfigFile { get; }
UiBuilder
Gets the Dalamud.Plugin.IDalamudPluginInterface.UiBuilder instance which allows you to draw UI into the game via ImGui draw calls.
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.
bool IsDevMenuOpen { get; }
IsDebugging
Gets a value indicating whether a debugger is attached.
bool IsDebugging { get; }
UiLanguage
Gets the current UI language in two-letter iso format.
string UiLanguage { get; }
Sanitizer
Gets serializer class with functions to remove special characters from strings.
ISanitizer Sanitizer { get; }
GeneralChatType
Gets the chat type used by default for plugin messages.
XivChatType GeneralChatType { get; }
InstalledPlugins
Gets a list of installed plugins along with their current state.
IEnumerable<IExposedPlugin> InstalledPlugins { get; }
Methods
OpenPluginInstallerTo(PluginInstallerOpenKind, string?)
Opens the Dalamud.Interface.Internal.Windows.PluginInstaller.PluginInstallerWindow, with an optional search term.
bool OpenPluginInstallerTo(PluginInstallerOpenKind openTo = PluginInstallerOpenKind.AllPlugins, string? searchText = null)
Returns
System.Boolean: Returns false if the DalamudInterface was null.
Parameters
| Type | Name | Description |
|---|---|---|
| Dalamud.Interface.PluginInstallerOpenKind | openTo | The page to open the installer to. Defaults to the "All Plugins" page. |
System.String | searchText | An 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.
bool OpenDalamudSettingsTo(SettingsOpenKind openTo = SettingsOpenKind.General, string? searchText = null)
Returns
System.Boolean: Returns false if the DalamudInterface was null.
Parameters
| Type | Name | Description |
|---|---|---|
| Dalamud.Interface.SettingsOpenKind | openTo | The tab to open the settings to. Defaults to the "General" tab. |
System.String | searchText | An optional search text to input in the search box. |
OpenDeveloperMenu()
Opens the dev menu bar.
bool OpenDeveloperMenu()
Returns
System.Boolean: Returns false if the DalamudInterface was null.
GetPlugin(Assembly)
Gets the plugin the given assembly is part of.
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
| Type | Name | Description |
|---|---|---|
System.Reflection.Assembly | assembly | The assembly to check. |
GetPlugin(AssemblyLoadContext)
Gets the plugin that loads in the given context.
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
| Type | Name | Description |
|---|---|---|
System.Runtime.Loader.AssemblyLoadContext | context | The context to check. |
GetDalamudVersion()
Gets information about the version of Dalamud this plugin is loaded into.
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.
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
| Type | Name | Description |
|---|---|---|
System.String | tag | The name for the data cache. |
System.Func<<T>> | dataGenerator | The function that generates the data if it does not already exist. |
Type Parameters
| Name | Description |
|---|---|
T | The 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.
void RelinquishData(string tag)
Parameters
| Type | Name | Description |
|---|---|---|
System.String | tag | The 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.
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
| Type | Name | Description |
|---|---|---|
System.String | tag | The name for the data cache. |
<T> | data | The requested data on success, null otherwise. |
Type Parameters
| Name | Description |
|---|---|
T | The 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.
T? GetData<T>(string tag) where T : class
Returns
<T>: The requested data.
Parameters
| Type | Name | Description |
|---|---|---|
System.String | tag | The name for the data cache. |
Type Parameters
| Name | Description |
|---|---|
T | The 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.
ICallGateProvider<TRet> GetIpcProvider<TRet>(string name)
Returns
Dalamud.Plugin.Ipc.ICallGateProvider<TRet>: An IPC provider.
Parameters
| Type | Name | Description |
|---|---|---|
System.String | name | The name of the IPC registration. |
Type Parameters
| Name | Description |
|---|---|
TRet | The 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.
ICallGateProvider<T1, TRet> GetIpcProvider<T1, TRet>(string name)
Returns
Dalamud.Plugin.Ipc.ICallGateProvider<TRet>
Parameters
| Type | Name |
|---|---|
System.String | name |
Type Parameters
T1TRet
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.
ICallGateProvider<T1, T2, TRet> GetIpcProvider<T1, T2, TRet>(string name)
Returns
Dalamud.Plugin.Ipc.ICallGateProvider<TRet>
Parameters
| Type | Name |
|---|---|
System.String | name |
Type Parameters
T1T2TRet
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.
ICallGateProvider<T1, T2, T3, TRet> GetIpcProvider<T1, T2, T3, TRet>(string name)
Returns
Dalamud.Plugin.Ipc.ICallGateProvider<TRet>
Parameters
| Type | Name |
|---|---|
System.String | name |
Type Parameters
T1T2T3TRet
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.
ICallGateProvider<T1, T2, T3, T4, TRet> GetIpcProvider<T1, T2, T3, T4, TRet>(string name)
Returns
Dalamud.Plugin.Ipc.ICallGateProvider<TRet>
Parameters
| Type | Name |
|---|---|
System.String | name |
Type Parameters
T1T2T3T4TRet
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.
ICallGateProvider<T1, T2, T3, T4, T5, TRet> GetIpcProvider<T1, T2, T3, T4, T5, TRet>(string name)
Returns
Dalamud.Plugin.Ipc.ICallGateProvider<TRet>
Parameters
| Type | Name |
|---|---|
System.String | name |
Type Parameters
T1T2T3T4T5TRet
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.
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
| Type | Name |
|---|---|
System.String | name |
Type Parameters
T1T2T3T4T5T6TRet
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.
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
| Type | Name |
|---|---|
System.String | name |
Type Parameters
T1T2T3T4T5T6T7TRet
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.
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
| Type | Name |
|---|---|
System.String | name |
Type Parameters
T1T2T3T4T5T6T7T8TRet
GetIpcSubscriber<TRet>(string)
Gets an IPC subscriber.
ICallGateSubscriber<TRet> GetIpcSubscriber<TRet>(string name)
Returns
Dalamud.Plugin.Ipc.ICallGateSubscriber<TRet>: An IPC subscriber.
Parameters
| Type | Name | Description |
|---|---|---|
System.String | name | The name of the IPC registration. |
Type Parameters
| Name | Description |
|---|---|
TRet | The return type for funcs. Use object if this is unused. |
GetIpcSubscriber<T1, TRet>(string)
This class facilitates inter-plugin communication.
ICallGateSubscriber<T1, TRet> GetIpcSubscriber<T1, TRet>(string name)
Returns
Dalamud.Plugin.Ipc.ICallGateSubscriber<TRet>
Parameters
| Type | Name |
|---|---|
System.String | name |
Type Parameters
T1TRet
GetIpcSubscriber<T1, T2, TRet>(string)
This class facilitates inter-plugin communication.
ICallGateSubscriber<T1, T2, TRet> GetIpcSubscriber<T1, T2, TRet>(string name)
Returns
Dalamud.Plugin.Ipc.ICallGateSubscriber<TRet>
Parameters
| Type | Name |
|---|---|
System.String | name |
Type Parameters
T1T2TRet
GetIpcSubscriber<T1, T2, T3, TRet>(string)
This class facilitates inter-plugin communication.
ICallGateSubscriber<T1, T2, T3, TRet> GetIpcSubscriber<T1, T2, T3, TRet>(string name)
Returns
Dalamud.Plugin.Ipc.ICallGateSubscriber<TRet>
Parameters
| Type | Name |
|---|---|
System.String | name |
Type Parameters
T1T2T3TRet
GetIpcSubscriber<T1, T2, T3, T4, TRet>(string)
This class facilitates inter-plugin communication.
ICallGateSubscriber<T1, T2, T3, T4, TRet> GetIpcSubscriber<T1, T2, T3, T4, TRet>(string name)
Returns
Dalamud.Plugin.Ipc.ICallGateSubscriber<TRet>
Parameters
| Type | Name |
|---|---|
System.String | name |
Type Parameters
T1T2T3T4TRet
GetIpcSubscriber<T1, T2, T3, T4, T5, TRet>(string)
This class facilitates inter-plugin communication.
ICallGateSubscriber<T1, T2, T3, T4, T5, TRet> GetIpcSubscriber<T1, T2, T3, T4, T5, TRet>(string name)
Returns
Dalamud.Plugin.Ipc.ICallGateSubscriber<TRet>
Parameters
| Type | Name |
|---|---|
System.String | name |
Type Parameters
T1T2T3T4T5TRet
GetIpcSubscriber<T1, T2, T3, T4, T5, T6, TRet>(string)
This class facilitates inter-plugin communication.
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
| Type | Name |
|---|---|
System.String | name |
Type Parameters
T1T2T3T4T5T6TRet
GetIpcSubscriber<T1, T2, T3, T4, T5, T6, T7, TRet>(string)
This class facilitates inter-plugin communication.
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
| Type | Name |
|---|---|
System.String | name |
Type Parameters
T1T2T3T4T5T6T7TRet
GetIpcSubscriber<T1, T2, T3, T4, T5, T6, T7, T8, TRet>(string)
This class facilitates inter-plugin communication.
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>