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
2 changes: 1 addition & 1 deletion include/RE/A/ApplyChangesFunctor.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace RE
static constexpr auto VTABLE{ VTABLE::__ApplyChangesFunctor };

// override
virtual void WriteDataImpl(TESBoundObject& a_baseObj, BGSInventoryItem::Stack& a_stack) override // 01
virtual void WriteDataImpl(TESBoundObject& a_baseObj, BGSInventoryItem::Stack& a_stack) override // 00
{
using func_t = decltype(&ApplyChangesFunctor::WriteDataImpl);
static REL::Relocation<func_t> func{ ID::ApplyChangesFunctor::WriteDataImpl };
Expand Down
123 changes: 118 additions & 5 deletions include/RE/B/BGSInventoryItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,73 @@ namespace RE
{}

// override (StackDataCompareFunctor)
bool CompareData(const BGSInventoryItem::Stack&) override { return true; } // this->extra == extra; ??
bool CompareData(const BGSInventoryItem::Stack& a_stack) override { return a_stack.extra.get() == extra; } // 00

// members
const ExtraDataList* extra; // 08
};
static_assert(sizeof(CheckExtraDataFunctor) == 0x10);

class alignas(0x08) FindEquippedStackFunctor :
public StackDataCompareFunctor // 00
{
public:
static constexpr auto RTTI{ RTTI::BGSInventoryItem__FindEquippedStackFunctor };
static constexpr auto VTABLE{ VTABLE::BGSInventoryItem__FindEquippedStackFunctor };

// override (StackDataCompareFunctor)
bool CompareData(const BGSInventoryItem::Stack& a_stack) override { return a_stack.IsEquipped(); } // 00
};
static_assert(sizeof(FindEquippedStackFunctor) == 0x8);

class alignas(0x08) HasExtraDataFunctor :
public StackDataCompareFunctor // 00
{
public:
static constexpr auto RTTI{ RTTI::BGSInventoryItem__HasExtraDataFunctor };
static constexpr auto VTABLE{ VTABLE::BGSInventoryItem__HasExtraDataFunctor };

HasExtraDataFunctor(EXTRA_DATA_TYPE a_type) noexcept :
type(a_type)
{}

// override (StackDataCompareFunctor)
bool CompareData(const BGSInventoryItem::Stack& a_stack) override { return a_stack.extra->HasType(type.get()); } // 00

// members
REX::TEnum<EXTRA_DATA_TYPE, std::uint8_t> type; // 08
};
static_assert(sizeof(HasExtraDataFunctor) == 0x10);

class __declspec(novtable) alignas(0x08) IsUIEquivalentStackFunctor :
public StackDataCompareFunctor // 00
{
public:
static constexpr auto RTTI{ RTTI::BGSInventoryItem__IsUIEquivalentStackFunctor };
static constexpr auto VTABLE{ VTABLE::BGSInventoryItem__IsUIEquivalentStackFunctor };

IsUIEquivalentStackFunctor(BGSInventoryItem::Stack* a_stack) :
stack(a_stack)
{
REX::EMPLACE_VTABLE(this);
}

// override (StackDataCompareFunctor)
bool CompareData(const BGSInventoryItem::Stack& a_stack) override; // 00

// members
BSTSmartPointer<BGSInventoryItem::Stack> stack; // 08
};
static_assert(sizeof(IsUIEquivalentStackFunctor) == 0x10);

class __declspec(novtable) alignas(0x08) StackDataWriteFunctor
{
public:
static constexpr auto RTTI{ RTTI::BGSInventoryItem__StackDataWriteFunctor };
static constexpr auto VTABLE{ VTABLE::BGSInventoryItem__StackDataWriteFunctor };

// add
virtual void WriteDataImpl(TESBoundObject& a_baseObj, BGSInventoryItem::Stack& a_stack) = 0; // 01
virtual void WriteDataImpl(TESBoundObject& a_baseObj, BGSInventoryItem::Stack& a_stack) = 0; // 00

// members
bool shouldSplitStacks{ true }; // 08
Expand Down Expand Up @@ -126,7 +178,7 @@ namespace RE
}

// override (StackDataWriteFunctor)
void WriteDataImpl(TESBoundObject&, BGSInventoryItem::Stack&) override; // 01
void WriteDataImpl(TESBoundObject&, BGSInventoryItem::Stack&) override; // 00

// members
BGSMod::Attachment::Mod* mod; // 10
Expand All @@ -152,14 +204,75 @@ namespace RE
}

// override (StackDataWriteFunctor)
void WriteDataImpl(TESBoundObject&, BGSInventoryItem::Stack&) override; // 01
void WriteDataImpl(TESBoundObject&, BGSInventoryItem::Stack&) override; // 00

// members
float health; // 10
};
static_assert(sizeof(SetHealthFunctor) == 0x18);

bool FindAndWriteStackData(StackDataCompareFunctor& a_compareFunc, StackDataWriteFunctor& a_writeFunc, bool a_manualMerge, ObjectRefHandle a_owner)
class __declspec(novtable) ClearEquipFlagsFunctor :
public StackDataWriteFunctor // 00
{
public:
static constexpr auto RTTI{ RTTI::BGSInventoryItem__ClearEquipFlagsFunctor };
static constexpr auto VTABLE{ VTABLE::BGSInventoryItem__ClearEquipFlagsFunctor };

ClearEquipFlagsFunctor()
{
REX::EMPLACE_VTABLE(this);
}

// override (StackDataWriteFunctor)
void WriteDataImpl(TESBoundObject&, BGSInventoryItem::Stack&) override; // 00
};
static_assert(sizeof(ClearEquipFlagsFunctor) == 0x10);

class __declspec(novtable) ModCountFunctor :
public StackDataWriteFunctor // 00
{
public:
static constexpr auto RTTI{ RTTI::BGSInventoryItem__ModCountFunctor };
static constexpr auto VTABLE{ VTABLE::BGSInventoryItem__ModCountFunctor };

ModCountFunctor(std::int32_t a_count) :
count(a_count)
{
REX::EMPLACE_VTABLE(this);
}

// override (StackDataWriteFunctor)
void WriteDataImpl(TESBoundObject&, BGSInventoryItem::Stack&) override; // 00

// members
std::int32_t count; // 10
};
static_assert(sizeof(ModCountFunctor) == 0x18);

class __declspec(novtable) SetFlagFunctor :
public StackDataWriteFunctor // 00
{
public:
static constexpr auto RTTI{ RTTI::BGSInventoryItem__SetFlagFunctor };
static constexpr auto VTABLE{ VTABLE::BGSInventoryItem__SetFlagFunctor };

SetFlagFunctor(std::uint32_t a_flagIndex, bool a_setFlag) :
flagIndex(a_flagIndex),
setFlag(a_setFlag)
{
REX::EMPLACE_VTABLE(this);
}

// override (StackDataWriteFunctor)
void WriteDataImpl(TESBoundObject&, BGSInventoryItem::Stack&) override; // 00

// members
std::uint32_t flagIndex; // 10
bool setFlag; // 14
};
static_assert(sizeof(SetFlagFunctor) == 0x18);

bool FindAndWriteStackData(StackDataCompareFunctor& a_compareFunc, StackDataWriteFunctor& a_writeFunc, bool a_manualMerge, const ObjectRefHandle& a_owner)
{
using func_t = decltype(&BGSInventoryItem::FindAndWriteStackData);
static REL::Relocation<func_t> func{ ID::BGSInventoryItem::FindAndWriteStackData };
Expand Down
2 changes: 1 addition & 1 deletion include/RE/C/CHANGE_TYPES.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace RE
kTopicSaidPlayer = 1u << 30,
kTopicSaidOnce = 1u << 31,
kRelationshipData = 1u << 1,
kLocationSpecRefs = 1u < 28,
kLocationSpecRefs = 1u << 28,
kLocationNewRefs = 1u << 29,
kLocationKeywordData = 1u << 30,
kLocationCleared = 1u << 31,
Expand Down
4 changes: 2 additions & 2 deletions include/RE/I/InventoryItemDisplayData.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace RE
{
public:
InventoryItemDisplayData(
const ObjectRefHandle a_inventoryRef,
const ObjectRefHandle& a_inventoryRef,
const InventoryUserUIInterfaceEntry& a_entry)
{
ctor(a_inventoryRef, a_entry);
Expand Down Expand Up @@ -41,7 +41,7 @@ namespace RE

private:
InventoryItemDisplayData* ctor(
const ObjectRefHandle a_inventoryRef,
const ObjectRefHandle& a_inventoryRef,
const InventoryUserUIInterfaceEntry& a_entry)
{
using func_t = decltype(&InventoryItemDisplayData::ctor);
Expand Down
4 changes: 2 additions & 2 deletions include/RE/I/InventoryUserUIInterfaceEntry.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ namespace RE
{
public:
// members
InventoryInterface::Handle invHandle; // 00
BSTSmallArray<std::uint8_t, 4> stackIndex; // 08
InventoryInterface::Handle invHandle; // 00
BSTSmallArray<std::uint16_t, 4> stackIndex; // 08
};
static_assert(sizeof(InventoryUserUIInterfaceEntry) == 0x20);
}