From 401a1b4cd911ced39555f6117e985ec238a18948 Mon Sep 17 00:00:00 2001 From: Knightmore <35805408+Knightmore@users.noreply.github.com> Date: Tue, 30 Dec 2025 01:50:46 +0100 Subject: [PATCH 01/10] Update AgentRepair.cs --- .../FFXIV/Client/UI/Agent/AgentRepair.cs | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs b/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs index d5c92a6ec..8421c9e39 100644 --- a/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs +++ b/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs @@ -10,29 +10,29 @@ namespace FFXIVClientStructs.FFXIV.Client.UI.Agent; [Inherits] [StructLayout(LayoutKind.Explicit, Size = 0xDE0)] public unsafe partial struct AgentRepair { - [FieldOffset(0x28)] private nint Unk_28; - [FieldOffset(0x30)] public bool IsSelfRepairOpen; - [FieldOffset(0x31)] public bool UseSelfRepair; - [FieldOffset(0x38)] private nint CustomTalkHandler; // assigned when using NPC. .data:0000000142740FB8 off_142740FB8 dq offset off_142175380 ; - [FieldOffset(0x40)] public int SelectedItemInventoryType; - [FieldOffset(0x44)] public ushort SelectedItemInventorySlot; - [FieldOffset(0x48)] public int SelectedItemId; - [FieldOffset(0x50)] public int AddonId_SelectYesno; - [FieldOffset(0x54)] public int InventoryContainerIndex; // Used to lookup static array. Mapped index ids of repair gear dropdown. (7 = Equipped, 0 = Main/Off Hand, 1 = Head/Body/Hands, ...) - [FieldOffset(0x58)] public int SelectedItemIndex; - [FieldOffset(0x5C)] public int ShownRepairEntryAmount; - [FieldOffset(0x60)] public int TotalRepairCost; - [FieldOffset(0x68)] private nint Unk_68; // points to a data structure that holds all information about the currently shown repairable items. likely some Atk Data? - [FieldOffset(0x70)] private nint Unk_70; // same pointer as in Unk_68 - [FieldOffset(0x78)] private nint Unk_78; - [FieldOffset(0x80)][FixedSizeArray] internal FixedSizeArray140 _repairItemInfos; - [FieldOffset(0x948)] private byte Unk_948; // Seems to be some loading state - [FieldOffset(0x94C)] public int RepairEntriesAmount; + [FieldOffset(0x30)] private nint Unk_28; + [FieldOffset(0x38)] public bool IsSelfRepairOpen; + [FieldOffset(0x39)] public bool UseSelfRepair; + [FieldOffset(0x40)] private nint CustomTalkHandler; // assigned when using NPC. .data:0000000142740FB8 off_142740FB8 dq offset off_142175380 ; + [FieldOffset(0x48)] public int SelectedItemInventoryType; + [FieldOffset(0x4C)] public ushort SelectedItemInventorySlot; + [FieldOffset(0x50)] public int SelectedItemId; + [FieldOffset(0x58)] public int AddonId_SelectYesno; + [FieldOffset(0x5C)] public int InventoryContainerIndex; // Used to lookup static array. Mapped index ids of repair gear dropdown. (7 = Equipped, 0 = Main/Off Hand, 1 = Head/Body/Hands, ...) + [FieldOffset(0x60)] public int SelectedItemIndex; + [FieldOffset(0x64)] public int ShownRepairEntryAmount; + [FieldOffset(0x68)] public int TotalRepairCost; + [FieldOffset(0x70)] private nint Unk_70; // points to a data structure that holds all information about the currently shown repairable items. likely some Atk Data? + [FieldOffset(0x78)] private nint Unk_78; // same pointer as in Unk_68 + [FieldOffset(0x80)] private nint Unk_80; + [FieldOffset(0x88)][FixedSizeArray] internal FixedSizeArray140 _repairItemInfos; + [FieldOffset(0x948)] private byte Unk_948; // Loading state for InventoryItemEntries. Is true while InventoryItemEntryAmount and Unk_850 are unequal + [FieldOffset(0x94C)] public int InventoryItemEntryAmount; [FieldOffset(0x950)] private int Unk_950; // Ends to be the same number as in RepairEntriesAmount. Maybe some counter for adding up AtkEntries. - [FieldOffset(0x954)][FixedSizeArray] internal FixedSizeArray140 _repairEntries; + [FieldOffset(0x954)][FixedSizeArray] internal FixedSizeArray140 _inventoryItemEntries; // Holds all items of the selected InventoryContainerIndex in the same order as ItemODR [FieldOffset(0xDB4)] private int Unk_DB4; // This is checked in AgentRepair_Update for 1 or 2 [FieldOffset(0xDB8)] private int Unk_DB8; // Some InventoryType - [FieldOffset(0xDBC)] private ushort Unk_DBC; + [FieldOffset(0xDBC)] private ushort Unk_DBC; [FieldOffset(0xDC0)] private nint Unk_DC0; [FieldOffset(0xDC8)] private int Unk_DC8; [FieldOffset(0xDCC)] private byte Unk_DCC; @@ -44,7 +44,7 @@ public unsafe partial struct AgentRepair { [MemberFunction("E8 ?? ?? ?? ?? 40 F6 C7 08 74 2D")] public partial RepairEntry* ChangeInventoryContainer(bool arg0); // false for self- and NPC-Repair but will be set in 0xDCC. unsure for what that's used. - [StructLayout(LayoutKind.Explicit, Size = 0x10)] + [StructLayout(LayoutKind.Explicit, Size = 0x16)] public struct RepairItemInfo { [FieldOffset(0x0)] public int InventoryType; [FieldOffset(0x4)] public ushort Slot; @@ -52,8 +52,8 @@ public struct RepairItemInfo { } [StructLayout(LayoutKind.Explicit, Size = 0x8)] - public struct RepairEntry { + public struct ItemEntry { [FieldOffset(0x0)] public uint InventoryType; - [FieldOffset(0x4)] private uint Unk_4; + [FieldOffset(0x4)] public uint Slot; } } From 7cf2e358e0d4851250a105ae4442995e83666ad6 Mon Sep 17 00:00:00 2001 From: Knightmore <35805408+Knightmore@users.noreply.github.com> Date: Tue, 30 Dec 2025 01:55:51 +0100 Subject: [PATCH 02/10] Rename ChangeInventoryContainer return type to ItemEntry --- FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs b/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs index 8421c9e39..be9c3aa5b 100644 --- a/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs +++ b/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs @@ -42,7 +42,7 @@ public unsafe partial struct AgentRepair { [MemberFunction("E8 ?? ?? ?? ?? 40 F6 C7 08 74 2D")] - public partial RepairEntry* ChangeInventoryContainer(bool arg0); // false for self- and NPC-Repair but will be set in 0xDCC. unsure for what that's used. + public partial ItemEntry* ChangeInventoryContainer(bool arg0); // false for self- and NPC-Repair but will be set in 0xDCC. unsure for what that's used. [StructLayout(LayoutKind.Explicit, Size = 0x16)] public struct RepairItemInfo { From 4e4e013cefe2456194e4fd9753e0d6e135fd78df Mon Sep 17 00:00:00 2001 From: Knightmore <35805408+Knightmore@users.noreply.github.com> Date: Tue, 30 Dec 2025 02:04:27 +0100 Subject: [PATCH 03/10] Fix struct size for RepairItemInfo in AgentRepair --- FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs b/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs index be9c3aa5b..8004a2432 100644 --- a/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs +++ b/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs @@ -44,7 +44,7 @@ public unsafe partial struct AgentRepair { [MemberFunction("E8 ?? ?? ?? ?? 40 F6 C7 08 74 2D")] public partial ItemEntry* ChangeInventoryContainer(bool arg0); // false for self- and NPC-Repair but will be set in 0xDCC. unsure for what that's used. - [StructLayout(LayoutKind.Explicit, Size = 0x16)] + [StructLayout(LayoutKind.Explicit, Size = 0x10)] public struct RepairItemInfo { [FieldOffset(0x0)] public int InventoryType; [FieldOffset(0x4)] public ushort Slot; From 3f3f642232cdba8e8b19726ac63c99cba8e4baad Mon Sep 17 00:00:00 2001 From: Knightmore <35805408+Knightmore@users.noreply.github.com> Date: Tue, 30 Dec 2025 10:28:02 +0100 Subject: [PATCH 04/10] Update AgentRepair.cs Adjusted some names and comments (for a better understanding) which I forgot last night --- .../FFXIV/Client/UI/Agent/AgentRepair.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs b/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs index 8004a2432..cb6143024 100644 --- a/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs +++ b/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs @@ -10,7 +10,7 @@ namespace FFXIVClientStructs.FFXIV.Client.UI.Agent; [Inherits] [StructLayout(LayoutKind.Explicit, Size = 0xDE0)] public unsafe partial struct AgentRepair { - [FieldOffset(0x30)] private nint Unk_28; + [FieldOffset(0x30)] private nint Unk_30; [FieldOffset(0x38)] public bool IsSelfRepairOpen; [FieldOffset(0x39)] public bool UseSelfRepair; [FieldOffset(0x40)] private nint CustomTalkHandler; // assigned when using NPC. .data:0000000142740FB8 off_142740FB8 dq offset off_142175380 ; @@ -20,15 +20,15 @@ public unsafe partial struct AgentRepair { [FieldOffset(0x58)] public int AddonId_SelectYesno; [FieldOffset(0x5C)] public int InventoryContainerIndex; // Used to lookup static array. Mapped index ids of repair gear dropdown. (7 = Equipped, 0 = Main/Off Hand, 1 = Head/Body/Hands, ...) [FieldOffset(0x60)] public int SelectedItemIndex; - [FieldOffset(0x64)] public int ShownRepairEntryAmount; + [FieldOffset(0x64)] public int RepairableItemAmount; [FieldOffset(0x68)] public int TotalRepairCost; [FieldOffset(0x70)] private nint Unk_70; // points to a data structure that holds all information about the currently shown repairable items. likely some Atk Data? - [FieldOffset(0x78)] private nint Unk_78; // same pointer as in Unk_68 + [FieldOffset(0x78)] private nint Unk_78; // same pointer as in Unk_70 [FieldOffset(0x80)] private nint Unk_80; [FieldOffset(0x88)][FixedSizeArray] internal FixedSizeArray140 _repairItemInfos; - [FieldOffset(0x948)] private byte Unk_948; // Loading state for InventoryItemEntries. Is true while InventoryItemEntryAmount and Unk_850 are unequal - [FieldOffset(0x94C)] public int InventoryItemEntryAmount; - [FieldOffset(0x950)] private int Unk_950; // Ends to be the same number as in RepairEntriesAmount. Maybe some counter for adding up AtkEntries. + [FieldOffset(0x948)] private byte Unk_948; // Loading state for InventoryItemEntries. Is true while InventoryItemEntryAmount and Unk_950 are unequal + [FieldOffset(0x94C)] public int InventoryItemEntryAmount; // Amount of total inventory items for the selected InventoryContainerIndex + [FieldOffset(0x950)] private int Unk_950; // Ends to be the same number as in InventoryItemEntryAmount. Could be the amount of items in InventoryItemEntries after it loaded. [FieldOffset(0x954)][FixedSizeArray] internal FixedSizeArray140 _inventoryItemEntries; // Holds all items of the selected InventoryContainerIndex in the same order as ItemODR [FieldOffset(0xDB4)] private int Unk_DB4; // This is checked in AgentRepair_Update for 1 or 2 [FieldOffset(0xDB8)] private int Unk_DB8; // Some InventoryType From b5c46a54b7bae490ed59f1b59728daeef7bc7758 Mon Sep 17 00:00:00 2001 From: Knightmore <35805408+Knightmore@users.noreply.github.com> Date: Thu, 1 Jan 2026 23:49:49 +0100 Subject: [PATCH 05/10] Adjusting breaking changes --- .../FFXIV/Client/UI/Agent/AgentRepair.cs | 41 ++++++++++++++++--- ida/data.yml | 2 +- 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs b/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs index cb6143024..d3da8e575 100644 --- a/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs +++ b/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs @@ -10,6 +10,7 @@ namespace FFXIVClientStructs.FFXIV.Client.UI.Agent; [Inherits] [StructLayout(LayoutKind.Explicit, Size = 0xDE0)] public unsafe partial struct AgentRepair { + [FieldOffset(0x28)] private nint Unk_28; // new VTable that seems to be used with the new "Repair all" function. off_1420D26F0 dq offset sub_140C4F040 ; [FieldOffset(0x30)] private nint Unk_30; [FieldOffset(0x38)] public bool IsSelfRepairOpen; [FieldOffset(0x39)] public bool UseSelfRepair; @@ -18,7 +19,7 @@ public unsafe partial struct AgentRepair { [FieldOffset(0x4C)] public ushort SelectedItemInventorySlot; [FieldOffset(0x50)] public int SelectedItemId; [FieldOffset(0x58)] public int AddonId_SelectYesno; - [FieldOffset(0x5C)] public int InventoryContainerIndex; // Used to lookup static array. Mapped index ids of repair gear dropdown. (7 = Equipped, 0 = Main/Off Hand, 1 = Head/Body/Hands, ...) + [FieldOffset(0x5C)] public InventoryContainer InventoryContainerIndex; // Used to lookup static array. Mapped index ids of repair gear dropdown. (7 = Equipped, 0 = Main/Off Hand, 1 = Head/Body/Hands, ...) [FieldOffset(0x60)] public int SelectedItemIndex; [FieldOffset(0x64)] public int RepairableItemAmount; [FieldOffset(0x68)] public int TotalRepairCost; @@ -28,8 +29,12 @@ public unsafe partial struct AgentRepair { [FieldOffset(0x88)][FixedSizeArray] internal FixedSizeArray140 _repairItemInfos; [FieldOffset(0x948)] private byte Unk_948; // Loading state for InventoryItemEntries. Is true while InventoryItemEntryAmount and Unk_950 are unequal [FieldOffset(0x94C)] public int InventoryItemEntryAmount; // Amount of total inventory items for the selected InventoryContainerIndex + [Obsolete("RepairEntriesAmount is deprecated, please use InventoryItemEntryAmount instead.")] + [FieldOffset(0x94C)] public int RepairEntriesAmount; [FieldOffset(0x950)] private int Unk_950; // Ends to be the same number as in InventoryItemEntryAmount. Could be the amount of items in InventoryItemEntries after it loaded. [FieldOffset(0x954)][FixedSizeArray] internal FixedSizeArray140 _inventoryItemEntries; // Holds all items of the selected InventoryContainerIndex in the same order as ItemODR + [Obsolete("_repairEntries is deprecated, please use _inventoryItemEntries instead.")] + [FieldOffset(0x954)][FixedSizeArray] internal FixedSizeArray140 _repairEntries; [FieldOffset(0xDB4)] private int Unk_DB4; // This is checked in AgentRepair_Update for 1 or 2 [FieldOffset(0xDB8)] private int Unk_DB8; // Some InventoryType [FieldOffset(0xDBC)] private ushort Unk_DBC; @@ -38,11 +43,19 @@ public unsafe partial struct AgentRepair { [FieldOffset(0xDCC)] private byte Unk_DCC; [FieldOffset(0xDD0)] private int Unk_DDD0; // Maybe some AddonId [FieldOffset(0xDD4)] private bool Unk_DD4; // Some state. Is set from argument in ChangeInventoryContainer. Changes for a short amount of time to true after "Repair all" + + [Obsolete("ChangeInventoryContainer is deprecated, please use ChangeRepairInventory instead.")] + [MemberFunction("E8 ?? ?? ?? ?? 40 F6 C7 08 74 2D")] + public partial RepairEntry* ChangeInventoryContainer(bool arg0); // false for self- and NPC-Repair but will be set in 0xDCC. unsure for what that's used. - - + /// + /// Changes the selected inventory container of the repair gear dropdown. + /// + /// + /// Needs InventoryContainerIndex to be set first. (7 = Equipped, 0 = Main/Off Hand, 1 = Head/Body/Hands, ...) + /// [MemberFunction("E8 ?? ?? ?? ?? 40 F6 C7 08 74 2D")] - public partial ItemEntry* ChangeInventoryContainer(bool arg0); // false for self- and NPC-Repair but will be set in 0xDCC. unsure for what that's used. + public partial ItemEntry* ChangeRepairInventory(bool arg0); // false for self- and NPC-Repair but will be set in 0xDCC. unsure for what that's used. [StructLayout(LayoutKind.Explicit, Size = 0x10)] public struct RepairItemInfo { @@ -56,4 +69,22 @@ public struct ItemEntry { [FieldOffset(0x0)] public uint InventoryType; [FieldOffset(0x4)] public uint Slot; } -} + + [Obsolete("RepairEntry is deprecated, please use ItemEntry instead.")] + [StructLayout(LayoutKind.Explicit, Size = 0x8)] + public struct RepairEntry { + [FieldOffset(0x0)] public uint InventoryType; + [FieldOffset(0x4)] public uint Slot; + } + + public enum InventoryContainer : int { + None = -1, + Equipped, + MainHandOffHand, + HeadBodyHands, + LegsFeet, + NeckEars, + WristsRing, + Inventory + } +} \ No newline at end of file diff --git a/ida/data.yml b/ida/data.yml index ce71cf5fd..7a5bb96c3 100644 --- a/ida/data.yml +++ b/ida/data.yml @@ -11419,7 +11419,7 @@ classes: base: Client::UI::Agent::AgentInterface funcs: 0x140BE4F30: ctor - 0x140BE5720: ChangeInventoryContainer + 0x140BE5720: ChangeRepairInventory Client::UI::Agent::AgentRepairRequest: vtbls: - ea: 0x1420D28A8 From b8c164ae9a7f61c257049ebae7b7334671771f7f Mon Sep 17 00:00:00 2001 From: Knightmore <35805408+Knightmore@users.noreply.github.com> Date: Thu, 1 Jan 2026 23:58:44 +0100 Subject: [PATCH 06/10] Deprecate RepairableItemAmount, add ShownRepairEntryAmount Replaced RepairableItemAmount with ShownRepairEntryAmount and marked the old field as obsolete. --- FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs b/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs index d3da8e575..6f9eaeb05 100644 --- a/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs +++ b/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs @@ -21,7 +21,9 @@ public unsafe partial struct AgentRepair { [FieldOffset(0x58)] public int AddonId_SelectYesno; [FieldOffset(0x5C)] public InventoryContainer InventoryContainerIndex; // Used to lookup static array. Mapped index ids of repair gear dropdown. (7 = Equipped, 0 = Main/Off Hand, 1 = Head/Body/Hands, ...) [FieldOffset(0x60)] public int SelectedItemIndex; + [Obsolete("RepairableItemAmount is deprecated, please use ShownRepairEntryAmount instead.")] [FieldOffset(0x64)] public int RepairableItemAmount; + [FieldOffset(0x64)] public int ShownRepairEntryAmount; [FieldOffset(0x68)] public int TotalRepairCost; [FieldOffset(0x70)] private nint Unk_70; // points to a data structure that holds all information about the currently shown repairable items. likely some Atk Data? [FieldOffset(0x78)] private nint Unk_78; // same pointer as in Unk_70 @@ -87,4 +89,4 @@ public enum InventoryContainer : int { WristsRing, Inventory } -} \ No newline at end of file +} From ef4fd5eeacfc68f408d1fe19fe5d1dff4e35ce55 Mon Sep 17 00:00:00 2001 From: Knightmore <35805408+Knightmore@users.noreply.github.com> Date: Fri, 2 Jan 2026 10:22:18 +0100 Subject: [PATCH 07/10] Deprecate InventoryContainerIndex and update comments --- FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs b/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs index 6f9eaeb05..929f8db48 100644 --- a/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs +++ b/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs @@ -19,7 +19,9 @@ public unsafe partial struct AgentRepair { [FieldOffset(0x4C)] public ushort SelectedItemInventorySlot; [FieldOffset(0x50)] public int SelectedItemId; [FieldOffset(0x58)] public int AddonId_SelectYesno; - [FieldOffset(0x5C)] public InventoryContainer InventoryContainerIndex; // Used to lookup static array. Mapped index ids of repair gear dropdown. (7 = Equipped, 0 = Main/Off Hand, 1 = Head/Body/Hands, ...) + [Obsolete("InventoryContainerIndex is deprecated, please use InventoryContainer instead.")] + [FieldOffset(0x5C)] public int InventoryContainerIndex; // Used to lookup static array. Mapped index ids of repair gear dropdown. (7 = Equipped, 0 = Main/Off Hand, 1 = Head/Body/Hands, ...) + [FieldOffset(0x5C)] public InventoryContainer InventoryContainer; [FieldOffset(0x60)] public int SelectedItemIndex; [Obsolete("RepairableItemAmount is deprecated, please use ShownRepairEntryAmount instead.")] [FieldOffset(0x64)] public int RepairableItemAmount; From ecd31c07532ae0b87c51819eaf873a69b95833c6 Mon Sep 17 00:00:00 2001 From: Knightmore <35805408+Knightmore@users.noreply.github.com> Date: Fri, 2 Jan 2026 10:28:10 +0100 Subject: [PATCH 08/10] Rename InventoryContainer to InventoryContainerType --- FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs b/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs index 929f8db48..ed4c23d8d 100644 --- a/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs +++ b/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs @@ -21,7 +21,7 @@ public unsafe partial struct AgentRepair { [FieldOffset(0x58)] public int AddonId_SelectYesno; [Obsolete("InventoryContainerIndex is deprecated, please use InventoryContainer instead.")] [FieldOffset(0x5C)] public int InventoryContainerIndex; // Used to lookup static array. Mapped index ids of repair gear dropdown. (7 = Equipped, 0 = Main/Off Hand, 1 = Head/Body/Hands, ...) - [FieldOffset(0x5C)] public InventoryContainer InventoryContainer; + [FieldOffset(0x5C)] public InventoryContainerType InventoryContainer; [FieldOffset(0x60)] public int SelectedItemIndex; [Obsolete("RepairableItemAmount is deprecated, please use ShownRepairEntryAmount instead.")] [FieldOffset(0x64)] public int RepairableItemAmount; @@ -81,7 +81,7 @@ public struct RepairEntry { [FieldOffset(0x4)] public uint Slot; } - public enum InventoryContainer : int { + public enum InventoryContainerType : int { None = -1, Equipped, MainHandOffHand, From 369b5c8fc6554ec45a27364d2566f291ca399e70 Mon Sep 17 00:00:00 2001 From: Haselnussbomber Date: Sat, 3 Jan 2026 19:51:42 +0100 Subject: [PATCH 09/10] Update AgentRepair --- .../Client/Game/Event/NpcRepairCallback.cs | 14 +++ .../FFXIV/Client/Game/InventoryItemRef.cs | 9 ++ .../FFXIV/Client/Game/RepairManager.cs | 7 +- .../FFXIV/Client/UI/Agent/AgentRepair.cs | 101 +++++++++--------- 4 files changed, 82 insertions(+), 49 deletions(-) create mode 100644 FFXIVClientStructs/FFXIV/Client/Game/Event/NpcRepairCallback.cs create mode 100644 FFXIVClientStructs/FFXIV/Client/Game/InventoryItemRef.cs diff --git a/FFXIVClientStructs/FFXIV/Client/Game/Event/NpcRepairCallback.cs b/FFXIVClientStructs/FFXIV/Client/Game/Event/NpcRepairCallback.cs new file mode 100644 index 000000000..ce464c2a9 --- /dev/null +++ b/FFXIVClientStructs/FFXIV/Client/Game/Event/NpcRepairCallback.cs @@ -0,0 +1,14 @@ +using FFXIVClientStructs.FFXIV.Component.GUI; + +namespace FFXIVClientStructs.FFXIV.Client.Game.Event; + +// Client::Game::Event::NpcRepairCallback +// Client::Game::Event::UICallbackBase +// Client::Game::Event::UICallbackBaseInterface +// Component::GUI::AtkModuleInterface::AtkEventInterface +[GenerateInterop] +[Inherits] +[StructLayout(LayoutKind.Explicit, Size = 0x30)] +public unsafe partial struct NpcRepairCallback { + [FieldOffset(0x10)] public CustomTalkEventHandler* EventHandler; +} diff --git a/FFXIVClientStructs/FFXIV/Client/Game/InventoryItemRef.cs b/FFXIVClientStructs/FFXIV/Client/Game/InventoryItemRef.cs new file mode 100644 index 000000000..deab5bab6 --- /dev/null +++ b/FFXIVClientStructs/FFXIV/Client/Game/InventoryItemRef.cs @@ -0,0 +1,9 @@ +namespace FFXIVClientStructs.FFXIV.Client.Game; + +[StructLayout(LayoutKind.Explicit, Size = 0x10)] +public struct InventoryItemRef { + [FieldOffset(0x00)] public InventoryType Container; + [FieldOffset(0x04)] public short Slot; + [FieldOffset(0x08)] public uint ItemId; + [FieldOffset(0x0C)] private int UnkC; // used by AgentFreeCompanyChest, AgentTradeMultiple +} diff --git a/FFXIVClientStructs/FFXIV/Client/Game/RepairManager.cs b/FFXIVClientStructs/FFXIV/Client/Game/RepairManager.cs index 9bdc16e29..b41967cbf 100644 --- a/FFXIVClientStructs/FFXIV/Client/Game/RepairManager.cs +++ b/FFXIVClientStructs/FFXIV/Client/Game/RepairManager.cs @@ -1,12 +1,17 @@ +using FFXIVClientStructs.FFXIV.Common.Component.Excel; + namespace FFXIVClientStructs.FFXIV.Client.Game; // Client::Game::RepairManager [GenerateInterop] -[StructLayout(LayoutKind.Explicit, Size = 0x8)] +[StructLayout(LayoutKind.Explicit, Size = 0x78)] public unsafe partial struct RepairManager { [StaticAddress("48 8D 0D ?? ?? ?? ?? BA ?? ?? ?? ?? 41 0F 94 C0 45 33 C9", 3)] public static partial RepairManager* Instance(); + [FieldOffset(0x08)] private ExcelSheet* ItemSheet; + [FieldOffset(0x10)] private ExcelSheetWaiter* SheetWaiter; + [MemberFunction("E8 ?? ?? ?? ?? E9 ?? ?? ?? ?? 48 83 F8 03 75 46")] public partial bool RepairItem(InventoryType itemToRepairInventory, ushort itemToRepairSlot, bool isNpc); diff --git a/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs b/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs index ed4c23d8d..90f1a7973 100644 --- a/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs +++ b/FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentRepair.cs @@ -1,4 +1,6 @@ using FFXIVClientStructs.FFXIV.Client.Game; +using FFXIVClientStructs.FFXIV.Client.Game.Event; +using FFXIVClientStructs.FFXIV.Client.System.String; namespace FFXIVClientStructs.FFXIV.Client.UI.Agent; @@ -10,45 +12,47 @@ namespace FFXIVClientStructs.FFXIV.Client.UI.Agent; [Inherits] [StructLayout(LayoutKind.Explicit, Size = 0xDE0)] public unsafe partial struct AgentRepair { - [FieldOffset(0x28)] private nint Unk_28; // new VTable that seems to be used with the new "Repair all" function. off_1420D26F0 dq offset sub_140C4F040 ; - [FieldOffset(0x30)] private nint Unk_30; + [FieldOffset(0x28)] private nint Unk28; // new VTable that seems to be used with the new "Repair all" function + [FieldOffset(0x30)] public InventoryItem* TargetInventorySlot; // temporarily set when opening via rightlick on an item [FieldOffset(0x38)] public bool IsSelfRepairOpen; [FieldOffset(0x39)] public bool UseSelfRepair; - [FieldOffset(0x40)] private nint CustomTalkHandler; // assigned when using NPC. .data:0000000142740FB8 off_142740FB8 dq offset off_142175380 ; - [FieldOffset(0x48)] public int SelectedItemInventoryType; - [FieldOffset(0x4C)] public ushort SelectedItemInventorySlot; - [FieldOffset(0x50)] public int SelectedItemId; - [FieldOffset(0x58)] public int AddonId_SelectYesno; - [Obsolete("InventoryContainerIndex is deprecated, please use InventoryContainer instead.")] - [FieldOffset(0x5C)] public int InventoryContainerIndex; // Used to lookup static array. Mapped index ids of repair gear dropdown. (7 = Equipped, 0 = Main/Off Hand, 1 = Head/Body/Hands, ...) - [FieldOffset(0x5C)] public InventoryContainerType InventoryContainer; + [FieldOffset(0x40)] public NpcRepairCallback* NpcRepairCallback; + [FieldOffset(0x48)] public InventoryItemRef SelectedItem; + [FieldOffset(0x58)] public int DialogAddonId; + [FieldOffset(0x5C)] public ItemFilter Filter; [FieldOffset(0x60)] public int SelectedItemIndex; - [Obsolete("RepairableItemAmount is deprecated, please use ShownRepairEntryAmount instead.")] - [FieldOffset(0x64)] public int RepairableItemAmount; [FieldOffset(0x64)] public int ShownRepairEntryAmount; [FieldOffset(0x68)] public int TotalRepairCost; - [FieldOffset(0x70)] private nint Unk_70; // points to a data structure that holds all information about the currently shown repairable items. likely some Atk Data? - [FieldOffset(0x78)] private nint Unk_78; // same pointer as in Unk_70 - [FieldOffset(0x80)] private nint Unk_80; - [FieldOffset(0x88)][FixedSizeArray] internal FixedSizeArray140 _repairItemInfos; - [FieldOffset(0x948)] private byte Unk_948; // Loading state for InventoryItemEntries. Is true while InventoryItemEntryAmount and Unk_950 are unequal - [FieldOffset(0x94C)] public int InventoryItemEntryAmount; // Amount of total inventory items for the selected InventoryContainerIndex - [Obsolete("RepairEntriesAmount is deprecated, please use InventoryItemEntryAmount instead.")] - [FieldOffset(0x94C)] public int RepairEntriesAmount; - [FieldOffset(0x950)] private int Unk_950; // Ends to be the same number as in InventoryItemEntryAmount. Could be the amount of items in InventoryItemEntries after it loaded. - [FieldOffset(0x954)][FixedSizeArray] internal FixedSizeArray140 _inventoryItemEntries; // Holds all items of the selected InventoryContainerIndex in the same order as ItemODR - [Obsolete("_repairEntries is deprecated, please use _inventoryItemEntries instead.")] - [FieldOffset(0x954)][FixedSizeArray] internal FixedSizeArray140 _repairEntries; - [FieldOffset(0xDB4)] private int Unk_DB4; // This is checked in AgentRepair_Update for 1 or 2 - [FieldOffset(0xDB8)] private int Unk_DB8; // Some InventoryType - [FieldOffset(0xDBC)] private ushort Unk_DBC; - [FieldOffset(0xDC0)] private nint Unk_DC0; - [FieldOffset(0xDC8)] private int Unk_DC8; - [FieldOffset(0xDCC)] private byte Unk_DCC; - [FieldOffset(0xDD0)] private int Unk_DDD0; // Maybe some AddonId - [FieldOffset(0xDD4)] private bool Unk_DD4; // Some state. Is set from argument in ChangeInventoryContainer. Changes for a short amount of time to true after "Repair all" - - [Obsolete("ChangeInventoryContainer is deprecated, please use ChangeRepairInventory instead.")] + /// Temporarily used while refreshing. 3 per Item. + [FieldOffset(0x70)] private StdVector Strings; + [FieldOffset(0x88), FixedSizeArray] internal FixedSizeArray140 _filterItemRefs; + [FieldOffset(0x948)] public bool IsAddonRefreshPending; + /// Amount of total inventory items for the selected + [FieldOffset(0x94C)] public int FilterItemCount; + [FieldOffset(0x950)] public int ProcessedFilterItemCount; + /// Holds all items of the selected Filter in the same order as ItemODR + [FieldOffset(0x954), FixedSizeArray] internal FixedSizeArray140 _inventoryItemEntries; + [FieldOffset(0xDB4)] private int UnkDB4; // This is checked in AgentRepair_Update for 1 or 2 + [FieldOffset(0xDB8)] private InventoryItemRef UnkDB8ItemRef; // from here on saved state when opening RepairAuto? + [FieldOffset(0xDC8)] private ItemFilter UnkDC8Filter; + [FieldOffset(0xDCC)] private byte UnkDCC; + [FieldOffset(0xDD0)] private int UnkDD0AddonId; + [FieldOffset(0xDD4)] private bool UnkDD4; + [FieldOffset(0xDD5)] private bool UnkDD5; + [FieldOffset(0xDD6)] private bool UnkDD6; + [FieldOffset(0xDD8)] public int RepairAutoAddonId; + + [FieldOffset(0x48), Obsolete("Use SelectedItem.Container")] public int SelectedItemInventoryType; + [FieldOffset(0x4C), Obsolete("Use SelectedItem.Slot")] public ushort SelectedItemInventorySlot; + [FieldOffset(0x50), Obsolete("Use SelectedItem.ItemId")] public int SelectedItemId; + [FieldOffset(0x58), Obsolete("Renamed to DialogAddonId")] public int AddonId_SelectYesno; + [FieldOffset(0x5C), Obsolete("Renamed to Filter")] public int InventoryContainerIndex; + [FieldOffset(0x64), Obsolete("Renamed to ShownRepairEntryAmount")] public int RepairableItemAmount; + [FieldOffset(0x88), FixedSizeArray, Obsolete("Use to FilterItemRefs")] internal FixedSizeArray140 _repairItemInfos; + [FieldOffset(0x94C), Obsolete("Renamed to InventoryItemEntryAmount")] public int RepairEntriesAmount; + [FieldOffset(0x954), FixedSizeArray, Obsolete("Use InventoryItemEntries")] internal FixedSizeArray140 _repairEntries; + + [Obsolete("Use ChangeRepairInventory.")] [MemberFunction("E8 ?? ?? ?? ?? 40 F6 C7 08 74 2D")] public partial RepairEntry* ChangeInventoryContainer(bool arg0); // false for self- and NPC-Repair but will be set in 0xDCC. unsure for what that's used. @@ -56,11 +60,18 @@ public unsafe partial struct AgentRepair { /// Changes the selected inventory container of the repair gear dropdown. /// /// - /// Needs InventoryContainerIndex to be set first. (7 = Equipped, 0 = Main/Off Hand, 1 = Head/Body/Hands, ...) + /// Needs to be set first. /// [MemberFunction("E8 ?? ?? ?? ?? 40 F6 C7 08 74 2D")] public partial ItemEntry* ChangeRepairInventory(bool arg0); // false for self- and NPC-Repair but will be set in 0xDCC. unsure for what that's used. + [StructLayout(LayoutKind.Explicit, Size = 0x8)] + public struct ItemEntry { + [FieldOffset(0x0)] public InventoryType InventoryType; + [FieldOffset(0x4)] public int Slot; + } + + // TODO: remove (was replaced by InventoryItemRef) [StructLayout(LayoutKind.Explicit, Size = 0x10)] public struct RepairItemInfo { [FieldOffset(0x0)] public int InventoryType; @@ -68,27 +79,21 @@ public struct RepairItemInfo { [FieldOffset(0x8)] public int ItemId; } - [StructLayout(LayoutKind.Explicit, Size = 0x8)] - public struct ItemEntry { - [FieldOffset(0x0)] public uint InventoryType; - [FieldOffset(0x4)] public uint Slot; - } - - [Obsolete("RepairEntry is deprecated, please use ItemEntry instead.")] + // TODO: remove with ChangeInventoryContainer (was replaced by ItemEntry) [StructLayout(LayoutKind.Explicit, Size = 0x8)] public struct RepairEntry { [FieldOffset(0x0)] public uint InventoryType; [FieldOffset(0x4)] public uint Slot; } - public enum InventoryContainerType : int { + public enum ItemFilter { None = -1, Equipped, - MainHandOffHand, - HeadBodyHands, - LegsFeet, - NeckEars, - WristsRing, + ArmouryMainHandOffHand, + ArmouryHeadBodyHands, + ArmouryLegsFeet, + ArmouryNeckEars, + ArmouryWristsRing, Inventory } } From ff679be9380b30aa2975fa5bb888addb5d0b705a Mon Sep 17 00:00:00 2001 From: Haselnussbomber Date: Sat, 3 Jan 2026 20:04:27 +0100 Subject: [PATCH 10/10] Update data.yml --- ida/data.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ida/data.yml b/ida/data.yml index 7a5bb96c3..3ae90f641 100644 --- a/ida/data.yml +++ b/ida/data.yml @@ -1730,6 +1730,10 @@ classes: 0x14085F460: GetParameterValue 0x140B6DD50: GetParameterMaxValue #oldfail 0x1408A0170: GetEquipErrorLogMessageId # (this, race, sex, level, classJob, grandCompany, pvpRank, itemRow) + Client::Game::InventoryItemRef: + funcs: + 0x1401176F0: Set + 0x140117770: Get Client::Game::InventoryContainer: vtbls: - ea: 0x1420BC698 @@ -15068,6 +15072,10 @@ classes: vtbls: - ea: 0x1421DC4B8 base: Component::GUI::AtkModuleInterface::AtkEventInterface # this should be Client::Game::Event::UICallbackBase but it's too hard to find + Client::Game::Event::NpcRepairCallback: + vtbls: + - ea: 0x1421DC9E0 + base: Component::GUI::AtkModuleInterface::AtkEventInterface # this should be Client::Game::Event::UICallbackBase Client::Game::Event::EventSceneModule: funcs: 0x141709150: ctor