Skip to main content
Version: 15.x (API 15) [Current]

Interface IAddonLifecycle

This class provides events for in-game addon lifecycles.

Assembly: Dalamud.dll​
Declaration
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.

Declaration
void RegisterListener(AddonEvent eventType, IEnumerable<string> addonNames, IAddonLifecycle.AddonEventDelegate handler)
Parameters​
TypeNameDescription
Dalamud.Game.Addon.Lifecycle.AddonEventeventTypeEvent type to trigger on.
System.Collections.Generic.IEnumerable<System.String>addonNamesAddon names that will trigger the handler to be invoked.
Dalamud.Plugin.Services.IAddonLifecycle.AddonEventDelegatehandlerThe handler to invoke.

RegisterListener(AddonEvent, string, AddonEventDelegate)​

Register a listener that will trigger on the specified event only for the specified addon.

Declaration
void RegisterListener(AddonEvent eventType, string addonName, IAddonLifecycle.AddonEventDelegate handler)
Parameters​
TypeNameDescription
Dalamud.Game.Addon.Lifecycle.AddonEventeventTypeEvent type to trigger on.
System.StringaddonNameThe addon name that will trigger the handler to be invoked.
Dalamud.Plugin.Services.IAddonLifecycle.AddonEventDelegatehandlerThe handler to invoke.

RegisterListener(AddonEvent, AddonEventDelegate)​

Register a listener that will trigger on the specified event for any addon.

Declaration
void RegisterListener(AddonEvent eventType, IAddonLifecycle.AddonEventDelegate handler)
Parameters​
TypeNameDescription
Dalamud.Game.Addon.Lifecycle.AddonEventeventTypeEvent type to trigger on.
Dalamud.Plugin.Services.IAddonLifecycle.AddonEventDelegatehandlerThe handler to invoke.

UnregisterListener(AddonEvent, IEnumerable<string>, AddonEventDelegate)​

Unregister listener from specified event type and specified addon names.

Declaration
void UnregisterListener(AddonEvent eventType, IEnumerable<string> addonNames, IAddonLifecycle.AddonEventDelegate handler)
Parameters​
TypeNameDescription
Dalamud.Game.Addon.Lifecycle.AddonEventeventTypeEvent type to deregister.
System.Collections.Generic.IEnumerable<System.String>addonNamesAddon names to deregister.
Dalamud.Plugin.Services.IAddonLifecycle.AddonEventDelegatehandlerOptional 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.

Declaration
void UnregisterListener(AddonEvent eventType, string addonName, IAddonLifecycle.AddonEventDelegate handler)
Parameters​
TypeNameDescription
Dalamud.Game.Addon.Lifecycle.AddonEventeventTypeEvent type to deregister.
System.StringaddonNameAddon name to deregister.
Dalamud.Plugin.Services.IAddonLifecycle.AddonEventDelegatehandlerOptional 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).

Declaration
void UnregisterListener(AddonEvent eventType, IAddonLifecycle.AddonEventDelegate handler)
Parameters​
TypeNameDescription
Dalamud.Game.Addon.Lifecycle.AddonEventeventTypeEvent type to deregister.
Dalamud.Plugin.Services.IAddonLifecycle.AddonEventDelegatehandlerOptional 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.

Declaration
void UnregisterListener(params IAddonLifecycle.AddonEventDelegate[] handlers)
Parameters​
TypeNameDescription
Dalamud.Plugin.Services.IAddonLifecycle.AddonEventDelegate[]handlersHandlers to remove.

GetOriginalVirtualTable(nint)​

Resolves an addons virtual table address back to the original unmodified table address.

Declaration
nint GetOriginalVirtualTable(nint virtualTableAddress)
Returns​

System.IntPtr: The address of the addons original virtual table.

Parameters​
TypeNameDescription
System.IntPtrvirtualTableAddressThe address of a modified addons virtual table.