Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Oct 31, 2023
1 parent e0f884d commit 3dd6d90
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/mods/vr/OverlayComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ std::optional<std::string> 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;
}
Expand All @@ -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();
Expand Down
1 change: 1 addition & 0 deletions src/mods/vr/OverlayComponent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 3dd6d90

Please sign in to comment.