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

feat: Misc RE'ing. (#6) #13

Merged
merged 1 commit into from
May 16, 2024
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: 2 additions & 0 deletions CommonLibF4/cmake/sourcelist.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,10 @@ set(SOURCES
include/RE/Bethesda/Movement.h
include/RE/Bethesda/NavMesh.h
include/RE/Bethesda/NavMeshInfoMap.h
include/RE/Bethesda/PipboyDataGroup.h
include/RE/Bethesda/PipboyInventoryUtils.h
include/RE/Bethesda/PipboyManager.h
include/RE/Bethesda/PipboyValue.h
include/RE/Bethesda/PlayerCharacter.h
include/RE/Bethesda/PlayerControls.h
include/RE/Bethesda/PowerArmor.h
Expand Down
6 changes: 3 additions & 3 deletions CommonLibF4/include/RE/Bethesda/BGSStoryManagerTreeForm.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ namespace RE
class BGSQuestInstanceText
{
public:
void ParseString(BSStringT<char>& inOutText, const TESQuest* quest, std::uint32_t instanceID)
static void ParseString(BSStringT<char>* inOutText, const TESQuest* quest, std::uint32_t instanceID)
{
using func_t = decltype(&BGSQuestInstanceText::ParseString);
REL::Relocation<func_t> func{ REL::ID(141681) }; // Update
return func(this, inOutText, quest, instanceID);
REL::Relocation<func_t> func{ REL::ID(2206630) };
return func(inOutText, quest, instanceID);
}

struct StringData
Expand Down
9 changes: 7 additions & 2 deletions CommonLibF4/include/RE/Bethesda/BSExtraData.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,12 @@ namespace RE
static constexpr auto VTABLE{ VTABLE::ExtraHealth };
static constexpr auto TYPE{ EXTRA_DATA_TYPE::kHealth };

ExtraHealth();
ExtraHealth(float health);
ExtraHealth(float health) :
BSExtraData(TYPE),
health(health)
{
stl::emplace_vtable(this);
}

// members
float health; // 18
Expand Down Expand Up @@ -899,6 +903,7 @@ namespace RE
{
using func_t = decltype(&ExtraDataList::GetHealthPerc);
REL::Relocation<func_t> func{ REL::ID(2190226) };
return func(this);
}

void SetHealthPerc(float a_healthPerc)
Expand Down
27 changes: 27 additions & 0 deletions CommonLibF4/include/RE/Bethesda/PipboyDataGroup.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#pragma once

#include "RE/Bethesda/BSTEvent.h"
#include "RE/Bethesda/IMenu.h"
#include "RE/Bethesda/PipboyValue.h"

namespace RE
{
class PipboyDataGroup
: BSTEventSource<PipboyValueChangedEvent>
{
public:
static constexpr auto RTTI{ RTTI::PipboyDataGroup };
static constexpr auto VTABLE{ VTABLE::PipboyDataGroup };

virtual ~PipboyDataGroup();

virtual void Populate(bool);
virtual void DoClearData();
virtual void DoClearSink();

REX::W32::CRITICAL_SECTION PipboyDataMutex;
void* rThrottleManager; // PipboyThrottleManager
PipboyValue* rootValue;
};
static_assert(sizeof(PipboyDataGroup) == 0x98);
}
61 changes: 61 additions & 0 deletions CommonLibF4/include/RE/Bethesda/PipboyValue.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#pragma once

#include "RE/Bethesda/BSFixedString.h"
#include "RE/Bethesda/BSTArray.h"
#include "RE/Bethesda/BSTHashMap.h"

namespace RE
{
class PipboyObject;

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

enum SERIALIZATION_DATA_TYPE : std::uint8_t
{
SDT_BOOL = 0x0,
SDT_INT_8 = 0x1,
SDT_UINT_8 = 0x2,
SDT_INT_32 = 0x3,
SDT_UINT_32 = 0x4,
SDT_FLOAT = 0x5,
SDT_STRING = 0x6,
SDT_ARRAY = 0x7,
SDT_OBJECT = 0x8,
};

virtual ~PipboyValue();

virtual void CleanDirtyToGame();
virtual void Serialize(void* a_args1);
virtual void SerializeChanged(void* a_args1);
virtual SERIALIZATION_DATA_TYPE GetType();

// members
std::uint32_t id; // 08
bool isDirtyGame; // 0C
bool isDirtyToCompanion; // 0D
PipboyValue* parentValue; // 10
};
static_assert(sizeof(PipboyValue) == 0x18);

class __declspec(novtable) PipboyObject :
PipboyValue
{
public:
static constexpr auto RTTI{ RTTI::PipboyObject };
static constexpr auto VTABLE{ VTABLE::PipboyObject };

virtual ~PipboyObject();

//members
BSTHashMap<BSFixedString, PipboyValue*> memberMap;
BSTSet<std::uint32_t> addedMemberIDs;
BSTArray<std::uint32_t> removedMemberIDs;
bool newlyCreated;
};
static_assert(sizeof(PipboyObject) == 0x98);
}
14 changes: 14 additions & 0 deletions CommonLibF4/include/RE/Bethesda/TESForms.h
Original file line number Diff line number Diff line change
Expand Up @@ -1770,6 +1770,20 @@ namespace RE
return func(this);
}

CHARISMA_CHALLENGE_DIFFICULTY GetSpeechChallengeLevel()
{
using func_t = decltype(&TESTopicInfo::GetSpeechChallengeLevel);
REL::Relocation<func_t> func{ REL::ID(2208441) };
return func(this);
}

CHARISMA_CHALLENGE_SUCCESS GetSuccessLevel()
{
using func_t = decltype(&TESTopicInfo::GetSuccessLevel);
REL::Relocation<func_t> func{ REL::ID(2208444) };
return func(this);
}

// members
TESTopic* parentTopic; // 20
TESGlobal* resetGlobal; // 28
Expand Down
2 changes: 2 additions & 0 deletions CommonLibF4/include/RE/Fallout.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,10 @@
#include "RE/Bethesda/Movement.h"
#include "RE/Bethesda/NavMesh.h"
#include "RE/Bethesda/NavMeshInfoMap.h"
#include "RE/Bethesda/PipboyDataGroup.h"
#include "RE/Bethesda/PipboyInventoryUtils.h"
#include "RE/Bethesda/PipboyManager.h"
#include "RE/Bethesda/PipboyValue.h"
#include "RE/Bethesda/PlayerCharacter.h"
#include "RE/Bethesda/PlayerControls.h"
#include "RE/Bethesda/PowerArmor.h"
Expand Down
Loading