From b4bfd0f744484d690ac2ceb9f2783c73ffc71a31 Mon Sep 17 00:00:00 2001 From: matzman666 Date: Sat, 7 Jan 2017 15:26:16 +0100 Subject: [PATCH] Fine-tuned granularity of spinner boxes on revive page. Added check for outdated OpenVR installation. Changed version string to v2.2. --- bin/win64/res/qml/RevivePage.qml | 12 ++++++------ src/overlaycontroller.cpp | 29 ++++++++++++++++++++++++++++- src/overlaycontroller.h | 2 +- 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/bin/win64/res/qml/RevivePage.qml b/bin/win64/res/qml/RevivePage.qml index b15bffc..8f9720e 100644 --- a/bin/win64/res/qml/RevivePage.qml +++ b/bin/win64/res/qml/RevivePage.qml @@ -530,7 +530,7 @@ MyStackViewPage { Layout.preferredWidth: 40 text: "-" onClicked: { - ReviveTabController.setTouchX((ReviveTabController.touchX - 0.001).toFixed(3)) + ReviveTabController.setTouchX((ReviveTabController.touchX - 0.005).toFixed(3)) } } @@ -559,7 +559,7 @@ MyStackViewPage { Layout.preferredWidth: 40 text: "+" onClicked: { - ReviveTabController.setTouchX((ReviveTabController.touchX + 0.001).toFixed(3)) + ReviveTabController.setTouchX((ReviveTabController.touchX + 0.005).toFixed(3)) } } @@ -576,7 +576,7 @@ MyStackViewPage { Layout.preferredWidth: 40 text: "-" onClicked: { - ReviveTabController.setTouchY((ReviveTabController.touchY - 0.001).toFixed(3)) + ReviveTabController.setTouchY((ReviveTabController.touchY - 0.005).toFixed(3)) } } @@ -605,7 +605,7 @@ MyStackViewPage { Layout.preferredWidth: 40 text: "+" onClicked: { - ReviveTabController.setTouchY((ReviveTabController.touchY + 0.001).toFixed(3)) + ReviveTabController.setTouchY((ReviveTabController.touchY + 0.005).toFixed(3)) } } @@ -622,7 +622,7 @@ MyStackViewPage { Layout.preferredWidth: 40 text: "-" onClicked: { - ReviveTabController.setTouchZ((ReviveTabController.touchZ - 0.001).toFixed(3)) + ReviveTabController.setTouchZ((ReviveTabController.touchZ - 0.005).toFixed(3)) } } @@ -651,7 +651,7 @@ MyStackViewPage { Layout.preferredWidth: 40 text: "+" onClicked: { - ReviveTabController.setTouchZ((ReviveTabController.touchZ + 0.001).toFixed(3)) + ReviveTabController.setTouchZ((ReviveTabController.touchZ + 0.005).toFixed(3)) } } } diff --git a/src/overlaycontroller.cpp b/src/overlaycontroller.cpp index bd410d1..59dd346 100644 --- a/src/overlaycontroller.cpp +++ b/src/overlaycontroller.cpp @@ -43,12 +43,39 @@ void OverlayController::Init(QQmlEngine* qmlEngine) { if (initError == vr::VRInitError_Init_HmdNotFound || initError == vr::VRInitError_Init_HmdNotFoundPresenceFailed) { QMessageBox::critical(nullptr, "OpenVR Advanced Settings Overlay", "Could not find HMD!"); } - throw std::runtime_error(std::string("Failed to initialize OpenVR: " + std::string(vr::VR_GetVRInitErrorAsEnglishDescription(initError)))); + throw std::runtime_error(std::string("Failed to initialize OpenVR: ") + std::string(vr::VR_GetVRInitErrorAsEnglishDescription(initError))); } m_runtimePathUrl = QUrl::fromLocalFile(vr::VR_RuntimePath()); LOG(INFO) << "VR Runtime Path: " << m_runtimePathUrl.toLocalFile(); + // Check whether OpenVR is too outdated + if (!vr::VR_IsInterfaceVersionValid(vr::IVRSystem_Version)) { + QMessageBox::critical(nullptr, "OpenVR Advanced Settings Overlay", "OpenVR version is too outdated. Please update OpenVR."); + throw std::runtime_error(std::string("OpenVR version is too outdated: Interface version ") + std::string(vr::IVRSystem_Version) + std::string(" not found.")); + } else if (!vr::VR_IsInterfaceVersionValid(vr::IVRSettings_Version)) { + QMessageBox::critical(nullptr, "OpenVR Advanced Settings Overlay", "OpenVR version is too outdated. Please update OpenVR."); + throw std::runtime_error(std::string("OpenVR version is too outdated: Interface version ") + std::string(vr::IVRSettings_Version) + std::string(" not found.")); + } else if (!vr::VR_IsInterfaceVersionValid(vr::IVROverlay_Version)) { + QMessageBox::critical(nullptr, "OpenVR Advanced Settings Overlay", "OpenVR version is too outdated. Please update OpenVR."); + throw std::runtime_error(std::string("OpenVR version is too outdated: Interface version ") + std::string(vr::IVROverlay_Version) + std::string(" not found.")); + } else if (!vr::VR_IsInterfaceVersionValid(vr::IVRApplications_Version)) { + QMessageBox::critical(nullptr, "OpenVR Advanced Settings Overlay", "OpenVR version is too outdated. Please update OpenVR."); + throw std::runtime_error(std::string("OpenVR version is too outdated: Interface version ") + std::string(vr::IVRApplications_Version) + std::string(" not found.")); + } else if (!vr::VR_IsInterfaceVersionValid(vr::IVRChaperone_Version)) { + QMessageBox::critical(nullptr, "OpenVR Advanced Settings Overlay", "OpenVR version is too outdated. Please update OpenVR."); + throw std::runtime_error(std::string("OpenVR version is too outdated: Interface version ") + std::string(vr::IVRChaperone_Version) + std::string(" not found.")); + } else if (!vr::VR_IsInterfaceVersionValid(vr::IVRChaperoneSetup_Version)) { + QMessageBox::critical(nullptr, "OpenVR Advanced Settings Overlay", "OpenVR version is too outdated. Please update OpenVR."); + throw std::runtime_error(std::string("OpenVR version is too outdated: Interface version ") + std::string(vr::IVRChaperoneSetup_Version) + std::string(" not found.")); + } else if (!vr::VR_IsInterfaceVersionValid(vr::IVRCompositor_Version)) { + QMessageBox::critical(nullptr, "OpenVR Advanced Settings Overlay", "OpenVR version is too outdated. Please update OpenVR."); + throw std::runtime_error(std::string("OpenVR version is too outdated: Interface version ") + std::string(vr::IVRCompositor_Version) + std::string(" not found.")); + } else if (!vr::VR_IsInterfaceVersionValid(vr::IVRNotifications_Version)) { + QMessageBox::critical(nullptr, "OpenVR Advanced Settings Overlay", "OpenVR version is too outdated. Please update OpenVR."); + throw std::runtime_error(std::string("OpenVR version is too outdated: Interface version ") + std::string(vr::IVRNotifications_Version) + std::string(" not found.")); + } + QSurfaceFormat format; // Qt's QOpenGLPaintDevice is not compatible with OpenGL versions >= 3.0 // NVIDIA does not care, but unfortunately AMD does diff --git a/src/overlaycontroller.h b/src/overlaycontroller.h index 41cad09..b0f9bd1 100644 --- a/src/overlaycontroller.h +++ b/src/overlaycontroller.h @@ -44,7 +44,7 @@ class OverlayController : public QObject { public: static constexpr const char* applicationKey = "matzman666.AdvancedSettings"; static constexpr const char* applicationName = "Advanced Settings"; - static constexpr const char* applicationVersionString = "v2.2a"; + static constexpr const char* applicationVersionString = "v2.2"; private: vr::VROverlayHandle_t m_ulOverlayHandle = vr::k_ulOverlayHandleInvalid;