-
Notifications
You must be signed in to change notification settings - Fork 37
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
5 changed files
with
413 additions
and
206 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#pragma once | ||
|
||
#include "RE/B/BSTArray.h" | ||
#include "RE/B/BSTEvent.h" | ||
#include "RE/B/BSTSingleton.h" | ||
|
||
namespace RE | ||
{ | ||
class BGSInventoryItem; | ||
class TESBoundObject; | ||
|
||
namespace InventoryInterface | ||
{ | ||
struct FavoriteChangedEvent | ||
{ | ||
public: | ||
~FavoriteChangedEvent() noexcept {} // intentional | ||
|
||
// members | ||
BGSInventoryItem* itemAffected; // 0 | ||
}; | ||
static_assert(sizeof(FavoriteChangedEvent) == 0x8); | ||
|
||
struct Handle | ||
{ | ||
public: | ||
~Handle() noexcept {} // intentional | ||
|
||
// members | ||
std::uint32_t id; // 0 | ||
}; | ||
static_assert(sizeof(Handle) == 0x4); | ||
} | ||
|
||
class BGSInventoryInterface : | ||
BSTSingletonSDM<BGSInventoryInterface>, // 00 | ||
BSTEventSource<InventoryInterface::FavoriteChangedEvent> // 08 | ||
{ | ||
public: | ||
struct Agent | ||
{ | ||
public: | ||
// members | ||
std::uint32_t handleID; // 0 | ||
std::uint32_t itemOwner; // 4 - TESPointerHandle | ||
std::uint16_t listIndex; // 8 | ||
std::uint16_t refCount; // A | ||
}; | ||
static_assert(sizeof(Agent) == 0xC); | ||
|
||
[[nodiscard]] static BGSInventoryInterface* GetSingleton() | ||
{ | ||
REL::Relocation<BGSInventoryInterface**> singleton { ID::BGSInventoryInterface::singleton }; | ||
return *singleton; | ||
} | ||
|
||
[[nodiscard]] TESBoundObject* GetInventoryObject(const std::uint32_t& a_handleID) const | ||
{ | ||
using func_t = decltype(&BGSInventoryInterface::GetInventoryObject); | ||
REL::Relocation<func_t> func{ ID::BGSInventoryInterface::GetInventoryObject }; | ||
return func(this, a_handleID); | ||
} | ||
|
||
virtual ~BGSInventoryInterface(); // 00 | ||
|
||
// members | ||
BSTArray<Agent> agentArray; // 30 | ||
}; | ||
static_assert(sizeof(BGSInventoryInterface) == 0x40); | ||
} |
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,45 @@ | ||
#pragma once | ||
|
||
#include "RE/B/BSTArray.h" | ||
#include "RE/B/BSTSmartPointer.h" | ||
|
||
namespace RE | ||
{ | ||
class ExtraDataList; | ||
class TBO_InstanceData; | ||
class TESBoundObject; | ||
|
||
class BGSInventoryItem | ||
{ | ||
public: | ||
struct Stack | ||
{ | ||
public: | ||
// members | ||
BSTSmartPointer<ExtraDataList> extra; // 00 | ||
std::uint32_t unk10; // 10 | ||
}; | ||
static_assert(sizeof(Stack) == 0x10); | ||
|
||
enum class Flag | ||
{ | ||
kSlotIndex1 = 1 << 0, | ||
kSlotIndex2 = 1 << 1, | ||
kSlotIndex3 = 1 << 2, | ||
kEquipStateLocked = 1 << 3, | ||
kInvShouldEquip = 1 << 4, | ||
kTemporary = 1 << 5, | ||
kSlotMask = kSlotIndex1 | kSlotIndex2 | kSlotIndex3 | ||
}; | ||
|
||
[[nodiscard]] bool IsEquipped() const noexcept { return flags.any(Flag::kSlotMask); } | ||
|
||
// members | ||
TESBoundObject* object; // 00 | ||
BSTSmartPointer<TBO_InstanceData> instanceData; // 08 | ||
BSTArray<Stack> stacks; // 10 | ||
stl::enumeration<Flag, std::uint32_t> flags; // 20 | ||
std::int8_t unk24; // 24 | ||
}; | ||
static_assert(sizeof(BGSInventoryItem) == 0x28); | ||
} |
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.