Interface IDalamudPluginInterface
This interface acts as an interface to various objects needed to interact with Dalamud and the game.
Assembly: Dalamud.dll
View Source
public interface IDalamudPluginInterface
Properties
Reason
Gets the reason this plugin was loaded.
View Source
PluginLoadReason Reason { get; }
IsAutoUpdateComplete
Gets a value indicating whether or not auto-updates have already completed this session.
View Source
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
string SourceRepository { get; }
InternalName
Gets the current internal plugin name.
View Source
string InternalName { get; }
Manifest
Gets the plugin's manifest.
View Source
IPluginManifest Manifest { get; }
IsDev
Gets a value indicating whether this is a dev plugin.
View Source
bool IsDev { get; }
IsTesting
Gets a value indicating whether this is a testing release of a plugin.
View Source
bool IsTesting { get; }
LoadTime
Gets the time that this plugin was loaded.
View Source
DateTime LoadTime { get; }
LoadTimeUTC
Gets the UTC time that this plugin was loaded.
View Source
DateTime LoadTimeUTC { get; }
LoadTimeDelta
Gets the timespan delta from when this plugin was loaded.
View Source
TimeSpan LoadTimeDelta { get; }
DalamudAssetDirectory
Gets the directory Dalamud assets are stored in.
View Source
DirectoryInfo DalamudAssetDirectory { get; }
AssemblyLocation
Gets the location of your plugin assembly.
View Source
FileInfo AssemblyLocation { get; }
ConfigDirectory
Gets the directory your plugin configurations are stored in.
View Source
DirectoryInfo ConfigDirectory { get; }
ConfigFile
Gets the config file of your plugin.
View Source
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
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
bool IsDevMenuOpen { get; }
IsDebugging
Gets a value indicating whether a debugger is attached.
View Source
bool IsDebugging { get; }
UiLanguage
Gets the current UI language in two-letter iso format.
View Source
string UiLanguage { get; }
Sanitizer
Gets serializer class with functions to remove special characters from strings.
View Source
ISanitizer Sanitizer { get; }
GeneralChatType
Gets the chat type used by default for plugin messages.
View Source
XivChatType GeneralChatType { get; }
InstalledPlugins
Gets a list of installed plugins along with their current state.
View Source
IEnumerable<IExposedPlugin> InstalledPlugins { get; }
Methods
OpenPluginInstallerTo(PluginInstallerOpenKind, string?)
Opens the Dalamud.Interface.Internal.Windows.PluginInstaller.PluginInstallerWindow
, with an optional search term.
View Source
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.
View Source
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.
View Source
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
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.
View Source
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.
View Source
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.
View Source
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.
View Source
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.
View Source
ICallGateProvider<T1, TRet> GetIpcProvider<T1, TRet>(string name)
Returns
Dalamud.Plugin.Ipc.ICallGateProvider<TRet>
Parameters
Type | Name |
---|---|
System.String | name |
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.
View Source
ICallGateProvider<T1, T2, TRet> GetIpcProvider<T1, T2, TRet>(string name)
Returns
Dalamud.Plugin.Ipc.ICallGateProvider<TRet>
Parameters
Type | Name |
---|---|
System.String | name |
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.
View Source
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
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.
View Source
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
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.
View Source
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
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.
View Source
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
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.
View Source
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
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.
View Source
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
T1
T2
T3
T4
T5
T6
T7
T8
TRet
GetIpcSubscriber<TRet>(string)
Gets an IPC subscriber.
View Source
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.
View Source
ICallGateSubscriber<T1, TRet> GetIpcSubscriber<T1, TRet>(string name)
Returns
Dalamud.Plugin.Ipc.ICallGateSubscriber<TRet>
Parameters
Type | Name |
---|---|
System.String | name |
Type Parameters
T1
TRet
GetIpcSubscriber<T1, T2, TRet>(string)
This class facilitates inter-plugin communication.
View Source
ICallGateSubscriber<T1, T2, TRet> GetIpcSubscriber<T1, T2, TRet>(string name)