Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Further reverse engineering. #12

Merged
merged 13 commits into from
Jul 18, 2024
7 changes: 7 additions & 0 deletions CommonLibF4/include/RE/Bethesda/Actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -1265,6 +1265,13 @@ namespace RE
return func(this, a_refr, a_owner, a_crime);
}

void UpdateVoiceTimer(bool a_force)
{
using func_t = decltype(&Actor::UpdateVoiceTimer);
static REL::Relocation<func_t> func{ REL::ID(2230178) };
return func(this, a_force);
}

// members
NiTFlags<std::uint32_t, Actor> niFlags; // 2D0
float updateTargetTimer; // 2D4
Expand Down
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
52 changes: 36 additions & 16 deletions CommonLibF4/include/RE/Bethesda/BGSSceneAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,26 +76,26 @@ namespace RE
virtual ~BGSSceneAction(); // 00

// add
virtual void Unk_01(void); // 01
virtual void Unk_02(void); // 02
virtual void Unk_03(void); // 03
virtual void Unk_04(void); // 04
virtual void Unk_05(void); // 05
virtual void Load(void); // 01
virtual void InitItem(void); // 02
virtual void OnDelete(void); // 03
virtual void ClearData(void); // 04
virtual void Copy(void); // 05
virtual bool QIsLooping(void); // 06
virtual bool QFaceHeadTrackTarget(const BGSScene* scene); // 07
virtual SCENE_ACTION_TYPE GetActionType() const = 0; // 08
virtual bool QActionCanEnd(); // 09
virtual bool IsPackageActive(BGSScene* scene, TESPackage* package, Actor* actor); // 0A
virtual void Unk_0B(void); // 0B
virtual void Unk_0C(void); // 0C
virtual void Unk_0D(void); // 0D
virtual void Unk_0E(void); // 0E
virtual void Unk_0F(void); // 0F
virtual void Unk_10(void); // 10
virtual void Unk_11(void); // 11
virtual void LoadGame(void); // 0B
virtual void SaveGame(void); // 0C
virtual void Revert(void); // 0D
virtual void InitLoadGame(void); // 0E
virtual void ResetActionData(void); // 0F
virtual void SetInput(void); // 10
virtual float GetActionPercentDone(const BGSScene* scene); // 11
virtual void StartAction(BGSScene* scene); // 12
virtual void EndAction(BGSScene* scene); // 13
virtual void CleanUpActionActor(void); // 14
virtual void CleanUpActionActor(BGSScene* scene); // 14
virtual void UpdateAction(BGSScene* scene); // 14

// members
Expand Down Expand Up @@ -158,12 +158,32 @@ namespace RE
TESTopic* pNPCResponseTopics[4]; // 98
BGSKeyword* pNPCResponseSubtypeKeywords[4]; // B8
TESTopic* pTopic; // D8
SCENE_ACTION_PLAYER_RESPONSE_TYPE playerInput; // E0
std::uint32_t playerInput; // E0

TESTopicInfo* GetCurrentTopicInfo(BGSScene* a_parentScene, TESObjectREFR* a_target, std::uint32_t a_type)
{
using func_t = decltype(&BGSSceneActionPlayerDialogue::GetCurrentTopicInfo);
static REL::Relocation<func_t> func{ REL::ID(2196825) };
return func(this, a_parentScene, a_target, a_type);
}
};
static_assert(sizeof(BGSSceneActionPlayerDialogue) == 0xE8);

class __declspec(novtable) BGSSceneActionNPCResponseDialogue : public BGSSceneActionConversationBase
{};
class __declspec(novtable) BGSSceneActionNPCResponseDialogue :
public BGSSceneActionConversationBase
{
public:
static constexpr auto RTTI{ RTTI::BGSSceneActionNPCResponseDialogue };
static constexpr auto VTABLE{ VTABLE::BGSSceneActionNPCResponseDialogue };

TESTopicInfo* GetCurrentTopicInfo(BGSScene* a_parentScene)
{
using func_t = decltype(&BGSSceneActionNPCResponseDialogue::GetCurrentTopicInfo);
static REL::Relocation<func_t> func{ REL::ID(2196825) };
return func(this, a_parentScene);
}
};
static_assert(sizeof(BGSSceneActionNPCResponseDialogue) == 0x90);

class __declspec(novtable) BGSSceneActionStartScene :
public BGSSceneAction
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
10 changes: 5 additions & 5 deletions CommonLibF4/include/RE/Bethesda/BSInputEnableManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace RE
[[nodiscard]] std::uint32_t DecRef() const
{
using func_t = decltype(&BSInputEnableLayer::DecRef);
static REL::Relocation<func_t> func{ REL::ID(659989) };
static REL::Relocation<func_t> func{ REL::ID(2268272) };
return func(this);
}

Expand Down Expand Up @@ -77,14 +77,14 @@ namespace RE

[[nodiscard]] static BSInputEnableManager* GetSingleton()
{
static REL::Relocation<BSInputEnableManager**> singleton{ REL::ID(781703) };
static REL::Relocation<BSInputEnableManager**> singleton{ REL::ID(2689007) };
return *singleton;
}

bool AllocateNewLayer(BSTSmartPointer<BSInputEnableLayer>& a_layer, const char* a_debugName)
{
using func_t = decltype(&BSInputEnableManager::AllocateNewLayer);
static REL::Relocation<func_t> func{ REL::ID(537494) };
static REL::Relocation<func_t> func{ REL::ID(2268244) };
return func(this, a_layer, a_debugName);
}

Expand All @@ -98,14 +98,14 @@ namespace RE
bool EnableUserEvent(std::uint32_t a_layerID, UEFlag a_userEventFlags, bool a_enable, UserEvents::SENDER_ID a_senderID)
{
using func_t = decltype(&BSInputEnableManager::EnableUserEvent);
static REL::Relocation<func_t> func{ REL::ID(1432984) };
static REL::Relocation<func_t> func{ REL::ID(2268263) };
return func(this, a_layerID, a_userEventFlags, a_enable, a_senderID);
}

bool EnableOtherEvent(std::uint32_t a_layerID, OEFlag a_otherEventFlags, bool a_enable, UserEvents::SENDER_ID a_senderID)
{
using func_t = decltype(&BSInputEnableManager::EnableOtherEvent);
static REL::Relocation<func_t> func{ REL::ID(1419268) };
static REL::Relocation<func_t> func{ REL::ID(2268265) };
return func(this, a_layerID, a_otherEventFlags, a_enable, a_senderID);
}

Expand Down
14 changes: 14 additions & 0 deletions CommonLibF4/include/RE/Bethesda/BSRandom.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,19 @@ namespace RE
static REL::Relocation<func_t> func{ REL::ID(2267950) };
return func(a_min, a_max);
}

inline float Float(float a_min, float a_max)
{
using func_t = decltype(&BSRandom::Float);
static REL::Relocation<func_t> func{ REL::ID(2267953) };
return func(a_min, a_max);
}

inline float Float0To1()
{
using func_t = decltype(&BSRandom::Float0To1);
static REL::Relocation<func_t> func{ REL::ID(2267954) };
return func();
}
}
}
2 changes: 1 addition & 1 deletion CommonLibF4/include/RE/Bethesda/BSUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace RE::BSUtilities
inline NiAVObject* GetObjectByName(NiAVObject* a_root, const BSFixedString& a_name, bool a_tryInternal, bool a_dontAttach)
{
using func_t = decltype(&GetObjectByName);
static REL::Relocation<func_t> func{ REL::ID(843650) };
static REL::Relocation<func_t> func{ REL::ID(2274841) };
return func(a_root, a_name, a_tryInternal, a_dontAttach);
}
}
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
2 changes: 1 addition & 1 deletion CommonLibF4/include/RE/Bethesda/MagicItems.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace RE
void GetDescription(BSStringT<char>* a_buffer, const char* a_beginTagFormat, const char* a_endTagFormat, float a_magnitude, float a_duration)
{
using func_t = decltype(&EffectItem::GetDescription);
static REL::Relocation<func_t> func{ REL::ID(949839) };
static REL::Relocation<func_t> func{ REL::ID(2189612) };
return func(this, a_buffer, a_beginTagFormat, a_endTagFormat, a_magnitude, a_duration);
}

Expand Down
2 changes: 1 addition & 1 deletion CommonLibF4/include/RE/Bethesda/MenuControls.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace RE
public:
[[nodiscard]] static MenuControls* GetSingleton()
{
static REL::Relocation<MenuControls**> singleton{ REL::ID(520890) };
static REL::Relocation<MenuControls**> singleton{ REL::ID(2689089) };
return *singleton;
}

Expand Down
2 changes: 1 addition & 1 deletion CommonLibF4/include/RE/Bethesda/MenuTopicManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace RE

[[nodiscard]] static MenuTopicManager* GetSingleton()
{
static REL::Relocation<MenuTopicManager**> singleton{ REL::ID(520890) }; // TODO: Update
static REL::Relocation<MenuTopicManager**> singleton{ REL::ID(2689089) };
return *singleton;
}

Expand Down
4 changes: 2 additions & 2 deletions CommonLibF4/include/RE/Bethesda/MessageMenuManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ namespace RE
public:
[[nodiscard]] static MessageMenuManager* GetSingleton()
{
static REL::Relocation<MessageMenuManager**> singleton{ REL::ID(959572) };
static REL::Relocation<MessageMenuManager**> singleton{ REL::ID(2689087) };
return *singleton;
}

Expand All @@ -104,7 +104,7 @@ namespace RE
bool a_ensureUnique = false)
{
using func_t = decltype(&MessageMenuManager::Create);
static REL::Relocation<func_t> func{ REL::ID(89563) };
static REL::Relocation<func_t> func{ REL::ID(2249456) };
return func(this, a_headerText, a_bodyText, a_callback, a_warningContext, a_button1Text, a_button2Text, a_button3Text, a_button4Text, a_ensureUnique);
}

Expand Down
23 changes: 8 additions & 15 deletions CommonLibF4/include/RE/Bethesda/PipboyManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,63 +62,56 @@ namespace RE

[[nodiscard]] static PipboyManager* GetSingleton()
{
static REL::Relocation<PipboyManager**> singleton{ REL::ID(553234) };
static REL::Relocation<PipboyManager**> singleton{ REL::ID(2691945) };
return *singleton;
}

void AddMenuToPipboy(IMenu& a_menu, const NiRect<float>& a_standVP, const NiRect<float>& a_powerVP)
{
using func_t = decltype(&PipboyManager::AddMenuToPipboy);
static REL::Relocation<func_t> func{ REL::ID(394568) };
static REL::Relocation<func_t> func{ REL::ID(2225453) };
return func(this, a_menu, a_standVP, a_powerVP);
}

void ClosedownPipboy()
{
using func_t = decltype(&PipboyManager::ClosedownPipboy);
static REL::Relocation<func_t> func{ REL::ID(731410) };
return func(this);
}

void DisablePipboyShader()
{
using func_t = decltype(&PipboyManager::DisablePipboyShader);
static REL::Relocation<func_t> func{ REL::ID(662519) };
static REL::Relocation<func_t> func{ REL::ID(2225480) };
return func(this);
}

void EnablePipboyShader()
{
using func_t = decltype(&PipboyManager::EnablePipboyShader);
static REL::Relocation<func_t> func{ REL::ID(157921) };
static REL::Relocation<func_t> func{ REL::ID(2225484) };
return func(this);
}

void InitPipboy()
{
using func_t = decltype(&PipboyManager::InitPipboy);
static REL::Relocation<func_t> func{ REL::ID(1477369) };
static REL::Relocation<func_t> func{ REL::ID(2225479) };
return func(this);
}

void LowerPipboy(LOWER_REASON a_reason)
{
using func_t = decltype(&PipboyManager::LowerPipboy);
static REL::Relocation<func_t> func{ REL::ID(1444875) };
static REL::Relocation<func_t> func{ REL::ID(2225454) };
return func(this, a_reason);
}

void OnPipboyCloseAnim()
{
using func_t = decltype(&PipboyManager::OnPipboyCloseAnim);
static REL::Relocation<func_t> func{ REL::ID(1231000) };
static REL::Relocation<func_t> func{ REL::ID(2225457) };
return func(this);
}

void OnPipboyCloseAnimFailed()
{
using func_t = decltype(&PipboyManager::OnPipboyCloseAnimFailed);
static REL::Relocation<func_t> func{ REL::ID(1362084) };
static REL::Relocation<func_t> func{ REL::ID(2225459) };
return func(this);
}

Expand Down
Loading