Move AddonArgs to it's own file

This commit is contained in:
MidoriKami 2023-09-10 19:26:28 -07:00
parent c9a5c7c4c5
commit ca58a1bf4f
3 changed files with 34 additions and 32 deletions

View file

@ -2,8 +2,6 @@
using System.Runtime.InteropServices;
using Dalamud.Game.AddonLifecycle;
using Dalamud.Memory;
using FFXIVClientStructs.FFXIV.Component.GUI;
namespace Dalamud.Plugin.Services;
@ -79,22 +77,4 @@ public interface IAddonLifecycle
/// </summary>
/// <param name="handlers">Handlers to remove.</param>
void UnregisterListener(params AddonEventDelegate[] handlers);
/// <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; }
}
}