Skip to content

Commit

Permalink
Further reverse engineering. (#12)
Browse files Browse the repository at this point in the history
* feat: Scaleform IDs updated.

* feat: NiController ID update.

* feat: Actor IDs updated.

* chore: Update 'BSInputEnableManager' IDs.

* chore: More misc. IDs updated.
feat: Functions delcared in BGSScene.

* chore: More IDs updated.

* chore: Single ID update.
feat: ´Float´ & ´Float0To1´ added to BSRandom.

* feat: Few more functions.

* feat: Further implementation of BGSSceneAction classes.

* feat: More RE/IDs.

* chore: Update ID.

* feat: More REing.
  • Loading branch information
FlenarnTemp authored Jul 18, 2024
1 parent f0c9020 commit 34f57a6
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 9 deletions.
23 changes: 22 additions & 1 deletion CommonLibF4/include/RE/Bethesda/BGSInventoryItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,31 @@ namespace RE
};
static_assert(sizeof(ModifyModDataFunctor) == 0x30);

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

SetHealthFunctor(float a_health) :
health(a_health)
{
stl::emplace_vtable(this);
}

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

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

bool FindAndWriteStackData(StackDataCompareFunctor& a_compareFunc, StackDataWriteFunctor& a_writeFunc, bool a_manualMerge, ObjectRefHandle a_owner)
{
using func_t = decltype(&BGSInventoryItem::FindAndWriteStackData);
static REL::Relocation<func_t> func{ REL::ID(770140) };
static REL::Relocation<func_t> func{ REL::ID(2194123) };
return func(this, a_compareFunc, a_writeFunc, a_manualMerge, a_owner);
}

Expand Down
7 changes: 7 additions & 0 deletions CommonLibF4/include/RE/Bethesda/BSExtraData.h
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,13 @@ namespace RE
return func(this);
}

bool IsDamaged()
{
using func_t = decltype(&ExtraDataList::IsDamaged);
static REL::Relocation<func_t> func{ REL::ID(2190224) };
return func(this);
}

// members
BaseExtraList extraData; // 08
mutable BSReadWriteLock extraRWLock; // 20
Expand Down
4 changes: 2 additions & 2 deletions CommonLibF4/include/RE/Bethesda/IMenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -1982,14 +1982,14 @@ namespace RE
[[nodiscard]] std::uint32_t GetSelectedIndex()
{
using func_t = decltype(&ExamineMenu::GetSelectedIndex);
static REL::Relocation<func_t> func{ REL::ID(776503) };
static REL::Relocation<func_t> func{ REL::ID(2223022) };
return func(this);
}

void ShowConfirmMenu(ExamineConfirmMenu::InitData* a_data, ExamineConfirmMenu::ICallback* a_callback)
{
using func_t = decltype(&ExamineMenu::ShowConfirmMenu);
static REL::Relocation<func_t> func{ REL::ID(443081) };
static REL::Relocation<func_t> func{ REL::ID(2223081) };
return func(this, a_data, a_callback);
}

Expand Down
6 changes: 3 additions & 3 deletions CommonLibF4/include/RE/Bethesda/InventoryUserUIUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace RE
float a_compareDamage = FLT_MAX)
{
using func_t = decltype(&detail::AddItemCardInfoEntry);
static REL::Relocation<func_t> func{ REL::ID(489521) };
static REL::Relocation<func_t> func{ REL::ID(2222648) };
return func(a_array, a_newEntry, a_textID, a_value, a_difference, a_totalDamage, a_compareDamage);
}
}
Expand Down Expand Up @@ -70,14 +70,14 @@ namespace RE
inline void PlayPipboySound(const char* a_soundName)
{
using func_t = decltype(&PlayPipboySound);
static REL::Relocation<func_t> func{ REL::ID(1320952) };
static REL::Relocation<func_t> func{ REL::ID(2249706) };
return func(a_soundName);
}

inline void PlayMenuSound(const char* a_soundName)
{
using func_t = decltype(&PlayMenuSound);
static REL::Relocation<func_t> func{ REL::ID(1227993) };
static REL::Relocation<func_t> func{ REL::ID(2249707) };
return func(a_soundName);
}
}
Expand Down
6 changes: 3 additions & 3 deletions CommonLibF4/include/RE/Bethesda/TESObjectREFRs.h
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ namespace RE
bool a_alwaysContinue = false)
{
using func_t = decltype(&BGSInventoryList::FindAndWriteStackDataForItem);
static REL::Relocation<func_t> func{ REL::ID(1354005) };
static REL::Relocation<func_t> func{ REL::ID(2194179) };
return func(this, a_object, a_compareFunc, a_writeFunc, a_objCompFn, a_alwaysContinue);
}

Expand Down Expand Up @@ -795,7 +795,7 @@ namespace RE
[[nodiscard]] std::uint32_t GetInventoryObjectCount(const TESBoundObject* a_object)
{
using func_t = decltype(&TESObjectREFR::GetInventoryObjectCount);
static REL::Relocation<func_t> func{ REL::ID(333415) };
static REL::Relocation<func_t> func{ REL::ID(2200939) };
return func(this, a_object);
}

Expand Down Expand Up @@ -907,7 +907,7 @@ namespace RE
bool GetItemCount(uint32_t& count, TESForm* item, bool countComponent)
{
using func_t = decltype(&TESObjectREFR::GetItemCount);
static REL::Relocation<func_t> func{ REL::ID(635042) };
static REL::Relocation<func_t> func{ REL::ID(2200996) };
return func(this, count, item, countComponent);
}

Expand Down

0 comments on commit 34f57a6

Please sign in to comment.