Skip to content

Commit

Permalink
feat: add SKSEPluginLoad macro and getters for plugin name etc. (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirdEyeSqueegee authored Sep 9, 2023
1 parent 1cd48a3 commit 3df4cc8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ conan.lock
conanbuildinfo.*
conaninfo.txt
graph_info.json

/CommonLibSF/.vs
/CommonLibSF/out
17 changes: 17 additions & 0 deletions CommonLibSF/include/SFSE/Interfaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,31 @@ namespace SFSE
pluginVersion = a_version;
}

[[nodiscard]] constexpr std::uint32_t GetPluginVersion() const noexcept
{
return pluginVersion;
}

constexpr void PluginName(std::string_view a_plugin) noexcept
{
SetCharBuffer(a_plugin, std::span{ pluginName });
}

[[nodiscard]] constexpr std::string_view GetPluginName() const noexcept
{
return std::string_view{ pluginName };
}

constexpr void AuthorName(std::string_view a_name) noexcept
{
SetCharBuffer(a_name, std::span{ author });
}

[[nodiscard]] constexpr std::string_view GetAuthorName() const noexcept
{
return std::string_view{ author };
}

constexpr void UsesSigScanning(bool a_value) noexcept
{
addressIndependence = !a_value;
Expand Down Expand Up @@ -185,3 +200,5 @@ namespace SFSE
static_assert(offsetof(PluginVersionData, reservedBreaking) == 0x258);
static_assert(sizeof(PluginVersionData) == 0x25C);
} // namespace SFSE

#define SFSEPluginLoad(...) extern "C" [[maybe_unused]] __declspec(dllexport) bool SFSEPlugin_Load(__VA_ARGS__)

0 comments on commit 3df4cc8

Please sign in to comment.