[Api13] Add native wrapper structs (#2330)

This commit is contained in:
Haselnussbomber 2025-08-04 02:43:52 +02:00 committed by GitHub
parent b425ee0a2a
commit 57c6089fc1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 682 additions and 149 deletions

View file

@ -1,6 +1,7 @@
using System.Numerics;
using System.Numerics;
using Dalamud.Game.Gui;
using Dalamud.Game.NativeWrapper;
using Dalamud.Game.Text.SeStringHandling.Payloads;
namespace Dalamud.Plugin.Services;
@ -75,37 +76,37 @@ public unsafe interface IGameGui
public bool ScreenToWorld(Vector2 screenPos, out Vector3 worldPos, float rayDistance = 100000.0f);
/// <summary>
/// Gets a pointer to the game's UI module.
/// Gets a pointer to the game's UIModule instance.
/// </summary>
/// <returns>IntPtr pointing to UI module.</returns>
public nint GetUIModule();
/// <returns>A pointer wrapper to UIModule.</returns>
public UIModulePtr GetUIModule();
/// <summary>
/// Gets the pointer to the Addon with the given name and index.
/// </summary>
/// <param name="name">Name of addon to find.</param>
/// <param name="index">Index of addon to find (1-indexed).</param>
/// <returns>nint.Zero if unable to find UI, otherwise nint pointing to the start of the addon.</returns>
public nint GetAddonByName(string name, int index = 1);
/// <returns>A pointer wrapper to the addon.</returns>
public AtkUnitBasePtr GetAddonByName(string name, int index = 1);
/// <summary>
/// Find the agent associated with an addon, if possible.
/// </summary>
/// <param name="id">The agent id.</param>
/// <returns>A pointer wrapper to the agent interface.</returns>
public AgentInterfacePtr GetAgentById(int id);
/// <summary>
/// Find the agent associated with an addon, if possible.
/// </summary>
/// <param name="addonName">The addon name.</param>
/// <returns>A pointer to the agent interface.</returns>
public nint FindAgentInterface(string addonName);
/// <returns>A pointer wrapper to the agent interface.</returns>
public AgentInterfacePtr FindAgentInterface(string addonName);
/// <summary>
/// Find the agent associated with an addon, if possible.
/// </summary>
/// <param name="addon">The addon address.</param>
/// <returns>A pointer to the agent interface.</returns>
public nint FindAgentInterface(void* addon);
/// <summary>
/// Find the agent associated with an addon, if possible.
/// </summary>
/// <param name="addonPtr">The addon address.</param>
/// <returns>A pointer to the agent interface.</returns>
public IntPtr FindAgentInterface(IntPtr addonPtr);
/// <returns>A pointer wrapper to the agent interface.</returns>
public AgentInterfacePtr FindAgentInterface(AtkUnitBasePtr addon);
}