aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/clientruihooks.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'NorthstarDLL/clientruihooks.cpp')
-rw-r--r--NorthstarDLL/clientruihooks.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/NorthstarDLL/clientruihooks.cpp b/NorthstarDLL/clientruihooks.cpp
index a05ef217..3cb08368 100644
--- a/NorthstarDLL/clientruihooks.cpp
+++ b/NorthstarDLL/clientruihooks.cpp
@@ -1,13 +1,14 @@
#include "pch.h"
-#include "clientruihooks.h"
#include "convar.h"
-ConVar* Cvar_rui_drawEnable;
+AUTOHOOK_INIT()
-typedef char (*DrawRUIFuncType)(void* a1, float* a2);
-DrawRUIFuncType DrawRUIFunc;
+ConVar* Cvar_rui_drawEnable;
-char DrawRUIFuncHook(void* a1, float* a2)
+// clang-format off
+AUTOHOOK(DrawRUIFunc, engine.dll + 0xFC500,
+bool, __fastcall, (void* a1, float* a2))
+// clang-format on
{
if (!Cvar_rui_drawEnable->GetBool())
return 0;
@@ -15,10 +16,9 @@ char DrawRUIFuncHook(void* a1, float* a2)
return DrawRUIFunc(a1, a2);
}
-void InitialiseEngineClientRUIHooks(HMODULE baseAddress)
+ON_DLL_LOAD_CLIENT_RELIESON("engine.dll", RUI, ConVar, (CModule module))
{
- Cvar_rui_drawEnable = new ConVar("rui_drawEnable", "1", FCVAR_CLIENTDLL, "Controls whether RUI should be drawn");
+ AUTOHOOK_DISPATCH()
- HookEnabler hook;
- ENABLER_CREATEHOOK(hook, (char*)baseAddress + 0xFC500, &DrawRUIFuncHook, reinterpret_cast<LPVOID*>(&DrawRUIFunc));
+ Cvar_rui_drawEnable = new ConVar("rui_drawEnable", "1", FCVAR_CLIENTDLL, "Controls whether RUI should be drawn");
}