diff --git a/include/uevr/API.h b/include/uevr/API.h index c536ac9b..a46e93dd 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 31 +#define UEVR_PLUGIN_VERSION_MINOR 32 #define UEVR_PLUGIN_VERSION_PATCH 0 #define UEVR_RENDERER_D3D11 0 @@ -325,6 +325,8 @@ typedef struct { typedef struct { void* (*get_native_function)(UEVR_UFunctionHandle function); bool (*hook_ptr)(UEVR_UFunctionHandle function, UEVR_UFunction_NativePreFn pre_hook, UEVR_UFunction_NativePostFn post_hook); + unsigned int (*get_function_flags)(UEVR_UFunctionHandle function); + void (*set_function_flags)(UEVR_UFunctionHandle function, unsigned int flags); } UEVR_UFunctionFunctions; typedef struct { diff --git a/include/uevr/API.hpp b/include/uevr/API.hpp index 6b2c6d48..657a51ea 100644 --- a/include/uevr/API.hpp +++ b/include/uevr/API.hpp @@ -548,6 +548,16 @@ class API { return fn(to_handle()); } + uint32_t get_function_flags() const { + static const auto fn = initialize()->get_function_flags; + return fn(to_handle()); + } + + void set_function_flags(uint32_t flags) { + static const auto fn = initialize()->set_function_flags; + fn(to_handle(), flags); + } + using UEVR_UFunction_CPPPreNative = bool(*)(API::UFunction*, API::UObject*, void*, void*); using UEVR_UFunction_CPPPostNative = void(*)(API::UFunction*, API::UObject*, void*, void*); diff --git a/lua-api/lib/src/ScriptContext.cpp b/lua-api/lib/src/ScriptContext.cpp index bce9c6c3..26ebb541 100644 --- a/lua-api/lib/src/ScriptContext.cpp +++ b/lua-api/lib/src/ScriptContext.cpp @@ -549,7 +549,9 @@ int ScriptContext::setup_bindings() { if (post != sol::nil) { hook->post_hooks.push_back(post); } - } + }, + "get_function_flags", &uevr::API::UFunction::get_function_flags, + "set_function_flags", &uevr::API::UFunction::set_function_flags ); m_lua.new_usertype("UEVR_FField", diff --git a/src/mods/PluginLoader.cpp b/src/mods/PluginLoader.cpp index 150d548c..9870a80b 100644 --- a/src/mods/PluginLoader.cpp +++ b/src/mods/PluginLoader.cpp @@ -618,7 +618,13 @@ UEVR_UFunctionFunctions g_ufunction_functions { }, .hook_ptr = [](UEVR_UFunctionHandle func, UEVR_UFunction_NativePreFn pre, UEVR_UFunction_NativePostFn post) -> bool { return PluginLoader::get()->hook_ufunction_ptr(func, pre, post); - } + }, + .get_function_flags = [](UEVR_UFunctionHandle func) -> uint32_t { + return UFUNCTION(func)->get_function_flags(); + }, + .set_function_flags = [](UEVR_UFunctionHandle func, uint32_t flags) { + UFUNCTION(func)->get_function_flags() = flags; + }, }; namespace uevr {