Class DalamudPluginInterface
This class acts as an interface to various objects needed to interact with Dalamud and the game.
Inheritance
Implements
Inherited Members
Namespace: Dalamud.Plugin
Assembly: Dalamud.dll
Syntax
public class DalamudPluginInterface : IDisposable
Properties
| Improve this Doc View SourceClientState
Gets the ClientState object that allows you to access current client memory information like actors, territories, etc.
Declaration
public ClientState ClientState { get; }
Property Value
| Type | Description |
|---|---|
| ClientState |
CommandManager
Gets the CommandManager object that allows you to add and remove custom chat commands.
Declaration
public CommandManager CommandManager { get; }
Property Value
| Type | Description |
|---|---|
| CommandManager |
ConfigDirectory
Gets the directory your plugin configurations are stored in.
Declaration
public DirectoryInfo ConfigDirectory { get; }
Property Value
| Type | Description |
|---|---|
| System.IO.DirectoryInfo |
ConfigFile
Gets the config file of your plugin.
Declaration
public FileInfo ConfigFile { get; }
Property Value
| Type | Description |
|---|---|
| System.IO.FileInfo |
DalamudAssetDirectory
Gets the directory Dalamud assets are stored in.
Declaration
public DirectoryInfo DalamudAssetDirectory { get; }
Property Value
| Type | Description |
|---|---|
| System.IO.DirectoryInfo |
Data
Gets the DataManager instance which allows you to access game data needed by the main dalamud features.
Declaration
public DataManager Data { get; }
Property Value
| Type | Description |
|---|---|
| DataManager |
Framework
Gets the Framework object that allows you to interact with the client.
Declaration
public Framework Framework { get; }
Property Value
| Type | Description |
|---|---|
| Framework |
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 |
Reason
Gets the reason this plugin was loaded.
Declaration
public PluginLoadReason Reason { get; }
Property Value
| Type | Description |
|---|---|
| PluginLoadReason |
Sanitizer
Gets serializer class with functions to remove special characters from strings.
Declaration
public ISanitizer Sanitizer { get; }
Property Value
| Type | Description |
|---|---|
| ISanitizer |
SeStringManager
Gets the SeStringManager instance which allows creating and parsing SeString payloads.
Declaration
public SeStringManager SeStringManager { get; }
Property Value
| Type | Description |
|---|---|
| SeStringManager |
TargetModuleScanner
Gets the SigScanner instance targeting the main module of the FFXIV process.
Declaration
public SigScanner TargetModuleScanner { get; }
Property Value
| Type | Description |
|---|---|
| SigScanner |
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 |
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 SourceAddChatLinkHandler(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. |
Dispose()
Unregister your plugin and dispose all references. You have to call this when your IDalamudPlugin is disposed.
Declaration
public void Dispose()
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. |
GetPluginConfigDirectory()
Get the config directory.
Declaration
public string GetPluginConfigDirectory()
Returns
| Type | Description |
|---|---|
| System.String | directory with path of AppData/XIVLauncher/pluginConfig/PluginInternalName. |
GetPluginLocDirectory()
Get the loc directory.
Declaration
public string GetPluginLocDirectory()
Returns
| Type | Description |
|---|---|
| System.String | directory with path of AppData/XIVLauncher/pluginConfig/PluginInternalName/loc. |
Log(String, Object[])
Log a templated message to the in-game debug log.
Declaration
[Obsolete]
public void Log(string messageTemplate, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | messageTemplate | The message template. |
| System.Object[] | values | Values to log. |
LogError(Exception, String, Object[])
Log a templated error message to the in-game debug log.
Declaration
[Obsolete]
public void LogError(Exception exception, string messageTemplate, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Exception | exception | The exception that caused the error. |
| System.String | messageTemplate | The message template. |
| System.Object[] | values | Values to log. |
LogError(String, Object[])
Log a templated error message to the in-game debug log.
Declaration
[Obsolete]
public void LogError(string messageTemplate, params object[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | messageTemplate | The message template. |
| System.Object[] | values | Values to log. |
RemoveChatLinkHandler()
Removes all chat link handlers registered by the plugin.
Declaration
public void RemoveChatLinkHandler()
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. |
SavePluginConfig(IPluginConfiguration)
Save a plugin configuration(inheriting IPluginConfiguration).
Declaration
public void SavePluginConfig(IPluginConfiguration currentConfig)
Parameters
| Type | Name | Description |
|---|---|---|
| IPluginConfiguration | currentConfig | The current configuration. |
SendMessage(ExpandoObject)
Send a message to all subscribed plugins.
Declaration
[Obsolete("The current IPC mechanism is obsolete and scheduled to be replaced after API level 3.")]
public void SendMessage(ExpandoObject message)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Dynamic.ExpandoObject | message | The message to send. |
SendMessage(String, ExpandoObject)
Send a message to a specific plugin.
Declaration
[Obsolete("The current IPC mechanism is obsolete and scheduled to be replaced after API level 3.")]
public bool SendMessage(string pluginName, ExpandoObject message)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | pluginName | The InternalName of the plugin to send the message to. |
| System.Dynamic.ExpandoObject | message | The message to send. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the corresponding plugin was present and received the message. |
Subscribe(String, Action<ExpandoObject>)
Subscribe to an IPC message by a plugin.
Declaration
[Obsolete("The current IPC mechanism is obsolete and scheduled to be replaced after API level 3.")]
public void Subscribe(string pluginName, Action<ExpandoObject> action)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | pluginName | The InternalName of the plugin to subscribe to. |
| System.Action<System.Dynamic.ExpandoObject> | action | The action to take when a message was received. |
SubscribeAny(Action<String, ExpandoObject>)
Subscribe to an IPC message by any plugin.
Declaration
[Obsolete("The current IPC mechanism is obsolete and scheduled to be replaced after API level 3.")]
public void SubscribeAny(Action<string, ExpandoObject> action)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Action<System.String, System.Dynamic.ExpandoObject> | action | The action to take when a message was received. |
Unsubscribe(String)
Unsubscribe from messages from a plugin.
Declaration
[Obsolete("The current IPC mechanism is obsolete and scheduled to be replaced after API level 3.")]
public void Unsubscribe(string pluginName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | pluginName | The InternalName of the plugin to unsubscribe from. |
UnsubscribeAny()
Unsubscribe from messages from any plugin.
Declaration
[Obsolete("The current IPC mechanism is obsolete and scheduled to be replaced after API level 3.")]
public void UnsubscribeAny()
Events
| Improve this Doc View SourceOnLanguageChanged
Event that gets fired when loc is changed
Declaration
public event DalamudPluginInterface.LanguageChangedDelegate OnLanguageChanged
Event Type
| Type | Description |
|---|---|
| DalamudPluginInterface.LanguageChangedDelegate |