From 73d53ed948be16abc864b7dfb09736cdf50da04e Mon Sep 17 00:00:00 2001 From: FlenarnTemp <68670981+FlenarnTemp@users.noreply.github.com> Date: Mon, 13 May 2024 16:49:50 +0200 Subject: [PATCH 1/7] feat: Misc RE'ing. (#5) --- CommonLibF4/cmake/sourcelist.cmake | 1 + CommonLibF4/include/RE/Bethesda/Actor.h | 16 +-- CommonLibF4/include/RE/Bethesda/Archive2.h | 2 +- .../include/RE/Bethesda/BGSCharacterTint.h | 114 +++++++++++++++++- .../RE/Bethesda/BGSStoryManagerTreeForm.h | 42 ++++++- CommonLibF4/include/RE/Bethesda/BSExtraData.h | 14 ++- CommonLibF4/include/RE/Bethesda/BSStringT.h | 7 ++ CommonLibF4/include/RE/Bethesda/Events.h | 61 ++++++++++ CommonLibF4/include/RE/Bethesda/GameScript.h | 2 +- CommonLibF4/include/RE/Bethesda/IMenu.h | 20 +++ .../include/RE/Bethesda/MenuTopicManager.h | 19 +++ .../include/RE/Bethesda/PlayerCharacter.h | 30 +++-- .../include/RE/Bethesda/ProcessLists.h | 6 +- .../include/RE/Bethesda/TESBoundAnimObjects.h | 13 +- CommonLibF4/include/RE/Bethesda/TESForms.h | 8 ++ CommonLibF4/include/RE/Fallout.h | 1 + 16 files changed, 322 insertions(+), 34 deletions(-) create mode 100644 CommonLibF4/include/RE/Bethesda/MenuTopicManager.h diff --git a/CommonLibF4/cmake/sourcelist.cmake b/CommonLibF4/cmake/sourcelist.cmake index 73dcfae8..fef13a36 100644 --- a/CommonLibF4/cmake/sourcelist.cmake +++ b/CommonLibF4/cmake/sourcelist.cmake @@ -187,6 +187,7 @@ set(SOURCES include/RE/Bethesda/MemoryManager.h include/RE/Bethesda/MenuControls.h include/RE/Bethesda/MenuCursor.h + include/RE/Bethesda/MenuTopicManager.h include/RE/Bethesda/MessageMenuManager.h include/RE/Bethesda/Movement.h include/RE/Bethesda/NavMesh.h diff --git a/CommonLibF4/include/RE/Bethesda/Actor.h b/CommonLibF4/include/RE/Bethesda/Actor.h index 27cdf864..ae0361fc 100644 --- a/CommonLibF4/include/RE/Bethesda/Actor.h +++ b/CommonLibF4/include/RE/Bethesda/Actor.h @@ -660,14 +660,14 @@ namespace RE [[nodiscard]] bool IsTakingHealthDamageFromActiveEffect() { using func_t = decltype(&MagicTarget::IsTakingHealthDamageFromActiveEffect); - REL::Relocation func{ REL::ID(999442) }; + REL::Relocation func{ REL::ID(2226397) }; return func(this); } [[nodiscard]] bool IsTakingRadDamageFromActiveEffect() { using func_t = decltype(&MagicTarget::IsTakingRadDamageFromActiveEffect); - REL::Relocation func{ REL::ID(1079111) }; + REL::Relocation func{ REL::ID(2226398) }; return func(this); } @@ -967,7 +967,7 @@ namespace RE void AddPerk(BGSPerk* a_perk, std::uint8_t a_rank = 0) { using func_t = decltype(&Actor::AddPerk); - REL::Relocation func{ REL::ID(187096) }; + REL::Relocation func{ REL::ID(2230121) }; return func(this, a_perk, a_rank); } @@ -1114,28 +1114,28 @@ namespace RE bool IsFollowing() { using func_t = decltype(&Actor::IsFollowing); - REL::Relocation func{ REL::ID(629579) }; + REL::Relocation func{ REL::ID(2230013) }; return func(this); } [[nodiscard]] bool IsJumping() { using func_t = decltype(&Actor::IsJumping); - REL::Relocation func{ REL::ID(1041558) }; + REL::Relocation func{ REL::ID(2229640) }; return func(this); } bool IsPathValid() { using func_t = decltype(&Actor::IsPathValid); - REL::Relocation func{ REL::ID(1522194) }; + REL::Relocation func{ REL::ID(2230279) }; return func(this); } bool IsPathing() { using func_t = decltype(&Actor::IsPathing); - REL::Relocation func{ REL::ID(989661) }; + REL::Relocation func{ REL::ID(2234312) }; return func(this); } @@ -1184,7 +1184,7 @@ namespace RE void RewardExperience(float a_amount, bool a_direct, TESObjectREFR* a_actionTarget, TESObjectREFR* a_killWeapon) { using func_t = decltype(&Actor::RewardExperience); - REL::Relocation func{ REL::ID(262786) }; + REL::Relocation func{ REL::ID(2230428) }; return func(this, a_amount, a_direct, a_actionTarget, a_killWeapon); } diff --git a/CommonLibF4/include/RE/Bethesda/Archive2.h b/CommonLibF4/include/RE/Bethesda/Archive2.h index 44ddad18..44ff4f75 100644 --- a/CommonLibF4/include/RE/Bethesda/Archive2.h +++ b/CommonLibF4/include/RE/Bethesda/Archive2.h @@ -330,7 +330,7 @@ namespace RE::BSResource::Archive2 bool a_block) override // 0B { using func_t = decltype(&AsyncReaderStream::DoWait); - REL::Relocation func{ REL::ID(244066) }; + REL::Relocation func{ REL::ID(2269399) }; return func(this, a_transferred, a_block); } diff --git a/CommonLibF4/include/RE/Bethesda/BGSCharacterTint.h b/CommonLibF4/include/RE/Bethesda/BGSCharacterTint.h index 57e8e443..a385ab0e 100644 --- a/CommonLibF4/include/RE/Bethesda/BGSCharacterTint.h +++ b/CommonLibF4/include/RE/Bethesda/BGSCharacterTint.h @@ -3,6 +3,7 @@ #include "RE/Bethesda/BSFixedString.h" #include "RE/Bethesda/BSTArray.h" #include "RE/Bethesda/TESCondition.h" +#include "RE/Bethesda/TESForms.h" namespace RE { @@ -11,6 +12,24 @@ namespace RE namespace BGSCharacterTint { + enum BlendOp : std::uint32_t + { + kDefault = 0, + kMultiply = 1, + kOverlay = 2, + kSoftLight = 3, + kHardLight = 4, + kTotal = 5 + }; + + enum EntryType : std::uint32_t + { + kMask = 0x0, + kPalette = 0x1, + kTexture = 0x2, + kUnknown = 0x3 + }; + enum class EntrySlot { kForeheadMask, @@ -49,23 +68,53 @@ namespace RE static constexpr auto RTTI{ RTTI::BGSCharacterTint__Template__Entry }; static constexpr auto VTABLE{ VTABLE::BGSCharacterTint__Template__Entry }; + enum Flags : std::uint32_t + { + kOnOffOnly = 0x1, + kIsChargenDetaul = 0x2, + kTakesSkinTone = 0x4 + }; + virtual ~Entry(); // 00 // add virtual float GetDefaultValue() { return 0.0F; } // 01 virtual void InitItem(TESForm* a_owner); // 02 - virtual void CopyData(Entry* a_copy); // 03 + virtual void CopyData(BGSCharacterTint::Template::Entry* a_copy); // 03 virtual void LoadImpl(TESFile* a_file) = 0; // 04 // members BGSLocalizedString name; // 08 TESCondition chargenConditions; // 10 - stl::enumeration slot; // 18 + stl::enumeration slot; // 18 const std::uint16_t uniqueID{ 0 }; // 1C std::int8_t flags; // 1E }; static_assert(sizeof(Entry) == 0x20); + class __declspec(novtable) Palette : + public BGSCharacterTint::Template::Entry + { + public: + static constexpr auto RTTI{ RTTI::BGSCharacterTint__Template__Palette }; + static constexpr auto VTABLE{ VTABLE::BGSCharacterTint__Template__Palette }; + + struct ColorValue + { + BGSColorForm* Color; // 00 + float value; // 08 + BGSCharacterTint::BlendOp BlendOp; // 0C + std::uint16_t SwatchID; // 01 + }; + static_assert(sizeof(ColorValue) == 0x18); + + // Members + BSFixedString MaskTextureName; + std::uint32_t DefaultIndex; + BSTArray colorValues; + }; + static_assert(sizeof(Palette) == 0x48); + class Group { public: @@ -73,7 +122,7 @@ namespace RE BGSLocalizedString name; // 00 std::uint32_t id; // 08 std::uint32_t chargenIndex; // 0C - BSTArray entries; // 10 + BSTArray entries; // 10 }; static_assert(sizeof(Group) == 0x28); @@ -85,5 +134,64 @@ namespace RE }; static_assert(sizeof(Groups) == 0x18); } + + class __declspec(novtable) Entry + { + public: + static constexpr auto RTTI{ RTTI::BGSCharacterTint__Entry }; + static constexpr auto VTABLE{ VTABLE::BGSCharacterTint__Entry }; + + virtual ~Entry(); // 00 + + virtual bool GetIsIdentical(const Entry* entry); // 08 + virtual bool CopyData(const Entry entry); // 10 + virtual bool SetFromTemplateDefault(const BGSCharacterTint::Template::Entry* entry); // 18 + virtual bool GetMatchesTemplateDefault(const BGSCharacterTint::Template::Entry* entry); // 20 + virtual BGSCharacterTint::EntryType GetType(); // 28 + + // Members + BGSCharacterTint::Template::Entry* Template; // 08 + const std::uint16_t IDLink; // 10 + std::uint8_t TingingValue; // 12 + }; + static_assert(sizeof(Entry) == 0x18); + + class __declspec(novtable) MaskEntry : + public BGSCharacterTint::Entry + { + public: + static constexpr auto RTTI{ RTTI::BGSCharacterTint__MaskEntry }; + static constexpr auto VTABLE{ VTABLE::BGSCharacterTint__MaskEntry }; + }; + static_assert(sizeof(MaskEntry) == 0x18); + + class __declspec(novtable) PaletteEntry : + public BGSCharacterTint::MaskEntry + { + public: + static constexpr auto RTTI{ RTTI::BGSCharacterTint__PaletteEntry }; + static constexpr auto VTABLE{ VTABLE::BGSCharacterTint__PaletteEntry }; + + // members + std::uint32_t uiTintingColor; // 18 + std::uint16_t usSwatchID; // 1C + }; + static_assert(sizeof(PaletteEntry) == 0x20); + + class __declspec(novtable) TextureSetEntry : + public BGSCharacterTint::Entry + { + public: + static constexpr auto RTTI{ RTTI::BGSCharacterTint__TextureSetEntry }; + static constexpr auto VTABLE{ VTABLE::BGSCharacterTint__TextureSetEntry }; + }; + static_assert(sizeof(TextureSetEntry) == 0x18); + + class Entries + { + public: + BSTArray entriesA; + }; + static_assert(sizeof(Entries) == 0x18); } } diff --git a/CommonLibF4/include/RE/Bethesda/BGSStoryManagerTreeForm.h b/CommonLibF4/include/RE/Bethesda/BGSStoryManagerTreeForm.h index a6115be9..1dbf8e19 100644 --- a/CommonLibF4/include/RE/Bethesda/BGSStoryManagerTreeForm.h +++ b/CommonLibF4/include/RE/Bethesda/BGSStoryManagerTreeForm.h @@ -15,7 +15,6 @@ namespace RE { class BGSBaseAlias; - class BGSQuestInstanceText; class BGSQuestObjective; class BGSRegisteredStoryEvent; class BGSStoryEvent; @@ -80,6 +79,39 @@ namespace RE }; static_assert(sizeof(QUEST_DATA) == 0x8); + class BGSQuestInstanceText + { + public: + void ParseString(BSStringT& inOutText, const TESQuest* quest, std::uint32_t instanceID) + { + using func_t = decltype(&BGSQuestInstanceText::ParseString); + REL::Relocation func{ REL::ID(141681) }; // Update + return func(this, inOutText, quest, instanceID); + } + + struct StringData + { + std::uint32_t aliasID; + std::uint32_t fullNameFormID; + }; + static_assert(sizeof(StringData) == 0x8); + + struct GlobabValueData + { + const TESGlobal* globab; + float value; + }; + static_assert(sizeof(GlobabValueData) == 0x10); + + // Members + std::uint32_t ID; // 00 + BSTArray StringData; // 08 + BSTArray ValueData; // 20 + std::uint16_t JournalStage; // 38 + std::uint16_t JournalStageItem; // 3A + }; + static_assert(sizeof(BGSQuestInstanceText) == 0x40); + class __declspec(novtable) TESQuest : public BGSStoryManagerTreeForm, // 000 public TESFullName // 028 @@ -100,6 +132,14 @@ namespace RE return func(this, stage); } + BSPointerHandle* GetAliasedRef(BSPointerHandle* a_result, std::uint32_t a_aiAliasID) + { + using func_t = decltype(&TESQuest::GetAliasedRef); + REL::Relocation func{ REL::ID(2207810) }; + return func(this, a_result, a_aiAliasID); + } + + // members BSTArray instanceData; // 038 std::uint32_t currentInstanceID; // 050 diff --git a/CommonLibF4/include/RE/Bethesda/BSExtraData.h b/CommonLibF4/include/RE/Bethesda/BSExtraData.h index 1091ec2a..edcb1afa 100644 --- a/CommonLibF4/include/RE/Bethesda/BSExtraData.h +++ b/CommonLibF4/include/RE/Bethesda/BSExtraData.h @@ -350,6 +350,10 @@ namespace RE static constexpr auto VTABLE{ VTABLE::ExtraHealth }; static constexpr auto TYPE{ EXTRA_DATA_TYPE::kHealth }; + ExtraHealth(); + ExtraHealth(float health); + + // members float health; // 18 }; @@ -892,9 +896,15 @@ namespace RE return func(this, a_form); } - void SetHealthPercent(float a_healthPerc) + float GetHealthPerc() + { + using func_t = decltype(&ExtraDataList::GetHealthPerc); + REL::Relocation func{ REL::ID(2190226) }; + } + + void SetHealthPerc(float a_healthPerc) { - using func_t = decltype(&ExtraDataList::SetHealthPercent); + using func_t = decltype(&ExtraDataList::SetHealthPerc); REL::Relocation func{ REL::ID(2190124) }; return func(this, a_healthPerc); } diff --git a/CommonLibF4/include/RE/Bethesda/BSStringT.h b/CommonLibF4/include/RE/Bethesda/BSStringT.h index a3e33c64..f32c7670 100644 --- a/CommonLibF4/include/RE/Bethesda/BSStringT.h +++ b/CommonLibF4/include/RE/Bethesda/BSStringT.h @@ -94,6 +94,13 @@ namespace RE return *this; } + bool Set(const char* apString, std::uint64_t auiMaxLen) + { + using func_t = decltype(&BSStringT::Set); + REL::Relocation func{ REL::ID(2189084) }; + return func(this, apString, auiMaxLen); + } + [[nodiscard]] const_pointer data() const noexcept { return _data; } [[nodiscard]] pointer data() noexcept { return _data; } diff --git a/CommonLibF4/include/RE/Bethesda/Events.h b/CommonLibF4/include/RE/Bethesda/Events.h index ba59527c..fe2ab199 100644 --- a/CommonLibF4/include/RE/Bethesda/Events.h +++ b/CommonLibF4/include/RE/Bethesda/Events.h @@ -482,6 +482,32 @@ namespace RE }; static_assert(sizeof(QuickContainerStateEvent) == 0xC0); + struct HUDPerkVaultBoyData + { + public: + // members + BSFixedString SwfName; + const BGSSoundDescriptorForm* soundForm; + bool VATSCritAppliedAnim; + bool VATSCritFillenAnim; + bool dialogueSpeechChallengeAnim; + }; + static_assert(sizeof(HUDPerkVaultBoyData) == 0x18); + + class HUDPerkVaultBoySwfDisplayEvent : + public BSTValueEvent // 00 + { + public: + }; + static_assert(sizeof(HUDPerkVaultBoySwfDisplayEvent) == 0x20); + + class ShowingDialogueSpeechChallengeAnim : + public BSTValueEvent + { + public: + }; + static_assert(sizeof(ShowingDialogueSpeechChallengeAnim) == 0x2); + namespace SPECIALMenuEvent { struct NameChangedEvent @@ -769,4 +795,39 @@ namespace RE stl::enumeration senderID; // 8 }; static_assert(sizeof(UserEventEnabledEvent) == 0xC); + + struct PositionPlayerEvent + { + enum EVENT_TYPE : uint32_t + { + PRE_POSITION_PLAYER = 0x0, + POSITION_PLAYER_PRE_UPDATE_PACKAGES = 0x1, + POSITION_PLAYER_POST_UPDATE_PACKAGES = 0x2, + POST_POSITION_PLAYER = 0x3, + FINISH_POSITION_PLAYER = 0x4, + }; + + // members + EVENT_TYPE type; + bool NoLoadScreen; + }; + static_assert(sizeof(PositionPlayerEvent) == 0x08); + + class TESInitScriptEvent + { + public: + // Members + TESObjectREFR* hObjectInitialized; // 00 + }; + static_assert(sizeof(TESInitScriptEvent) == 0x08); + + class TESInitScriptEventSource : public BSTEventSource + { + public: + [[nodiscard]] static TESInitScriptEventSource* GetSingleton() + { + REL::Relocation singleton{ REL::ID(444105) }; // Needs updating. + return singleton.get(); + } + }; } diff --git a/CommonLibF4/include/RE/Bethesda/GameScript.h b/CommonLibF4/include/RE/Bethesda/GameScript.h index fa4ba018..46b9f76e 100644 --- a/CommonLibF4/include/RE/Bethesda/GameScript.h +++ b/CommonLibF4/include/RE/Bethesda/GameScript.h @@ -13,6 +13,7 @@ #include "RE/Bethesda/BSTSmartPointer.h" #include "RE/Bethesda/BSTTuple.h" #include "RE/Bethesda/BSTimer.h" +#include "RE/Bethesda/Events.h" #include "RE/Bethesda/MemoryManager.h" #include "RE/Bethesda/TESFile.h" #include "RE/NetImmerse/NiSmartPointer.h" @@ -102,7 +103,6 @@ namespace RE struct TESFormIDRemapEvent; struct TESFurnitureEvent; struct TESGrabReleaseEvent; - struct TESInitScriptEvent; struct TESLimbCrippleEvent; struct TESLoadGameEvent; struct TESLocationClearedEvent; diff --git a/CommonLibF4/include/RE/Bethesda/IMenu.h b/CommonLibF4/include/RE/Bethesda/IMenu.h index 704341f3..dcd31a41 100644 --- a/CommonLibF4/include/RE/Bethesda/IMenu.h +++ b/CommonLibF4/include/RE/Bethesda/IMenu.h @@ -1528,6 +1528,26 @@ namespace RE }; static_assert(sizeof(ContainerMenu) == 0x440); + class __declspec(novtable) DialogueMenu : + public GameMenuBase // 00 + { + public: + static constexpr auto RTTI{ RTTI::DialogueMenu }; + static constexpr auto VTABLE{ VTABLE::DialogueMenu }; + static constexpr auto MENU_NAME{ "DialogueMenu"sv }; + + // Members + msvc::unique_ptr dialogueButtonOBJs[4]; + msvc::unique_ptr speechChallengeAnimObj; + BSTValueEventSink CurrentVBPerk; + BSTValueEventSource ShowingSpeechChallenge; + BSTSmartPointer inputLayer; + UserEvents::INPUT_CONTEXT_ID CurrentContext; + bool IsLookingAtPlayer; + bool AreButtonsShown; + }; + static_assert(sizeof(DialogueMenu) == 0x168); + class __declspec(novtable) BarterMenuTentativeInventoryUIInterface : public InventoryUserUIInterface // 00 { diff --git a/CommonLibF4/include/RE/Bethesda/MenuTopicManager.h b/CommonLibF4/include/RE/Bethesda/MenuTopicManager.h new file mode 100644 index 00000000..c852f4b1 --- /dev/null +++ b/CommonLibF4/include/RE/Bethesda/MenuTopicManager.h @@ -0,0 +1,19 @@ +#pragma once + +namespace RE +{ + class __declspec(novtable) MenuTopicManager : + public BSTEventSink, // 00 + public BSTEventSink, // 08 + public BSTSingletonSDM // 10 + { + public: + static constexpr auto RTTI{ RTTI::MenuTopicManager }; + static constexpr auto VTABLE{ VTABLE::MenuTopicManager }; + + [[nodiscard]] static MenuTopicManager* GetSingleton() + { + + } + }; +} diff --git a/CommonLibF4/include/RE/Bethesda/PlayerCharacter.h b/CommonLibF4/include/RE/Bethesda/PlayerCharacter.h index 408c70cf..8c3eb591 100644 --- a/CommonLibF4/include/RE/Bethesda/PlayerCharacter.h +++ b/CommonLibF4/include/RE/Bethesda/PlayerCharacter.h @@ -2,6 +2,7 @@ #include "RE/Bethesda/AITimeStamp.h" #include "RE/Bethesda/Actor.h" +#include "RE/Bethesda/BGSCharacterTint.h" #include "RE/Bethesda/BSLock.h" #include "RE/Bethesda/BSPointerHandle.h" #include "RE/Bethesda/BSSoundHandle.h" @@ -55,11 +56,6 @@ namespace RE struct PickRefUpdateEvent; struct PositionPlayerEvent; - namespace BGSCharacterTint - { - class Entries; - } - namespace PerkValueEvents { struct PerkEntryUpdatedEvent; @@ -282,7 +278,7 @@ namespace RE DIFFICULTY_LEVEL GetDifficultyLevel() { using func_t = decltype(&PlayerCharacter::GetDifficultyLevel); - REL::Relocation func{ REL::ID(922962) }; + REL::Relocation func{ REL::ID(2233056) }; return func(this); } @@ -296,14 +292,14 @@ namespace RE bool IsHolotapePlaying(BGSNote* a_holotape) { using func_t = decltype(&PlayerCharacter::IsHolotapePlaying); - REL::Relocation func{ REL::ID(530826) }; + REL::Relocation func{ REL::ID(2233206) }; return func(this, a_holotape); } bool IsImmortal() { using func_t = decltype(&PlayerCharacter::IsImmortal); - REL::Relocation func{ REL::ID(500346) }; + REL::Relocation func{ REL::ID(2232988) }; return func(this); } @@ -321,14 +317,14 @@ namespace RE void PauseHolotape(BGSNote* a_holotape) { using func_t = decltype(&PlayerCharacter::PauseHolotape); - REL::Relocation func{ REL::ID(1567456) }; + REL::Relocation func{ REL::ID(2233208) }; return func(this, a_holotape); } void PlayHolotape(BGSNote* a_holotape) { using func_t = decltype(&PlayerCharacter::PlayHolotape); - REL::Relocation func{ REL::ID(1581042) }; + REL::Relocation func{ REL::ID(2233207) }; return func(this, a_holotape); } @@ -374,6 +370,20 @@ namespace RE return func(this, a_show, a_skipEffects); } + void SetLastDialogueInput(uint32_t dialogueOption) + { + using func_t = decltype(&PlayerCharacter::SetLastDialogueInput); + REL::Relocation func{ REL::ID(2233190) }; + return func(this, dialogueOption); + } + + void ClearPrison() + { + using func_t = decltype(&PlayerCharacter::ClearPrison); + REL::Relocation func{ REL::ID(2233196) }; + return func(this); + } + // members BSSpinLock actorToDisplayOnHUDLock; // 628 BSSpinLock questTargetLock; // 630 diff --git a/CommonLibF4/include/RE/Bethesda/ProcessLists.h b/CommonLibF4/include/RE/Bethesda/ProcessLists.h index 6ea73cf0..e96713ae 100644 --- a/CommonLibF4/include/RE/Bethesda/ProcessLists.h +++ b/CommonLibF4/include/RE/Bethesda/ProcessLists.h @@ -24,14 +24,14 @@ namespace RE [[nodiscard]] static ProcessLists* GetSingleton() { - REL::Relocation singleton{ REL::ID(1569706) }; + REL::Relocation singleton{ REL::ID(2688869) }; return *singleton; } [[nodiscard]] bool AreHostileActorsNear(BSScrapArray* a_hostileActorArray) { using func_t = decltype(&ProcessLists::AreHostileActorsNear); - REL::Relocation func{ REL::ID(1053584) }; + REL::Relocation func{ REL::ID(2234105) }; return func(this, a_hostileActorArray); } @@ -79,7 +79,7 @@ namespace RE [[nodiscard]] std::int16_t RequestHighestDetectionLevelAgainstActor(Actor* a_actor, std::uint32_t& a_LOSCount) { using func_t = decltype(&ProcessLists::RequestHighestDetectionLevelAgainstActor); - REL::Relocation func{ REL::ID(1036693) }; + REL::Relocation func{ REL::ID(2234111) }; return func(this, a_actor, a_LOSCount); } diff --git a/CommonLibF4/include/RE/Bethesda/TESBoundAnimObjects.h b/CommonLibF4/include/RE/Bethesda/TESBoundAnimObjects.h index b81b7a5d..a13f01d6 100644 --- a/CommonLibF4/include/RE/Bethesda/TESBoundAnimObjects.h +++ b/CommonLibF4/include/RE/Bethesda/TESBoundAnimObjects.h @@ -1,6 +1,7 @@ #pragma once #include "RE/Bethesda/BGSCharacterMorph.h" +#include "RE/Bethesda/BGSCharacterTint.h" #include "RE/Bethesda/BSFixedString.h" #include "RE/Bethesda/BSTArray.h" #include "RE/Bethesda/BSTEvent.h" @@ -18,11 +19,6 @@ namespace RE class MenuOpenCloseEvent; - namespace BGSCharacterTint - { - class Entries; - } - class __declspec(novtable) TESBoundAnimObject : public TESBoundObject // 00 { @@ -469,6 +465,13 @@ namespace RE [[nodiscard]] bool UsingAlternateHeadPartList() const; + float GetFacialBoneMorphIntensity() + { + using func_t = decltype(&TESNPC::GetFacialBoneMorphIntensity); + REL::Relocation func{ REL::ID(2207416) }; + return func(this); + } + // members BGSAttachParentArray attachParents; // 220 NPC_DATA data; // 238 diff --git a/CommonLibF4/include/RE/Bethesda/TESForms.h b/CommonLibF4/include/RE/Bethesda/TESForms.h index d86d13a7..9eadecfa 100644 --- a/CommonLibF4/include/RE/Bethesda/TESForms.h +++ b/CommonLibF4/include/RE/Bethesda/TESForms.h @@ -1762,6 +1762,14 @@ namespace RE CC_SUCCESS_COUNT = 0x2, }; + // Returns nullptr if no parent. + TESTopicInfo* GetParentInfoGroup() + { + using func_t = decltype(&TESTopicInfo::GetParentInfoGroup); + REL::Relocation func{ REL::ID(2208435) }; + return func(this); + } + // members TESTopic* parentTopic; // 20 TESGlobal* resetGlobal; // 28 diff --git a/CommonLibF4/include/RE/Fallout.h b/CommonLibF4/include/RE/Fallout.h index 140610b0..4cea9ea9 100644 --- a/CommonLibF4/include/RE/Fallout.h +++ b/CommonLibF4/include/RE/Fallout.h @@ -182,6 +182,7 @@ #include "RE/Bethesda/MemoryManager.h" #include "RE/Bethesda/MenuControls.h" #include "RE/Bethesda/MenuCursor.h" +#include "RE/Bethesda/MenuTopicManager.h" #include "RE/Bethesda/MessageMenuManager.h" #include "RE/Bethesda/Movement.h" #include "RE/Bethesda/NavMesh.h" From 9e439ec33bb91bc7371ae3c0be0268a76930fdc0 Mon Sep 17 00:00:00 2001 From: FalloutCascadia <54562300+FalloutCascadia@users.noreply.github.com> Date: Tue, 14 May 2024 08:12:58 +0200 Subject: [PATCH 2/7] Update BGSCharacterTint.h Member names adjusted. --- .../include/RE/Bethesda/BGSCharacterTint.h | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/CommonLibF4/include/RE/Bethesda/BGSCharacterTint.h b/CommonLibF4/include/RE/Bethesda/BGSCharacterTint.h index a385ab0e..b4f12d74 100644 --- a/CommonLibF4/include/RE/Bethesda/BGSCharacterTint.h +++ b/CommonLibF4/include/RE/Bethesda/BGSCharacterTint.h @@ -101,16 +101,16 @@ namespace RE struct ColorValue { - BGSColorForm* Color; // 00 + BGSColorForm* color; // 00 float value; // 08 - BGSCharacterTint::BlendOp BlendOp; // 0C - std::uint16_t SwatchID; // 01 + BGSCharacterTint::BlendOp blendOp; // 0C + std::uint16_t swatchID; // 01 }; static_assert(sizeof(ColorValue) == 0x18); // Members - BSFixedString MaskTextureName; - std::uint32_t DefaultIndex; + BSFixedString maskTextureName; + std::uint32_t defaultIndex; BSTArray colorValues; }; static_assert(sizeof(Palette) == 0x48); @@ -150,9 +150,9 @@ namespace RE virtual BGSCharacterTint::EntryType GetType(); // 28 // Members - BGSCharacterTint::Template::Entry* Template; // 08 - const std::uint16_t IDLink; // 10 - std::uint8_t TingingValue; // 12 + BGSCharacterTint::Template::Entry* template; // 08 + const std::uint16_t idLink; // 10 + std::uint8_t tingingValue; // 12 }; static_assert(sizeof(Entry) == 0x18); @@ -173,8 +173,8 @@ namespace RE static constexpr auto VTABLE{ VTABLE::BGSCharacterTint__PaletteEntry }; // members - std::uint32_t uiTintingColor; // 18 - std::uint16_t usSwatchID; // 1C + std::uint32_t tintingColor; // 18 + std::uint16_t swatchID; // 1C }; static_assert(sizeof(PaletteEntry) == 0x20); From 62c2665ebb80f5d63b565d2e585d3c9d7751945c Mon Sep 17 00:00:00 2001 From: FalloutCascadia <54562300+FalloutCascadia@users.noreply.github.com> Date: Tue, 14 May 2024 08:22:10 +0200 Subject: [PATCH 3/7] Update MenuTopicManager.h --- .../include/RE/Bethesda/MenuTopicManager.h | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/CommonLibF4/include/RE/Bethesda/MenuTopicManager.h b/CommonLibF4/include/RE/Bethesda/MenuTopicManager.h index c852f4b1..44646a77 100644 --- a/CommonLibF4/include/RE/Bethesda/MenuTopicManager.h +++ b/CommonLibF4/include/RE/Bethesda/MenuTopicManager.h @@ -13,7 +13,36 @@ namespace RE [[nodiscard]] static MenuTopicManager* GetSingleton() { - + REL::Relocation singleton{ REL::ID(520890) }; // TODO: Update + return singleton* } + + // members + BSPointerHandle> speaker; // 14 + BSPointerHandle> lastSpeaker; // 18 + BSTSmartPointer inputLayer; // 20 + float reLookTimer; // 28 + float notInMenuTimer; // 2C + float restartMenuOnFocus; // 30 + float menuStart; // 34 + float buttonShowTimer; // 38 + NiPoint3 centerPoint; // 3C + uint32_t numRefsInScene; // 48 + bool menuOpen; // 4C + bool shutMenu; // 4D + bool canSkip; // 4E + bool shuttingDown; // 4F + bool menuSlow; // 50 + bool doneFOV; // 51 + bool leaveMenuOpen; // 52 + bool showHelpButton; // 53 + bool needEnterDialogueAction; // 54 + bool allowInput; // 55 + bool 3rdPartyCameraReady; // 56 + bool speechChallengeAlwaysSucceed; // 57 + bool speechChallengeAlwaysFail; // 58 + bool overSceneActor; // 59 + bool forceCameraRotationStart; // 5A }; + static_assert(sizeof(MenuTopicManager) = 0x60) } From 4fe108248441eb2ad73aecd94c42f97a2e832bbd Mon Sep 17 00:00:00 2001 From: FalloutCascadia <54562300+FalloutCascadia@users.noreply.github.com> Date: Tue, 14 May 2024 12:58:55 +0200 Subject: [PATCH 4/7] feat: Helper functions for weapons. --- .../include/RE/Bethesda/TESBoundObjects.h | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/CommonLibF4/include/RE/Bethesda/TESBoundObjects.h b/CommonLibF4/include/RE/Bethesda/TESBoundObjects.h index 38f5ee25..f75818a4 100644 --- a/CommonLibF4/include/RE/Bethesda/TESBoundObjects.h +++ b/CommonLibF4/include/RE/Bethesda/TESBoundObjects.h @@ -614,6 +614,46 @@ namespace RE return func(a_speed); } + bool IsThrownWeapon() + { + return (this->weaponData.type.underlying() - 10) <= 1u; + } + + bool IsGunWeapon() + { + return ((this->weaponData.type.underlying() - 7) & 0xFD) == 0; + } + + bool IsMeleeWeapon() + { + return (this->weaponData.type.underlying() + 1) <= 7; + } + + bool IsRangedWeapon() + { + return (this->weaponData.type.underlying() - 7) >= 2; + } + + bool IsBoundWeapon() + { + return (this->weaponData.type.underlying() >> 13) & 1; + } + + bool IsTwoHandedWeapon() + { + return (this->weaponData.type.underlying() - 5) <= 2; + } + + bool IsOneHandedWeapon() + { + retunr (this->weaponData.type.underlying() <= 4 || this->weaponData.type.underlying() == 8); + } + + bool IsEmbeddedWeapon() + { + return (this->weaponData.flags.underlying() >> 19) & 1; + } + // members TESObjectWEAP::Data weaponData; // 198 BGSModelMaterialSwap* firstPersonModel; // 2D0 From 88ad8b51fafb6ea5ea45c1a3a8913f88e014257b Mon Sep 17 00:00:00 2001 From: FalloutCascadia <54562300+FalloutCascadia@users.noreply.github.com> Date: Tue, 14 May 2024 13:03:10 +0200 Subject: [PATCH 5/7] FIGHT_ACTION enum. --- CommonLibF4/include/RE/Bethesda/FormComponents.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CommonLibF4/include/RE/Bethesda/FormComponents.h b/CommonLibF4/include/RE/Bethesda/FormComponents.h index cd354414..88a9ffe0 100644 --- a/CommonLibF4/include/RE/Bethesda/FormComponents.h +++ b/CommonLibF4/include/RE/Bethesda/FormComponents.h @@ -1730,13 +1730,21 @@ namespace RE }; static_assert(sizeof(TESRaceForm) == 0x10); + enum class FIGHT_REACTION + { + kNeutral = 0, + kEnemy = 1, + kAlly = 2, + kFriend = 3 + }; + struct GROUP_REACTION { public: // members TESForm* form; // 00 std::int32_t reaction; // 08 - std::int32_t fightReaction; // 0C + FIGHT_REACTION fightReaction; // 0C }; static_assert(sizeof(GROUP_REACTION) == 0x10); From d6a6b4d4227b0dc5a96cea0e63bb7e66cd5c12c7 Mon Sep 17 00:00:00 2001 From: FalloutCascadia <54562300+FalloutCascadia@users.noreply.github.com> Date: Tue, 14 May 2024 13:12:57 +0200 Subject: [PATCH 6/7] feat: WEAPON_FLAGS added. --- .../include/RE/Bethesda/TESBoundObjects.h | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/CommonLibF4/include/RE/Bethesda/TESBoundObjects.h b/CommonLibF4/include/RE/Bethesda/TESBoundObjects.h index f75818a4..a958696e 100644 --- a/CommonLibF4/include/RE/Bethesda/TESBoundObjects.h +++ b/CommonLibF4/include/RE/Bethesda/TESBoundObjects.h @@ -489,6 +489,29 @@ namespace RE kMine = 11, }; + enum class WEAPON_FLAGS : std::uint32_t + { + + kIgnoresNormalResist = 0x0000002, + kMinorCrime = 0x0000004, + kChargingReload = 0x0000008, + kHideBackpack = 0x0000010, + kNonHostile = 0x0000040, + kNPCsUseAmmo = 0x0000200, + kRepeatableSingleFire = 0x0000800, + kHasScope = 0x0001000, + kHoldInputToPower = 0x0002000, + kAutomatic = 0x0004000, + kCantDrop = 0x0008000, + kChargingAttack = 0x0010000, + kNotUsedInNormalCombat = 0x0020000, + kBoundWeapon = 0x0040000, + kSecondaryWeapon = 0x0200000, + kBoltAction = 0x0400000, + kNoJamAfterReload = 0x0800000, + kDisableShells = 0x1000000, + }; + class __declspec(novtable) TESObjectWEAP : public TESBoundObject, // 000 public TESFullName, // 068 @@ -578,7 +601,7 @@ namespace RE float criticalDamageMult; // 104 stl::enumeration staggerValue; // 108 std::uint32_t value; // 10C - std::uint32_t flags; // 110 + stlenumeration flags; // 110 stl::enumeration soundLevel; // 114 stl::enumeration hitBehavior; // 118 ActorValueInfo* skill; // 120 From d9613a50cf6fda38293c5fe24e8db9943a7c92a1 Mon Sep 17 00:00:00 2001 From: FalloutCascadia <54562300+FalloutCascadia@users.noreply.github.com> Date: Tue, 14 May 2024 13:13:34 +0200 Subject: [PATCH 7/7] Update TESBoundObjects.h --- CommonLibF4/include/RE/Bethesda/TESBoundObjects.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CommonLibF4/include/RE/Bethesda/TESBoundObjects.h b/CommonLibF4/include/RE/Bethesda/TESBoundObjects.h index a958696e..8dacbd99 100644 --- a/CommonLibF4/include/RE/Bethesda/TESBoundObjects.h +++ b/CommonLibF4/include/RE/Bethesda/TESBoundObjects.h @@ -491,7 +491,6 @@ namespace RE enum class WEAPON_FLAGS : std::uint32_t { - kIgnoresNormalResist = 0x0000002, kMinorCrime = 0x0000004, kChargingReload = 0x0000008, @@ -601,7 +600,7 @@ namespace RE float criticalDamageMult; // 104 stl::enumeration staggerValue; // 108 std::uint32_t value; // 10C - stlenumeration flags; // 110 + stl::enumeration flags; // 110 stl::enumeration soundLevel; // 114 stl::enumeration hitBehavior; // 118 ActorValueInfo* skill; // 120