Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions FFXIVClientStructs/FFXIV/Client/UI/AddonCabinet.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using FFXIVClientStructs.FFXIV.Component.GUI;

namespace FFXIVClientStructs.FFXIV.Client.UI;

// Client::UI::AddonCabinet
// Component::GUI::AtkUnitBase
// Component::GUI::AtkEventListener
[Addon("Cabinet")]
[GenerateInterop]
[Inherits<AtkUnitBase>]
[StructLayout(LayoutKind.Explicit, Size = 0x4B88)]
public unsafe partial struct AddonCabinet {
// Count of populated slots = NumberArrayData[0x30][0]. Slots past that count are stale.
[FieldOffset(0x238), FixedSizeArray] internal FixedSizeArray140<ItemSlot> _itemSlots;

// Category names shown in the dropdown, populated from AtkValue args on setup.
[FieldOffset(0x4838), FixedSizeArray] internal FixedSizeArray7<Utf8String> _categoryNames;

[FieldOffset(0x4B10)] public AtkComponentList* ItemList;
[FieldOffset(0x4B18)] public AtkResNode* TimelineNode;
[FieldOffset(0x4B28)] public AtkComponentDropDownList* CategoryDropDown;
[FieldOffset(0x4B58)] public AtkComponentButton* CloseButton;
[FieldOffset(0x4B60)] public uint CategoryIndex; // 0xFFFFFFFF until first render

[StructLayout(LayoutKind.Explicit, Size = 0x80)]
public struct ItemSlot {
[FieldOffset(0x00)] public Utf8String Name;
[FieldOffset(0x68)] public uint Unk68; // ItemCache.Unk74; fed to image node renderer
[FieldOffset(0x6C)] public uint InventorySlotIndex; // slot index within the found InventoryContainer
[FieldOffset(0x70)] public uint InventoryContainerType; // InventoryType where the item is held/equipped
[FieldOffset(0x74)] public uint ItemsArrayIndex; // index into AgentCabinet.Items[]
[FieldOffset(0x78)] public float ConditionNormalized; // item condition as Condition / 30000f
}
}
12 changes: 10 additions & 2 deletions FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentCabinet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@ namespace FFXIVClientStructs.FFXIV.Client.UI.Agent;
[StructLayout(LayoutKind.Explicit, Size = 0x4AD8)]
public unsafe partial struct AgentCabinet {
[FieldOffset(0x30)] public uint ConfirmationAddonId;
[FieldOffset(0x34)] public uint SelectedIndex;
[FieldOffset(0x34)] public uint SelectedIndex; // index into Items[]
[FieldOffset(0x38)] public uint OpenMode; // 0 = normal cabinet, 2 = MiragePrism plate selection
[FieldOffset(0x40)] public uint SelectedItemId; // game item ID of the selected item

[FieldOffset(0x4AB0)] public CabinetItem* Items; // length: Cabinet RowCount
[FieldOffset(0x49)] public byte SelectedCategoryIndex; // dropdown selection as (index + 1);
[FieldOffset(0x4A)] public bool PendingUpdate; // set to true on category change; triggers item list rebuild in Update

[FieldOffset(0x50), FixedSizeArray] internal FixedSizeArray140<RaptureAtkModule.ItemCache> _itemCaches;

[FieldOffset(0x4AB0)] public CabinetItem* Items; // all valid Cabinet rows sorted by category; length: ItemCount
[FieldOffset(0x4AB8)] public uint ItemCount; // total valid Cabinet rows across all categories

[StructLayout(LayoutKind.Explicit, Size = 0x10)]
public struct CabinetItem {
Expand Down
Loading