diff --git a/include/uevr/API.h b/include/uevr/API.h index d5e6d22d..5f1eaef4 100644 --- a/include/uevr/API.h +++ b/include/uevr/API.h @@ -36,7 +36,7 @@ SOFTWARE. #define UEVR_OUT #define UEVR_PLUGIN_VERSION_MAJOR 2 -#define UEVR_PLUGIN_VERSION_MINOR 22 +#define UEVR_PLUGIN_VERSION_MINOR 23 #define UEVR_PLUGIN_VERSION_PATCH 0 #define UEVR_RENDERER_D3D11 0 @@ -296,6 +296,8 @@ typedef struct { UEVR_FFieldHandle (*get_child_properties)(UEVR_UStructHandle klass); UEVR_UFunctionHandle (*find_function)(UEVR_UStructHandle klass, const wchar_t* name); UEVR_FPropertyHandle (*find_property)(UEVR_UStructHandle klass, const wchar_t* name); + int (*get_properties_size)(UEVR_UStructHandle klass); /* size in bytes */ + int (*get_min_alignment)(UEVR_UStructHandle klass); } UEVR_UStructFunctions; typedef struct { diff --git a/include/uevr/API.hpp b/include/uevr/API.hpp index 667a1c82..3ac4ff7d 100644 --- a/include/uevr/API.hpp +++ b/include/uevr/API.hpp @@ -414,6 +414,16 @@ class API { return (FField*)fn(to_handle()); } + int32_t get_properties_size() const { + static const auto fn = initialize()->get_properties_size; + return fn(to_handle()); + } + + int32_t get_min_alignment() const { + static const auto fn = initialize()->get_min_alignment; + return fn(to_handle()); + } + private: static inline const UEVR_UStructFunctions* s_functions{nullptr}; inline static const UEVR_UStructFunctions* initialize() { diff --git a/src/mods/PluginLoader.cpp b/src/mods/PluginLoader.cpp index 73099acb..caf2557e 100644 --- a/src/mods/PluginLoader.cpp +++ b/src/mods/PluginLoader.cpp @@ -427,22 +427,24 @@ UEVR_FPropertyFunctions g_fproperty_functions { #define USTRUCT(x) ((sdk::UStruct*)x) UEVR_UStructFunctions g_ustruct_functions { - // get_super_struct - [](UEVR_UStructHandle strct) { + .get_super_struct = [](UEVR_UStructHandle strct) { return (UEVR_UStructHandle)USTRUCT(strct)->get_super_struct(); }, - // get_child_properties - [](UEVR_UStructHandle strct) { + .get_child_properties = [](UEVR_UStructHandle strct) { return (UEVR_FFieldHandle)USTRUCT(strct)->get_child_properties(); }, - // find_function - [](UEVR_UStructHandle strct, const wchar_t* name) { + .find_function = [](UEVR_UStructHandle strct, const wchar_t* name) { return (UEVR_UFunctionHandle)USTRUCT(strct)->find_function(name); }, - // find_property - [](UEVR_UStructHandle strct, const wchar_t* name) { + .find_property = [](UEVR_UStructHandle strct, const wchar_t* name) { return (UEVR_FPropertyHandle)USTRUCT(strct)->find_property(name); }, + .get_properties_size = [](UEVR_UStructHandle strct) { + return USTRUCT(strct)->get_properties_size(); + }, + .get_min_alignment = [](UEVR_UStructHandle strct) { + return USTRUCT(strct)->get_min_alignment(); + } }; #define UCLASS(x) ((sdk::UClass*)x)