diff --git a/CommonLibF4/include/RE/Bethesda/IMenu.h b/CommonLibF4/include/RE/Bethesda/IMenu.h index 67a01fea..a7b9840a 100644 --- a/CommonLibF4/include/RE/Bethesda/IMenu.h +++ b/CommonLibF4/include/RE/Bethesda/IMenu.h @@ -400,7 +400,7 @@ namespace RE bool menuCanBeVisible{ true }; // 61 bool hasQuadsForCumstomRenderer{ false }; // 62 bool hasDoneFirstAdvanceMovie{ false }; // 63 - REX::EnumSet depthPriority{ UI_DEPTH_PRIORITY::kStandard }; // 64 + UI_DEPTH_PRIORITY depthPriority{ UI_DEPTH_PRIORITY::kStandard }; // 64 REX::EnumSet inputContext{ UserEvents::INPUT_CONTEXT_ID::kNone }; // 68 }; static_assert(sizeof(IMenu) == 0x70); diff --git a/CommonLibF4/include/RE/Bethesda/PlayerControls.h b/CommonLibF4/include/RE/Bethesda/PlayerControls.h index 400e511b..e068ea1f 100644 --- a/CommonLibF4/include/RE/Bethesda/PlayerControls.h +++ b/CommonLibF4/include/RE/Bethesda/PlayerControls.h @@ -22,7 +22,6 @@ namespace RE struct AutoMoveHandler; struct GrabRotationHandler; struct JumpHandler; - struct LookHandler; struct MeleeThrowHandler; struct MovementHandler; struct ReadyWeaponHandler; @@ -138,6 +137,22 @@ namespace RE }; static_assert(sizeof(HeldStateHandler) == 0x28); + class LookHandler : + public PlayerInputHandler + { + public: + static constexpr auto RTTI{ RTTI::LookHandler }; + static constexpr auto VTABLE{ VTABLE::LookHandler }; + + explicit constexpr LookHandler(PlayerControlsData& a_data) noexcept : + PlayerInputHandler(a_data) + {} + + // members + float thumbstickMaxedSec{ 0.0f }; // 20 + }; + static_assert(sizeof(LookHandler) == 0x28); + class __declspec(novtable) PlayerControls : BSInputEventReceiver, // 000 BSTEventSink, // 010 @@ -154,7 +169,7 @@ namespace RE static PlayerControls* GetSingleton() { - static REL::Relocation singleton{ REL::ID(544871) }; + static REL::Relocation singleton{ REL::ID(2692013) }; return *singleton; } diff --git a/CommonLibF4/include/REL/IDDB.h b/CommonLibF4/include/REL/IDDB.h index 74a069ed..e7c48e8d 100644 --- a/CommonLibF4/include/REL/IDDB.h +++ b/CommonLibF4/include/REL/IDDB.h @@ -24,26 +24,7 @@ namespace REL return singleton; } - [[nodiscard]] std::size_t id2offset(std::uint64_t a_id) const - { - if (_id2offset.empty()) { - stl::report_and_fail("data is empty"sv); - } - - const mapping_t elem{ a_id, 0 }; - const auto it = std::lower_bound( - _id2offset.begin(), - _id2offset.end(), - elem, - [](auto&& a_lhs, auto&& a_rhs) { - return a_lhs.id < a_rhs.id; - }); - if (it == _id2offset.end()) { - stl::report_and_fail("id not found"sv); - } - - return static_cast(it->offset); - } + [[nodiscard]] std::size_t id2offset(std::uint64_t a_id) const; protected: friend class Offset2ID; diff --git a/CommonLibF4/src/REL/IDDB.cpp b/CommonLibF4/src/REL/IDDB.cpp index a8bab763..a07b1725 100644 --- a/CommonLibF4/src/REL/IDDB.cpp +++ b/CommonLibF4/src/REL/IDDB.cpp @@ -1,4 +1,5 @@ #include "REL/IDDB.h" +#include "REL/Module.h" #include "REL/Version.h" #include "REX/W32/BCRYPT.h" @@ -105,4 +106,27 @@ namespace REL *reinterpret_cast(_mmap.data()) }; } + + std::size_t IDDB::id2offset(std::uint64_t a_id) const + { + if (_id2offset.empty()) { + stl::report_and_fail("data is empty"sv); + } + + const mapping_t elem{ a_id, 0 }; + const auto it = std::lower_bound( + _id2offset.begin(), + _id2offset.end(), + elem, + [](auto&& a_lhs, auto&& a_rhs) { + return a_lhs.id < a_rhs.id; + }); + if (it == _id2offset.end()) { + const auto version = Module::get().version(); + const auto str = std::format("id {} not found!\ngame version: {}"sv, a_id, version.string()); + stl::report_and_fail(str); + } + + return static_cast(it->offset); + } }