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: Update, misc. #7

Merged
merged 5 commits into from
May 8, 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
1 change: 1 addition & 0 deletions CommonLibF4/cmake/sourcelist.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ set(SOURCES
include/RE/Bethesda/BGSMod.h
include/RE/Bethesda/BGSPrimitive.h
include/RE/Bethesda/BGSSaveLoad.h
include/RE/Bethesda/BGSSceneAction.h
include/RE/Bethesda/BGSStoryEventManager.h
include/RE/Bethesda/BGSStoryManagerTreeForm.h
include/RE/Bethesda/BGSSynchronizedAnimationManager.h
Expand Down
2 changes: 1 addition & 1 deletion CommonLibF4/include/RE/Bethesda/Actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ namespace RE
void SetupFireSounds(Actor& a_actor, BGSObjectInstanceT<TESObjectWEAP>& a_weapon)
{
using func_t = decltype(&EquippedWeaponData::SetupFireSounds);
REL::Relocation<func_t> func{ REL::ID(1468462) };
REL::Relocation<func_t> func{ REL::ID(2232275) };
return func(this, a_actor, a_weapon);
}

Expand Down
228 changes: 228 additions & 0 deletions CommonLibF4/include/RE/Bethesda/BGSSceneAction.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
#pragma once

#include "RE/Bethesda/BSTArray.h"
#include "RE/Bethesda/BSTSmartPointer.h"
#include "RE/Bethesda/TESCondition.h"
#include "RE/Bethesda/TESForms.h"

namespace RE
{
class Actor;
class BGSScene;
class BGSKeyword;
class BGSSoundDescriptorForm;
class BGSSoundOutput;
class BSInputEnableLayer;
class TESCondition;
class TESPackage;
class TESQuest;
class TESTopic;

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

struct STARTSCENEACTIONDATA
{
BGSScene* pScene;
std::uint16_t sceneStartPhase;
TESQuest* parentQuest;
TESCondition sceneConditions;
};

enum SCENE_ACTION_PLAYER_RESPONSE_TYPE : std::uint32_t
{
kPositive = 0,
kNegative = 1,
kNeutral = 2,
kQuestion = 3,
kTotal = 4,
kNone
};

enum SCENE_ACTION_TYPE : std::uint32_t
{
kDialogue = 0,
kPackage = 1,
kTimer = 2,
kPlayerDialogue = 3,
kStartScene = 4,
kNPCResponse = 5,
kRadio = 6,
};

enum class Flag
{
kPlayerUseDialogueSubtypePositive = 1 << 7,
kPlayerUseDialogueSubtypeNegative = 1 << 8,
kPlayerUseDialogueSubtypeNeutral = 1 << 9,
kUseDialogueSubtype = 1 << 10,
kPlayerUseDialogueSubtypeQuestion = 1 << 11,
kFaceTaget = 1 << 15,
kHeadTrackPlayer = 1 << 17,
kIngoreForCompletion = 1 << 19,
kCameraSpeakerTarget = 1 << 21
};

enum class Status
{
kStopped,
kRunning,
kComplete
};

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 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 StartAction(BGSScene* scene); // 12
virtual void EndAction(BGSScene* scene); // 13
virtual void CleanUpActionActor(void); // 14
virtual void UpdateAction(BGSScene* scene); // 14

// members
std::uint32_t actorID; // 08
std::uint16_t startPhase; // 0C
std::uint16_t endPhase; // 0E
stl::enumeration<Flag, std::uint32_t> flags; // 10
stl::enumeration<Status, std::uint8_t> status; // 14
std::uint32_t uniqueID; // 18
};
static_assert(sizeof(BGSSceneAction) == 0x20);

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

// members
TESTopic* topic; // 20
float maxLoopTime; // 28
float minLoopTime; // 2C
BSTArray<std::uint32_t> headTrackTargetA; // 30
float currentLoopTimer; // 48
BGSKeyword* pAnimFaceArchType; // 50
BGSKeyword* pSubtypeKeyword; // 58
BGSSoundOutput* outputModel; // 60
BSTSmartPointer<BSInputEnableLayer> pInputLayer; // 68
std::uint32_t headTargetValue; // 74
float headTrackChangeTimer; // 78
};
static_assert(sizeof(BGSSceneActionDialogue) == 0x78);

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

TESTopic* responseTopics[4]; // 20
BGSKeyword* pResponseSubtypeKeywords[4]; // 40
BGSSoundOutput* pOutputModel; // 60
BSTArray<std::uint32_t> headTrackTargetA; // 68
std::uint32_t headTargetValue; // 80
float headTrackChangeTimer; // 84
TESTopic* currentTopic; // 88
};
static_assert(sizeof(BGSSceneActionConversationBase) == 0x90);

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

std::uint64_t dialogueTarget; // 90
TESTopic* pNPCResponseTopics[4]; // 98
BGSKeyword* pNPCResponseSubtypeKeywords[4]; // B8
TESTopic* pTopic; // D8
SCENE_ACTION_PLAYER_RESPONSE_TYPE playerInput; // E0
};
static_assert(sizeof(BGSSceneActionPlayerDialogue) == 0xE8);

class __declspec(novtable) BGSSceneActionNPCResponseDialogue : public BGSSceneActionConversationBase { };

class __declspec(novtable) BGSSceneActionStartScene :
public BGSSceneAction
{
public:
static constexpr auto RTTI{ RTTI::BGSSceneActionStartScene };
static constexpr auto VTABlE{ VTABLE::BGSSceneActionStartScene };

BSTArray<STARTSCENEACTIONDATA*> scenesA; // 20
BGSScene* scene; // 38
std::uint16_t sceneStartPhase; // 40
bool endSceneSayGreeting; // 42
};
static_assert(sizeof(BGSSceneActionStartScene) == 0x48);

class __declspec(novtable) BGSSceneActionTimer :
public BGSSceneAction
{
public:
static constexpr auto RTTI{ RTTI::BGSSceneActionTimer };
static constexpr auto VTABlE{ VTABLE::BGSSceneActionTimer };

float seconds; // 20
float minSeconds; // 24
float timer; // 28
bool scriptEndRun; // 2C
bool runEnd; // 2D
float currentSeconds; // 30
};
static_assert(sizeof(BGSSceneActionTimer) == 0x38);

class __declspec(novtable) BGSSceneActionRadio :
public BGSSceneAction
{
public:
static constexpr auto RTTI{ RTTI::BGSSceneActionRadio };
static constexpr auto VTABlE{ VTABLE::BGSSceneActionRadio };

TESTopic* topic; // 20
BGSSoundDescriptorForm* sound; // 28
BGSSoundOutput* outputModel; // 30
BGSKeyword* subtypeKeyword; // 38
BGSSoundDescriptorForm* topicSound; // 40
float soundDuration; // 48
std::uint32_t soundID; // 4C
bool soundDone; // 50
TESTopic* currentTopic; // 58
float failTimer; // 60
};
static_assert(sizeof(BGSSceneActionRadio) == 0x68);

class __declspec(novtable) BGSSceneActionPackage :
public BGSSceneAction
{
public:
static constexpr auto RTTI{ RTTI::BGSSceneActionPackage };
static constexpr auto VTABlE{ VTABLE::BGSSceneActionPackage };

std::uint32_t currentPackIndex; // 20
BSTArray<TESPackage*> packages; // 28
};
static_assert(sizeof(BGSSceneActionPackage) == 0x40);
}
2 changes: 1 addition & 1 deletion CommonLibF4/include/RE/Bethesda/BGSStoryManagerTreeForm.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ namespace RE
bool SetStage(std::uint16_t stage)
{
using func_t = decltype(&TESQuest::SetStage);
REL::Relocation<func_t> func{ REL::ID(952799) };
REL::Relocation<func_t> func{ REL::ID(2207743) };
return func(this, stage);
}

Expand Down
2 changes: 1 addition & 1 deletion CommonLibF4/include/RE/Bethesda/BSExtraData.h
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ namespace RE
void SetStartingWorldOrCell(TESForm* a_form)
{
using func_t = decltype(&ExtraDataList::SetStartingWorldOrCell);
REL::Relocation<func_t> func{ REL::ID(603621) };
REL::Relocation<func_t> func{ REL::ID(2191213) };
return func(this, a_form);
}

Expand Down
2 changes: 1 addition & 1 deletion CommonLibF4/include/RE/Bethesda/PlayerCharacter.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ namespace RE
bool IsGodMode()
{
using func_t = decltype(&PlayerCharacter::IsGodMode);
REL::Relocation<func_t> func{ REL::ID(1032309) };
REL::Relocation<func_t> func{ REL::ID(2232986) };
return func(this);
}

Expand Down
2 changes: 1 addition & 1 deletion CommonLibF4/include/RE/Bethesda/ProcessLists.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ namespace RE
[[nodiscard]] bool IsActorTargetingREFinPackage(const TESObjectREFR* a_actor, PTYPE a_type, bool a_onlyHigh)
{
using func_t = decltype(&ProcessLists::IsActorTargetingREFinPackage);
REL::Relocation<func_t> func{ REL::ID(559542) };
REL::Relocation<func_t> func{ REL::ID(2234033) };
return func(this, a_actor, a_type, a_onlyHigh);
}

Expand Down
4 changes: 2 additions & 2 deletions CommonLibF4/include/RE/Bethesda/SWFToCodeFunctionHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ namespace RE
void MapCodeMethodToASFunction(const char* a_functionName, std::int32_t a_functionID)
{
using func_t = decltype(&SWFToCodeFunctionHandler::MapCodeMethodToASFunction);
REL::Relocation<func_t> func{ REL::ID(1263128) };
REL::Relocation<func_t> func{ REL::ID(2287419) };
return func(this, a_functionName, a_functionID);
}

void RegisterCodeObject(Scaleform::GFx::Movie& a_movie, Scaleform::GFx::Value& a_menuObj)
{
using func_t = decltype(&SWFToCodeFunctionHandler::RegisterCodeObject);
REL::Relocation<func_t> func{ REL::ID(67637) };
REL::Relocation<func_t> func{ REL::ID(2287415) };
return func(this, a_movie, a_menuObj);
}
};
Expand Down
10 changes: 5 additions & 5 deletions CommonLibF4/include/RE/Bethesda/TESBoundAnimObjects.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ namespace RE
[[nodiscard]] TESContainer* GetContainer()
{
using func_t = decltype(&TESFurniture::GetContainer);
REL::Relocation<func_t> func{ REL::ID(1049933) };
REL::Relocation<func_t> func{ REL::ID(2198043) };
return func(this);
}

Expand Down Expand Up @@ -443,7 +443,7 @@ namespace RE
[[nodiscard]] uint32_t GetSex() noexcept
{
using func_t = decltype(&TESNPC::GetSex);
REL::Relocation<func_t> func{ REL::ID(1257181) };
REL::Relocation<func_t> func{ REL::ID(2207107) };
return func(this);
}

Expand Down Expand Up @@ -563,21 +563,21 @@ namespace RE
LOCK_LEVEL GetHackDifficultyLockLevel(TESObjectREFR* a_refr)
{
using func_t = decltype(&BGSTerminal::GetHackDifficultyLockLevel);
REL::Relocation<func_t> func{ REL::ID(537273) };
REL::Relocation<func_t> func{ REL::ID(2197777) };
return func(this, a_refr);
}

static bool IsTerminalRefInUse(TESObjectREFR* a_refr)
{
using func_t = decltype(&BGSTerminal::IsTerminalRefInUse);
REL::Relocation<func_t> func{ REL::ID(1093565) };
REL::Relocation<func_t> func{ REL::ID(2197779) };
return func(a_refr);
}

static void Show(TESObjectREFR* a_refr)
{
using func_t = decltype(&BGSTerminal::Show);
REL::Relocation<func_t> func{ REL::ID(1069012) };
REL::Relocation<func_t> func{ REL::ID(2197776) };
return func(a_refr);
}

Expand Down
6 changes: 3 additions & 3 deletions CommonLibF4/include/RE/Bethesda/TESBoundObjects.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ namespace RE
void ApplyMods(BSTSmartPointer<TBO_InstanceData>& a_dest, const BGSObjectInstanceExtra* a_extra) const
{
using func_t = decltype(&TESBoundObject::ApplyMods);
REL::Relocation<func_t> func{ REL::ID(113585) };
REL::Relocation<func_t> func{ REL::ID(2198325) };
return func(this, a_dest, a_extra);
}

Expand Down Expand Up @@ -655,7 +655,7 @@ namespace RE
[[nodiscard]] static bool GetReloadsWithAmmoRef(const TESAmmo* a_ammo)
{
using func_t = decltype(&TESAmmo::GetReloadsWithAmmoRef);
REL::Relocation<func_t> func{ REL::ID(1035622) };
REL::Relocation<func_t> func{ REL::ID(2197864) };
return func(a_ammo);
}

Expand Down Expand Up @@ -793,7 +793,7 @@ namespace RE
bool CollidesWithSmallTransparentLayer()
{
using func_t = decltype(&BGSProjectile::CollidesWithSmallTransparentLayer);
REL::Relocation<func_t> func{ REL::ID(1115694) };
REL::Relocation<func_t> func{ REL::ID(2197620) };
return func(this);
}

Expand Down
4 changes: 2 additions & 2 deletions CommonLibF4/include/RE/Bethesda/TESCondition.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ namespace RE
[[nodiscard]] float GetComparisonValue()
{
using func_t = decltype(&TESConditionItem::GetComparisonValue);
REL::Relocation<func_t> func{ REL::ID(1373349) };
REL::Relocation<func_t> func{ REL::ID(2212007) };
return func(this);
}

[[nodiscard]] bool IsTrue(TESObjectREFR* a_actionRef, TESObjectREFR* a_targetRef)
{
using func_t = decltype(&TESConditionItem::IsTrue);
REL::Relocation<func_t> func{ REL::ID(1453240) };
REL::Relocation<func_t> func{ REL::ID(2212008) };
return func(this, a_actionRef, a_targetRef);
}

Expand Down
Loading
Loading