-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1370 from MidoriKami/AddonLifecycle_Enhancements
- Loading branch information
Showing
9 changed files
with
683 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Dalamud.Memory; | ||
using FFXIVClientStructs.FFXIV.Component.GUI; | ||
|
||
namespace Dalamud.Game.AddonLifecycle; | ||
|
||
/// <summary> | ||
/// Addon argument data for use in event subscribers. | ||
/// </summary> | ||
public unsafe class AddonArgs | ||
{ | ||
private string? addonName; | ||
|
||
/// <summary> | ||
/// Gets the name of the addon this args referrers to. | ||
/// </summary> | ||
public string AddonName => this.Addon == nint.Zero ? "NullAddon" : this.addonName ??= MemoryHelper.ReadString((nint)((AtkUnitBase*)this.Addon)->Name, 0x20); | ||
|
||
/// <summary> | ||
/// Gets the pointer to the addons AtkUnitBase. | ||
/// </summary> | ||
required public nint Addon { get; init; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
namespace Dalamud.Game.AddonLifecycle; | ||
|
||
/// <summary> | ||
/// Enumeration for available AddonLifecycle events. | ||
/// </summary> | ||
public enum AddonEvent | ||
{ | ||
/// <summary> | ||
/// Event that is fired before an addon begins it's setup process. | ||
/// </summary> | ||
PreSetup, | ||
|
||
/// <summary> | ||
/// Event that is fired after an addon has completed it's setup process. | ||
/// </summary> | ||
PostSetup, | ||
|
||
/// <summary> | ||
/// Event that is fired before an addon begins update. | ||
/// </summary> | ||
PreUpdate, | ||
|
||
/// <summary> | ||
/// Event that is fired after an addon has completed update. | ||
/// </summary> | ||
PostUpdate, | ||
|
||
/// <summary> | ||
/// Event that is fired before an addon begins draw. | ||
/// </summary> | ||
PreDraw, | ||
|
||
/// <summary> | ||
/// Event that is fired after an addon has completed draw. | ||
/// </summary> | ||
PostDraw, | ||
|
||
/// <summary> | ||
/// Event that is fired before an addon is finalized. | ||
/// </summary> | ||
PreFinalize, | ||
|
||
/// <summary> | ||
/// Event that is fired before an addon begins a requested update. | ||
/// </summary> | ||
PreRequestedUpdate, | ||
|
||
/// <summary> | ||
/// Event that is fired after an addon finishes a requested update. | ||
/// </summary> | ||
PostRequestedUpdate, | ||
|
||
/// <summary> | ||
/// Event that is fired before an addon begins a refresh. | ||
/// </summary> | ||
PreRefresh, | ||
|
||
/// <summary> | ||
/// Event that is fired after an addon has finished a refresh. | ||
/// </summary> | ||
PostRefresh, | ||
} |
Oops, something went wrong.