Skip to content

Commit

Permalink
Update various thingies (#1278)
Browse files Browse the repository at this point in the history
* Update various thingies

* Add AgentMiragePrismPrismSetConvert

* Restore AtkUnitManager.AtkEventListener

* Add missing using

* Fix data.yml
  • Loading branch information
Haselnussbomber authored Jan 20, 2025
1 parent 3190841 commit b668052
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 12 deletions.
2 changes: 2 additions & 0 deletions FFXIVClientStructs/FFXIV/Client/Game/InventoryManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ public enum InventoryType : uint {
PremiumSaddleBag1 = 4100,
PremiumSaddleBag2 = 4101,

Invalid = 9999,

RetainerPage1 = 10000,
RetainerPage2 = 10001,
RetainerPage3 = 10002,
Expand Down
14 changes: 14 additions & 0 deletions FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentInventory.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace FFXIVClientStructs.FFXIV.Client.UI.Agent;

// Client::UI::Agent::AgentInventory
// Client::UI::Agent::AgentInterface
// Component::GUI::AtkModuleInterface::AtkEventInterface
[Agent(AgentId.Inventory)]
[GenerateInterop]
[Inherits<AgentInterface>]
[StructLayout(LayoutKind.Explicit, Size = 0x68)]
public partial struct AgentInventory {
[FieldOffset(0x30)] public uint OpenTitleId;
[FieldOffset(0x34)] public uint OpenAddonId;
[FieldOffset(0x38)] public uint OpenType;
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void OpenForItemSlot(InventoryType inventory, int slot, uint addonId) {
}

[MemberFunction("E8 ?? ?? ?? ?? E9 ?? ?? ?? ?? 48 8D 0D ?? ?? ?? ?? E8 ?? ?? ?? ?? 4C 89 74 24 ??")]
public partial long UseItem(uint itemId, uint inventoryType = 9999, uint itemSlot = 0, short a5 = 0);
public partial long UseItem(uint itemId, uint inventoryType = 9999, uint itemSlot = 0, short a5 = 0); // TODO: use InventoryType.Invalid

public bool IsContextItemDisabled(int index) {
return index >= 0 && (ContextItemDisabledMask & (1 << index)) != 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using FFXIVClientStructs.FFXIV.Client.Game;

namespace FFXIVClientStructs.FFXIV.Client.UI.Agent;

// Client::UI::Agent::AgentMiragePrismPrismSetConvert
// Client::UI::Agent::AgentInterface
// Component::GUI::AtkModuleInterface::AtkEventInterface
[Agent(AgentId.MiragePrismPrismSetConvert)]
[GenerateInterop]
[Inherits<AgentInterface>]
[StructLayout(LayoutKind.Explicit, Size = 0x30)]
public unsafe partial struct AgentMiragePrismPrismSetConvert {
[MemberFunction("E8 ?? ?? ?? ?? 48 8B 43 28 C6 40 02 0B")]
public partial void Open(uint itemId, InventoryType inventoryType, int slot, int openerAddonId, bool enableStoring);

// OpenPreview in data.yml
public void Open(uint itemId) => Open(itemId, InventoryType.Invalid, 0, 0, false);
}
7 changes: 7 additions & 0 deletions FFXIVClientStructs/FFXIV/Client/UI/Agent/AgentModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,16 @@ public unsafe partial struct AgentModule {
[FieldOffset(0x18)] public float FrameDelta;

[FieldOffset(0x20), FixedSizeArray] internal FixedSizeArray452<Pointer<AgentInterface>> _agents;
[FieldOffset(0xE40)] public UIModuleAgentModulePtrStruct UIModuleAgentModulePtr;

[MemberFunction("E8 ?? ?? ?? ?? 83 7B 48 00")]
public partial AgentInterface* GetAgentByInternalId(AgentId agentId);

[StructLayout(LayoutKind.Explicit, Size = 0x10)]
public unsafe struct UIModuleAgentModulePtrStruct {
[FieldOffset(0x0)] public UIModule* UIModule;
[FieldOffset(0x8)] public AgentModule* AgentModule;
}
}

public enum AgentId : uint {
Expand Down
9 changes: 5 additions & 4 deletions FFXIVClientStructs/FFXIV/Client/UI/UIModuleInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public unsafe partial struct UIModuleInterface {
[VirtualFunction(35)] public partial InfoModule* GetInfoModule();
[VirtualFunction(36)] public partial UIModuleHelpers* GetUIModuleHelpers();
[VirtualFunction(37)] public partial AgentModule* GetAgentModule();
// [VirtualFunction(37)] public partial UIModule* GetAfterAgentsPtr(); // points to the field right after the last Agent in AgentModule
[VirtualFunction(38)] public partial AgentModule.UIModuleAgentModulePtrStruct* GetUIModuleAgentModulePtr();
[VirtualFunction(39)] public partial UI3DModule* GetUI3DModule();
// [VirtualFunction(40)] public partial Vf40Struct* GetVf40Struct();
// [VirtualFunction(41)] public partial Vf41Struct* GetVf40Struct();
Expand Down Expand Up @@ -150,9 +150,10 @@ public unsafe partial struct UIModuleInterface {
[VirtualFunction(196), GenerateStringOverloads] public partial void ShowBattleTalkImage(byte* name, byte* text, float duration, uint image, byte style, int sound = -1, uint entityId = 0xE0000000);
// [VirtualFunction(197)] public partial ??? ShowBattleTalkUnknown(???);
[VirtualFunction(198), GenerateStringOverloads] public partial void ShowBattleTalkSound(byte* name, byte* text, float duration, int sound, byte style);
// [VirtualFunction(200)] public partial ??? OpenInventory(???);
// [VirtualFunction(201)] public partial ??? CloseInventory(???);
// [VirtualFunction(202)] public partial ??? IsInventoryOpen(???);
/// <param name="type">0 = Inventory, 1 = Key Items</param>
[VirtualFunction(200)] public partial void OpenInventory(byte type = 0);
[VirtualFunction(201)] public partial void CloseInventory();
[VirtualFunction(202)] public partial bool IsInventoryOpen();
[VirtualFunction(203)] public partial void ExecuteMainCommand(uint command);
[VirtualFunction(204)] public partial bool IsMainCommandUnlocked(uint command);
// [VirtualFunction(207)] public partial ??? ShowRaceCountdownEnd(???);
Expand Down
10 changes: 10 additions & 0 deletions FFXIVClientStructs/FFXIV/Component/GUI/AtkUnitManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ public unsafe partial struct AtkUnitManager {
[VirtualFunction(8)]
public partial bool SetAddonVisibility(ushort addonId, bool visible);

[VirtualFunction(9)]
public partial AddonStatus GetAddonStatus(ushort addonId);

[VirtualFunction(10)]
public partial bool RefreshAddon(AtkUnitBase* addon, uint valueCount, AtkValue* values);

Expand All @@ -52,6 +55,13 @@ public unsafe partial struct AtkUnitManager {

[MemberFunction("E8 ?? ?? ?? ?? 8B 6B 20")]
public partial AtkUnitBase* GetAddonById(ushort id);

public enum AddonStatus {
NotLoaded = 0,

Shown = 1 << 2,
Hidden = 1 << 3,
}
}

[Flags]
Expand Down
46 changes: 39 additions & 7 deletions ida/data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1318,6 +1318,17 @@ classes:
0x140828750: RestorePrismBoxItem
0x140828FB0: RequestGlamourPlates
0x140829320: ApplyGlamourPlate
Client::Game::MateriaRequestManager:
instances:
- ea: 0x142823260
pointer: True
funcs:
0x1416B6F60: HasInstance
0x1416B6F87: GetInstance
0x1416B702E: Initialize
0x1416B7040: Destroy
0x1416B7090: Clear
0x1416B70E0: Finalize
Client::Game::CurrencyManager:
instances:
- ea: 0x142813458
Expand Down Expand Up @@ -1392,7 +1403,7 @@ classes:
0: Dtor
1: Copy
2: EqualTo
3: IsNotLinked
3: IsEmpty
4: Clear
5: GetBaseItemId
6: GetItemId
Expand Down Expand Up @@ -1433,6 +1444,11 @@ classes:
2: Clear
4: GetSize
5: GetInventorySlot
Client::Game::InventoryType:
funcs:
0x1408024B0: IsCrystals
0x1408024E0: IsArmory
0x14080BC00: IsEquippedItems
Client::Game::MonsterNoteManager:
instances:
- ea: 0x1427F6370
Expand Down Expand Up @@ -1567,10 +1583,10 @@ classes:
- ea: 0x1428278E8
pointer: True
funcs:
0x1417AF6C0: HasInstance
0x1417AF6B0: GetInstance
#fail 0x1417A0230: ctor
#fail 0x1417A0290: Destroy
0x1417AF6C0: HasInstance
0x1417AF6E0: Initialize
0x1417AF740: Destroy
Client::Game::QuestRecompleteManager: # Seasonal Event Replay
instances:
- ea: 0x1428278D8
Expand Down Expand Up @@ -3870,6 +3886,7 @@ classes:
base: Component::GUI::AtkEventListener
vfuncs:
8: SetAddonVisibility
9: GetAddonStatus
10: RefreshAddon
11: AddonRequestUpdateById
19: IsScdResourceLoaded
Expand Down Expand Up @@ -4042,6 +4059,7 @@ classes:
0x1408B1A20: SetOnlineStatusFlags
0x1408B1C50: IsOnlineStatusSet
0x1408B1CD0: IsInCrossWorldDuty
0x1408B1D10: IsPlayerBlocked
Client::UI::Info::InfoProxyBlacklist:
vtbls:
- ea: 0x141F84778
Expand Down Expand Up @@ -4814,6 +4832,7 @@ classes:
funcs:
0x14023CE40: ctor
0x14023CE70: Finalizer
0x14023D180: CloseContextAddons
0x14023D300: CloseAddon
0x14023D3F0: GetAgentByInternalId
0x14023D470: GetAgentInventoryContext
Expand Down Expand Up @@ -7292,6 +7311,7 @@ classes:
35: GetInfoModule
36: GetUIModuleHelpers
37: GetAgentModule
38: GetUIModuleAgentModulePtr
39: GetUI3DModule
42: GetEmoteHistoryModule
43: GetMinionListModule
Expand Down Expand Up @@ -8032,6 +8052,9 @@ classes:
funcs:
0x140785A10: ctor
0x140785C60: Finalizer
Client::UI::Misc::ItemOrderModuleSorter:
funcs:
0x140783A10: FreePreviousOrderArray
Client::UI::Misc::LetterDataModule:
vtbls:
- ea: 0x141F7C1C0
Expand Down Expand Up @@ -8564,6 +8587,7 @@ classes:
0x1408797A0: SetChatChannel
0x140879B00: SetFlags
0x140878FC0: SetTellTargetInForay
0x140879F80: PrintLogMessage
0x140E5DF40: ReplyInSelectedChatMode
Client::UI::Shell::ShellCommandBlueAction:
vtbls:
Expand Down Expand Up @@ -9095,6 +9119,9 @@ classes:
base: Client::UI::Agent::AgentInterface
funcs:
0x140DB6AC0: ctor
0x140DB6BD0: Open
0x140DB6E70: CloseByTitleIndex
0x140DB7B70: IsOpen
Client::UI::Agent::AgentScenarioTree:
vtbls:
- ea: 0x141F9DB98
Expand All @@ -9111,6 +9138,7 @@ classes:
funcs:
0x14024FCB0: ctor
0x140250560: Finalizer
0x1402508E0: GetOwnerAddonId
0x140251090: UseItem
0x140251A60: UnblockItemSlot
0x140250610: OpenForItemSlot
Expand Down Expand Up @@ -10564,6 +10592,9 @@ classes:
vtbls:
- ea: 0x141FAC980
base: Client::UI::Agent::AgentInterface
funcs:
0x140BE8850: Open
0x140BE8DB0: OpenPreview
Client::UI::Agent::AgentMiragePrismMiragePlate::MiragePrismMiragePlateCharaView:
vtbls:
- ea: 0x141FAC9F8
Expand Down Expand Up @@ -12891,15 +12922,16 @@ classes:
Client::Game::ReconstructionBoxManager:
instances:
- ea: 0x1427F5EE8
pointer: False
pointer: True
vtbls:
- ea: 0x141F8A2F8
vfuncs:
0: Dtor
funcs:
0x1409596E0: Initialize
0x1409597A0: Destroy
0x1417A7550: HasInstance
0x1417A7570: GetInstance
0x140959800: HasInstance
0x140959820: GetInstance
Client::Game::Event::EventFramework:
instances:
- ea: 0x142812628
Expand Down

0 comments on commit b668052

Please sign in to comment.