From 9a259100b4fbffc28455c18819f83e736d497905 Mon Sep 17 00:00:00 2001 From: MidoriKami <9083275+MidoriKami@users.noreply.github.com> Date: Thu, 25 Jul 2024 17:02:29 -0400 Subject: [PATCH] Better AddonLifecycle AddonEvent docs (#1964) Co-authored-by: Kaz Wolfe Co-authored-by: Haselnussbomber --- Dalamud/Game/Addon/Lifecycle/AddonEvent.cs | 81 +++++++++++++++++----- 1 file changed, 65 insertions(+), 16 deletions(-) diff --git a/Dalamud/Game/Addon/Lifecycle/AddonEvent.cs b/Dalamud/Game/Addon/Lifecycle/AddonEvent.cs index 7cbc93eb2..91b9dd51f 100644 --- a/Dalamud/Game/Addon/Lifecycle/AddonEvent.cs +++ b/Dalamud/Game/Addon/Lifecycle/AddonEvent.cs @@ -1,4 +1,8 @@ -namespace Dalamud.Game.Addon.Lifecycle; +using Dalamud.Game.Addon.Lifecycle.AddonArgTypes; + +using FFXIVClientStructs.FFXIV.Component.GUI; + +namespace Dalamud.Game.Addon.Lifecycle; /// /// Enumeration for available AddonLifecycle events. @@ -6,67 +10,112 @@ public enum AddonEvent { /// - /// Event that is fired before an addon begins it's setup process. + /// An event that is fired prior to an addon being setup with its implementation of + /// . This event is useful for modifying the initial data contained within + /// prior to the addon being created. /// + /// PreSetup, - + /// - /// Event that is fired after an addon has completed it's setup process. + /// An event that is fired after an addon has finished its initial setup. This event is particularly useful for + /// developers seeking to add custom elements to now-initialized and populated node lists, as well as reading data + /// placed in the AtkValues by the game during the setup process. + /// See for more information. /// PostSetup, /// - /// Event that is fired before an addon begins update. + /// An event that is fired before an addon begins its update cycle via . This event + /// is fired every frame that an addon is loaded, regardless of visibility. /// + /// PreUpdate, /// - /// Event that is fired after an addon has completed update. + /// An event that is fired after an addon has finished its update. + /// See for more information. /// PostUpdate, /// - /// Event that is fired before an addon begins draw. + /// An event that is fired before an addon begins drawing to screen via . Unlike + /// , this event is only fired if an addon is visible or otherwise drawing to screen. /// + /// PreDraw, /// - /// Event that is fired after an addon has completed draw. + /// An event that is fired after an addon has finished its draw to screen. + /// See for more information. /// PostDraw, /// - /// Event that is fired before an addon is finalized. + /// An event that is fired immediately before an addon is finalized via and + /// destroyed. After this event, the addon will destruct its UI node data as well as free any allocated memory. + /// This event can be used for cleanup and tracking tasks. /// + /// + /// This event is NOT fired when the addon is being hidden, but tends to be fired when it's being properly + /// closed. + ///
+ /// As this is part of the destruction process for an addon, this event does not have an associated Post event. + ///
+ /// PreFinalize, /// - /// Event that is fired before an addon begins a requested update. + /// An event that is fired before a call to is made in response to a + /// change in the subscribed or + /// backing this addon. This generally occurs in response to + /// receiving data from the game server, but can happen in other cases as well. This event is useful for modifying + /// the data received before it's passed to the UI for display. Contrast to which tends to + /// be in response to client-driven interactions. /// + /// + /// + /// + /// A developer would use this event to intercept free company information after it's received from the server, but + /// before it's displayed to the user. This would allow the developer to add user-driven notes or other information + /// to the Free Company's overview. + /// PreRequestedUpdate, /// - /// Event that is fired after an addon finishes a requested update. + /// An event that is fired after an addon has finished processing an ArrayData update. + /// See for more information. /// PostRequestedUpdate, /// - /// Event that is fired before an addon begins a refresh. - /// + /// An event that is fired before an addon calls its method. Refreshes are + /// generally triggered in response to certain user interactions such as changing tabs, and are primarily used to + /// update the AtkValues present in this addon. Contrast to which is called + /// in response to ArrayData updates.
+ /// + /// PreRefresh, /// - /// Event that is fired after an addon has finished a refresh. + /// An event that is fired after an addon has finished its refresh. + /// See for more information. /// PostRefresh, /// - /// Event that is fired before an addon begins processing an event. + /// An event that is fired before an addon begins processing a user-driven event via + /// , such as mousing over an element or clicking a button. This event + /// is only valid for addons that actually override the ReceiveEvent method of the underlying + /// AtkEventListener. /// + /// + /// PreReceiveEvent, /// - /// Event that is fired after an addon has processed an event. + /// An event that is fired after an addon finishes calling its method. + /// See for more information. /// PostReceiveEvent, }