10 class InventoryEntryData;
19 class IVirtualMachine;
72 [[nodiscard]] std::uint32_t
Version()
const;
92 [[nodiscard]] std::uint32_t
Version()
const;
101 bool WriteRecord(std::uint32_t a_type, std::uint32_t a_version,
const void* a_buf, std::uint32_t a_length)
const;
109 inline bool WriteRecord(std::uint32_t a_type, std::uint32_t a_version,
const T& a_buf)
const
111 return WriteRecord(a_type, a_version, std::addressof(a_buf),
sizeof(T));
120 inline bool WriteRecord(std::uint32_t a_type, std::uint32_t a_version,
const T (&a_buf)[N])
const
122 return WriteRecord(a_type, a_version, std::addressof(a_buf),
sizeof(T) * N);
125 [[nodiscard]]
bool OpenRecord(std::uint32_t a_type, std::uint32_t a_version)
const;
151 bool GetNextRecordInfo(std::uint32_t& a_type, std::uint32_t& a_version, std::uint32_t& a_length)
const;
242 template <
class Last>
245 return Register_Impl(a_last);
248 template <
class First,
class... Rest>
251 return Register_Impl(a_first) &&
Register(a_rest...);
308 bool Dispatch(std::uint32_t a_messageType,
void* a_data, std::uint32_t a_dataLen,
const char* a_receiver)
const;
373 constexpr
void AuthorName(std::string_view a_name) noexcept { SetCharBuffer(a_name, std::span{
author }); }
382 [](
const REL::Version& a_version) noexcept { return a_version.pack(); });
386 constexpr
void PluginName(std::string_view a_plugin) noexcept { SetCharBuffer(a_plugin, std::span{
pluginName }); }
413 static constexpr
void SetCharBuffer(
414 std::string_view a_src,
415 std::span<char> a_dst) noexcept
417 assert(a_src.size() < a_dst.size());
418 std::fill(a_dst.begin(), a_dst.end(),
'\0');
419 std::copy(a_src.begin(), a_src.end(), a_dst.begin());
422 static_assert(offsetof(PluginVersionData, dataVersion) == 0x000);
423 static_assert(offsetof(PluginVersionData, pluginVersion) == 0x004);
424 static_assert(offsetof(PluginVersionData, pluginName) == 0x008);
425 static_assert(offsetof(PluginVersionData, author) == 0x108);
426 static_assert(offsetof(PluginVersionData, supportEmail) == 0x208);
427 static_assert(offsetof(PluginVersionData, padding2) == 0x305);
428 static_assert(offsetof(PluginVersionData, padding3) == 0x306);
429 static_assert(offsetof(PluginVersionData, padding5) == 0x309);
430 static_assert(offsetof(PluginVersionData, padding6) == 0x30A);
431 static_assert(offsetof(PluginVersionData, compatibleVersions) == 0x30C);
432 static_assert(offsetof(PluginVersionData, xseMinimum) == 0x34C);
433 static_assert(
sizeof(PluginVersionData) == 0x350);
452 template <std::
size_t N>
458 constexpr
String(std::string_view a_string) noexcept
460 std::span<char> buffer(_buffer, N);
461 std::fill(buffer.begin(), buffer.end(),
'\0');
462 std::copy(a_string.begin(), a_string.end(), buffer.begin());
465 constexpr
String(
const char* a_string) noexcept
467 std::string_view
string(a_string);
468 std::span<char> buffer(_buffer, N);
469 std::fill(buffer.begin(), buffer.end(),
'\0');
470 std::copy(
string.begin(),
string.end(), buffer.begin());
473 [[nodiscard]] constexpr
operator const char*()
const noexcept
478 [[nodiscard]] constexpr
operator std::string_view() const noexcept
494 _packed(
REL::Version{ a_major, a_minor, a_patch, a_build }.pack())
498 _packed(a_version.pack()) {}
502 _packed = a_version.pack();
511 [[nodiscard]] constexpr
explicit operator std::uint32_t() const noexcept
517 std::uint32_t _packed{};
527 template <
class... Args>
530 _addressLibrary(false), _compatibleVersions({
VersionNumber(a_compatibleVersions)... })
537 _structsPost629(a_requiresPost629Structs) {}
541 return _addressLibrary;
546 return _signatureScanning;
551 return _structsPost629;
561 return _compatibleVersions;
565 const bool _addressLibrary : 1 =
true;
566 const bool _signatureScanning: 1 =
false;
567 const bool _structsPost629 : 1 =
false;
568 [[maybe_unused]]
const std::uint8_t _pad0: 5 = 0;
569 [[maybe_unused]]
const std::uint8_t _pad1{ 0 };
570 [[maybe_unused]]
const std::uint16_t _pad2{ 0 };
571 std::array<VersionNumber, 16> _compatibleVersions{};
573 static_assert(
sizeof(RuntimeCompatibility) == 0x44);
625 static_assert(offsetof(PluginDeclarationInfo, Version) == 0x000);
626 static_assert(offsetof(PluginDeclarationInfo, Name) == 0x004);
627 static_assert(offsetof(PluginDeclarationInfo, Author) == 0x104);
628 static_assert(offsetof(PluginDeclarationInfo, SupportEmail) == 0x204);
630 static_assert(offsetof(PluginDeclarationInfo, RuntimeCompatibility) == 0x304);
631 static_assert(offsetof(PluginDeclarationInfo, MinimumSKSEVersion) == 0x348);
634 _data(std::move(info)) {}
641 [[nodiscard]] constexpr std::string_view
GetName() const noexcept
646 [[nodiscard]] constexpr std::string_view
GetAuthor() const noexcept
679 [[maybe_unused]]
const std::uint32_t _dataVersion{ kVersion };
680 [[maybe_unused]]
const PluginDeclarationInfo _data;
682 static_assert(
sizeof(PluginDeclaration) == 0x350);
685 #define SKSEPluginInfo(...) \
686 extern "C" [[maybe_unused]] __declspec(dllexport) constinit ::SKSE::PluginDeclaration SKSEPlugin_Version({ __VA_ARGS__ }); \
687 extern "C" [[maybe_unused]] __declspec(dllexport) bool SKSEPlugin_Query(::SKSE::QueryInterface*, ::SKSE::PluginInfo* pluginInfo) \
689 pluginInfo->infoVersion = ::SKSE::PluginInfo::kVersion; \
690 pluginInfo->name = SKSEPlugin_Version.GetName().data(); \
691 pluginInfo->version = static_cast<std::uint32_t>(SKSEPlugin_Version.GetVersion().pack()); \
695 #define SKSEPluginLoad(...) extern "C" [[maybe_unused]] __declspec(dllexport) bool SKSEPlugin_Load(__VA_ARGS__)
static constexpr Version unpack(std::uint32_t a_packedVersion) noexcept
Definition: Version.h:112
std::uint16_t value_type
Definition: Version.h:8
Definition: IVirtualMachine.h:39
Definition: VirtualMachine.h:46
Definition: GFxMovieView.h:24
Definition: GFxValue.h:92
Definition: InventoryEntryData.h:15
Definition: Interfaces.h:40
void * QueryInterface(std::uint32_t a_id) const
@ kTrampoline
Definition: Interfaces.h:51
@ kMessaging
Definition: Interfaces.h:49
@ kPapyrus
Definition: Interfaces.h:46
@ kSerialization
Definition: Interfaces.h:47
@ kObject
Definition: Interfaces.h:50
@ kTask
Definition: Interfaces.h:48
@ kInvalid
Definition: Interfaces.h:44
@ kScaleform
Definition: Interfaces.h:45
@ kTotal
Definition: Interfaces.h:52
const PluginInfo * GetPluginInfo(const char *a_name) const
PluginHandle GetPluginHandle() const
std::uint32_t GetReleaseIndex() const
Definition: Interfaces.h:263
@ kTotal
Definition: Interfaces.h:292
@ kPostPostLoad
Definition: Interfaces.h:283
@ kPostLoad
Definition: Interfaces.h:282
@ kPreLoadGame
Definition: Interfaces.h:284
@ kSaveGame
Definition: Interfaces.h:286
@ kNewGame
Definition: Interfaces.h:289
@ kDataLoaded
Definition: Interfaces.h:290
@ kInputLoaded
Definition: Interfaces.h:288
@ kDeleteGame
Definition: Interfaces.h:287
@ kPostLoadGame
Definition: Interfaces.h:285
Dispatcher
Definition: Interfaces.h:296
std::uint32_t Version() const
void * GetEventDispatcher(Dispatcher a_dispatcherID) const
bool Dispatch(std::uint32_t a_messageType, void *a_data, std::uint32_t a_dataLen, const char *a_receiver) const
bool RegisterListener(const char *a_sender, EventCallback *a_callback) const
const detail::SKSEMessagingInterface * GetProxy() const
bool RegisterListener(EventCallback *a_callback) const
@ kVersion
Definition: Interfaces.h:277
void(Message *a_msg) EventCallback
Definition: Interfaces.h:273
Definition: Interfaces.h:318
SKSEDelayFunctorManager & GetDelayFunctorManager() const
SKSEPersistentObjectStorage & GetPersistentObjectStorage() const
std::uint32_t Version() const
@ kVersion
Definition: Interfaces.h:322
SKSEObjectRegistry & GetObjectRegistry() const
Definition: Interfaces.h:230
bool Register(First a_first, Rest... a_rest) const
Definition: Interfaces.h:249
std::uint32_t Version() const
@ kVersion
Definition: Interfaces.h:237
const detail::SKSEPapyrusInterface * GetProxy() const
bool(RE::BSScript::Internal::VirtualMachine *a_vm) RegFunction1
Definition: Interfaces.h:232
bool(RE::BSScript::IVirtualMachine *a_vm) RegFunction2
Definition: Interfaces.h:233
bool Register(Last a_last) const
Definition: Interfaces.h:243
Definition: Interfaces.h:521
constexpr bool Targets629Structs() const noexcept
Definition: Interfaces.h:549
constexpr RuntimeCompatibility()=default
constexpr RuntimeCompatibility(VersionIndependence a_versionIndependence, bool a_requiresPost629Structs=false) noexcept
Definition: Interfaces.h:534
constexpr std::array< VersionNumber, 16 > GetCompatibleRuntimeVersions() const noexcept
Definition: Interfaces.h:559
static constexpr std::size_t MaxCompatibleVersions
Definition: Interfaces.h:523
constexpr bool IsVersionIndependent() const noexcept
Definition: Interfaces.h:554
requires(sizeof...(Args)<=MaxCompatibleVersions &&(std::convertible_to< Args, VersionNumber > &&...)) const expr RuntimeCompatibility(Args... a_compatibleVersions) noexcept
Definition: Interfaces.h:528
constexpr bool UsesAddressLibrary() const noexcept
Definition: Interfaces.h:539
constexpr bool UsesSignatureScanning() const noexcept
Definition: Interfaces.h:544
Definition: Interfaces.h:454
constexpr String(const char *a_string) noexcept
Definition: Interfaces.h:465
constexpr String(std::string_view a_string) noexcept
Definition: Interfaces.h:458
constexpr String()=default
Definition: Interfaces.h:488
constexpr VersionNumber & operator=(REL::Version a_version) noexcept
Definition: Interfaces.h:500
constexpr VersionNumber(value_type a_major=1, value_type a_minor=0, value_type a_patch=0, value_type a_build=0) noexcept
Definition: Interfaces.h:492
typename REL::Version::value_type value_type
Definition: Interfaces.h:490
constexpr VersionNumber(REL::Version a_version) noexcept
Definition: Interfaces.h:497
Definition: Interfaces.h:28
std::uint32_t EditorVersion() const
REL::Version RuntimeVersion() const
const detail::SKSEInterface * GetProxy() const
std::uint32_t SKSEVersion() const
Definition: Interfaces.h:82
bool ResolveHandle(RE::VMHandle a_oldHandle, RE::VMHandle &a_newHandle) const
void SetLoadCallback(EventCallback *a_callback) const
@ kVersion
Definition: Interfaces.h:89
void SetFormDeleteCallback(FormDeleteCallback *a_callback) const
std::uint32_t ReadRecordData(T &a_buf) const
Definition: Interfaces.h:161
bool WriteRecord(std::uint32_t a_type, std::uint32_t a_version, const T(&a_buf)[N]) const
Definition: Interfaces.h:120
void(SerializationInterface *a_intfc) EventCallback
Definition: Interfaces.h:84
bool WriteRecordData(const T &a_buf) const
Definition: Interfaces.h:135
void(RE::VMHandle a_handle) FormDeleteCallback
Definition: Interfaces.h:85
std::uint32_t ReadRecordData(void *a_buf, std::uint32_t a_length) const
void SetRevertCallback(EventCallback *a_callback) const
bool WriteRecord(std::uint32_t a_type, std::uint32_t a_version, const T &a_buf) const
Definition: Interfaces.h:109
void SetUniqueID(std::uint32_t a_uid) const
bool WriteRecordData(const void *a_buf, std::uint32_t a_length) const
bool GetNextRecordInfo(std::uint32_t &a_type, std::uint32_t &a_version, std::uint32_t &a_length) const
void SetSaveCallback(EventCallback *a_callback) const
std::uint32_t ReadRecordData(T(&a_buf)[N]) const
Definition: Interfaces.h:172
const detail::SKSESerializationInterface * GetProxy() const
bool ResolveFormID(RE::FormID a_oldFormID, RE::FormID &a_newFormID) const
bool WriteRecordData(const T(&a_buf)[N]) const
Definition: Interfaces.h:146
std::uint32_t Version() const
bool WriteRecord(std::uint32_t a_type, std::uint32_t a_version, const void *a_buf, std::uint32_t a_length) const
bool OpenRecord(std::uint32_t a_type, std::uint32_t a_version) const
Definition: Interfaces.h:203
Definition: Interfaces.h:215
Definition: Interfaces.h:185
void AddUITask(UIDelegate_v1 *a_task) const
std::function< void()> TaskFn
Definition: Interfaces.h:187
void AddTask(TaskFn a_task) const
void AddUITask(TaskFn a_task) const
@ kVersion
Definition: Interfaces.h:191
void AddTask(TaskDelegate *a_task) const
const detail::SKSETaskInterface * GetProxy() const
std::uint32_t Version() const
Definition: Interfaces.h:336
std::uint32_t Version() const
@ kVersion
Definition: Interfaces.h:340
void * AllocateFromLocalPool(std::size_t a_size) const
void * AllocateFromBranchPool(std::size_t a_size) const
Definition: AbsorbEffect.h:6
std::uint32_t FormID
Definition: BSCoreTypes.h:5
std::uint64_t VMHandle
Definition: BSCoreTypes.h:7
string(const CharT(&)[N]) -> string< CharT, N - 1 >
std::uint32_t PluginHandle
Definition: Stubs.h:11
VersionIndependence
Definition: Interfaces.h:436
@ AddressLibraryPre1_6_629
@ AddressLibraryPost1_6_629
StructCompatibility
Definition: Interfaces.h:444
Definition: Interfaces.h:266
std::uint32_t dataLen
Definition: Interfaces.h:269
const char * sender
Definition: Interfaces.h:267
std::uint32_t type
Definition: Interfaces.h:268
void * data
Definition: Interfaces.h:270
Definition: Interfaces.h:576
const String< 256 > Name
Definition: Interfaces.h:585
const VersionNumber MinimumSKSEVersion
Definition: Interfaces.h:623
const StructCompatibility StructCompatibility
Definition: Interfaces.h:607
const String< 256 > Author
Definition: Interfaces.h:590
const VersionNumber Version
Definition: Interfaces.h:580
const String< 252 > SupportEmail
Definition: Interfaces.h:595
const RuntimeCompatibility RuntimeCompatibility
Definition: Interfaces.h:618
Definition: Interfaces.h:450
constexpr const RuntimeCompatibility & GetRuntimeCompatibility() const noexcept
Definition: Interfaces.h:661
constexpr std::string_view GetAuthor() const noexcept
Definition: Interfaces.h:646
constexpr PluginDeclaration(PluginDeclarationInfo info) noexcept
Definition: Interfaces.h:633
constexpr std::string_view GetName() const noexcept
Definition: Interfaces.h:641
constexpr REL::Version GetMinimumSKSEVersion() const noexcept
Definition: Interfaces.h:666
static const PluginDeclaration * GetSingleton() noexcept
constexpr REL::Version GetVersion() const noexcept
Definition: Interfaces.h:636
constexpr std::string_view GetSupportEmail() const noexcept
Definition: Interfaces.h:651
constexpr StructCompatibility GetStructCompatibility() const noexcept
Definition: Interfaces.h:656
Definition: Interfaces.h:353
std::uint32_t version
Definition: Interfaces.h:361
const char * name
Definition: Interfaces.h:360
std::uint32_t infoVersion
Definition: Interfaces.h:359
@ kVersion
Definition: Interfaces.h:356
Definition: Interfaces.h:365
@ kVersion
Definition: Interfaces.h:369
std::uint8_t padding5
Definition: Interfaces.h:407
constexpr void HasNoStructUse(bool a_value=true) noexcept
Definition: Interfaces.h:388
std::uint16_t padding6
Definition: Interfaces.h:408
constexpr void UsesNoStructs(bool a_value=true) noexcept
Definition: Interfaces.h:389
std::uint8_t padding4
Definition: Interfaces.h:406
bool structsPost629
Definition: Interfaces.h:405
constexpr void MinimumRequiredXSEVersion(REL::Version a_version) noexcept
Definition: Interfaces.h:385
constexpr void PluginName(std::string_view a_plugin) noexcept
Definition: Interfaces.h:386
std::uint16_t padding3
Definition: Interfaces.h:402
std::uint32_t pluginVersion
Definition: Interfaces.h:395
std::uint32_t xseMinimum
Definition: Interfaces.h:410
constexpr void CompatibleVersions(std::initializer_list< REL::Version > a_versions) noexcept
Definition: Interfaces.h:375
char pluginName[256]
Definition: Interfaces.h:396
constexpr void AuthorEmail(std::string_view a_email) noexcept
Definition: Interfaces.h:372
bool addressLibrary
Definition: Interfaces.h:403
constexpr void UsesStructsPost629(bool a_value=true) noexcept
Definition: Interfaces.h:392
std::uint8_t padding1
Definition: Interfaces.h:400
constexpr void PluginVersion(REL::Version a_version) noexcept
Definition: Interfaces.h:387
char author[256]
Definition: Interfaces.h:397
std::uint8_t padding2
Definition: Interfaces.h:401
bool sigScanning
Definition: Interfaces.h:404
constexpr void AuthorName(std::string_view a_name) noexcept
Definition: Interfaces.h:373
bool noStructUse
Definition: Interfaces.h:399
std::uint32_t compatibleVersions[16]
Definition: Interfaces.h:409
constexpr void UsesAddressLibrary(bool a_value=true) noexcept
Definition: Interfaces.h:390
const std::uint32_t dataVersion
Definition: Interfaces.h:394
char supportEmail[252]
Definition: Interfaces.h:398
constexpr void UsesSigScanning(bool a_value=true) noexcept
Definition: Interfaces.h:391