aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/clientruihooks.cpp
diff options
context:
space:
mode:
authorKawe Mazidjatari <48657826+Mauler125@users.noreply.github.com>2022-04-13 00:12:27 +0200
committerGitHub <noreply@github.com>2022-04-13 00:12:27 +0200
commit0c7fcc06f0fb072c00729c646773174b273a18b3 (patch)
tree240b3177c5eb8a9d005809c1d545fa0f3abdf6b1 /NorthstarDedicatedTest/clientruihooks.cpp
parent9916463631b3c31501617cdce02129178908d052 (diff)
parent8d242da7981204ea61b4678741a7cfe73d337442 (diff)
downloadNorthstarLauncher-0c7fcc06f0fb072c00729c646773174b273a18b3.tar.gz
NorthstarLauncher-0c7fcc06f0fb072c00729c646773174b273a18b3.zip
Merge branch 'main' into NetCon
Diffstat (limited to 'NorthstarDedicatedTest/clientruihooks.cpp')
-rw-r--r--NorthstarDedicatedTest/clientruihooks.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/NorthstarDedicatedTest/clientruihooks.cpp b/NorthstarDedicatedTest/clientruihooks.cpp
new file mode 100644
index 00000000..bc6c7aa7
--- /dev/null
+++ b/NorthstarDedicatedTest/clientruihooks.cpp
@@ -0,0 +1,24 @@
+#include "pch.h"
+#include "clientruihooks.h"
+#include "convar.h"
+
+ConVar* Cvar_rui_drawEnable;
+
+typedef char (*DrawRUIFuncType)(void* a1, float* a2);
+DrawRUIFuncType DrawRUIFunc;
+
+char DrawRUIFuncHook(void* a1, float* a2)
+{
+ if (!Cvar_rui_drawEnable->GetBool())
+ return 0;
+
+ return DrawRUIFunc(a1, a2);
+}
+
+void InitialiseEngineClientRUIHooks(HMODULE baseAddress)
+{
+ Cvar_rui_drawEnable = new ConVar("rui_drawEnable", "1", FCVAR_CLIENTDLL, "Controls whether RUI should be drawn");
+
+ HookEnabler hook;
+ ENABLER_CREATEHOOK(hook, (char*)baseAddress + 0xFC500, &DrawRUIFuncHook, reinterpret_cast<LPVOID*>(&DrawRUIFunc));
+} \ No newline at end of file