diff --git a/Dalamud/Game/ClientState/Buddy/BuddyMember.cs b/Dalamud/Game/ClientState/Buddy/BuddyMember.cs index 025de611d..393598d32 100644 --- a/Dalamud/Game/ClientState/Buddy/BuddyMember.cs +++ b/Dalamud/Game/ClientState/Buddy/BuddyMember.cs @@ -19,8 +19,14 @@ public interface IBuddyMember /// /// Gets the object ID of this buddy. /// + [Obsolete("Renamed to EntityId")] uint ObjectId { get; } + /// + /// Gets the entity ID of this buddy. + /// + uint EntityId { get; } + /// /// Gets the actor associated with this buddy. /// @@ -83,6 +89,9 @@ internal unsafe class BuddyMember : IBuddyMember /// public uint ObjectId => this.Struct->EntityId; + /// + public uint EntityId => this.Struct->EntityId; + /// public IGameObject? GameObject => this.objectTable.SearchById(this.ObjectId); diff --git a/Dalamud/Game/ClientState/Objects/Types/GameObject.cs b/Dalamud/Game/ClientState/Objects/Types/GameObject.cs index 4209100f0..829949c12 100644 --- a/Dalamud/Game/ClientState/Objects/Types/GameObject.cs +++ b/Dalamud/Game/ClientState/Objects/Types/GameObject.cs @@ -35,8 +35,14 @@ public interface IGameObject : IEquatable /// /// Gets the data ID for linking to other respective game data. /// + [Obsolete("Renamed to BaseId")] public uint DataId { get; } + /// + /// Gets the base ID for linking to other respective game data. + /// + public uint BaseId { get; } + /// /// Gets the ID of this GameObject's owner. /// @@ -208,6 +214,9 @@ internal unsafe partial class GameObject : IGameObject /// public uint DataId => this.Struct->BaseId; + /// + public uint BaseId => this.Struct->BaseId; + /// public uint OwnerId => this.Struct->OwnerId; diff --git a/Dalamud/Game/ClientState/Party/PartyMember.cs b/Dalamud/Game/ClientState/Party/PartyMember.cs index 65b752808..4c738d866 100644 --- a/Dalamud/Game/ClientState/Party/PartyMember.cs +++ b/Dalamud/Game/ClientState/Party/PartyMember.cs @@ -40,8 +40,14 @@ public interface IPartyMember /// /// Gets the actor ID of this party member. /// + [Obsolete("Renamed to EntityId")] uint ObjectId { get; } + /// + /// Gets the entity ID of this party member. + /// + uint EntityId { get; } + /// /// Gets the actor associated with this buddy. /// @@ -115,87 +121,55 @@ internal unsafe class PartyMember : IPartyMember this.Address = address; } - /// - /// Gets the address of this party member in memory. - /// + /// public IntPtr Address { get; } - /// - /// Gets a list of buffs or debuffs applied to this party member. - /// + /// public StatusList Statuses => new(&this.Struct->StatusManager); - /// - /// Gets the position of the party member. - /// + /// public Vector3 Position => this.Struct->Position; - /// - /// Gets the content ID of the party member. - /// + /// public long ContentId => (long)this.Struct->ContentId; - /// - /// Gets the actor ID of this party member. - /// + /// public uint ObjectId => this.Struct->EntityId; - /// - /// Gets the actor associated with this buddy. - /// - /// - /// This iterates the actor table, it should be used with care. - /// - public IGameObject? GameObject => Service.Get().SearchById(this.ObjectId); + /// + public uint EntityId => this.Struct->EntityId; - /// - /// Gets the current HP of this party member. - /// + /// + public IGameObject? GameObject => Service.Get().SearchById(this.EntityId); + + /// public uint CurrentHP => this.Struct->CurrentHP; - /// - /// Gets the maximum HP of this party member. - /// + /// public uint MaxHP => this.Struct->MaxHP; - /// - /// Gets the current MP of this party member. - /// + /// public ushort CurrentMP => this.Struct->CurrentMP; - /// - /// Gets the maximum MP of this party member. - /// + /// public ushort MaxMP => this.Struct->MaxMP; - /// - /// Gets the territory this party member is located in. - /// + /// public RowRef Territory => LuminaUtils.CreateRef(this.Struct->TerritoryType); - /// - /// Gets the World this party member resides in. - /// + /// public RowRef World => LuminaUtils.CreateRef(this.Struct->HomeWorld); - /// - /// Gets the displayname of this party member. - /// + /// public SeString Name => SeString.Parse(this.Struct->Name); - /// - /// Gets the sex of this party member. - /// + /// public byte Sex => this.Struct->Sex; - /// - /// Gets the classjob of this party member. - /// + /// public RowRef ClassJob => LuminaUtils.CreateRef(this.Struct->ClassJob); - /// - /// Gets the level of this party member. - /// + /// public byte Level => this.Struct->Level; private FFXIVClientStructs.FFXIV.Client.Game.Group.PartyMember* Struct => (FFXIVClientStructs.FFXIV.Client.Game.Group.PartyMember*)this.Address; diff --git a/Dalamud/Interface/Internal/Windows/Data/Widgets/BuddyListWidget.cs b/Dalamud/Interface/Internal/Windows/Data/Widgets/BuddyListWidget.cs index 07ff2fdce..06dc1b11e 100644 --- a/Dalamud/Interface/Internal/Windows/Data/Widgets/BuddyListWidget.cs +++ b/Dalamud/Interface/Internal/Windows/Data/Widgets/BuddyListWidget.cs @@ -40,7 +40,7 @@ internal class BuddyListWidget : IDataWindowWidget } else { - ImGui.Text($"[Companion] {member.Address.ToInt64():X} - {member.ObjectId} - {member.DataID}"); + ImGui.Text($"[Companion] {member.Address.ToInt64():X} - {member.EntityId} - {member.DataID}"); if (this.resolveGameData) { var gameObject = member.GameObject; @@ -64,7 +64,7 @@ internal class BuddyListWidget : IDataWindowWidget } else { - ImGui.Text($"[Pet] {member.Address.ToInt64():X} - {member.ObjectId} - {member.DataID}"); + ImGui.Text($"[Pet] {member.Address.ToInt64():X} - {member.EntityId} - {member.DataID}"); if (this.resolveGameData) { var gameObject = member.GameObject; @@ -91,7 +91,7 @@ internal class BuddyListWidget : IDataWindowWidget for (var i = 0; i < count; i++) { var member = buddyList[i]; - ImGui.Text($"[BattleBuddy] [{i}] {member?.Address.ToInt64():X} - {member?.ObjectId} - {member?.DataID}"); + ImGui.Text($"[BattleBuddy] [{i}] {member?.Address.ToInt64():X} - {member?.EntityId} - {member?.DataID}"); if (this.resolveGameData) { var gameObject = member?.GameObject; diff --git a/Dalamud/Utility/Util.cs b/Dalamud/Utility/Util.cs index a1c2eb6b2..ff06618ab 100644 --- a/Dalamud/Utility/Util.cs +++ b/Dalamud/Utility/Util.cs @@ -753,7 +753,7 @@ public static partial class Util $"{actor.Address.ToInt64():X}:{actor.GameObjectId:X}[{tag}] - {actor.ObjectKind} - {actor.Name} - X{actor.Position.X} Y{actor.Position.Y} Z{actor.Position.Z} D{actor.YalmDistanceX} R{actor.Rotation} - Target: {actor.TargetObjectId:X}\n"; if (actor is Npc npc) - actorString += $" DataId: {npc.DataId} NameId:{npc.NameId}\n"; + actorString += $" BaseId: {npc.BaseId} NameId:{npc.NameId}\n"; if (actor is ICharacter chara) { @@ -787,7 +787,7 @@ public static partial class Util $"{actor.Address.ToInt64():X}:{actor.GameObjectId:X}[{tag}] - {actor.ObjectKind} - {actor.Name} - X{actor.Position.X} Y{actor.Position.Y} Z{actor.Position.Z} D{actor.YalmDistanceX} R{actor.Rotation} - Target: {actor.TargetObjectId:X}\n"; if (actor is Npc npc) - actorString += $" DataId: {npc.DataId} NameId:{npc.NameId}\n"; + actorString += $" BaseId: {npc.BaseId} NameId:{npc.NameId}\n"; if (actor is Character chara) {