From 8f234be5124895563a2a36939e020e7e77ba1863 Mon Sep 17 00:00:00 2001 From: praydog Date: Sun, 25 Feb 2024 12:01:50 -0800 Subject: [PATCH] VR: Fix various screen space UI elements like Not a Hero in RE7 --- src/mods/VR.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/mods/VR.cpp b/src/mods/VR.cpp index 5f8f7c093..583b06b76 100644 --- a/src/mods/VR.cpp +++ b/src/mods/VR.cpp @@ -2389,22 +2389,13 @@ bool VR::on_pre_gui_draw_element(REComponent* gui_element, void* primitive_conte } #endif -#ifdef RE7 - if (name_hash == "HUD"_fnv) { // not a hero - game_object->transform->worldTransform = Matrix4x4f{ - 3.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 3.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 3.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 1.0f - }; - - return true; - } -#endif //spdlog::info("VR: on_pre_gui_draw_element: {}", name); //spdlog::info("VR: on_pre_gui_draw_element: {} {:x}", name, (uintptr_t)game_object); + // Fixes various UI elements that are stuck to the camera, like Not a Hero's UI + sdk::call_object_func(gui_element, "set_RenderTarget", context, gui_element, nullptr); + auto view = sdk::call_object_func(gui_element, "get_View", context, gui_element); if (view != nullptr) {