From 3dd6d904933529b69b8954e5f3feff70abad033b Mon Sep 17 00:00:00 2001 From: praydog Date: Mon, 30 Oct 2023 18:28:15 -0700 Subject: [PATCH] tidy --- src/mods/vr/OverlayComponent.cpp | 7 +++++++ src/mods/vr/OverlayComponent.hpp | 1 + 2 files changed, 8 insertions(+) diff --git a/src/mods/vr/OverlayComponent.cpp b/src/mods/vr/OverlayComponent.cpp index 3cccb2cd..c5ed545c 100644 --- a/src/mods/vr/OverlayComponent.cpp +++ b/src/mods/vr/OverlayComponent.cpp @@ -72,7 +72,10 @@ std::optional OverlayComponent::on_initialize_openvr() { void OverlayComponent::on_pre_imgui_frame() { this->update_input_openvr(); + this->update_input_mouse_emulation(); +} +void OverlayComponent::update_input_mouse_emulation() { if (VR::get()->get_runtime()->is_openvr() && m_framework_wrist_ui->value()) { return; } @@ -84,6 +87,10 @@ void OverlayComponent::on_pre_imgui_frame() { const auto delta_f = delta / 1000.0f; last_time = now; + if (!m_framework_mouse_emulation->value()) { + return; + } + if (m_framework_intersect_state.intersecting && VR::get()->is_using_controllers()) { auto vr = VR::get(); auto& io = ImGui::GetIO(); diff --git a/src/mods/vr/OverlayComponent.hpp b/src/mods/vr/OverlayComponent.hpp index b096fcd2..c9cccc10 100644 --- a/src/mods/vr/OverlayComponent.hpp +++ b/src/mods/vr/OverlayComponent.hpp @@ -163,6 +163,7 @@ class OverlayComponent : public ModComponent { private: void update_input_openvr(); + void update_input_mouse_emulation(); void update_overlay_openvr(); bool update_wrist_overlay_openvr(); void update_slate_openvr();