[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

@ -81,7 +81,7 @@ public unsafe partial class AddonTree : IDisposable
{
var ptr = GameGui.GetAddonByName(name);
if ((AtkUnitBase*)ptr != null)
if (!ptr.IsNull)
{
if (AddonTrees.TryGetValue(name, out var tree))
{
@ -152,7 +152,7 @@ public unsafe partial class AddonTree : IDisposable
var uldManager = addon->UldManager;
PrintFieldValuePair("Address", $"{(nint)addon:X}");
PrintFieldValuePair("Agent", $"{GameGui.FindAgentInterface(addon):X}");
PrintFieldValuePair("Agent", $"{(nint)GameGui.FindAgentInterface(addon):X}");
PrintFieldValuePairs(
("X", $"{addon->X}"),
@ -234,7 +234,7 @@ public unsafe partial class AddonTree : IDisposable
/// <returns>true if the addon is found.</returns>
private bool ValidateAddon(out AtkUnitBase* addon)
{
addon = (AtkUnitBase*)GameGui.GetAddonByName(this.AddonName);
addon = GameGui.GetAddonByName(this.AddonName).Struct;
if (addon == null || (nint)addon != this.InitialPtr)
{
this.Dispose();