22 lines
624 B
C#
22 lines
624 B
C#
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
|
|
using FFXIVClientStructs.FFXIV.Component.GUI;
|
|
|
|
namespace LLib.GameUI;
|
|
|
|
public static class AgentHelper
|
|
{
|
|
public unsafe static void SendEvent(AgentInterface* agent, ulong eventId, params int[] args)
|
|
{
|
|
if (agent != null)
|
|
{
|
|
AtkValue* ptr = stackalloc AtkValue[(args.Length == 0) ? 1 : args.Length];
|
|
for (int i = 0; i < args.Length; i++)
|
|
{
|
|
ptr[i].Type = AtkValueType.Int;
|
|
ptr[i].Int = args[i];
|
|
}
|
|
AtkValue* returnValue = stackalloc AtkValue[1];
|
|
agent->ReceiveEvent(returnValue, (args.Length == 0) ? null : ptr, (uint)args.Length, eventId);
|
|
}
|
|
}
|
|
}
|