From 34f57a6a1dca1a2950f045cc8b8249b28e4dffb8 Mon Sep 17 00:00:00 2001 From: FlenarnTemp <68670981+FlenarnTemp@users.noreply.github.com> Date: Thu, 18 Jul 2024 08:27:09 +0200 Subject: [PATCH] Further reverse engineering. (#12) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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. --- .../include/RE/Bethesda/BGSInventoryItem.h | 23 ++++++++++++++++++- CommonLibF4/include/RE/Bethesda/BSExtraData.h | 7 ++++++ CommonLibF4/include/RE/Bethesda/IMenu.h | 4 ++-- .../RE/Bethesda/InventoryUserUIUtils.h | 6 ++--- .../include/RE/Bethesda/TESObjectREFRs.h | 6 ++--- 5 files changed, 37 insertions(+), 9 deletions(-) diff --git a/CommonLibF4/include/RE/Bethesda/BGSInventoryItem.h b/CommonLibF4/include/RE/Bethesda/BGSInventoryItem.h index fe07372a..882c49b4 100644 --- a/CommonLibF4/include/RE/Bethesda/BGSInventoryItem.h +++ b/CommonLibF4/include/RE/Bethesda/BGSInventoryItem.h @@ -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{ REL::ID(770140) }; + static REL::Relocation func{ REL::ID(2194123) }; return func(this, a_compareFunc, a_writeFunc, a_manualMerge, a_owner); } diff --git a/CommonLibF4/include/RE/Bethesda/BSExtraData.h b/CommonLibF4/include/RE/Bethesda/BSExtraData.h index 3931b1f1..df65587b 100644 --- a/CommonLibF4/include/RE/Bethesda/BSExtraData.h +++ b/CommonLibF4/include/RE/Bethesda/BSExtraData.h @@ -976,6 +976,13 @@ namespace RE return func(this); } + bool IsDamaged() + { + using func_t = decltype(&ExtraDataList::IsDamaged); + static REL::Relocation func{ REL::ID(2190224) }; + return func(this); + } + // members BaseExtraList extraData; // 08 mutable BSReadWriteLock extraRWLock; // 20 diff --git a/CommonLibF4/include/RE/Bethesda/IMenu.h b/CommonLibF4/include/RE/Bethesda/IMenu.h index a7b9840a..6a904765 100644 --- a/CommonLibF4/include/RE/Bethesda/IMenu.h +++ b/CommonLibF4/include/RE/Bethesda/IMenu.h @@ -1982,14 +1982,14 @@ namespace RE [[nodiscard]] std::uint32_t GetSelectedIndex() { using func_t = decltype(&ExamineMenu::GetSelectedIndex); - static REL::Relocation func{ REL::ID(776503) }; + static REL::Relocation 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{ REL::ID(443081) }; + static REL::Relocation func{ REL::ID(2223081) }; return func(this, a_data, a_callback); } diff --git a/CommonLibF4/include/RE/Bethesda/InventoryUserUIUtils.h b/CommonLibF4/include/RE/Bethesda/InventoryUserUIUtils.h index ad34a817..18291a5e 100644 --- a/CommonLibF4/include/RE/Bethesda/InventoryUserUIUtils.h +++ b/CommonLibF4/include/RE/Bethesda/InventoryUserUIUtils.h @@ -24,7 +24,7 @@ namespace RE float a_compareDamage = FLT_MAX) { using func_t = decltype(&detail::AddItemCardInfoEntry); - static REL::Relocation func{ REL::ID(489521) }; + static REL::Relocation func{ REL::ID(2222648) }; return func(a_array, a_newEntry, a_textID, a_value, a_difference, a_totalDamage, a_compareDamage); } } @@ -70,14 +70,14 @@ namespace RE inline void PlayPipboySound(const char* a_soundName) { using func_t = decltype(&PlayPipboySound); - static REL::Relocation func{ REL::ID(1320952) }; + static REL::Relocation func{ REL::ID(2249706) }; return func(a_soundName); } inline void PlayMenuSound(const char* a_soundName) { using func_t = decltype(&PlayMenuSound); - static REL::Relocation func{ REL::ID(1227993) }; + static REL::Relocation func{ REL::ID(2249707) }; return func(a_soundName); } } diff --git a/CommonLibF4/include/RE/Bethesda/TESObjectREFRs.h b/CommonLibF4/include/RE/Bethesda/TESObjectREFRs.h index 5c02ca82..e8987c53 100644 --- a/CommonLibF4/include/RE/Bethesda/TESObjectREFRs.h +++ b/CommonLibF4/include/RE/Bethesda/TESObjectREFRs.h @@ -345,7 +345,7 @@ namespace RE bool a_alwaysContinue = false) { using func_t = decltype(&BGSInventoryList::FindAndWriteStackDataForItem); - static REL::Relocation func{ REL::ID(1354005) }; + static REL::Relocation func{ REL::ID(2194179) }; return func(this, a_object, a_compareFunc, a_writeFunc, a_objCompFn, a_alwaysContinue); } @@ -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{ REL::ID(333415) }; + static REL::Relocation func{ REL::ID(2200939) }; return func(this, a_object); } @@ -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{ REL::ID(635042) }; + static REL::Relocation func{ REL::ID(2200996) }; return func(this, count, item, countComponent); }