Interface IAddonLifecycle
This class provides events for in-game addon lifecycles.
Assembly: Dalamud.dll
public interface IAddonLifecycle : IDalamudService
Methods
RegisterListener(AddonEvent, IEnumerable<string>, AddonEventDelegate)
Register a listener that will trigger on the specified event and any of the specified addons.
void RegisterListener(AddonEvent eventType, IEnumerable<string> addonNames, IAddonLifecycle.AddonEventDelegate handler)
Parameters
| Type | Name | Description |
|---|---|---|
| Dalamud.Game.Addon.Lifecycle.AddonEvent | eventType | Event type to trigger on. |
System.Collections.Generic.IEnumerable<System.String> | addonNames | Addon names that will trigger the handler to be invoked. |
| Dalamud.Plugin.Services.IAddonLifecycle.AddonEventDelegate | handler | The handler to invoke. |
RegisterListener(AddonEvent, string, AddonEventDelegate)
Register a listener that will trigger on the specified event only for the specified addon.
void RegisterListener(AddonEvent eventType, string addonName, IAddonLifecycle.AddonEventDelegate handler)
Parameters
| Type | Name | Description |
|---|---|---|
| Dalamud.Game.Addon.Lifecycle.AddonEvent | eventType | Event type to trigger on. |
System.String | addonName | The addon name that will trigger the handler to be invoked. |
| Dalamud.Plugin.Services.IAddonLifecycle.AddonEventDelegate | handler | The handler to invoke. |
RegisterListener(AddonEvent, AddonEventDelegate)
Register a listener that will trigger on the specified event for any addon.
void RegisterListener(AddonEvent eventType, IAddonLifecycle.AddonEventDelegate handler)
Parameters
| Type | Name | Description |
|---|---|---|
| Dalamud.Game.Addon.Lifecycle.AddonEvent | eventType | Event type to trigger on. |
| Dalamud.Plugin.Services.IAddonLifecycle.AddonEventDelegate | handler | The handler to invoke. |
UnregisterListener(AddonEvent, IEnumerable<string>, AddonEventDelegate)
Unregister listener from specified event type and specified addon names.
void UnregisterListener(AddonEvent eventType, IEnumerable<string> addonNames, IAddonLifecycle.AddonEventDelegate handler)
Parameters
| Type | Name | Description |
|---|---|---|
| Dalamud.Game.Addon.Lifecycle.AddonEvent | eventType | Event type to deregister. |
System.Collections.Generic.IEnumerable<System.String> | addonNames | Addon names to deregister. |
| Dalamud.Plugin.Services.IAddonLifecycle.AddonEventDelegate | handler | Optional specific handler to remove. |
Remarks
If a specific handler is not provided, all handlers for the event type and addon names will be unregistered.
UnregisterListener(AddonEvent, string, AddonEventDelegate)
Unregister all listeners for the specified event type and addon name.
void UnregisterListener(AddonEvent eventType, string addonName, IAddonLifecycle.AddonEventDelegate handler)
Parameters
| Type | Name | Description |
|---|---|---|
| Dalamud.Game.Addon.Lifecycle.AddonEvent | eventType | Event type to deregister. |
System.String | addonName | Addon name to deregister. |
| Dalamud.Plugin.Services.IAddonLifecycle.AddonEventDelegate | handler | Optional specific handler to remove. |
Remarks
If a specific handler is not provided, all handlers for the event type and addons will be unregistered.
UnregisterListener(AddonEvent, AddonEventDelegate)
Unregister an event type handler.
This will only remove a handler that is added via Dalamud.Plugin.Services.IAddonLifecycle.RegisterListener(Dalamud.Game.Addon.Lifecycle.AddonEvent,Dalamud.Plugin.Services.IAddonLifecycle.AddonEventDelegate).
void UnregisterListener(AddonEvent eventType, IAddonLifecycle.AddonEventDelegate handler)
Parameters
| Type | Name | Description |
|---|---|---|
| Dalamud.Game.Addon.Lifecycle.AddonEvent | eventType | Event type to deregister. |
| Dalamud.Plugin.Services.IAddonLifecycle.AddonEventDelegate | handler | Optional specific handler to remove. |
Remarks
If a specific handler is not provided, all handlers for the event type and addons will be unregistered.
UnregisterListener(params AddonEventDelegate[])
Unregister all events that use the specified handlers.
void UnregisterListener(params IAddonLifecycle.AddonEventDelegate[] handlers)
Parameters
| Type | Name | Description |
|---|---|---|
Dalamud.Plugin.Services.IAddonLifecycle.AddonEventDelegate[] | handlers | Handlers to remove. |
GetOriginalVirtualTable(nint)
Resolves an addons virtual table address back to the original unmodified table address.
nint GetOriginalVirtualTable(nint virtualTableAddress)
Returns
System.IntPtr: The address of the addons original virtual table.
Parameters
| Type | Name | Description |
|---|---|---|
System.IntPtr | virtualTableAddress | The address of a modified addons virtual table. |