Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/powerof3/CommonLibSSE into vr
Browse files Browse the repository at this point in the history
  • Loading branch information
alandtse committed Oct 12, 2024
2 parents 4aac68c + 7873751 commit 0cf8498
Show file tree
Hide file tree
Showing 29 changed files with 412 additions and 75 deletions.
2 changes: 2 additions & 0 deletions cmake/sourcelist.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ set(SOURCES
include/RE/A/AutoMoveHandler.h
include/RE/A/AutoRegisterCreator.h
include/RE/A/AutoRegisterFactory.h
include/RE/A/AutoVanityState.h
include/RE/A/ahkpCharacterProxy.h
include/RE/A/ahkpWorld.h
include/RE/B/BGSAbilityPerkEntry.h
Expand Down Expand Up @@ -1380,6 +1381,7 @@ set(SOURCES
include/RE/Q/QuestEvents.h
include/RE/Q/QuestObjectiveStates.h
include/RE/Q/QuestStatus.h
include/RE/Q/QuickSaveLoadHandler.h
include/RE/R/REFREventCallbacks.h
include/RE/R/RaceSexCamera.h
include/RE/R/RaceSexMenu.h
Expand Down
8 changes: 6 additions & 2 deletions include/RE/A/AIProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,10 @@ namespace RE
};
static_assert(sizeof(Data0B8) == 0x38);

void AddToProcedureIndexRunning(Actor* a_actor, std::uint32_t a_num);
void ClearActionHeadtrackTarget(bool a_defaultHold);
void ClearMuzzleFlashes();
void ComputeLastTimeProcessed();
float GetCachedHeight() const;
bhkCharacterController* GetCharController();
ActorHandle GetCommandingActor() const;
Expand All @@ -183,12 +185,14 @@ namespace RE
void SetActorRefraction(float a_refraction);
void KnockExplosion(Actor* a_actor, const NiPoint3& a_location, float a_magnitude);
bool PlayIdle(Actor* a_actor, TESIdleForm* a_idle, TESObjectREFR* a_target);
void RandomlyPlaySpecialIdles(Actor* a_actor);
void SetActorsDetectionEvent(Actor* a_actor, const NiPoint3& a_location, std::int32_t a_soundLevel, TESObjectREFR* a_ref);
void SetArrested(bool a_arrested);
void SetCachedHeight(float a_height);
void SetRefraction(float a_refraction);
void SetHeadtrackTarget(Actor* a_owner, NiPoint3& a_targetPosition);
void Set3DUpdateFlag(RESET_3D_FLAGS a_flags);
void SetRunOncePackage(TESPackage* a_package, Actor* a_actor);
bool SetupSpecialIdle(Actor* a_actor, DEFAULT_OBJECT a_action, TESIdleForm* a_idle, bool a_arg5, bool a_arg6, TESObjectREFR* a_target);
void StopCurrentIdle(Actor* a_actor, bool a_forceIdleStop);
void Update3DModel(Actor* a_actor);
Expand All @@ -199,8 +203,8 @@ namespace RE
MiddleHighProcessData* middleHigh; // 008
HighProcessData* high; // 010
ActorPackage currentPackage; // 018
float unk048; // 048
std::uint32_t unk04C; // 04C
float hourLastProcessed; // 048
float dateLastProcessed; // 04C
CachedValues* cachedValues; // 050
std::int32_t numberItemsActivate; // 058
std::uint32_t pad05C; // 05C
Expand Down
3 changes: 2 additions & 1 deletion include/RE/A/Actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ namespace RE
virtual void InitiateSpectator(Actor* a_target); // 0DC - { return; }
virtual void InitiateFlee(TESObjectREFR* a_fleeRef, bool a_runOnce, bool a_knows, bool a_combatMode, TESObjectCELL* a_cell, TESObjectREFR* a_ref, float a_fleeFromDist, float a_fleeToDist); // 0DD
virtual void InitiateGetUpPackage(); // 0DE
virtual void PutCreatedPackage(TESPackage* a_package, bool a_tempPackage, bool a_createdPackage, bool a_allowFromFurniture); // 0DF
virtual void PutCreatedPackage(TESPackage* a_package, bool a_tempPackage, bool a_createdPackage); // 0DF
virtual void UpdateAlpha(); // 0E0
virtual void SetAlpha(float a_alpha = 1.0); // 0E1
virtual float GetAlpha(); // 0E2
Expand Down Expand Up @@ -768,6 +768,7 @@ namespace RE
bool IsOnMount() const;
bool IsOverEncumbered() const;
bool IsPlayerTeammate() const;
bool IsPowerAttacking() const;
bool IsProtected() const;
bool IsRunning() const;
bool IsSneaking() const;
Expand Down
16 changes: 14 additions & 2 deletions include/RE/A/ActorState.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ namespace RE
void Unk_08(void) override; // 08 - { return 0; }

// add
virtual void Unk_14(void); // 14
virtual void Unk_15(void); // 15
virtual bool DoSetSitSleepState(SIT_SLEEP_STATE a_state); // 14
virtual void Unk_15(void); // 15

[[nodiscard]] ATTACK_STATE_ENUM GetAttackState() const noexcept { return actorState1.meleeAttackState; }
[[nodiscard]] FLY_STATE GetFlyState() const noexcept { return actorState1.flyState; }
Expand Down Expand Up @@ -183,6 +183,18 @@ namespace RE
}

[[nodiscard]] bool IsReanimated() const noexcept { return GetLifeState() == ACTOR_LIFE_STATE::kReanimate; }

[[nodiscard]] bool IsSitting() const noexcept
{
switch (GetSitSleepState()) {
case SIT_SLEEP_STATE::kIsSitting:
case SIT_SLEEP_STATE::kWantToStand:
return true;
default:
return false;
}
}

[[nodiscard]] bool IsSneaking() const noexcept { return static_cast<bool>(actorState1.sneaking); }
[[nodiscard]] bool IsSprinting() const noexcept { return static_cast<bool>(actorState1.sprinting); }
[[nodiscard]] bool IsSwimming() const noexcept { return static_cast<bool>(actorState1.swimming); }
Expand Down
27 changes: 27 additions & 0 deletions include/RE/A/AutoVanityState.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#pragma once

#include "RE/T/TESCameraState.h"

namespace RE
{
class AutoVanityState : public TESCameraState
{
public:
inline static constexpr auto RTTI = RTTI_AutoVanityState;
inline static constexpr auto VTABLE = VTABLE_AutoVanityState;

~AutoVanityState() override; // 00

// override (TESCameraState)
void Begin() override; // 01
void End() override; // 02
void Update(BSTSmartPointer<TESCameraState>& a_nextState) override; // 03
void GetRotation(NiQuaternion& a_rotation) override; // 04
void GetTranslation(NiPoint3& a_translation) override; // 05

// members
float autoVanityRot; // 20
std::uint32_t pad24; // 24
};
static_assert(sizeof(AutoVanityState) == 0x28);
}
2 changes: 2 additions & 0 deletions include/RE/B/BGSDebris.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ namespace RE
kCollisionData = 1 << 0
};

TES_HEAP_REDEFINE_NEW();

// members
std::int8_t percentage; // 00 - DATA~
stl::enumeration<BGSDebrisDataFlags, std::uint8_t> flags; // 01 - ~DATA
Expand Down
52 changes: 34 additions & 18 deletions include/RE/B/BGSSaveLoadManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,41 @@ namespace RE
class BGSSaveLoadFileEntry
{
public:
enum class SaveType
{
kAutosave = 0x0,
kSave = 0x1,
kQuicksave = 0x2
};

// members
BSFixedString fileName; // 00
BSFixedString playerName; // 08
BSFixedString playerTitle; // 10
BSFixedString location; // 18
BSFixedString playTime; // 20
BSFixedString raceName; // 28
std::uint32_t unk30; // 30
std::uint32_t unk34; // 34
std::uint32_t unk38; // 38
std::uint32_t unk3C; // 3C
std::uint32_t unk40; // 40
std::uint32_t unk44; // 44
std::uint64_t unk48; // 48
std::uint64_t unk50; // 50
std::uint64_t unk58; // 58
std::uint64_t unk60; // 60
std::uint64_t unk68; // 68
std::uint64_t unk70; // 70
BSFixedString fileName; // 00
BSFixedString characterName; // 08
BSFixedString characterTitle; // 10
BSFixedString currentLocation; // 18
BSFixedString playTime; // 20
BSFixedString characterRace; // 28
std::int32_t saveVersion; // 30
std::uint32_t saveNumber; // 34
std::uint32_t characterLevel; // 38
float currentExperience; // 3C
float requiredExperience; // 40
std::uint32_t screenshotWidth; // 44
std::uint32_t screenshotHeight; // 48
std::uint32_t unk4C; // 4C
REX::W32::FILETIME fileTime; // 50
REX::W32::FILETIME saveTime; // 58
std::int32_t unk60; // 60
bool loaded; // 64
bool unk65; // 65
bool unk66; // 66
std::uint8_t unk67; // 67
std::uint8_t unk68; // 68
bool unk69; // 69
std::uint16_t pad6A; // 6A
std::uint32_t characterID; // 6C
stl::enumeration<SaveType, std::uint32_t> saveType; // 70
std::uint32_t pad74; // 74
private:
KEEP_FOR_RE()
};
Expand Down
2 changes: 1 addition & 1 deletion include/RE/C/ConstructibleObjectMenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ namespace RE

// override (CraftingSubMenu)
void Accept(CallbackProcessor* a_cbReg) override; // 01
void Unk_06(void) override; // 06
void UpdateItemList() override; // 06
void SetItemCardInfo(ItemCard* a_itemCard) override; // 07

// members
Expand Down
2 changes: 1 addition & 1 deletion include/RE/C/CraftingSubMenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace RE
virtual void Unk_03(void); // 03 - { return; }
virtual bool HasItemPreview(); // 04 - { return 1; }
virtual bool ProcessUserEvent(BSFixedString* a_control); // 05 - { return 0; }
virtual void Unk_06(void); // 06 - { return; }
virtual void UpdateItemList(); // 06 - { return; }
virtual void SetItemCardInfo(ItemCard* a_itemCard); // 07 - { return; }

void UpdateCraftingInfo(ActorValue a_actorValue)
Expand Down
2 changes: 1 addition & 1 deletion include/RE/H/HighProcessData.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ namespace RE
float takeBackTimer; // 200
std::uint32_t pad204; // 204
Data208* unk208; // 208
std::uint32_t unk210; // 210
float avoidWaitTimer; // 210
PLAYER_ACTION playerActionReaction; // 214
BSFixedString voiceSubtitle; // 218
BSTArray<BSTTuple<FormID, NiPointer<ActorKnowledge>>> knowledgeArray; // 220
Expand Down
2 changes: 1 addition & 1 deletion include/RE/M/MenuControls.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "RE/B/BSTEvent.h"
#include "RE/B/BSTSingleton.h"
#include "RE/B/BSTSmartPointer.h"
#include "RE/Q/QuickSaveLoadHandler.h"

namespace RE
{
Expand All @@ -15,7 +16,6 @@ namespace RE
struct DirectionHandler;
struct FavoritesHandler;
struct MenuOpenHandler;
struct QuickSaveLoadHandler;
struct ScreenshotHandler;

class MenuControls :
Expand Down
24 changes: 12 additions & 12 deletions include/RE/M/MovementControllerNPC.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ namespace RE
~MovementControllerNPC() override; // 00

// add
virtual void Unk_0A(void); // 0A
virtual void Unk_0B(void); // 0B
virtual void DisablePlayerControls(); // 0C
virtual void EnablePlayerControls(); // 0D
virtual bool IsPlayerControlsDisabled(); // 0E - { return unk1C5 == 0; }
virtual bool IsPlayerControlsEnabled(); // 0F - { return unk1C5; }
virtual void Unk_10(void); // 10
virtual void Unk_11(void); // 11
virtual void Unk_12(void); // 12
virtual void Unk_13(void); // 13
virtual void Unk_14(void); // 14
virtual void Unk_0A(void); // 0A
virtual void Unk_0B(void); // 0B
virtual void SetAIDriven(); // 0C
virtual void SetControlsDriven(); // 0D
virtual bool GetAIDriven(); // 0E - { return controlsDriven == 0; }
virtual bool GetControlsDriven(); // 0F - { return controlsDriven; }
virtual void Unk_10(void); // 10
virtual void Unk_11(void); // 11
virtual void Unk_12(void); // 12
virtual void Unk_13(void); // 13
virtual void Unk_14(void); // 14

// members
std::uint64_t unk150; // 150
Expand All @@ -55,7 +55,7 @@ namespace RE
std::uint64_t unk1B8; // 1B8
std::uint32_t unk1C0; // 1C0
std::uint8_t unk1C4; // 1C4
bool playerControls; // 1C5
bool controlsDriven; // 1C5
std::uint16_t unk1C6; // 1C6
std::uint64_t unk1C8; // 1C8
private:
Expand Down
1 change: 1 addition & 0 deletions include/RE/P/PlayerCamera.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ namespace RE
bool IsInFirstPerson() const;
bool IsInFreeCameraMode() const;
bool IsInThirdPerson() const;
void PushCameraState(CameraState a_state);
void ToggleFreeCameraMode(bool a_freezeTime);
void UpdateThirdPerson(bool a_weaponDrawn);

Expand Down
1 change: 1 addition & 0 deletions include/RE/P/ProcessLists.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ namespace RE

static ProcessLists* GetSingleton();

bool AreHostileActorsNear(BSScrapArray<ActorHandle>* a_arrayOut);
void ClearCachedFactionFightReactions() const;
void ForAllActors(std::function<BSContainer::ForEachResult(Actor*)> a_callback);
void ForEachHighActor(std::function<BSContainer::ForEachResult(Actor*)> a_callback);
Expand Down
29 changes: 29 additions & 0 deletions include/RE/Q/QuickSaveLoadHandler.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#pragma once

#include "RE/M/MenuEventHandler.h"

namespace RE
{
class ButtonEvent;
class InputEvent;
class KinectEvent;
class MouseMoveEvent;
class ThumbstickEvent;

class QuickSaveLoadHandler : public MenuEventHandler
{
public:
inline static constexpr auto RTTI = RTTI_QuickSaveLoadHandler;
inline static constexpr auto VTABLE = VTABLE_QuickSaveLoadHandler;

~QuickSaveLoadHandler() override; // 00

// override (MenuEventHandler)
bool CanProcess(InputEvent* a_event) override; // 01
bool ProcessKinect(KinectEvent* a_event) override; // 02
bool ProcessThumbstick(ThumbstickEvent* a_event) override; // 03
bool ProcessMouseMove(MouseMoveEvent* a_event) override; // 04
bool ProcessButton(ButtonEvent* a_event) override; // 05
};
static_assert(sizeof(QuickSaveLoadHandler) == 0x10);
}
2 changes: 2 additions & 0 deletions include/RE/Skyrim.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#include "RE/A/AutoMoveHandler.h"
#include "RE/A/AutoRegisterCreator.h"
#include "RE/A/AutoRegisterFactory.h"
#include "RE/A/AutoVanityState.h"
#include "RE/A/ahkpCharacterProxy.h"
#include "RE/A/ahkpWorld.h"
#include "RE/B/BGSAbilityPerkEntry.h"
Expand Down Expand Up @@ -1373,6 +1374,7 @@
#include "RE/Q/QuestEvents.h"
#include "RE/Q/QuestObjectiveStates.h"
#include "RE/Q/QuestStatus.h"
#include "RE/Q/QuickSaveLoadHandler.h"
#include "RE/R/REFREventCallbacks.h"
#include "RE/R/RaceSexCamera.h"
#include "RE/R/RaceSexMenu.h"
Expand Down
Loading

0 comments on commit 0cf8498

Please sign in to comment.