Skip to content

Commit

Permalink
feat: misc (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
qudix authored Oct 2, 2024
1 parent 2dd6c11 commit 2165663
Show file tree
Hide file tree
Showing 12 changed files with 181 additions and 159 deletions.
13 changes: 13 additions & 0 deletions include/RE/B/BGSStoryManagerTreeForm.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#pragma once

#include "RE/T/TESForm.h"

namespace RE
{
class __declspec(novtable) BGSStoryManagerTreeForm :
public TESForm
{
public:
SF_RTTI_VTABLE(BGSStoryManagerTreeForm);
};
}
34 changes: 34 additions & 0 deletions include/RE/B/BGSStoryTeller.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#pragma once

#include "RE/B/BSTArray.h"

namespace RE
{
class TESQuest;

class __declspec(novtable) BGSStoryTeller
{
public:
SF_RTTI_VTABLE(BGSStoryTeller);

[[nodiscard]] static BGSStoryTeller* GetSingleton()
{
static REL::Relocation<BGSStoryTeller**> singleton{ REL::ID(878850) };
return *singleton;
}

// members
std::byte pad00[0x38];
BSTArray<TESQuest*> queuedStartQuests;
BSTArray<TESQuest*> runningQuests;
BSTArray<TESQuest*> queuedStopQuests;
std::byte pad70[0x10];
BSTArray<TESQuest*> unk78;
BSTArray<TESQuest*> unk88;
};
static_assert(offsetof(BGSStoryTeller, queuedStartQuests) == 0x38);
static_assert(offsetof(BGSStoryTeller, runningQuests) == 0x48);
static_assert(offsetof(BGSStoryTeller, queuedStopQuests) == 0x58);
static_assert(offsetof(BGSStoryTeller, unk78) == 0x78);
static_assert(offsetof(BGSStoryTeller, unk88) == 0x88);
}
61 changes: 42 additions & 19 deletions include/RE/E/Events.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ namespace RE
class Actor;
class TESObjectCELL;
class TESObjectREFR;
}

namespace RE::Events
{
struct TESLoadGameEvent
{
[[nodiscard]] static BSTEventSource<TESLoadGameEvent>* GetEventSource()
Expand Down Expand Up @@ -105,7 +102,7 @@ namespace RE::Events
// members
NiPointer<TESObjectREFR> actor;
TESFormID baseObject;
std::uint32_t origRef;
TESFormID origRef;
std::uint16_t uniqueID;
bool equipped;
};
Expand All @@ -122,6 +119,7 @@ namespace RE::Events
return func();
}

// members
NiPointer<TESObjectREFR> ref;
};

Expand All @@ -134,6 +132,7 @@ namespace RE::Events
return func();
}

// members
NiPointer<TESObjectREFR> ref;
};
};
Expand Down Expand Up @@ -180,6 +179,7 @@ namespace RE::Events
return func();
}

// members
NiPointer<TESObjectREFR> source;
NiPointer<TESObjectREFR> target;
std::uint32_t state;
Expand Down Expand Up @@ -333,7 +333,7 @@ namespace RE::Events
}
};

struct BGSPlanet
namespace BGSPlanet
{
struct PlayerKnowledgeFlagSetEvent
{
Expand Down Expand Up @@ -2880,7 +2880,7 @@ namespace RE::Events
}
};

struct ModelReferenceEffectEvents
namespace ModelReferenceEffectEvents
{
struct ReferenceEffectFinished
{
Expand Down Expand Up @@ -3132,7 +3132,7 @@ namespace RE::Events
}
};

struct Spaceship
namespace Spaceship
{
struct TakeOffEvent
{
Expand Down Expand Up @@ -3567,7 +3567,7 @@ namespace RE::Events
[[nodiscard]] static BSTEventSource<TESCellFullyLoadedEvent>* GetEventSource()
{
using func_t = decltype(&TESCellFullyLoadedEvent::GetEventSource);
static REL::Relocation<func_t> func{ REL::ID(107143) };
static REL::Relocation<func_t> func{ ID::TESCellFullyLoadedEvent::GetEventSource };
return func();
}

Expand All @@ -3580,17 +3580,37 @@ namespace RE::Events
[[nodiscard]] static BSTEventSource<TESContainerChangedEvent>* GetEventSource()
{
using func_t = decltype(&TESContainerChangedEvent::GetEventSource);
static REL::Relocation<func_t> func{ REL::ID(107155) };
static REL::Relocation<func_t> func{ ID::TESContainerChangedEvent::GetEventSource };
return func();
}

// members
TESFormID source; // 00
TESFormID target; // 04
TESFormID baseObject; // 08
std::uint32_t itemCount; // 0C
TESFormID itemRef; // 10
std::uint16_t uniqueID; // 14
std::uint64_t unk18; // 18
std::uint32_t unk20; // 20
};
static_assert(sizeof(TESContainerChangedEvent) == 0x28);

struct TESDeathEvent
{
[[nodiscard]] static BSTEventSource<TESDeathEvent>* GetEventSource()
{
using func_t = decltype(&TESDeathEvent::GetEventSource);
static REL::Relocation<func_t> func{ ID::TESDeathEvent::GetEventSource };
return func();
}

// members
TESFormID source; // 00
TESFormID target; // 04
TESFormID item; // 08
std::uint32_t itemCount; // 0C
std::uint32_t itemRef; // 10
NiPointer<TESObjectREFR> actorDying; // 00
NiPointer<TESObjectREFR> actorKiller; // 08
bool dead; // 10
};
static_assert(sizeof(TESDeathEvent) == 0x18);

struct TESFormDeleteEvent
{
Expand All @@ -3615,8 +3635,8 @@ namespace RE::Events
}

// members
std::uint32_t oldFormID;
std::uint32_t newFormID;
TESFormID oldFormID;
TESFormID newFormID;
};

struct TESFurnitureEvent
Expand Down Expand Up @@ -3654,14 +3674,17 @@ namespace RE::Events
[[nodiscard]] static BSTEventSource<TESObjectLoadedEvent>* GetEventSource()
{
using func_t = decltype(&TESObjectLoadedEvent::GetEventSource);
static REL::Relocation<func_t> func{ REL::ID(107177) };
static REL::Relocation<func_t> func{ ID::TESObjectLoadedEvent::GetEventSource };
return func();
}

// members
TESFormID formID;
bool loaded;
TESFormID formID; // 00
bool loaded; // 04
std::uint8_t pad05; // 05
std::uint16_t pad06; // 06
};
static_assert(sizeof(TESObjectLoadedEvent) == 0x8);

struct TESPickNewIdleEvent
{
Expand Down
33 changes: 26 additions & 7 deletions include/RE/M/Main.h
Original file line number Diff line number Diff line change
@@ -1,28 +1,47 @@
#pragma once

#include "RE/B/BSTEvent.h"

namespace RE
{
class NiAVObject;
class NiCamera;

class Main
struct PositionPlayerEvent;

class Main :
public BSTEventSink<PositionPlayerEvent>
{
public:
SF_RTTI_VTABLE(Main);

struct SceneGraphRoot
{
std::byte unk[120];
NiAVObject* worldCameraRoot; //NiNode
NiCamera* worldCamera;
// members
std::byte pad00[0x78]; // 00
NiAVObject* worldCameraRoot; // 78 - NiNode
NiCamera* worldCamera; // 80
};
// static_assert(offsetof(SceneGraphRoot, SceneGraphRoot::worldCamera) == 0x80); // FIXME: clang-cl chokes on this assertion

static SceneGraphRoot* WorldRoot()
virtual ~Main(); // 00

// override
virtual BSEventNotifyControl ProcessEvent(const PositionPlayerEvent& a_event, BSTEventSource<PositionPlayerEvent>* a_source) override; // 01

[[nodiscard]] static Main* GetSingleton()
{
static REL::Relocation<SceneGraphRoot**> singleton{ REL::ID(887308) };
static REL::Relocation<Main**> singleton{ REL::ID(881027) };
return *singleton;
}

static NiCamera* WorldCamera()
[[nodiscard]] static SceneGraphRoot* WorldRoot()
{
static REL::Relocation<SceneGraphRoot**> worldRoot{ REL::ID(887308) };
return *worldRoot;
}

[[nodiscard]] static NiCamera* WorldRootCamera()
{
return WorldRoot()->worldCamera;
}
Expand Down
43 changes: 43 additions & 0 deletions include/RE/P/ProcessLists.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#pragma once

#include "RE/B/BSTArray.h"
#include "RE/B/BSTEvent.h"
#include "RE/B/BSTSingleton.h"

namespace RE
{
struct PositionPlayerEvent;

class __declspec(novtable) ProcessLists :
public BSTEventSink<PositionPlayerEvent>, // 000
public BSTSingletonSDM<ProcessLists> // 008
{
public:
SF_RTTI_VTABLE(ProcessLists);

virtual ~ProcessLists(); // 00

// override
virtual BSEventNotifyControl ProcessEvent(const PositionPlayerEvent&, BSTEventSource<PositionPlayerEvent>*) override; // 01

[[nodiscard]] static ProcessLists* GetSingleton()
{
static REL::Relocation<ProcessLists**> singleton{ REL::ID(878338) };
return *singleton;
}

// members
std::byte pad10[0x3B]; // 010
bool runDetection; // 044
std::byte pad45[0x13]; // 045
BSTArray<std::uint32_t> highActorHandles; // 058
BSTArray<std::uint32_t> lowActorHandles; // 068
BSTArray<std::uint32_t> middleHighActorHandles; // 078
BSTArray<std::uint32_t> middleLowActorHandles; // 088
};
static_assert(offsetof(ProcessLists, runDetection) == 0x44);
static_assert(offsetof(ProcessLists, highActorHandles) == 0x58);
static_assert(offsetof(ProcessLists, lowActorHandles) == 0x68);
static_assert(offsetof(ProcessLists, middleHighActorHandles) == 0x78);
static_assert(offsetof(ProcessLists, middleLowActorHandles) == 0x88);
}
8 changes: 3 additions & 5 deletions include/RE/Starfield.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@
#include "RE/B/BGSSpeechChallengeObject.h"
#include "RE/B/BGSStar.h"
#include "RE/B/BGSStaticCollection.h"
#include "RE/B/BGSStoryManagerTreeForm.h"
#include "RE/B/BGSStoryTeller.h"
#include "RE/B/BGSSunPresetForm.h"
#include "RE/B/BGSSurfaceBlock.h"
#include "RE/B/BGSSurfacePattern.h"
Expand Down Expand Up @@ -319,6 +321,7 @@
#include "RE/P/PlasmaProjectile.h"
#include "RE/P/PlayerCamera.h"
#include "RE/P/PlayerCharacter.h"
#include "RE/P/ProcessLists.h"
#include "RE/P/Profiler.h"
#include "RE/P/Projectile.h"
#include "RE/P/PropertyGroupInfo.h"
Expand Down Expand Up @@ -366,15 +369,12 @@
#include "RE/T/TESBoundAnimObject.h"
#include "RE/T/TESBoundObject.h"
#include "RE/T/TESCamera.h"
#include "RE/T/TESCellFullyLoadedEvent.h"
#include "RE/T/TESClass.h"
#include "RE/T/TESClimate.h"
#include "RE/T/TESCombatStyle.h"
#include "RE/T/TESCondition.h"
#include "RE/T/TESContainer.h"
#include "RE/T/TESContainerChangedEvent.h"
#include "RE/T/TESDataHandler.h"
#include "RE/T/TESDeathEvent.h"
#include "RE/T/TESDescription.h"
#include "RE/T/TESEffectShader.h"
#include "RE/T/TESEnchantableForm.h"
Expand All @@ -383,7 +383,6 @@
#include "RE/T/TESFile.h"
#include "RE/T/TESFlora.h"
#include "RE/T/TESForm.h"
#include "RE/T/TESFormIDRemapEvent.h"
#include "RE/T/TESFormRefCount.h"
#include "RE/T/TESFullName.h"
#include "RE/T/TESFurniture.h"
Expand Down Expand Up @@ -414,7 +413,6 @@
#include "RE/T/TESObjectCONT.h"
#include "RE/T/TESObjectDOOR.h"
#include "RE/T/TESObjectLIGH.h"
#include "RE/T/TESObjectLoadedEvent.h"
#include "RE/T/TESObjectMISC.h"
#include "RE/T/TESObjectREFR.h"
#include "RE/T/TESObjectSTAT.h"
Expand Down
23 changes: 0 additions & 23 deletions include/RE/T/TESCellFullyLoadedEvent.h

This file was deleted.

Loading

0 comments on commit 2165663

Please sign in to comment.