Skip to content

Commit

Permalink
VR: Fix various screen space UI elements like Not a Hero in RE7
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Feb 25, 2024
1 parent 8265afb commit 8f234be
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/mods/VR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<REComponent*>(gui_element, "set_RenderTarget", context, gui_element, nullptr);

auto view = sdk::call_object_func<REComponent*>(gui_element, "get_View", context, gui_element);

if (view != nullptr) {
Expand Down

0 comments on commit 8f234be

Please sign in to comment.