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;
364 #ifdef SKYRIM_SUPPORT_AE
365 struct PluginVersionData
375 kVersionIndependent_AddressLibraryPostAE = 1 << 0,
376 kVersionIndependent_Signatures = 1 << 1,
377 kVersionIndependent_StructsPost629 = 1 << 2,
382 kVersionIndependentEx_NoStructUse = 1 << 0,
385 constexpr
void PluginVersion(
REL::Version a_version) noexcept { pluginVersion = a_version.pack(); }
389 constexpr
void PluginName(std::string_view a_plugin) noexcept { SetCharBuffer(a_plugin, std::span{ pluginName }); }
391 [[nodiscard]] constexpr std::string_view GetPluginName() const noexcept {
return std::string_view{ pluginName }; }
393 constexpr
void AuthorName(std::string_view a_name) noexcept { SetCharBuffer(a_name, std::span{ author }); }
395 [[nodiscard]] constexpr std::string_view GetAuthorName() const noexcept {
return std::string_view{ author }; }
397 constexpr
void AuthorEmail(std::string_view a_email) noexcept { SetCharBuffer(a_email, std::span{ supportEmail }); }
399 [[nodiscard]] constexpr std::string_view GetAuthorEmail() const noexcept {
return std::string_view{ supportEmail }; }
401 constexpr
void UsesAddressLibrary() noexcept { versionIndependence |= kVersionIndependent_AddressLibraryPostAE; }
402 constexpr
void UsesSigScanning() noexcept { versionIndependence |= kVersionIndependent_Signatures; }
403 constexpr
void UsesUpdatedStructs() noexcept { versionIndependence |= kVersionIndependent_StructsPost629; }
405 constexpr
void UsesNoStructs() noexcept { versionIndependenceEx |= kVersionIndependentEx_NoStructUse; }
407 constexpr
void MinimumRequiredXSEVersion(
REL::Version a_version) noexcept { xseMinimum = a_version.pack(); }
409 constexpr
void CompatibleVersions(std::initializer_list<REL::Version> a_versions) noexcept
411 assert(a_versions.size() < std::size(compatibleVersions) - 1);
415 std::begin(compatibleVersions),
416 [](
const REL::Version& a_version) noexcept { return a_version.pack(); });
419 [[nodiscard]]
static const PluginVersionData*
GetSingleton() noexcept;
421 const
std::uint32_t dataVersion{ kVersion };
422 std::uint32_t pluginVersion = 0;
423 char pluginName[256] = {};
424 char author[256] = {};
425 char supportEmail[252] = {};
426 std::uint32_t versionIndependenceEx = 0;
427 std::uint32_t versionIndependence = 0;
428 std::uint32_t compatibleVersions[16] = {};
429 std::uint32_t xseMinimum = 0;
432 static constexpr
void SetCharBuffer(
433 std::string_view a_src,
434 std::span<char> a_dst) noexcept
436 assert(a_src.size() < a_dst.size());
437 std::fill(a_dst.begin(), a_dst.end(),
'\0');
438 std::copy(a_src.begin(), a_src.end(), a_dst.begin());
441 static_assert(offsetof(PluginVersionData, dataVersion) == 0x000);
442 static_assert(offsetof(PluginVersionData, pluginVersion) == 0x004);
443 static_assert(offsetof(PluginVersionData, pluginName) == 0x008);
444 static_assert(offsetof(PluginVersionData, author) == 0x108);
445 static_assert(offsetof(PluginVersionData, supportEmail) == 0x208);
446 static_assert(offsetof(PluginVersionData, versionIndependenceEx) == 0x304);
447 static_assert(offsetof(PluginVersionData, versionIndependence) == 0x308);
448 static_assert(offsetof(PluginVersionData, compatibleVersions) == 0x30C);
449 static_assert(offsetof(PluginVersionData, xseMinimum) == 0x34C);
450 static_assert(
sizeof(PluginVersionData) == 0x350);
454 #define SKSEPluginLoad(...) extern "C" [[maybe_unused]] __declspec(dllexport) bool SKSEPlugin_Load(__VA_ARGS__)
455 #define SKSEPluginVersion extern "C" [[maybe_unused]] __declspec(dllexport) constinit SKSE::PluginVersionData SKSEPlugin_Version
static constexpr Version unpack(std::uint32_t a_packedVersion) noexcept
Definition: Version.h:97
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
Dispatcher
Definition: Interfaces.h:296
@ 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
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
@ kVersion
Definition: Interfaces.h:277
const detail::SKSEMessagingInterface * GetProxy() const
bool RegisterListener(EventCallback *a_callback) const
void(Message *a_msg) EventCallback
Definition: Interfaces.h:273
Definition: Interfaces.h:318
SKSEDelayFunctorManager & GetDelayFunctorManager() const
SKSEPersistentObjectStorage & GetPersistentObjectStorage() const
std::uint32_t Version() const
SKSEObjectRegistry & GetObjectRegistry() const
@ kVersion
Definition: Interfaces.h:322
Definition: Interfaces.h:230
bool Register(First a_first, Rest... a_rest) const
Definition: Interfaces.h:249
std::uint32_t Version() const
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
@ kVersion
Definition: Interfaces.h:237
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
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
@ kVersion
Definition: Interfaces.h:89
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
@ kVersion
Definition: Interfaces.h:191
void AddTask(TaskFn a_task) const
void AddUITask(TaskFn a_task) const
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
void * AllocateFromLocalPool(std::size_t a_size) const
void * AllocateFromBranchPool(std::size_t a_size) const
@ kVersion
Definition: Interfaces.h:340
constexpr REL::ID GetSingleton(static_cast< std::uint64_t >(10878))
Definition: AbsorbEffect.h:6
std::uint32_t FormID
Definition: BSCoreTypes.h:5
std::uint64_t VMHandle
Definition: BSCoreTypes.h:7
std::uint32_t PluginHandle
Definition: Stubs.h:11
Definition: EffectArchetypes.h:65
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:353
@ kVersion
Definition: Interfaces.h:356
std::uint32_t version
Definition: Interfaces.h:361
const char * name
Definition: Interfaces.h:360
std::uint32_t infoVersion
Definition: Interfaces.h:359