From d7dc506261a716b479e779f58f22d86762f44eee Mon Sep 17 00:00:00 2001 From: FlenarnTemp <68670981+FlenarnTemp@users.noreply.github.com> Date: Tue, 23 Jul 2024 14:47:38 +0200 Subject: [PATCH] events and pr madness (#14) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Scaleform IDs updated. * feat: NiController ID update. * feat: Actor IDs updated. * chore: Update 'BSInputEnableManager' IDs. * chore: More misc. IDs updated. feat: Functions delcared in BGSScene. * chore: More IDs updated. * chore: Single ID update. feat: ´Float´ & ´Float0To1´ added to BSRandom. * feat: Few more functions. * feat: Further implementation of BGSSceneAction classes. * feat: More RE/IDs. * chore: Update ID. * feat: More REing. * feat: Further REing & IDs. * feat: Further RE. * feat: Further RE. * fix: BSTList is fucked. --- CommonLibF4/cmake/sourcelist.cmake | 1 + .../include/RE/Bethesda/BGSInventoryItem.h | 7 ++ CommonLibF4/include/RE/Bethesda/BSExtraData.h | 27 +++++++- CommonLibF4/include/RE/Bethesda/Events.h | 65 ++++++++++++++++++- .../include/RE/Bethesda/PipboyInventoryData.h | 65 +++++++++++++++++++ CommonLibF4/include/RE/Fallout.h | 1 + 6 files changed, 163 insertions(+), 3 deletions(-) create mode 100644 CommonLibF4/include/RE/Bethesda/PipboyInventoryData.h diff --git a/CommonLibF4/cmake/sourcelist.cmake b/CommonLibF4/cmake/sourcelist.cmake index 77c1ccfc..9a9dd61e 100644 --- a/CommonLibF4/cmake/sourcelist.cmake +++ b/CommonLibF4/cmake/sourcelist.cmake @@ -198,6 +198,7 @@ set(SOURCES include/RE/Bethesda/NavMesh.h include/RE/Bethesda/NavMeshInfoMap.h include/RE/Bethesda/PipboyDataGroup.h + include/RE/Bethesda/PipboyInventoryData.h include/RE/Bethesda/PipboyInventoryUtils.h include/RE/Bethesda/PipboyManager.h include/RE/Bethesda/PipboyValue.h diff --git a/CommonLibF4/include/RE/Bethesda/BGSInventoryItem.h b/CommonLibF4/include/RE/Bethesda/BGSInventoryItem.h index 882c49b4..81ea008e 100644 --- a/CommonLibF4/include/RE/Bethesda/BGSInventoryItem.h +++ b/CommonLibF4/include/RE/Bethesda/BGSInventoryItem.h @@ -187,6 +187,13 @@ namespace RE return func(this, a_stackID, a_scale); } + ExtraDataList GetExtraDataAt(std::uint32_t a_index) + { + using func_t = decltype(&BGSInventoryItem::GetExtraDataAt); + static REL::Relocation func{ REL::ID(2194092) }; + return func(this, a_index); + } + // members TESBoundObject* object; // 00 BSTSmartPointer stackData; // 08 diff --git a/CommonLibF4/include/RE/Bethesda/BSExtraData.h b/CommonLibF4/include/RE/Bethesda/BSExtraData.h index df65587b..f674a758 100644 --- a/CommonLibF4/include/RE/Bethesda/BSExtraData.h +++ b/CommonLibF4/include/RE/Bethesda/BSExtraData.h @@ -858,6 +858,23 @@ namespace RE !std::is_reference_v; } + namespace ComparisonQualifiers + { + static bool ContainerQualifier(const BSExtraData* a_extraData) + { + using func_t = decltype(ComparisonQualifiers::ContainerQualifier); + REL::Relocation func{ REL::ID(2190674) }; + return func(a_extraData); + } + + static bool UIQualifier(const BSExtraData* a_extraData) + { + using func_t = decltype(ComparisonQualifiers::UIQualifier); + REL::Relocation func{ REL::ID(2190675) }; + return func(a_extraData); + } + }; + class ExtraDataList : public BSIntrusiveRefCounted // 00 { @@ -983,9 +1000,17 @@ namespace RE return func(this); } + typedef bool (*ComparisonQualifier)(const BSExtraData*); + bool CompareList(const ExtraDataList* a_compare, ComparisonQualifier a_qualifier) + { + using func_t = decltype(&ExtraDataList::CompareList); + REL::Relocation func{ REL::ID(2190098) }; + return func(this, a_compare, a_qualifier); + } + // members BaseExtraList extraData; // 08 - mutable BSReadWriteLock extraRWLock; // 20 + mutable BSReadWriteLock extraRWLock; // 20 }; static_assert(sizeof(ExtraDataList) == 0x28); } diff --git a/CommonLibF4/include/RE/Bethesda/Events.h b/CommonLibF4/include/RE/Bethesda/Events.h index fd3a58e6..c898d8b0 100644 --- a/CommonLibF4/include/RE/Bethesda/Events.h +++ b/CommonLibF4/include/RE/Bethesda/Events.h @@ -45,13 +45,74 @@ namespace RE { // members REX::EnumSet changeType; // 00 - const BGSObjectInstance* itemAffected; // 08 - Actor* actorAffected; // 10 + const BGSObjectInstance* itemAffected; // 08 + Actor* actorAffected; // 10 std::uint32_t stackID; // 18 }; static_assert(sizeof(Event) == 0x20); } + namespace PerkValueEvents + { + enum class Type + { + Add = 0, + Remove + }; + + struct PerkValueChangedEvent + { + Type changeType; // 00 + BSPointerHandle> owner; // 04 + BGSPerk* perk; // 08 + std::uint8_t rank; // 10 + }; + static_assert(sizeof(PerkValueChangedEvent) == 0x18); + + struct PerkEntryUpdatedEvent + { + BSPointerHandle> owner; // 00 + BGSPerkEntry* perkEntry; // 08 + }; + static_assert(sizeof(PerkEntryUpdatedEvent) == 0x10); + } + + namespace HolotapeStateChanged + { + // intentional + struct Event + {}; + } + + namespace BGSInventoryItemEvent + { + struct Event + { + BSPointerHandle> owner; // 00 + InventoryInterface::Handle* item; // 04 + }; + } + + namespace FavoriteMgr_Events + { + struct ComponentFavoriteEvent + { + BGSComponent* component; // 00 + bool isFavorited; + }; + static_assert(sizeof(ComponentFavoriteEvent) == 0x10); + } + + namespace PlayerDifficultySettingChanged + { + struct Event + { + std::uint32_t oldDifficulty; + std::uint32_t newDifficulty; + }; + static_assert(sizeof(Event) == 0x8); + } + struct BGSActorEvent { public: diff --git a/CommonLibF4/include/RE/Bethesda/PipboyInventoryData.h b/CommonLibF4/include/RE/Bethesda/PipboyInventoryData.h new file mode 100644 index 00000000..e30d8ac3 --- /dev/null +++ b/CommonLibF4/include/RE/Bethesda/PipboyInventoryData.h @@ -0,0 +1,65 @@ +#pragma once + +#include "RE/Bethesda/BGSInventoryInterface.h" +#include "RE/Bethesda/BSTArray.h" +#include "RE/Bethesda/BSTHashMap.h" +#include "RE/Bethesda/BSTList.h" +#include "RE/Bethesda/PipboyDataGroup.h" + +namespace RE +{ + class PipboyDataGroup; + + class PipboyInventoryData : + public PipboyDataGroup, // 00 + public BSTEventSink, // 98 + public BSTEventSink, // A0 + public BSTEventSink, // A8 + public BSTEventSink, // B0 + public BSTEventSink, // B8 + public BSTEventSink, // C0 + public BSTEventSink, // C8 + public BSTEventSink, // D0 + public BSTEventSink, // D8 + public BSTEventSink // E0 + { + public: + enum ENTRY_TYPE + { + ENTRY_INT = 0, + ENTRY_FIXED_STRING, + ENTRY_FLOAT + }; + + enum SORT_ON_FIELD + { + SOF_ALPHABETICALLY = 0, + SOF_DAMAGE, + SOF_ROF, + SOF_RANGE, + SOF_ACCURARY, + SOF_VALUE, + SOF_WEIGHT + }; + + struct StackEntry + { + PipboyObject* linkedObject; // 00 + const InventoryInterface::Handle inventoryHandle; // 08 + }; + static_assert(sizeof(StackEntry) == 0x10); + + struct ItemEntry + { + void* stackEntries; // 00 - BSTList + }; + static_assert(sizeof(ItemEntry) == 0x8); + + // members + PipboyObject* inventoryObject; // E8 + BSTHashMap itemEntries; // F0 + BSTHashMap invComponents; // 120 + BSTArray sortedItems; // 150 + BSTSet queuedRepopulateCategories; // 168 + }; +} diff --git a/CommonLibF4/include/RE/Fallout.h b/CommonLibF4/include/RE/Fallout.h index 2cbac517..5dbefac7 100644 --- a/CommonLibF4/include/RE/Fallout.h +++ b/CommonLibF4/include/RE/Fallout.h @@ -193,6 +193,7 @@ #include "RE/Bethesda/NavMesh.h" #include "RE/Bethesda/NavMeshInfoMap.h" #include "RE/Bethesda/PipboyDataGroup.h" +#include "RE/Bethesda/PipboyInventoryData.h" #include "RE/Bethesda/PipboyInventoryUtils.h" #include "RE/Bethesda/PipboyManager.h" #include "RE/Bethesda/PipboyValue.h"