[apiX] first pass update for new clientstructs (#1818)

* first pass update for new clientstructs

* track latest clientstructs & fix compilation errors

* fix GameInventory hook bug
rename Appartment
This commit is contained in:
aers 2024-05-31 09:09:28 -07:00 committed by GitHub
parent 666eab98bd
commit d823db7930
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
36 changed files with 126 additions and 93 deletions

View file

@ -42,6 +42,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dalamud.Common", "Dalamud.C
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dalamud.LocExporter", "tools\Dalamud.LocExporter\Dalamud.LocExporter.csproj", "{A568929D-6FF6-4DFA-9D14-5D7DC08FA5E0}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dalamud.LocExporter", "tools\Dalamud.LocExporter\Dalamud.LocExporter.csproj", "{A568929D-6FF6-4DFA-9D14-5D7DC08FA5E0}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InteropGenerator", "lib\FFXIVClientStructs\InteropGenerator\InteropGenerator.csproj", "{3620414C-7DFC-423E-929F-310E19F5D930}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InteropGenerator.Runtime", "lib\FFXIVClientStructs\InteropGenerator.Runtime\InteropGenerator.Runtime.csproj", "{A6AA1C3F-9470-4922-9D3F-D4549657AB22}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -108,6 +112,14 @@ Global
{A568929D-6FF6-4DFA-9D14-5D7DC08FA5E0}.Debug|Any CPU.Build.0 = Debug|Any CPU {A568929D-6FF6-4DFA-9D14-5D7DC08FA5E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A568929D-6FF6-4DFA-9D14-5D7DC08FA5E0}.Release|Any CPU.ActiveCfg = Release|Any CPU {A568929D-6FF6-4DFA-9D14-5D7DC08FA5E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A568929D-6FF6-4DFA-9D14-5D7DC08FA5E0}.Release|Any CPU.Build.0 = Release|Any CPU {A568929D-6FF6-4DFA-9D14-5D7DC08FA5E0}.Release|Any CPU.Build.0 = Release|Any CPU
{3620414C-7DFC-423E-929F-310E19F5D930}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3620414C-7DFC-423E-929F-310E19F5D930}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3620414C-7DFC-423E-929F-310E19F5D930}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3620414C-7DFC-423E-929F-310E19F5D930}.Release|Any CPU.Build.0 = Release|Any CPU
{A6AA1C3F-9470-4922-9D3F-D4549657AB22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A6AA1C3F-9470-4922-9D3F-D4549657AB22}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A6AA1C3F-9470-4922-9D3F-D4549657AB22}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A6AA1C3F-9470-4922-9D3F-D4549657AB22}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -118,6 +130,8 @@ Global
{2F7FF0A8-B619-4572-86C7-71E46FE22FB8} = {E15BDA6D-E881-4482-94BA-BE5527E917FF} {2F7FF0A8-B619-4572-86C7-71E46FE22FB8} = {E15BDA6D-E881-4482-94BA-BE5527E917FF}
{C9B87BD7-AF49-41C3-91F1-D550ADEB7833} = {E15BDA6D-E881-4482-94BA-BE5527E917FF} {C9B87BD7-AF49-41C3-91F1-D550ADEB7833} = {E15BDA6D-E881-4482-94BA-BE5527E917FF}
{05AB2F46-268B-4915-806F-DDF813E2D59D} = {E15BDA6D-E881-4482-94BA-BE5527E917FF} {05AB2F46-268B-4915-806F-DDF813E2D59D} = {E15BDA6D-E881-4482-94BA-BE5527E917FF}
{3620414C-7DFC-423E-929F-310E19F5D930} = {E15BDA6D-E881-4482-94BA-BE5527E917FF}
{A6AA1C3F-9470-4922-9D3F-D4549657AB22} = {E15BDA6D-E881-4482-94BA-BE5527E917FF}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {79B65AC9-C940-410E-AB61-7EA7E12C7599} SolutionGuid = {79B65AC9-C940-410E-AB61-7EA7E12C7599}

View file

@ -211,8 +211,10 @@ internal sealed class Dalamud : IServiceType
{ {
using (Timings.Start("CS Resolver Init")) using (Timings.Start("CS Resolver Init"))
{ {
FFXIVClientStructs.Interop.Resolver.GetInstance.SetupSearchSpace(Service<TargetSigScanner>.Get().SearchBase, new FileInfo(Path.Combine(cacheDir.FullName, $"{this.StartInfo.GameVersion}_cs.json"))); // the resolver tracks version as a field in the json
FFXIVClientStructs.Interop.Resolver.GetInstance.Resolve(); InteropGenerator.Runtime.Resolver.GetInstance.Setup(Service<TargetSigScanner>.Get().SearchBase, $"{this.StartInfo.GameVersion}", new FileInfo(Path.Combine(cacheDir.FullName, "cs.json")));
FFXIVClientStructs.Interop.Generated.Addresses.Register();
InteropGenerator.Runtime.Resolver.GetInstance.Resolve();
} }
} }
} }

View file

@ -21,11 +21,11 @@ internal unsafe class AddonEventEntry
/// Gets the pointer to the addons AtkUnitBase. /// Gets the pointer to the addons AtkUnitBase.
/// </summary> /// </summary>
required public nint Addon { get; init; } required public nint Addon { get; init; }
/// <summary> /// <summary>
/// Gets the name of the addon this args referrers to. /// Gets the name of the addon this args referrers to.
/// </summary> /// </summary>
public string AddonName => this.Addon == nint.Zero ? InvalidAddonName : this.addonName ??= MemoryHelper.ReadString((nint)((AtkUnitBase*)this.Addon)->Name, 0x20); public string AddonName => this.Addon == nint.Zero ? InvalidAddonName : this.addonName ??= ((AtkUnitBase*)this.Addon)->NameString;
/// <summary> /// <summary>
/// Gets the pointer to the event source. /// Gets the pointer to the event source.

View file

@ -23,10 +23,10 @@ internal unsafe class AddonEventListener : IDisposable
this.receiveEventDelegate = eventHandler; this.receiveEventDelegate = eventHandler;
this.eventListener = (AtkEventListener*)Marshal.AllocHGlobal(sizeof(AtkEventListener)); this.eventListener = (AtkEventListener*)Marshal.AllocHGlobal(sizeof(AtkEventListener));
this.eventListener->vtbl = (void*)Marshal.AllocHGlobal(sizeof(void*) * 3); this.eventListener->VirtualTable = (AtkEventListener.AtkEventListenerVirtualTable*)Marshal.AllocHGlobal(sizeof(void*) * 3);
this.eventListener->vfunc[0] = (delegate* unmanaged<void>)&NullSub; this.eventListener->VirtualTable->Dtor = (delegate* unmanaged<AtkEventListener*, byte, void>)(delegate* unmanaged<void>)&NullSub;
this.eventListener->vfunc[1] = (delegate* unmanaged<void>)&NullSub; this.eventListener->VirtualTable->ReceiveGlobalEvent = (delegate* unmanaged<AtkEventListener*, AtkEventType, int, AtkEvent*, nint, void>)(delegate* unmanaged<void>)&NullSub;
this.eventListener->vfunc[2] = (void*)Marshal.GetFunctionPointerForDelegate(this.receiveEventDelegate); this.eventListener->VirtualTable->ReceiveEvent = (delegate* unmanaged<AtkEventListener*, AtkEventType, int, AtkEvent*, nint, void>)Marshal.GetFunctionPointerForDelegate(this.receiveEventDelegate);
} }
/// <summary> /// <summary>
@ -49,7 +49,7 @@ internal unsafe class AddonEventListener : IDisposable
{ {
if (this.eventListener is null) return; if (this.eventListener is null) return;
Marshal.FreeHGlobal((nint)this.eventListener->vtbl); Marshal.FreeHGlobal((nint)this.eventListener->VirtualTable);
Marshal.FreeHGlobal((nint)this.eventListener); Marshal.FreeHGlobal((nint)this.eventListener);
this.eventListener = null; this.eventListener = null;

View file

@ -47,7 +47,7 @@ internal unsafe class PluginEventController : IDisposable
var eventHandle = new AddonEventHandle var eventHandle = new AddonEventHandle
{ {
AddonName = MemoryHelper.ReadStringNullTerminated((nint)addon->Name), AddonName = addon->NameString,
ParamKey = eventId, ParamKey = eventId,
EventType = atkEventType, EventType = atkEventType,
EventGuid = eventGuid, EventGuid = eventGuid,

View file

@ -1,4 +1,6 @@
using Dalamud.Memory; using System.Runtime.CompilerServices;
using Dalamud.Memory;
using FFXIVClientStructs.FFXIV.Component.GUI; using FFXIVClientStructs.FFXIV.Component.GUI;
@ -64,9 +66,14 @@ public abstract unsafe class AddonArgs
return false; return false;
var addonPointer = (AtkUnitBase*)this.Addon; var addonPointer = (AtkUnitBase*)this.Addon;
if (addonPointer->Name is null) return false; if (addonPointer->Name[0] == 0) return false;
return MemoryHelper.EqualsZeroTerminatedString(name, (nint)addonPointer->Name, null, 0x20); // note: might want to rewrite this to just compare to NameString
return MemoryHelper.EqualsZeroTerminatedString(
name,
(nint)Unsafe.AsPointer(ref addonPointer->Name[0]),
null,
0x20);
} }
/// <summary> /// <summary>
@ -78,8 +85,8 @@ public abstract unsafe class AddonArgs
if (this.Addon == nint.Zero) return InvalidAddon; if (this.Addon == nint.Zero) return InvalidAddon;
var addonPointer = (AtkUnitBase*)this.Addon; var addonPointer = (AtkUnitBase*)this.Addon;
if (addonPointer->Name is null) return InvalidAddon; if (addonPointer->Name[0] == 0) return InvalidAddon;
return this.addonName ??= MemoryHelper.ReadString((nint)addonPointer->Name, 0x20); return this.addonName ??= addonPointer->NameString;
} }
} }

View file

@ -194,8 +194,8 @@ internal unsafe class AddonLifecycle : IInternalDisposableService
{ {
// Hook the addon's ReceiveEvent function here, but only enable the hook if we have an active listener. // Hook the addon's ReceiveEvent function here, but only enable the hook if we have an active listener.
// Disallows hooking the core internal event handler. // Disallows hooking the core internal event handler.
var addonName = MemoryHelper.ReadStringNullTerminated((nint)addon->Name); var addonName = addon->NameString;
var receiveEventAddress = (nint)addon->VTable->ReceiveEvent; var receiveEventAddress = (nint)addon->VirtualTable->ReceiveEvent;
if (receiveEventAddress != this.disallowedReceiveEventAddress) if (receiveEventAddress != this.disallowedReceiveEventAddress)
{ {
// If we have a ReceiveEvent listener already made for this hook address, add this addon's name to that handler. // If we have a ReceiveEvent listener already made for this hook address, add this addon's name to that handler.
@ -275,7 +275,7 @@ internal unsafe class AddonLifecycle : IInternalDisposableService
{ {
try try
{ {
var addonName = MemoryHelper.ReadStringNullTerminated((nint)atkUnitBase[0]->Name); var addonName = atkUnitBase[0]->NameString;
this.UnregisterReceiveEventHook(addonName); this.UnregisterReceiveEventHook(addonName);
} }
catch (Exception e) catch (Exception e)

View file

@ -72,7 +72,7 @@ internal unsafe class AddonLifecycleReceiveEventListener : IDisposable
private void OnReceiveEvent(AtkUnitBase* addon, AtkEventType eventType, int eventParam, AtkEvent* atkEvent, nint data) private void OnReceiveEvent(AtkUnitBase* addon, AtkEventType eventType, int eventParam, AtkEvent* atkEvent, nint data)
{ {
// Check that we didn't get here through a call to another addons handler. // Check that we didn't get here through a call to another addons handler.
var addonName = MemoryHelper.ReadString((nint)addon->Name, 0x20); var addonName = addon->NameString;
if (!this.AddonNames.Contains(addonName)) if (!this.AddonNames.Contains(addonName))
{ {
this.Hook!.Original(addon, eventType, eventParam, atkEvent, data); this.Hook!.Original(addon, eventType, eventParam, atkEvent, data);

View file

@ -60,9 +60,9 @@ public sealed class AetheryteEntry
public bool IsSharedHouse => this.data.IsSharedHouse; public bool IsSharedHouse => this.data.IsSharedHouse;
/// <summary> /// <summary>
/// Gets a value indicating whether this Aetheryte is an Appartment or not. /// Gets a value indicating whether this Aetheryte is an Apartment or not.
/// </summary> /// </summary>
public bool IsAppartment => this.data.IsAppartment; public bool IsApartment => this.data.IsApartment;
/// <summary> /// <summary>
/// Gets the Aetheryte data related to this aetheryte. /// Gets the Aetheryte data related to this aetheryte.

View file

@ -45,7 +45,7 @@ internal sealed unsafe partial class AetheryteList : IServiceType, IAetheryteLis
if (this.telepoInstance->TeleportList.First == this.telepoInstance->TeleportList.Last) if (this.telepoInstance->TeleportList.First == this.telepoInstance->TeleportList.Last)
return 0; return 0;
return (int)this.telepoInstance->TeleportList.Size(); return this.telepoInstance->TeleportList.Count;
} }
} }
@ -62,7 +62,7 @@ internal sealed unsafe partial class AetheryteList : IServiceType, IAetheryteLis
if (this.clientState.LocalPlayer == null) if (this.clientState.LocalPlayer == null)
return null; return null;
return new AetheryteEntry(this.telepoInstance->TeleportList.Get((ulong)index)); return new AetheryteEntry(this.telepoInstance->TeleportList[index]);
} }
} }

View file

@ -1,5 +1,6 @@
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using Dalamud.IoC; using Dalamud.IoC;
@ -97,13 +98,13 @@ internal sealed partial class BuddyList : IServiceType, IBuddyList
/// <inheritdoc/> /// <inheritdoc/>
public unsafe IntPtr GetCompanionBuddyMemberAddress() public unsafe IntPtr GetCompanionBuddyMemberAddress()
{ {
return (IntPtr)(&this.BuddyListStruct->Companion); return (IntPtr)this.BuddyListStruct->CompanionInfo.Companion;
} }
/// <inheritdoc/> /// <inheritdoc/>
public unsafe IntPtr GetPetBuddyMemberAddress() public unsafe IntPtr GetPetBuddyMemberAddress()
{ {
return (IntPtr)(&this.BuddyListStruct->Pet); return (IntPtr)this.BuddyListStruct->PetInfo.Pet;
} }
/// <inheritdoc/> /// <inheritdoc/>
@ -112,7 +113,7 @@ internal sealed partial class BuddyList : IServiceType, IBuddyList
if (index < 0 || index >= 3) if (index < 0 || index >= 3)
return IntPtr.Zero; return IntPtr.Zero;
return (IntPtr)(this.BuddyListStruct->BattleBuddies + (index * BuddyMemberSize)); return (IntPtr)Unsafe.AsPointer(ref this.BuddyListStruct->BattleBuddies[index]);
} }
/// <inheritdoc/> /// <inheritdoc/>

View file

@ -29,7 +29,7 @@ public unsafe class BuddyMember
/// <summary> /// <summary>
/// Gets the object ID of this buddy. /// Gets the object ID of this buddy.
/// </summary> /// </summary>
public uint ObjectId => this.Struct->ObjectID; public uint ObjectId => this.Struct->ObjectId;
/// <summary> /// <summary>
/// Gets the actor associated with this buddy. /// Gets the actor associated with this buddy.
@ -52,7 +52,7 @@ public unsafe class BuddyMember
/// <summary> /// <summary>
/// Gets the data ID of this buddy. /// Gets the data ID of this buddy.
/// </summary> /// </summary>
public uint DataID => this.Struct->DataID; public uint DataID => this.Struct->DataId;
/// <summary> /// <summary>
/// Gets the Mount data related to this buddy. It should only be used with companion buddies. /// Gets the Mount data related to this buddy. It should only be used with companion buddies.

View file

@ -49,7 +49,7 @@ internal sealed partial class FateTable : IServiceType, IFateTable
if (Struct->Fates.First == null || Struct->Fates.Last == null) if (Struct->Fates.First == null || Struct->Fates.Last == null)
return 0; return 0;
return (int)Struct->Fates.Size(); return Struct->Fates.Count;
} }
} }
@ -89,7 +89,7 @@ internal sealed partial class FateTable : IServiceType, IFateTable
if (fateTable == IntPtr.Zero) if (fateTable == IntPtr.Zero)
return IntPtr.Zero; return IntPtr.Zero;
return (IntPtr)this.Struct->Fates.Get((ulong)index).Value; return (IntPtr)this.Struct->Fates[index].Value;
} }
/// <inheritdoc/> /// <inheritdoc/>

View file

@ -31,5 +31,5 @@ public unsafe class PlayerCharacter : BattleChara
/// <summary> /// <summary>
/// Gets the target actor ID of the PlayerCharacter. /// Gets the target actor ID of the PlayerCharacter.
/// </summary> /// </summary>
public override ulong TargetObjectId => this.Struct->Character.Gaze.Controller.GazesSpan[0].TargetInfo.TargetId; public override ulong TargetObjectId => this.Struct->Character.Gaze.Controller.Gazes[0].TargetInfo.TargetId;
} }

View file

@ -21,37 +21,37 @@ public unsafe class BattleChara : Character
/// <summary> /// <summary>
/// Gets the current status effects. /// Gets the current status effects.
/// </summary> /// </summary>
public StatusList StatusList => new(this.Struct->GetStatusManager); public StatusList StatusList => new(this.Struct->GetStatusManager());
/// <summary> /// <summary>
/// Gets a value indicating whether the chara is currently casting. /// Gets a value indicating whether the chara is currently casting.
/// </summary> /// </summary>
public bool IsCasting => this.Struct->GetCastInfo->IsCasting > 0; public bool IsCasting => this.Struct->GetCastInfo()->IsCasting > 0;
/// <summary> /// <summary>
/// Gets a value indicating whether the cast is interruptible. /// Gets a value indicating whether the cast is interruptible.
/// </summary> /// </summary>
public bool IsCastInterruptible => this.Struct->GetCastInfo->Interruptible > 0; public bool IsCastInterruptible => this.Struct->GetCastInfo()->Interruptible > 0;
/// <summary> /// <summary>
/// Gets the spell action type of the spell being cast by the actor. /// Gets the spell action type of the spell being cast by the actor.
/// </summary> /// </summary>
public byte CastActionType => (byte)this.Struct->GetCastInfo->ActionType; public byte CastActionType => (byte)this.Struct->GetCastInfo()->ActionType;
/// <summary> /// <summary>
/// Gets the spell action ID of the spell being cast by the actor. /// Gets the spell action ID of the spell being cast by the actor.
/// </summary> /// </summary>
public uint CastActionId => this.Struct->GetCastInfo->ActionID; public uint CastActionId => this.Struct->GetCastInfo()->ActionId;
/// <summary> /// <summary>
/// Gets the object ID of the target currently being cast at by the chara. /// Gets the object ID of the target currently being cast at by the chara.
/// </summary> /// </summary>
public uint CastTargetObjectId => this.Struct->GetCastInfo->CastTargetID; public uint CastTargetObjectId => this.Struct->GetCastInfo()->CastTargetId;
/// <summary> /// <summary>
/// Gets the current casting time of the spell being cast by the chara. /// Gets the current casting time of the spell being cast by the chara.
/// </summary> /// </summary>
public float CurrentCastTime => this.Struct->GetCastInfo->CurrentCastTime; public float CurrentCastTime => this.Struct->GetCastInfo()->CurrentCastTime;
/// <summary> /// <summary>
/// Gets the total casting time of the spell being cast by the chara. /// Gets the total casting time of the spell being cast by the chara.
@ -61,7 +61,7 @@ public unsafe class BattleChara : Character
/// Use AdjustedTotalCastTime if you always need the total cast time. /// Use AdjustedTotalCastTime if you always need the total cast time.
/// </remarks> /// </remarks>
[Api10ToDo("Rename so it is not confused with AdjustedTotalCastTime")] [Api10ToDo("Rename so it is not confused with AdjustedTotalCastTime")]
public float TotalCastTime => this.Struct->GetCastInfo->TotalCastTime; public float TotalCastTime => this.Struct->GetCastInfo()->TotalCastTime;
/// <summary> /// <summary>
/// Gets the <see cref="TotalCastTime"/> plus any adjustments from the game, such as Action offset 2B. Used for display purposes. /// Gets the <see cref="TotalCastTime"/> plus any adjustments from the game, such as Action offset 2B. Used for display purposes.
@ -70,7 +70,7 @@ public unsafe class BattleChara : Character
/// This is the actual total cast time for all actions. /// This is the actual total cast time for all actions.
/// </remarks> /// </remarks>
[Api10ToDo("Rename so it is not confused with TotalCastTime")] [Api10ToDo("Rename so it is not confused with TotalCastTime")]
public float AdjustedTotalCastTime => this.Struct->GetCastInfo->AdjustedTotalCastTime; public float AdjustedTotalCastTime => this.Struct->GetCastInfo()->AdjustedTotalCastTime;
/// <summary> /// <summary>
/// Gets the underlying structure. /// Gets the underlying structure.

View file

@ -1,3 +1,5 @@
using System.Runtime.CompilerServices;
using Dalamud.Game.ClientState.Objects.Enums; using Dalamud.Game.ClientState.Objects.Enums;
using Dalamud.Game.ClientState.Resolvers; using Dalamud.Game.ClientState.Resolvers;
using Dalamud.Game.Text.SeStringHandling; using Dalamud.Game.Text.SeStringHandling;
@ -85,7 +87,7 @@ public unsafe class Character : GameObject
/// <summary> /// <summary>
/// Gets the Free Company tag of this chara. /// Gets the Free Company tag of this chara.
/// </summary> /// </summary>
public SeString CompanyTag => MemoryHelper.ReadSeString((IntPtr)this.Struct->FreeCompanyTag, 6); public SeString CompanyTag => MemoryHelper.ReadSeString((nint)Unsafe.AsPointer(ref this.Struct->FreeCompanyTag[0]), 6);
/// <summary> /// <summary>
/// Gets the target object ID of the character. /// Gets the target object ID of the character.
@ -95,7 +97,7 @@ public unsafe class Character : GameObject
/// <summary> /// <summary>
/// Gets the name ID of the character. /// Gets the name ID of the character.
/// </summary> /// </summary>
public uint NameId => this.Struct->NameID; public uint NameId => this.Struct->NameId;
/// <summary> /// <summary>
/// Gets the current online status of the character. /// Gets the current online status of the character.

View file

@ -1,4 +1,5 @@
using System.Numerics; using System.Numerics;
using System.Runtime.CompilerServices;
using Dalamud.Game.ClientState.Objects.Enums; using Dalamud.Game.ClientState.Objects.Enums;
using Dalamud.Game.Text.SeStringHandling; using Dalamud.Game.Text.SeStringHandling;
@ -95,22 +96,22 @@ public unsafe partial class GameObject
/// <summary> /// <summary>
/// Gets the name of this <see cref="GameObject" />. /// Gets the name of this <see cref="GameObject" />.
/// </summary> /// </summary>
public SeString Name => MemoryHelper.ReadSeString((IntPtr)this.Struct->Name, 64); public SeString Name => MemoryHelper.ReadSeString((nint)Unsafe.AsPointer(ref this.Struct->Name[0]), 64);
/// <summary> /// <summary>
/// Gets the object ID of this <see cref="GameObject" />. /// Gets the object ID of this <see cref="GameObject" />.
/// </summary> /// </summary>
public uint ObjectId => this.Struct->ObjectID; public uint ObjectId => this.Struct->EntityId;
/// <summary> /// <summary>
/// Gets the data ID for linking to other respective game data. /// Gets the data ID for linking to other respective game data.
/// </summary> /// </summary>
public uint DataId => this.Struct->DataID; public uint DataId => this.Struct->BaseId;
/// <summary> /// <summary>
/// Gets the ID of this GameObject's owner. /// Gets the ID of this GameObject's owner.
/// </summary> /// </summary>
public uint OwnerId => this.Struct->OwnerID; public uint OwnerId => this.Struct->OwnerId;
/// <summary> /// <summary>
/// Gets the index of this object in the object table. /// Gets the index of this object in the object table.

View file

@ -1,5 +1,6 @@
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using Dalamud.IoC; using Dalamud.IoC;
@ -50,10 +51,10 @@ internal sealed unsafe partial class PartyList : IServiceType, IPartyList
public IntPtr GroupManagerAddress => this.address.GroupManager; public IntPtr GroupManagerAddress => this.address.GroupManager;
/// <inheritdoc/> /// <inheritdoc/>
public IntPtr GroupListAddress => (IntPtr)GroupManagerStruct->PartyMembers; public IntPtr GroupListAddress => (IntPtr)Unsafe.AsPointer(ref GroupManagerStruct->PartyMembers[0]);
/// <inheritdoc/> /// <inheritdoc/>
public IntPtr AllianceListAddress => (IntPtr)this.GroupManagerStruct->AllianceMembers; public IntPtr AllianceListAddress => (IntPtr)Unsafe.AsPointer(ref this.GroupManagerStruct->AllianceMembers[0]);
/// <inheritdoc/> /// <inheritdoc/>
public long PartyId => this.GroupManagerStruct->PartyId; public long PartyId => this.GroupManagerStruct->PartyId;

View file

@ -41,12 +41,12 @@ public unsafe class PartyMember
/// <summary> /// <summary>
/// Gets the content ID of the party member. /// Gets the content ID of the party member.
/// </summary> /// </summary>
public long ContentId => this.Struct->ContentID; public long ContentId => this.Struct->ContentId;
/// <summary> /// <summary>
/// Gets the actor ID of this party member. /// Gets the actor ID of this party member.
/// </summary> /// </summary>
public uint ObjectId => this.Struct->ObjectID; public uint ObjectId => this.Struct->ObjectId;
/// <summary> /// <summary>
/// Gets the actor associated with this buddy. /// Gets the actor associated with this buddy.

View file

@ -26,12 +26,12 @@ public unsafe class Status
/// <summary> /// <summary>
/// Gets the status ID of this status. /// Gets the status ID of this status.
/// </summary> /// </summary>
public uint StatusId => this.Struct->StatusID; public uint StatusId => this.Struct->StatusId;
/// <summary> /// <summary>
/// Gets the GameData associated with this status. /// Gets the GameData associated with this status.
/// </summary> /// </summary>
public Lumina.Excel.GeneratedSheets.Status GameData => new ExcelResolver<Lumina.Excel.GeneratedSheets.Status>(this.Struct->StatusID).GameData; public Lumina.Excel.GeneratedSheets.Status GameData => new ExcelResolver<Lumina.Excel.GeneratedSheets.Status>(this.Struct->StatusId).GameData;
/// <summary> /// <summary>
/// Gets the parameter value of the status. /// Gets the parameter value of the status.
@ -51,7 +51,7 @@ public unsafe class Status
/// <summary> /// <summary>
/// Gets the source ID of this status. /// Gets the source ID of this status.
/// </summary> /// </summary>
public uint SourceId => this.Struct->SourceID; public uint SourceId => this.Struct->SourceId;
/// <summary> /// <summary>
/// Gets the source actor associated with this status. /// Gets the source actor associated with this status.

View file

@ -1,5 +1,6 @@
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Dalamud.Game.ClientState.Statuses; namespace Dalamud.Game.ClientState.Statuses;
@ -98,16 +99,16 @@ public sealed unsafe partial class StatusList
} }
/// <summary> /// <summary>
/// Gets the address of the party member at the specified index of the party list. /// Gets the address of the status at the specific index in the status list.
/// </summary> /// </summary>
/// <param name="index">The index of the party member.</param> /// <param name="index">The index of the status.</param>
/// <returns>The memory address of the party member.</returns> /// <returns>The memory address of the status.</returns>
public IntPtr GetStatusAddress(int index) public IntPtr GetStatusAddress(int index)
{ {
if (index < 0 || index >= this.Length) if (index < 0 || index >= this.Length)
return IntPtr.Zero; return IntPtr.Zero;
return (IntPtr)(this.Struct->Status + (index * StatusSize)); return (IntPtr)Unsafe.AsPointer(ref this.Struct->Status[index]);
} }
} }

View file

@ -34,7 +34,7 @@ internal sealed class GameConfig : IInternalDisposableService, IGameConfig
{ {
Log.Verbose("[GameConfig] Initializing"); Log.Verbose("[GameConfig] Initializing");
var csFramework = FFXIVClientStructs.FFXIV.Client.System.Framework.Framework.Instance(); var csFramework = FFXIVClientStructs.FFXIV.Client.System.Framework.Framework.Instance();
var commonConfig = &csFramework->SystemConfig.CommonSystemConfig; var commonConfig = &csFramework->SystemConfig.SystemConfigBase;
this.tcsSystem.SetResult(new("System", framework, &commonConfig->ConfigBase)); this.tcsSystem.SetResult(new("System", framework, &commonConfig->ConfigBase));
this.tcsUiConfig.SetResult(new("UiConfig", framework, &commonConfig->UiConfig)); this.tcsUiConfig.SetResult(new("UiConfig", framework, &commonConfig->UiConfig));
this.tcsUiControl.SetResult( this.tcsUiControl.SetResult(

View file

@ -17,6 +17,7 @@ using FFXIVClientStructs.FFXIV.Client.System.Memory;
using FFXIVClientStructs.FFXIV.Client.UI; using FFXIVClientStructs.FFXIV.Client.UI;
using FFXIVClientStructs.FFXIV.Client.UI.Agent; using FFXIVClientStructs.FFXIV.Client.UI.Agent;
using FFXIVClientStructs.FFXIV.Component.GUI; using FFXIVClientStructs.FFXIV.Component.GUI;
using FFXIVClientStructs.FFXIV.Component.GUI.AtkModuleInterface;
using FFXIVClientStructs.Interop; using FFXIVClientStructs.Interop;
using ValueType = FFXIVClientStructs.FFXIV.Component.GUI.ValueType; using ValueType = FFXIVClientStructs.FFXIV.Component.GUI.ValueType;
@ -40,7 +41,7 @@ internal sealed unsafe class ContextMenu : IInternalDisposableService, IContextM
private ContextMenu() private ContextMenu()
{ {
this.raptureAtkModuleOpenAddonByAgentHook = Hook<RaptureAtkModuleOpenAddonByAgentDelegate>.FromAddress((nint)RaptureAtkModule.Addresses.OpenAddonByAgent.Value, this.RaptureAtkModuleOpenAddonByAgentDetour); this.raptureAtkModuleOpenAddonByAgentHook = Hook<RaptureAtkModuleOpenAddonByAgentDelegate>.FromAddress((nint)RaptureAtkModule.Addresses.OpenAddonByAgent.Value, this.RaptureAtkModuleOpenAddonByAgentDetour);
this.addonContextMenuOnMenuSelectedHook = Hook<AddonContextMenuOnMenuSelectedDelegate>.FromAddress((nint)AddonContextMenu.StaticVTable.OnMenuSelected, this.AddonContextMenuOnMenuSelectedDetour); this.addonContextMenuOnMenuSelectedHook = Hook<AddonContextMenuOnMenuSelectedDelegate>.FromAddress((nint)AddonContextMenu.StaticVirtualTablePointer->OnMenuSelected, this.AddonContextMenuOnMenuSelectedDetour);
this.raptureAtkModuleOpenAddon = Marshal.GetDelegateForFunctionPointer<RaptureAtkModuleOpenAddonDelegate>((nint)RaptureAtkModule.Addresses.OpenAddon.Value); this.raptureAtkModuleOpenAddon = Marshal.GetDelegateForFunctionPointer<RaptureAtkModuleOpenAddonDelegate>((nint)RaptureAtkModule.Addresses.OpenAddon.Value);
this.raptureAtkModuleOpenAddonByAgentHook.Enable(); this.raptureAtkModuleOpenAddonByAgentHook.Enable();

View file

@ -24,7 +24,7 @@ public abstract unsafe class MenuArgs
/// <param name="eventInterfaces">List of AtkEventInterfaces associated with the context menu.</param> /// <param name="eventInterfaces">List of AtkEventInterfaces associated with the context menu.</param>
protected internal MenuArgs(AtkUnitBase* addon, AgentInterface* agent, ContextMenuType type, IReadOnlySet<nint>? eventInterfaces) protected internal MenuArgs(AtkUnitBase* addon, AgentInterface* agent, ContextMenuType type, IReadOnlySet<nint>? eventInterfaces)
{ {
this.AddonName = addon != null ? MemoryHelper.ReadString((nint)addon->Name, 32) : null; this.AddonName = addon != null ? addon->NameString : null;
this.AddonPtr = (nint)addon; this.AddonPtr = (nint)addon;
this.AgentPtr = (nint)agent; this.AgentPtr = (nint)agent;
this.MenuType = type; this.MenuType = type;

View file

@ -2,6 +2,7 @@ using System.Collections.Generic;
using Dalamud.Game.Text.SeStringHandling; using Dalamud.Game.Text.SeStringHandling;
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
using FFXIVClientStructs.FFXIV.Component.GUI; using FFXIVClientStructs.FFXIV.Component.GUI;
namespace Dalamud.Game.Gui.ContextMenu; namespace Dalamud.Game.Gui.ContextMenu;

View file

@ -1,5 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
using FFXIVClientStructs.FFXIV.Component.GUI; using FFXIVClientStructs.FFXIV.Component.GUI;
namespace Dalamud.Game.Gui.ContextMenu; namespace Dalamud.Game.Gui.ContextMenu;

View file

@ -276,7 +276,7 @@ internal sealed unsafe class DtrBar : IInternalDisposableService, IDtrBar
var node = addon->UldManager.NodeList[index]; var node = addon->UldManager.NodeList[index];
if (node->IsVisible) if (node->IsVisible)
{ {
var nodeId = node->NodeID; var nodeId = node->NodeId;
var nodeType = node->Type; var nodeType = node->Type;
if (nodeType == NodeType.Collision) if (nodeType == NodeType.Collision)
@ -330,7 +330,7 @@ internal sealed unsafe class DtrBar : IInternalDisposableService, IDtrBar
for (var i = 0; i < dtr->UldManager.NodeListCount; i++) for (var i = 0; i < dtr->UldManager.NodeListCount; i++)
{ {
if (dtr->UldManager.NodeList[i]->NodeID > 1000) if (dtr->UldManager.NodeList[i]->NodeId > 1000)
return true; return true;
} }
@ -357,8 +357,8 @@ internal sealed unsafe class DtrBar : IInternalDisposableService, IDtrBar
var dtr = this.GetDtr(); var dtr = this.GetDtr();
if (dtr == null || dtr->RootNode == null || dtr->UldManager.NodeList == null || node == null) return false; if (dtr == null || dtr->RootNode == null || dtr->UldManager.NodeList == null || node == null) return false;
this.eventHandles.TryAdd(node->AtkResNode.NodeID, new List<IAddonEventHandle>()); this.eventHandles.TryAdd(node->AtkResNode.NodeId, new List<IAddonEventHandle>());
this.eventHandles[node->AtkResNode.NodeID].AddRange(new List<IAddonEventHandle> this.eventHandles[node->AtkResNode.NodeId].AddRange(new List<IAddonEventHandle>
{ {
this.uiEventManager.AddEvent(AddonEventManager.DalamudInternalKey, (nint)dtr, (nint)node, AddonEventType.MouseOver, this.DtrEventHandler), this.uiEventManager.AddEvent(AddonEventManager.DalamudInternalKey, (nint)dtr, (nint)node, AddonEventType.MouseOver, this.DtrEventHandler),
this.uiEventManager.AddEvent(AddonEventManager.DalamudInternalKey, (nint)dtr, (nint)node, AddonEventType.MouseOut, this.DtrEventHandler), this.uiEventManager.AddEvent(AddonEventManager.DalamudInternalKey, (nint)dtr, (nint)node, AddonEventType.MouseOut, this.DtrEventHandler),
@ -386,8 +386,8 @@ internal sealed unsafe class DtrBar : IInternalDisposableService, IDtrBar
var dtr = this.GetDtr(); var dtr = this.GetDtr();
if (dtr == null || dtr->RootNode == null || dtr->UldManager.NodeList == null || node == null) return; if (dtr == null || dtr->RootNode == null || dtr->UldManager.NodeList == null || node == null) return;
this.eventHandles[node->AtkResNode.NodeID].ForEach(handle => this.uiEventManager.RemoveEvent(AddonEventManager.DalamudInternalKey, handle)); this.eventHandles[node->AtkResNode.NodeId].ForEach(handle => this.uiEventManager.RemoveEvent(AddonEventManager.DalamudInternalKey, handle));
this.eventHandles[node->AtkResNode.NodeID].Clear(); this.eventHandles[node->AtkResNode.NodeId].Clear();
var tmpPrevNode = node->AtkResNode.PrevSiblingNode; var tmpPrevNode = node->AtkResNode.PrevSiblingNode;
var tmpNextNode = node->AtkResNode.NextSiblingNode; var tmpNextNode = node->AtkResNode.NextSiblingNode;
@ -414,7 +414,7 @@ internal sealed unsafe class DtrBar : IInternalDisposableService, IDtrBar
return null; return null;
} }
newTextNode->AtkResNode.NodeID = nodeId; newTextNode->AtkResNode.NodeId = nodeId;
newTextNode->AtkResNode.Type = NodeType.Text; newTextNode->AtkResNode.Type = NodeType.Text;
newTextNode->AtkResNode.NodeFlags = NodeFlags.AnchorLeft | NodeFlags.AnchorTop | NodeFlags.Enabled | NodeFlags.RespondToMouse | NodeFlags.HasCollision | NodeFlags.EmitsEvents; newTextNode->AtkResNode.NodeFlags = NodeFlags.AnchorLeft | NodeFlags.AnchorTop | NodeFlags.Enabled | NodeFlags.RespondToMouse | NodeFlags.HasCollision | NodeFlags.EmitsEvents;
newTextNode->AtkResNode.DrawFlags = 12; newTextNode->AtkResNode.DrawFlags = 12;
@ -459,11 +459,11 @@ internal sealed unsafe class DtrBar : IInternalDisposableService, IDtrBar
switch (atkEventType) switch (atkEventType)
{ {
case AddonEventType.MouseOver: case AddonEventType.MouseOver:
AtkStage.GetSingleton()->TooltipManager.ShowTooltip(addon->ID, node, dtrBarEntry.Tooltip.Encode()); AtkStage.GetSingleton()->TooltipManager.ShowTooltip(addon->Id, node, dtrBarEntry.Tooltip.Encode());
break; break;
case AddonEventType.MouseOut: case AddonEventType.MouseOut:
AtkStage.GetSingleton()->TooltipManager.HideTooltip(addon->ID); AtkStage.GetSingleton()->TooltipManager.HideTooltip(addon->Id);
break; break;
} }
} }

View file

@ -12,6 +12,7 @@ using Dalamud.Utility;
using FFXIVClientStructs.FFXIV.Client.Graphics.Kernel; using FFXIVClientStructs.FFXIV.Client.Graphics.Kernel;
using FFXIVClientStructs.FFXIV.Client.System.String; using FFXIVClientStructs.FFXIV.Client.System.String;
using FFXIVClientStructs.FFXIV.Client.UI; using FFXIVClientStructs.FFXIV.Client.UI;
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
using FFXIVClientStructs.FFXIV.Common.Component.BGCollision; using FFXIVClientStructs.FFXIV.Common.Component.BGCollision;
using FFXIVClientStructs.FFXIV.Component.GUI; using FFXIVClientStructs.FFXIV.Component.GUI;
using ImGuiNET; using ImGuiNET;
@ -322,7 +323,7 @@ internal sealed unsafe class GameGui : IInternalDisposableService, IGameGui
return IntPtr.Zero; return IntPtr.Zero;
var addon = (AtkUnitBase*)addonPtr; var addon = (AtkUnitBase*)addonPtr;
var addonId = addon->ParentID == 0 ? addon->ID : addon->ParentID; var addonId = addon->ParentId == 0 ? addon->Id : addon->ParentId;
if (addonId == 0) if (addonId == 0)
return IntPtr.Zero; return IntPtr.Zero;
@ -330,7 +331,7 @@ internal sealed unsafe class GameGui : IInternalDisposableService, IGameGui
var index = 0; var index = 0;
while (true) while (true)
{ {
var agent = agentModule->GetAgentByInternalID((uint)index++); var agent = agentModule->GetAgentByInternalId((AgentId)index++);
if (agent == uiModule || agent == null) if (agent == uiModule || agent == null)
break; break;

View file

@ -51,7 +51,7 @@ internal class GameInventory : IInternalDisposableService
unsafe unsafe
{ {
this.raptureAtkModuleUpdateHook = Hook<RaptureAtkModuleUpdateDelegate>.FromFunctionPointerVariable( this.raptureAtkModuleUpdateHook = Hook<RaptureAtkModuleUpdateDelegate>.FromFunctionPointerVariable(
new(&((RaptureAtkModule.RaptureAtkModuleVTable*)RaptureAtkModule.StaticAddressPointers.VTable)->Update), new(&RaptureAtkModule.StaticVirtualTablePointer->Update),
this.RaptureAtkModuleUpdateDetour); this.RaptureAtkModuleUpdateDetour);
} }

View file

@ -46,7 +46,7 @@ public unsafe struct GameInventoryItem : IEquatable<GameInventoryItem>
/// <summary> /// <summary>
/// Gets a value indicating whether the this <see cref="GameInventoryItem"/> is empty. /// Gets a value indicating whether the this <see cref="GameInventoryItem"/> is empty.
/// </summary> /// </summary>
public bool IsEmpty => this.InternalItem.ItemID == 0; public bool IsEmpty => this.InternalItem.ItemId == 0;
/// <summary> /// <summary>
/// Gets the container inventory type. /// Gets the container inventory type.
@ -61,7 +61,7 @@ public unsafe struct GameInventoryItem : IEquatable<GameInventoryItem>
/// <summary> /// <summary>
/// Gets the item id. /// Gets the item id.
/// </summary> /// </summary>
public uint ItemId => this.InternalItem.ItemID; public uint ItemId => this.InternalItem.ItemId;
/// <summary> /// <summary>
/// Gets the quantity of items in this item stack. /// Gets the quantity of items in this item stack.
@ -81,7 +81,7 @@ public unsafe struct GameInventoryItem : IEquatable<GameInventoryItem>
/// <summary> /// <summary>
/// Gets a value indicating whether the item is High Quality. /// Gets a value indicating whether the item is High Quality.
/// </summary> /// </summary>
public bool IsHq => (this.InternalItem.Flags & InventoryItem.ItemFlags.HQ) != 0; public bool IsHq => (this.InternalItem.Flags & InventoryItem.ItemFlags.HighQuality) != 0;
/// <summary> /// <summary>
/// Gets a value indicating whether the item has a company crest applied. /// Gets a value indicating whether the item has a company crest applied.
@ -141,13 +141,13 @@ public unsafe struct GameInventoryItem : IEquatable<GameInventoryItem>
/// <summary> /// <summary>
/// Gets the glamour id for this item. /// Gets the glamour id for this item.
/// </summary> /// </summary>
public uint GlamourId => this.InternalItem.GlamourID; public uint GlamourId => this.InternalItem.GlamourId;
/// <summary> /// <summary>
/// Gets the items crafter's content id. /// Gets the items crafter's content id.
/// NOTE: I'm not sure if this is a good idea to include or not in the dalamud api. Marked internal for now. /// NOTE: I'm not sure if this is a good idea to include or not in the dalamud api. Marked internal for now.
/// </summary> /// </summary>
internal ulong CrafterContentId => this.InternalItem.CrafterContentID; internal ulong CrafterContentId => this.InternalItem.CrafterContentId;
public static bool operator ==(in GameInventoryItem l, in GameInventoryItem r) => l.Equals(r); public static bool operator ==(in GameInventoryItem l, in GameInventoryItem r) => l.Equals(r);

View file

@ -132,12 +132,12 @@ public unsafe class CharacterData
/// <summary> /// <summary>
/// Gets the name of the character. /// Gets the name of the character.
/// </summary> /// </summary>
public string Name => MemoryHelper.ReadString((nint)this.Struct->Name, 32); public string Name => this.Struct->NameString;
/// <summary> /// <summary>
/// Gets the free company tag of the character. /// Gets the free company tag of the character.
/// </summary> /// </summary>
public string FCTag => MemoryHelper.ReadString((nint)this.Struct->Name, 6); public string FCTag => this.Struct->FCTagString;
/// <summary> /// <summary>
/// Gets the underlying <see cref="InfoProxyCommonList.CharacterData"/> struct. /// Gets the underlying <see cref="InfoProxyCommonList.CharacterData"/> struct.

View file

@ -779,7 +779,7 @@ internal class DalamudInterface : IInternalDisposableService
unsafe unsafe
{ {
var hook = Hook<CrashDebugDelegate>.FromAddress( var hook = Hook<CrashDebugDelegate>.FromAddress(
(nint)UIModule.StaticVTable.GetUIInputData, (nint)UIModule.StaticVirtualTablePointer->GetUIInputData,
self => self =>
{ {
_ = *(byte*)0; _ = *(byte*)0;

View file

@ -80,7 +80,7 @@ internal unsafe class UiDebug
private void DrawUnitBase(AtkUnitBase* atkUnitBase) private void DrawUnitBase(AtkUnitBase* atkUnitBase)
{ {
var isVisible = (atkUnitBase->Flags & 0x20) == 0x20; var isVisible = (atkUnitBase->Flags & 0x20) == 0x20;
var addonName = MemoryHelper.ReadSeStringAsString(out _, new IntPtr(atkUnitBase->Name)); var addonName = atkUnitBase->NameString;
var agent = Service<GameGui>.Get().FindAgentInterface(atkUnitBase); var agent = Service<GameGui>.Get().FindAgentInterface(atkUnitBase);
ImGui.Text($"{addonName}"); ImGui.Text($"{addonName}");
@ -352,11 +352,11 @@ internal unsafe class UiDebug
var textInputComponent = (AtkComponentTextInput*)compNode->Component; var textInputComponent = (AtkComponentTextInput*)compNode->Component;
ImGui.Text($"InputBase Text1: {MemoryHelper.ReadSeStringAsString(out _, new IntPtr(textInputComponent->AtkComponentInputBase.UnkText1.StringPtr))}"); ImGui.Text($"InputBase Text1: {MemoryHelper.ReadSeStringAsString(out _, new IntPtr(textInputComponent->AtkComponentInputBase.UnkText1.StringPtr))}");
ImGui.Text($"InputBase Text2: {MemoryHelper.ReadSeStringAsString(out _, new IntPtr(textInputComponent->AtkComponentInputBase.UnkText2.StringPtr))}"); ImGui.Text($"InputBase Text2: {MemoryHelper.ReadSeStringAsString(out _, new IntPtr(textInputComponent->AtkComponentInputBase.UnkText2.StringPtr))}");
ImGui.Text($"Text1: {MemoryHelper.ReadSeStringAsString(out _, new IntPtr(textInputComponent->UnkText1.StringPtr))}"); ImGui.Text($"Text1: {MemoryHelper.ReadSeStringAsString(out _, new IntPtr(textInputComponent->UnkText01.StringPtr))}");
ImGui.Text($"Text2: {MemoryHelper.ReadSeStringAsString(out _, new IntPtr(textInputComponent->UnkText2.StringPtr))}"); ImGui.Text($"Text2: {MemoryHelper.ReadSeStringAsString(out _, new IntPtr(textInputComponent->UnkText02.StringPtr))}");
ImGui.Text($"Text3: {MemoryHelper.ReadSeStringAsString(out _, new IntPtr(textInputComponent->UnkText3.StringPtr))}"); ImGui.Text($"Text3: {MemoryHelper.ReadSeStringAsString(out _, new IntPtr(textInputComponent->UnkText03.StringPtr))}");
ImGui.Text($"Text4: {MemoryHelper.ReadSeStringAsString(out _, new IntPtr(textInputComponent->UnkText4.StringPtr))}"); ImGui.Text($"Text4: {MemoryHelper.ReadSeStringAsString(out _, new IntPtr(textInputComponent->UnkText04.StringPtr))}");
ImGui.Text($"Text5: {MemoryHelper.ReadSeStringAsString(out _, new IntPtr(textInputComponent->UnkText5.StringPtr))}"); ImGui.Text($"Text5: {MemoryHelper.ReadSeStringAsString(out _, new IntPtr(textInputComponent->UnkText05.StringPtr))}");
break; break;
} }
@ -390,7 +390,7 @@ internal unsafe class UiDebug
private void PrintResNode(AtkResNode* node) private void PrintResNode(AtkResNode* node)
{ {
ImGui.Text($"NodeID: {node->NodeID}"); ImGui.Text($"NodeID: {node->NodeId}");
ImGui.SameLine(); ImGui.SameLine();
if (ImGui.SmallButton($"T:Visible##{(ulong)node:X}")) if (ImGui.SmallButton($"T:Visible##{(ulong)node:X}"))
{ {
@ -465,14 +465,14 @@ internal unsafe class UiDebug
for (var j = 0; j < unitManager->Count && headerOpen; j++) for (var j = 0; j < unitManager->Count && headerOpen; j++)
{ {
var unitBase = *(AtkUnitBase**)Unsafe.AsPointer(ref unitManager->EntriesSpan[j]); AtkUnitBase* unitBase = unitManager->Entries[j];
if (this.selectedUnitBase != null && unitBase == this.selectedUnitBase) if (this.selectedUnitBase != null && unitBase == this.selectedUnitBase)
{ {
this.selectedInList[i] = true; this.selectedInList[i] = true;
foundSelected = true; foundSelected = true;
} }
var name = MemoryHelper.ReadSeStringAsString(out _, new IntPtr(unitBase->Name)); var name = unitBase->NameString;
if (searching) if (searching)
{ {
if (name == null || !name.ToLower().Contains(searchStr.ToLower())) continue; if (name == null || !name.ToLower().Contains(searchStr.ToLower())) continue;
@ -510,7 +510,7 @@ internal unsafe class UiDebug
{ {
for (var j = 0; j < unitManager->Count; j++) for (var j = 0; j < unitManager->Count; j++)
{ {
var unitBase = *(AtkUnitBase**)Unsafe.AsPointer(ref unitManager->EntriesSpan[j]); AtkUnitBase* unitBase = unitManager->Entries[j];
if (this.selectedUnitBase == null || unitBase != this.selectedUnitBase) continue; if (this.selectedUnitBase == null || unitBase != this.selectedUnitBase) continue;
this.selectedInList[i] = true; this.selectedInList[i] = true;
foundSelected = true; foundSelected = true;

View file

@ -49,7 +49,7 @@ internal unsafe class AddonWidget : IDataWindowWidget
} }
var addon = (FFXIVClientStructs.FFXIV.Component.GUI.AtkUnitBase*)address; var addon = (FFXIVClientStructs.FFXIV.Component.GUI.AtkUnitBase*)address;
var name = MemoryHelper.ReadStringNullTerminated((nint)addon->Name); var name = addon->NameString;
ImGui.TextUnformatted($"{name} - 0x{address.ToInt64():X}\n v:{addon->IsVisible} x:{addon->X} y:{addon->Y} s:{addon->Scale}, w:{addon->RootNode->Width}, h:{addon->RootNode->Height}"); ImGui.TextUnformatted($"{name} - 0x{address.ToInt64():X}\n v:{addon->IsVisible} x:{addon->X} y:{addon->Y} s:{addon->Scale}, w:{addon->RootNode->Width}, h:{addon->RootNode->Height}");
if (ImGui.Button("Find Agent")) if (ImGui.Button("Find Agent"))

View file

@ -83,7 +83,7 @@ internal class AetherytesWidget : IDataWindowWidget
ImGui.TextUnformatted($"{info.IsSharedHouse}"); ImGui.TextUnformatted($"{info.IsSharedHouse}");
ImGui.TableNextColumn(); // Apartment ImGui.TableNextColumn(); // Apartment
ImGui.TextUnformatted($"{info.IsAppartment}"); ImGui.TextUnformatted($"{info.IsApartment}");
} }
ImGui.EndTable(); ImGui.EndTable();

@ -1 +1 @@
Subproject commit b7a834e78fd7250023c3f70c5717c28b01d18acc Subproject commit 7e59f75b210593c4a1bdba8a296a08c3c40d05af