Skip to content

Commit

Permalink
Merge branch 'main' into bsscript-rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitalita authored Oct 21, 2023
2 parents e17f086 + 54c2797 commit 4acaf17
Show file tree
Hide file tree
Showing 18 changed files with 447 additions and 230 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint_pr_title.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# https://github.com/amannn/action-semantic-pull-request
name: Lint PR against Conventional Commits
name: Lint PR Title

on:
pull_request_target:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
workflow_dispatch:

env:
VCPKG_COMMIT_ID: e44d60e6bf0964064bf69667cd9f3e91dc383c7c
VCPKG_COMMIT_ID: 830f86fb309ad7167468a433a890b7415fbb90a5
GITHUB_WORKSPACE: ${{ github.workspace }}

jobs:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/main_ci_xmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
paths:
- "CommonLibSF/**"
- "xmake.lua"
workflow_dispatch:

jobs:
build:
Expand All @@ -22,7 +23,7 @@ jobs:
- name: Setup XMake
uses: xmake-io/[email protected]
with:
xmake-version: '2.8.2'
xmake-version: "2.8.2"

- name: Configure
run: xmake config -y --mode=${{ matrix.mode }} --vs_toolset=14.37
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/maintenance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
shell: pwsh
run: "& ${{ github.workspace }}/.github/make-directives.ps1 ${{ github.workspace }}/CommonLibSF"

- name: Apply Clang-Format
- name: Run clang-format
uses: DoozyX/[email protected]
with:
source: "."
Expand All @@ -32,21 +32,20 @@ jobs:
clangFormatVersion: 16
inplace: True

- name: Update VCPKG Version
- name: Update vcpkg port version
id: versioning
shell: pwsh
run: "& ${{ github.workspace }}/.github/update-registry.ps1 ${{ github.workspace }}"

- name: Check Failure
- name: Check failure
run: exit 1
if: ${{ steps.versioning.outputs.VCPKG_SUCCESS == 'false' }}

- name: Check for Commit
- name: Add & Commit
id: registry
uses: EndBug/add-and-commit@v9
with:
author_name: maintenance
author_email: 41898282+github-actions[bot]@users.noreply.github.com
default_author: github_actions
message: "ci: maintenance `${{ steps.versioning.outputs.VCPKG_VERSION }}`"

- name: Repository Dispatch
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update_pdb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:
cancel-in-progress: true

env:
VCPKG_COMMIT_ID: 5a38b5ec0eee3d1a1a6faab5e944617fee2697cf
VCPKG_COMMIT_ID: 830f86fb309ad7167468a433a890b7415fbb90a5
GITHUB_WORKSPACE: ${{ github.workspace }}

jobs:
Expand Down
70 changes: 70 additions & 0 deletions CommonLibSF/include/RE/B/BGSInventoryInterface.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#pragma once

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

namespace RE
{
class BGSInventoryItem;
class TESBoundObject;

namespace InventoryInterface
{
struct FavoriteChangedEvent
{
public:
~FavoriteChangedEvent() noexcept {} // intentional

// members
BGSInventoryItem* itemAffected; // 0
};
static_assert(sizeof(FavoriteChangedEvent) == 0x8);

struct Handle
{
public:
~Handle() noexcept {} // intentional

// members
std::uint32_t id; // 0
};
static_assert(sizeof(Handle) == 0x4);
}

class BGSInventoryInterface :
BSTSingletonSDM<BGSInventoryInterface>, // 00
BSTEventSource<InventoryInterface::FavoriteChangedEvent> // 08
{
public:
struct Agent
{
public:
// members
std::uint32_t handleID; // 0
std::uint32_t itemOwner; // 4 - TESPointerHandle
std::uint16_t listIndex; // 8
std::uint16_t refCount; // A
};
static_assert(sizeof(Agent) == 0xC);

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

[[nodiscard]] TESBoundObject* GetInventoryObject(const std::uint32_t& a_handleID) const
{
using func_t = decltype(&BGSInventoryInterface::GetInventoryObject);
REL::Relocation<func_t> func{ ID::BGSInventoryInterface::GetInventoryObject };
return func(this, a_handleID);
}

virtual ~BGSInventoryInterface(); // 00

// members
BSTArray<Agent> agentArray; // 30
};
static_assert(sizeof(BGSInventoryInterface) == 0x40);
}
45 changes: 45 additions & 0 deletions CommonLibSF/include/RE/B/BGSInventoryItem.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#pragma once

#include "RE/B/BSTArray.h"
#include "RE/B/BSTSmartPointer.h"

namespace RE
{
class ExtraDataList;
class TBO_InstanceData;
class TESBoundObject;

class BGSInventoryItem
{
public:
struct Stack
{
public:
// members
BSTSmartPointer<ExtraDataList> extra; // 00
std::uint32_t unk10; // 10
};
static_assert(sizeof(Stack) == 0x10);

enum class Flag
{
kSlotIndex1 = 1 << 0,
kSlotIndex2 = 1 << 1,
kSlotIndex3 = 1 << 2,
kEquipStateLocked = 1 << 3,
kInvShouldEquip = 1 << 4,
kTemporary = 1 << 5,
kSlotMask = kSlotIndex1 | kSlotIndex2 | kSlotIndex3
};

[[nodiscard]] bool IsEquipped() const noexcept { return flags.any(Flag::kSlotMask); }

// members
TESBoundObject* object; // 00
BSTSmartPointer<TBO_InstanceData> instanceData; // 08
BSTArray<Stack> stacks; // 10
stl::enumeration<Flag, std::uint32_t> flags; // 20
std::int8_t unk24; // 24
};
static_assert(sizeof(BGSInventoryItem) == 0x28);
}
7 changes: 7 additions & 0 deletions CommonLibSF/include/RE/IDs.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ namespace RE::ID
inline constexpr REL::ID GetByType{ 83208 };
}

namespace BGSInventoryInterface
{
inline constexpr REL::ID singleton{ 825787 };
inline constexpr REL::ID GetInventoryObject{ 87520 };
}

namespace BGSObjectInstance
{
inline constexpr REL::ID ctor{ 101725 };
Expand Down Expand Up @@ -252,6 +258,7 @@ namespace RE::ID
inline constexpr REL::ID HasKeyword{ 80343 };
inline constexpr REL::ID IsCrimeToActivate{ 106755 };
inline constexpr REL::ID IsInSpace{ 106767 };
inline constexpr REL::ID IsObjectEquipped{ 106991 };
inline constexpr REL::ID IsSpaceshipDocked{ 174146 };
inline constexpr REL::ID IsSpaceshipLanded{ 173880 };
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 6 additions & 4 deletions CommonLibSF/include/RE/Starfield.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include "RE/B/BGSEntryPoint.h"
#include "RE/B/BGSEquipSlot.h"
#include "RE/B/BGSForcedLocRefType.h"
#include "RE/B/BGSInventoryInterface.h"
#include "RE/B/BGSInventoryItem.h"
#include "RE/B/BGSInventoryList.h"
#include "RE/B/BGSKeyword.h"
#include "RE/B/BGSKeywordForm.h"
Expand Down Expand Up @@ -87,8 +89,11 @@
#include "RE/I/IObjectHandlePolicy.h"
#include "RE/I/IPostAnimationChannelUpdateFunctor.h"
#include "RE/I/IStoreAnimationActions.h"
#include "RE/IDs.h"
#include "RE/I/IVMObjectBindInterface.h"
#include "RE/IDs.h"
#include "RE/IDs_NiRTTI.h"
#include "RE/IDs_RTTI.h"
#include "RE/IDs_VTABLE.h"
#include "RE/M/MagicTarget.h"
#include "RE/M/MemoryManager.h"
#include "RE/M/MenuOpenCloseEvent.h"
Expand All @@ -100,9 +105,6 @@
#include "RE/O/Object.h"
#include "RE/O/ObjectBindPolicy.h"
#include "RE/O/ObjectTypeInfo.h"
#include "RE/Offsets_NiRTTI.h"
#include "RE/Offsets_RTTI.h"
#include "RE/Offsets_VTABLE.h"
#include "RE/P/PerkRankData.h"
#include "RE/P/PlayerCamera.h"
#include "RE/P/PlayerCharacter.h"
Expand Down
Loading

0 comments on commit 4acaf17

Please sign in to comment.