forked from aers/FFXIVClientStructs
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
2,362 additions
and
446 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
FFXIVClientStructs/FFXIV/Client/Game/Event/EventHandlerSelector.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using FFXIVClientStructs.FFXIV.Client.Game.Object; | ||
using FFXIVClientStructs.FFXIV.Component.GUI; | ||
|
||
namespace FFXIVClientStructs.FFXIV.Client.Game.Event; | ||
|
||
/// <summary> | ||
/// Singleton that manages selecting one of the multiple event handlers (eg. one of the several shops provided by a single vendor). | ||
/// </summary> | ||
[GenerateInterop] | ||
[Inherits<AtkModuleInterface.AtkEventInterface>] | ||
[StructLayout(LayoutKind.Explicit, Size = 0x428)] | ||
public unsafe partial struct EventHandlerSelector { | ||
[StaticAddress("48 8D 0D ?? ?? ?? ?? 48 63 C2 48 C1 E0 05", 3)] | ||
public static partial EventHandlerSelector* Instance(); | ||
|
||
[FieldOffset(0x010)] public GameObject* Target; // object corresponding to the active selection, null if selection is not active | ||
[FieldOffset(0x018), FixedSizeArray] internal FixedSizeArray32<Option> _options; | ||
[FieldOffset(0x418)] public int OptionsCount; // num valid elements in Options array | ||
|
||
[StructLayout(LayoutKind.Explicit, Size = 0x20)] | ||
public unsafe partial struct Option { | ||
[FieldOffset(0x00)] public int GlobalIndex; // index in Options array | ||
[FieldOffset(0x08)] public EventHandler* Handler; | ||
[FieldOffset(0x18)] public ushort IconId; | ||
[FieldOffset(0x1C)] public int LocalIndex; // sequence index for a single fill invocation, not sure what this is exactly | ||
} | ||
} |
126 changes: 126 additions & 0 deletions
126
FFXIVClientStructs/FFXIV/Client/Game/Event/ShopEventHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
using FFXIVClientStructs.FFXIV.Client.System.String; | ||
using FFXIVClientStructs.FFXIV.Common.Component.Excel; | ||
using FFXIVClientStructs.FFXIV.Component.GUI; | ||
|
||
namespace FFXIVClientStructs.FFXIV.Client.Game.Event; | ||
|
||
[GenerateInterop] | ||
[Inherits<EventHandler>] | ||
[StructLayout(LayoutKind.Explicit, Size = 0x32F0)] | ||
public unsafe partial struct ShopEventHandler { | ||
// 0x210: second base class, related to context menu integration for selling items | ||
// 0x218: third base class, related to buying items, not sure how it's used exactly | ||
|
||
[FieldOffset(0x0220)] public Utf8String ShopName; | ||
[FieldOffset(0x0288)] public uint ShopIcon; | ||
[FieldOffset(0x028C)] public GameMain.Festival Festival; | ||
[FieldOffset(0x0290)] public uint UnlockQuestId; | ||
// 0x294: byte, col 5 in GilShop row | ||
[FieldOffset(0x0298), FixedSizeArray] internal FixedSizeArray60<ShopItem> _items; | ||
[FieldOffset(0x29F8)] public int ItemsCount; // num valid entries in Items array | ||
[FieldOffset(0x29FC), FixedSizeArray] internal FixedSizeArray60<int> _visibleItems; // indices of items in Items array that are to be shown in shop | ||
[FieldOffset(0x2AEC)] public int VisibleItemsCount; // num valid entries in VisibleItems array | ||
[FieldOffset(0x2AF0)] public bool NeedSorting; // set after GilShopItem rows are loaded, used later when Item rows are loaded | ||
// 0x2AF8: int, ??? | ||
[FieldOffset(0x2AFC)] public int SellPriceBuy; // the vendor buy price of the item being sold | ||
[FieldOffset(0x2B00)] public int SellPrice; // the price vendor will pay for the item being sold (adjusted by materia etc) | ||
[FieldOffset(0x2B04)] public int SellStackMax; // max stack size of the item being sold | ||
[FieldOffset(0x2B08)] public bool SellIsUnique; // is item being sold unique? | ||
[FieldOffset(0x2B09)] public bool SellIsUntradeable; // is item attempted to be sold untradeable? | ||
[FieldOffset(0x2B0A)] public bool SellIsWithMateria; // is item being sold has attached materia? | ||
[FieldOffset(0x2B0B)] public bool SellIsFullySpiritbound; // is item being sold has full spiritbound? | ||
[FieldOffset(0x2B0C)] public bool SellIsCollectible; // is item being sold collectible? | ||
[FieldOffset(0x2B10)] public Utf8String SellItemName; | ||
[FieldOffset(0x2B78)] public int SellRarity; | ||
[FieldOffset(0x2B80), FixedSizeArray] internal FixedSizeArray10<BuybackItem> _buyback; | ||
[FieldOffset(0x32B0)] public int BuybackCount; // num valid entries in Buyback array | ||
[FieldOffset(0x32B4)] public bool StartingSell; // set while waiting for Item sheet reader to complete before to continue sell transaction | ||
[FieldOffset(0x32B5)] public bool StartingBuy; // set while waiting for Item sheet reader to complete before to continue buy transaction | ||
[FieldOffset(0x32B6)] public bool UpdatingBuybackItems; // set while waiting for Item sheet reader to update buyback item details | ||
[FieldOffset(0x32B7)] public bool BuybackTabActive; | ||
[FieldOffset(0x32B8)] public bool WaitingForSellConfirm; | ||
[FieldOffset(0x32B9)] public bool WaitingForTransactionToFinish; | ||
[FieldOffset(0x32BA)] public bool IsTradingWithRetainer; // if set, eg. will warn about transaction exceeding gil cap | ||
[FieldOffset(0x32BC)] public int CurrentMode; // 0 = none, 1 = normal, 2 = buyback | ||
[FieldOffset(0x32C0)] public int TransactionType; // 0 = n/a, 1 = buying, 2 = selling | ||
[FieldOffset(0x32C4)] public int BuyItemIndex; // index in Items or Buyback array, depending on mode | ||
[FieldOffset(0x32C8)] public uint TransactionItemId; // in Item row; set during all types of transactions | ||
[FieldOffset(0x32CC)] public int SellInventorySlot; | ||
[FieldOffset(0x32D0)] public int TransactionItemCount; // num items being bought/sold | ||
[FieldOffset(0x32D4)] public InventoryType SellInventoryType; | ||
// 0x32D8: int, ??? - related to sound effects being played, etcs | ||
[FieldOffset(0x32E0)] public void* SheetReader; | ||
[FieldOffset(0x32E8)] public ExcelSheet* CurrentSheet; | ||
|
||
[StructLayout(LayoutKind.Explicit, Size = 0xA8)] | ||
public unsafe partial struct ShopItem { | ||
[FieldOffset(0x00)] public uint ItemId; | ||
[FieldOffset(0x04)] public int PriceBuy; | ||
[FieldOffset(0x08)] public int PriceSell; | ||
[FieldOffset(0x0C)] public int NumOwned; | ||
[FieldOffset(0x10)] public int StackSize; | ||
[FieldOffset(0x14)] public bool IsUnique; | ||
[FieldOffset(0x18)] public uint CategoryIcon; | ||
// 0x1C: byte, col 2 in GilShopItem row | ||
// 0x1D: byte, col 3 in GilShopItem row | ||
[FieldOffset(0x20)] public Utf8String ItemName; | ||
[FieldOffset(0x88)] public bool IsHQ; | ||
[FieldOffset(0x8C)] public uint QuestRequired1; | ||
[FieldOffset(0x90)] public uint QuestRequired2; | ||
// 0x94: byte, col 7 in GilShopItem row, something to do with showing items that aren't yet unlocked | ||
[FieldOffset(0x98)] public uint SubRowId; // in GilShopItem sheet, corresponding to this item; note that items could be sorted after loading | ||
[FieldOffset(0x9C)] public byte CategoryOrderMajor; | ||
[FieldOffset(0x9D)] public byte CategoryOrderMinor; | ||
// 0xA0: int, col 19 in Item row | ||
[FieldOffset(0xA4)] public ushort StateRequired; // column in GilShopItem row | ||
[FieldOffset(0xA6)] public ushort PatchAdded; | ||
} | ||
|
||
[GenerateInterop] | ||
[StructLayout(LayoutKind.Explicit, Size = 0xB8)] | ||
public unsafe partial struct BuybackItem { | ||
[FieldOffset(0x00)] public uint ItemId; | ||
[FieldOffset(0x04)] public int Quantity; | ||
[FieldOffset(0x08)] public int Price; | ||
[FieldOffset(0x0C)] public int NumOwned; | ||
[FieldOffset(0x10)] public InventoryItem.ItemFlags Flags; | ||
[FieldOffset(0x18)] public Utf8String ItemName; | ||
// 0x80: byte, ??? | ||
[FieldOffset(0x84)] public uint CategoryIcon; | ||
[FieldOffset(0x88)] public uint ShopId; | ||
[FieldOffset(0x90)] public ulong CrafterContentId; | ||
[FieldOffset(0x98), FixedSizeArray] internal FixedSizeArray5<ushort> _materia; | ||
[FieldOffset(0xA2), FixedSizeArray] internal FixedSizeArray5<byte> _materiaGrades; | ||
[FieldOffset(0xA8)] public ushort Condition; | ||
[FieldOffset(0xAA)] public ushort Spiritbond; | ||
[FieldOffset(0xAC), FixedSizeArray] internal FixedSizeArray2<byte> _stains; | ||
[FieldOffset(0xB0)] public uint GlamourId; | ||
[FieldOffset(0xB4)] public bool IsUnique; | ||
} | ||
|
||
// there's a global singleton of this type, it's referenced by AgentShop.EventReceiver when shop is activated | ||
[GenerateInterop] | ||
[Inherits<AtkModuleInterface.AtkEventInterface>] | ||
[StructLayout(LayoutKind.Explicit, Size = 0x30)] | ||
public unsafe partial struct AgentProxy { | ||
[FieldOffset(0x10)] public ShopEventHandler* Handler; | ||
[FieldOffset(0x18)] public uint AddonId; | ||
} | ||
|
||
// there's a global singleton of this type, it's referenced by confirmation addons | ||
[GenerateInterop] | ||
[Inherits<AtkModuleInterface.AtkEventInterface>] | ||
[StructLayout(LayoutKind.Explicit, Size = 0x30)] | ||
public unsafe partial struct YesNoProxy { | ||
[FieldOffset(0x10)] public ShopEventHandler* Handler; | ||
[FieldOffset(0x18)] public uint AddonId; | ||
} | ||
|
||
/// <summary> | ||
/// Buy a bunch of items from the vendor. | ||
/// Note: BuyItemIndex field must be set before calling this function! | ||
/// </summary> | ||
/// <param name="count">Number of items to buy.</param> | ||
[MemberFunction("48 83 EC 38 80 B9 ?? ?? ?? ?? ?? C7 44 24")] | ||
public partial void ExecuteBuy(int count); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
namespace FFXIVClientStructs.FFXIV.Client.Game.UI; | ||
|
||
// Client::Game::UI::CharaCard | ||
[StructLayout(LayoutKind.Explicit, Size = 0x1C8)] | ||
[StructLayout(LayoutKind.Explicit, Size = 0x1E8)] | ||
public struct CharaCard; | ||
// contains temporary data when sending banner updates to the server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
namespace FFXIVClientStructs.FFXIV.Client.Game.UI; | ||
|
||
// Client::Game::UI::FishRecord | ||
[StructLayout(LayoutKind.Explicit, Size = 0x2E0)] | ||
[StructLayout(LayoutKind.Explicit, Size = 0x338)] | ||
public struct FishRecord; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
namespace FFXIVClientStructs.FFXIV.Client.Game.UI; | ||
|
||
// Client::Game::UI::FishingNote | ||
[StructLayout(LayoutKind.Explicit, Size = 0x50)] | ||
[StructLayout(LayoutKind.Explicit, Size = 0xE0)] | ||
public struct FishingNote; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
namespace FFXIVClientStructs.FFXIV.Client.Game.UI; | ||
|
||
// Client::Game::UI::GatheringNote | ||
[StructLayout(LayoutKind.Explicit, Size = 0x628)] | ||
[StructLayout(LayoutKind.Explicit, Size = 0x6A0)] | ||
public struct GatheringNote; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,36 @@ | ||
using FFXIVClientStructs.FFXIV.Client.System.String; | ||
|
||
namespace FFXIVClientStructs.FFXIV.Client.Game.UI; | ||
|
||
// Client::Game::UI::NpcTrade | ||
[GenerateInterop] | ||
[StructLayout(LayoutKind.Explicit, Size = 0x328)] | ||
public struct NpcTrade; | ||
public partial struct NpcTrade { | ||
[FieldOffset(0x008)] public ItemRequests Requests; | ||
|
||
[GenerateInterop] | ||
[StructLayout(LayoutKind.Explicit, Size = 0x90)] | ||
public partial struct Item { | ||
[FieldOffset(0x00)] public uint ItemId; | ||
[FieldOffset(0x04)] public int RequiredQuantity; | ||
[FieldOffset(0x08)] public uint IconId; | ||
[FieldOffset(0x10)] public Utf8String ItemName; | ||
[FieldOffset(0x78)] public bool WantHQ; | ||
[FieldOffset(0x7A), FixedSizeArray] internal FixedSizeArray5<ushort> _wantMateriaIds; | ||
[FieldOffset(0x84), FixedSizeArray] internal FixedSizeArray5<byte> _wantMateriaGrades; | ||
[FieldOffset(0x89)] public byte WantMateriaFilledSlots; | ||
[FieldOffset(0x8A)] public ushort MinCollectibility; | ||
[FieldOffset(0x8C)] public bool WantCollectible; | ||
[FieldOffset(0x8D)] public bool Stackable; | ||
} | ||
|
||
[GenerateInterop] | ||
[StructLayout(LayoutKind.Explicit, Size = 0x2D8)] | ||
public partial struct ItemRequests { | ||
[FieldOffset(0)] public byte Count; | ||
[FieldOffset(8), FixedSizeArray] internal FixedSizeArray5<Item> _items; | ||
} | ||
|
||
[VirtualFunction(0)] | ||
public partial void Dtor(byte freeFlags); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.