diff --git a/build_scripts/qt/resources.pri b/build_scripts/qt/resources.pri index 8c3ec74..7ed0eaf 100644 --- a/build_scripts/qt/resources.pri +++ b/build_scripts/qt/resources.pri @@ -26,7 +26,6 @@ DISTFILES += \ src/res/qml/motion_page/snap_turn/* \ src/res/qml/motion_page/space_drag/* \ src/res/qml/motion_page/space_turn/* \ - src/res/qml/RevivePage.qml \ src/res/qml/RootPage.qml \ src/res/qml/SettingsPage.qml \ src/res/qml/StatisticsPage.qml \ diff --git a/build_scripts/qt/sources.pri b/build_scripts/qt/sources.pri index 91a04e0..b483a3d 100644 --- a/build_scripts/qt/sources.pri +++ b/build_scripts/qt/sources.pri @@ -7,7 +7,6 @@ SOURCES += src/main.cpp\ src/tabcontrollers/SettingsTabController.cpp \ src/tabcontrollers/StatisticsTabController.cpp \ src/tabcontrollers/SteamVRTabController.cpp \ - src/tabcontrollers/ReviveTabController.cpp \ src/tabcontrollers/UtilitiesTabController.cpp \ src/tabcontrollers/PttController.cpp \ src/tabcontrollers/VideoTabController.cpp \ @@ -28,7 +27,6 @@ HEADERS += src/overlaycontroller.h \ src/tabcontrollers/SettingsTabController.h \ src/tabcontrollers/StatisticsTabController.h \ src/tabcontrollers/SteamVRTabController.h \ - src/tabcontrollers/ReviveTabController.h \ src/tabcontrollers/UtilitiesTabController.h \ src/tabcontrollers/VideoTabController.h \ src/tabcontrollers/AudioManager.h \ diff --git a/src/overlaycontroller.cpp b/src/overlaycontroller.cpp index c293625..83cdfb5 100644 --- a/src/overlaycontroller.cpp +++ b/src/overlaycontroller.cpp @@ -137,8 +137,6 @@ OverlayController::OverlayController( bool desktopMode, m_moveCenterTabController.initStage1(); m_audioTabController.initStage1(); m_settingsTabController.initStage1(); - m_reviveTabController.initStage1( - m_settingsTabController.forceRevivePage() ); m_utilitiesTabController.initStage1(); m_videoTabController.initStage1(); @@ -250,16 +248,6 @@ OverlayController::OverlayController( bool desktopMode, QQmlEngine::setObjectOwnership( obj, QQmlEngine::CppOwnership ); return obj; } ); - qmlRegisterSingletonType( - qmlSingletonImportName, - 1, - 0, - "ReviveTabController", - []( QQmlEngine*, QJSEngine* ) { - QObject* obj = &( objectAddress->m_reviveTabController ); - QQmlEngine::setObjectOwnership( obj, QQmlEngine::CppOwnership ); - return obj; - } ); qmlRegisterSingletonType( qmlSingletonImportName, 1, @@ -488,7 +476,6 @@ void OverlayController::SetWidget( QQuickItem* quickItem, m_audioTabController.initStage2(); m_statisticsTabController.initStage2( this ); m_settingsTabController.initStage2( this ); - m_reviveTabController.initStage2( this ); m_utilitiesTabController.initStage2( this ); m_moveCenterTabController.initStage2( this ); } @@ -1055,16 +1042,19 @@ void OverlayController::mainEventLoop() m_moveCenterTabController.eventLoopTick( vr::VRCompositor()->GetTrackingSpace(), devicePoses ); m_utilitiesTabController.eventLoopTick(); - m_fixFloorTabController.eventLoopTick( devicePoses ); m_statisticsTabController.eventLoopTick( devicePoses, leftSpeed, rightSpeed ); - m_steamVRTabController.eventLoopTick(); m_chaperoneTabController.eventLoopTick( devicePoses, leftSpeed, rightSpeed, hmdSpeed ); - m_settingsTabController.eventLoopTick(); - m_reviveTabController.eventLoopTick(); m_audioTabController.eventLoopTick(); + if ( vr::VROverlay()->IsDashboardVisible() ) + { + m_settingsTabController.dashboardLoopTick(); + m_steamVRTabController.dashboardLoopTick(); + m_fixFloorTabController.dashboardLoopTick( devicePoses ); + } + if ( m_ulOverlayThumbnailHandle != vr::k_ulOverlayHandleInvalid ) { while ( vr::VROverlay()->PollNextOverlayEvent( diff --git a/src/overlaycontroller.h b/src/overlaycontroller.h index d358cc4..6df5110 100644 --- a/src/overlaycontroller.h +++ b/src/overlaycontroller.h @@ -35,7 +35,6 @@ #include "tabcontrollers/AudioTabController.h" #include "tabcontrollers/StatisticsTabController.h" #include "tabcontrollers/SettingsTabController.h" -#include "tabcontrollers/ReviveTabController.h" #include "tabcontrollers/UtilitiesTabController.h" #include "tabcontrollers/VideoTabController.h" @@ -65,7 +64,6 @@ namespace advsettings constexpr int k_audioSettingsUpdateCounter = 89; constexpr int k_chaperoneSettingsUpdateCounter = 101; constexpr int k_moveCenterSettingsUpdateCounter = 83; -constexpr int k_reviveSettingsUpdateCounter = 139; constexpr int k_settingsTabSettingsUpdateCounter = 157; constexpr int k_steamVrSettingsUpdateCounter = 97; constexpr int k_utilitiesSettingsUpdateCounter = 19; @@ -131,7 +129,6 @@ public: // I know it's an ugly hack to make them public to enable external AudioTabController m_audioTabController; StatisticsTabController m_statisticsTabController; SettingsTabController m_settingsTabController; - ReviveTabController m_reviveTabController; UtilitiesTabController m_utilitiesTabController; VideoTabController m_videoTabController; overlay::DesktopOverlay m_desktopOverlay; diff --git a/src/res/qml/RevivePage.qml b/src/res/qml/RevivePage.qml deleted file mode 100644 index bb4ee3f..0000000 --- a/src/res/qml/RevivePage.qml +++ /dev/null @@ -1,1096 +0,0 @@ -import QtQuick 2.7 -import QtQuick.Controls 2.0 -import QtQuick.Layouts 1.3 -import ovras.advsettings 1.0 -import "common" - -MyStackViewPage { - headerText: "Revive Settings" - - property bool componentCompleted: false - - content: ColumnLayout { - spacing: 12 - - - MyDialogOkPopup { - id: reviveMessageDialog - function showMessage(title, text) { - dialogTitle = title - dialogText = text - open() - } - } - - MyDialogOkCancelPopup { - id: reviveDeleteProfileDialog - property int profileIndex: -1 - dialogTitle: "Delete Profile" - dialogText: "Do you really want to delete this profile?" - onClosed: { - if (okClicked) { - ReviveTabController.deleteControllerProfile(profileIndex) - } - } - } - - MyDialogOkCancelPopup { - id: reviveNewProfileDialog - dialogTitle: "Create New Profile" - dialogContentItem: ColumnLayout { - RowLayout { - Layout.topMargin: 16 - Layout.leftMargin: 16 - Layout.rightMargin: 16 - MyText { - text: "Name: " - } - MyTextField { - id: reviveNewProfileName - keyBoardUID: 290 - color: "#cccccc" - text: "" - Layout.fillWidth: true - font.pointSize: 20 - function onInputEvent(input) { - reviveNewProfileName.text = input - } - } - } - } - onClosed: { - if (okClicked) { - if (reviveNewProfileName.text == "") { - reviveMessageDialog.showMessage("Create New Profile", "ERROR: Empty profile name.") - } else { - ReviveTabController.addControllerProfile(reviveNewProfileName.text) - } - - } - } - function openPopup() { - reviveNewProfileName.text = "" - open() - } - } - - - RowLayout { - MyToggleButton { - id: pixelsPerDisplayPixelToggle - text: "Render Target Override:" - Layout.preferredWidth: 350 - onCheckedChanged: { - ReviveTabController.setPixelsPerDisplayPixelOverrideEnabled(checked, false) - } - } - - MyPushButton2 { - text: "-" - Layout.preferredWidth: 40 - onClicked: { - pixelsPerDisplayPixelSlider.decrease() - } - } - - MySlider { - id: pixelsPerDisplayPixelSlider - from: 0.1 - to: 4.0 - stepSize: 0.1 - value: 1.0 - Layout.fillWidth: true - onPositionChanged: { - var val = this.from + ( this.position * (this.to - this.from)) - pixelsPerDisplayPixelText.text = val.toFixed(1) - } - onValueChanged: { - ReviveTabController.setPixelsPerDisplayPixelOverride(value.toFixed(1), false) - } - } - - MyPushButton2 { - text: "+" - Layout.preferredWidth: 40 - onClicked: { - pixelsPerDisplayPixelSlider.increase() - } - } - - MyTextField { - id: pixelsPerDisplayPixelText - text: "0.00" - keyBoardUID: 221 - Layout.preferredWidth: 100 - Layout.leftMargin: 10 - horizontalAlignment: Text.AlignHCenter - function onInputEvent(input) { - var val = parseFloat(input) - if (!isNaN(val)) { - if (val < 0.1) { - val = 0.1 - } - var v = val.toFixed(1) - if (v <= pixelsPerDisplayPixelSlider.to) { - pixelsPerDisplayPixelSlider.value = v - } else { - ReviveTabController.setPixelsPerDisplayPixelOverride(v, false) - } - } - text = ReviveTabController.pixelsPerDisplayPixelOverride.toFixed(1) - } - } - } - - RowLayout { - MyText { - text: "Grip Button Mode:" - Layout.preferredWidth: 250 - } - - MyComboBox { - id: gripButtonModeComboBox - Layout.preferredWidth: 250 - model: ["Normal Mode", "Toggle Mode", "Hybrid Mode"] - onCurrentIndexChanged: { - if (componentCompleted) { - ReviveTabController.setGripButtonMode(currentIndex, false) - } - } - } - - MyText { - Layout.preferredWidth: 150 - Layout.leftMargin: 25 - text: "Toggle Delay: " - } - - MyTextField { - id: toggleDelayText - text: "0.50" - keyBoardUID: 225 - Layout.preferredWidth: 100 - Layout.leftMargin: 25 - horizontalAlignment: Text.AlignHCenter - function onInputEvent(input) { - var val = parseFloat(input) - if (!isNaN(val)) { - if (val < 0.0) { - val = 0.0 - } - ReviveTabController.setToggleDelay(val.toFixed(2), false) - } - text = ReviveTabController.toggleDelay.toFixed(2) - } - } - - MyToggleButton { - id: triggerAsGripToggle - text: "Trigger As Grip" - Layout.preferredWidth: 250 - Layout.leftMargin: 25 - onCheckedChanged: { - ReviveTabController.setTriggerAsGrip(checked, false) - } - } - } - - GroupBox { - Layout.fillWidth: true - - label: MyText { - leftPadding: 10 - text: "Thumbstick Settings" - bottomPadding: -10 - } - background: Rectangle { - color: "transparent" - border.color: "#ffffff" - radius: 8 - } - ColumnLayout { - anchors.fill: parent - - Rectangle { - color: "#ffffff" - height: 1 - Layout.fillWidth: true - Layout.bottomMargin: 5 - } - - ColumnLayout { - - RowLayout { - MyText { - text: "Deadzone:" - Layout.rightMargin: 12 - } - - MyPushButton2 { - id: thumbDeadzoneMinusButton - Layout.preferredWidth: 40 - text: "-" - onClicked: { - thumbDeadzoneSlider.decrease() - } - } - - MySlider { - id: thumbDeadzoneSlider - from: 0.0 - to: 1.0 - stepSize: 0.01 - value: 0.5 - Layout.fillWidth: true - onPositionChanged: { - var val = this.from + ( this.position * (this.to - this.from)) - thumbDeadzoneText.text = val.toFixed(2) - } - onValueChanged: { - ReviveTabController.setThumbDeadzone(value.toFixed(2), false) - } - } - - MyPushButton2 { - id: thumbDeadzonePlusButton - Layout.preferredWidth: 40 - text: "+" - onClicked: { - thumbDeadzoneSlider.increase() - } - } - - MyTextField { - id: thumbDeadzoneText - text: "0.00" - keyBoardUID: 222 - Layout.preferredWidth: 100 - Layout.leftMargin: 10 - horizontalAlignment: Text.AlignHCenter - function onInputEvent(input) { - var val = parseFloat(input) - if (!isNaN(val)) { - if (val < 0.0) { - val = 0.0 - } else if (val > 1.0) { - val = 1.0 - } - var v = val.toFixed(2) - if (v <= thumbDeadzoneSlider.to) { - thumbDeadzoneSlider.value = v - } else { - ReviveTabController.setThumbDeadzone(v, false) - } - } - text = ReviveTabController.thumbDeadzone.toFixed(2) - } - } - } - - RowLayout { - MyText { - text: "Sensitivity:" - Layout.rightMargin: 12 - } - - MyPushButton2 { - id: thumbRangeMinusButton - Layout.preferredWidth: 40 - text: "-" - onClicked: { - thumbRangeSlider.value -= 0.1 - } - } - - MySlider { - id: thumbRangeSlider - from: 1.0 - to: 5.0 - stepSize: 0.01 - value: 2.0 - Layout.fillWidth: true - onPositionChanged: { - var val = this.from + ( this.position * (this.to - this.from)) - thumbRangeText.text = val.toFixed(2) - } - onValueChanged: { - ReviveTabController.setThumbRange(value.toFixed(2), false) - } - } - - MyPushButton2 { - id: thumbRangePlusButton - Layout.preferredWidth: 40 - text: "+" - onClicked: { - thumbRangeSlider.value += 0.1 - } - } - - MyTextField { - id: thumbRangeText - text: "0.00" - keyBoardUID: 223 - Layout.preferredWidth: 100 - Layout.leftMargin: 10 - horizontalAlignment: Text.AlignHCenter - function onInputEvent(input) { - var val = parseFloat(input) - if (!isNaN(val)) { - if (val < 0.01) { - val = 0.01 - } - var v = val.toFixed(2) - if (v <= thumbRangeSlider.to) { - thumbRangeSlider.value = v - } else { - ReviveTabController.setThumbRange(v, false) - } - } - text = ReviveTabController.thumbRange.toFixed(2) - } - } - } - } - } - } - - GroupBox { - Layout.fillWidth: true - - label: MyText { - leftPadding: 10 - text: "Controller Offsets" - bottomPadding: -10 - } - background: Rectangle { - color: "transparent" - border.color: "#ffffff" - radius: 8 - } - ColumnLayout { - anchors.fill: parent - - Rectangle { - color: "#ffffff" - height: 1 - Layout.fillWidth: true - Layout.bottomMargin: 5 - } - - GridLayout { - columns: 12 - - MyText { - text: "Yaw:" - Layout.fillWidth: true - horizontalAlignment: Text.AlignRight - Layout.rightMargin: 12 - } - - MyPushButton2 { - id: touchYawMinusButton - Layout.preferredWidth: 40 - text: "-" - onClicked: { - var val = ReviveTabController.touchYaw - 1.0 - if (val < -180.0) { - val = -180.0 - } - ReviveTabController.setTouchYaw(val.toFixed(1)) - } - } - - MyTextField { - id: touchYawInputField - text: "0.00" - keyBoardUID: 202 - Layout.preferredWidth: 140 - Layout.leftMargin: 10 - Layout.rightMargin: 10 - horizontalAlignment: Text.AlignHCenter - function onInputEvent(input) { - var val = parseFloat(input) - if (!isNaN(val)) { - if (val < -180.0) { - val = -180.0 - } else if (val > 180.0) { - val = 180.0 - } - var v = val.toFixed(1) - ReviveTabController.setTouchYaw(v, false) - text = v + "°" - } else { - text = ReviveTabController.touchYaw.toFixed(1) + "°" - } - } - } - - MyPushButton2 { - id: touchYawPlusButton - Layout.preferredWidth: 40 - text: "+" - onClicked: { - var val = ReviveTabController.touchYaw + 1.0 - if (val > 180.0) { - val = 180.0 - } - ReviveTabController.setTouchYaw(val.toFixed(1)) - } - } - - MyText { - text: "Pitch:" - horizontalAlignment: Text.AlignRight - Layout.preferredWidth: 80 - Layout.leftMargin: 12 - Layout.rightMargin: 12 - } - - MyPushButton2 { - id: touchPitchMinusButton - Layout.preferredWidth: 40 - text: "-" - onClicked: { - var val = ReviveTabController.touchPitch - 1.0 - if (val < -180.0) { - val = -180.0 - } - ReviveTabController.setTouchPitch(val.toFixed(1)) - } - } - - MyTextField { - id: touchPitchInputField - text: "0.00" - keyBoardUID: 201 - Layout.preferredWidth: 140 - Layout.leftMargin: 10 - Layout.rightMargin: 10 - horizontalAlignment: Text.AlignHCenter - function onInputEvent(input) { - var val = parseFloat(input) - if (!isNaN(val)) { - if (val < -180.0) { - val = -180.0 - } else if (val > 180.0) { - val = 180.0 - } - var v = val.toFixed(1) - ReviveTabController.setTouchPitch(v, false) - text = v + "°" - } else { - text = ReviveTabController.touchPitch.toFixed(1) + "°" - } - } - } - - MyPushButton2 { - id: touchPitchPlusButton - Layout.preferredWidth: 40 - text: "+" - onClicked: { - var val = ReviveTabController.touchPitch + 1.0 - if (val > 180.0) { - val = 180.0 - } - ReviveTabController.setTouchPitch(val.toFixed(1)) - } - } - - MyText { - text: "Roll:" - Layout.fillWidth: true - horizontalAlignment: Text.AlignRight - Layout.leftMargin: 12 - Layout.rightMargin: 12 - } - - MyPushButton2 { - id: touchRollMinusButton - Layout.preferredWidth: 40 - text: "-" - onClicked: { - var val = ReviveTabController.touchRoll - 1.0 - if (val < -180.0) { - val = -180.0 - } - ReviveTabController.setTouchRoll(val.toFixed(1)) - } - } - - MyTextField { - id: touchRollInputField - text: "0.00" - keyBoardUID: 203 - Layout.preferredWidth: 140 - Layout.leftMargin: 10 - Layout.rightMargin: 10 - horizontalAlignment: Text.AlignHCenter - function onInputEvent(input) { - var val = parseFloat(input) - if (!isNaN(val)) { - if (val < -180.0) { - val = -180.0 - } else if (val > 180.0) { - val = 180.0 - } - var v = val.toFixed(1) - ReviveTabController.setTouchRoll(v, false) - text = v + "°" - } else { - text = ReviveTabController.touchRoll.toFixed(1) + "°" - } - } - } - - MyPushButton2 { - id: touchRollPlusButton - Layout.preferredWidth: 40 - text: "+" - onClicked: { - var val = ReviveTabController.touchRoll + 1.0 - if (val > 180.0) { - val = 180.0 - } - ReviveTabController.setTouchRoll(val.toFixed(1)) - } - } - - MyText { - text: "X:" - horizontalAlignment: Text.AlignRight - Layout.preferredWidth: 80 - Layout.rightMargin: 12 - } - - MyPushButton2 { - id: touchXMinusButton - Layout.preferredWidth: 40 - text: "-" - onClicked: { - ReviveTabController.setTouchX((ReviveTabController.touchX - 0.005).toFixed(3)) - } - } - - MyTextField { - id: touchXInputField - text: "0.00" - keyBoardUID: 204 - Layout.preferredWidth: 140 - Layout.leftMargin: 10 - Layout.rightMargin: 10 - horizontalAlignment: Text.AlignHCenter - function onInputEvent(input) { - var val = parseFloat(input) - if (!isNaN(val)) { - var v = val.toFixed(3) - ReviveTabController.setTouchX(v, false) - text = v - } else { - text = ReviveTabController.touchX.toFixed(3) - } - } - } - - MyPushButton2 { - id: touchXPlusButton - Layout.preferredWidth: 40 - text: "+" - onClicked: { - ReviveTabController.setTouchX((ReviveTabController.touchX + 0.005).toFixed(3)) - } - } - - MyText { - text: "Y:" - Layout.fillWidth: true - horizontalAlignment: Text.AlignRight - Layout.leftMargin: 12 - Layout.rightMargin: 12 - } - - MyPushButton2 { - id: touchYMinusButton - Layout.preferredWidth: 40 - text: "-" - onClicked: { - ReviveTabController.setTouchY((ReviveTabController.touchY - 0.005).toFixed(3)) - } - } - - MyTextField { - id: touchYInputField - text: "0.00" - keyBoardUID: 205 - Layout.preferredWidth: 140 - Layout.leftMargin: 10 - Layout.rightMargin: 10 - horizontalAlignment: Text.AlignHCenter - function onInputEvent(input) { - var val = parseFloat(input) - if (!isNaN(val)) { - var v = val.toFixed(3) - ReviveTabController.setTouchY(v, false) - text = v - } else { - text = ReviveTabController.touchY.toFixed(3) - } - } - } - - MyPushButton2 { - id: touchYPlusButton - Layout.preferredWidth: 40 - text: "+" - onClicked: { - ReviveTabController.setTouchY((ReviveTabController.touchY + 0.005).toFixed(3)) - } - } - - MyText { - text: "Z:" - Layout.fillWidth: true - horizontalAlignment: Text.AlignRight - Layout.leftMargin: 12 - Layout.rightMargin: 12 - } - - MyPushButton2 { - id: touchZMinusButton - Layout.preferredWidth: 40 - text: "-" - onClicked: { - ReviveTabController.setTouchZ((ReviveTabController.touchZ - 0.005).toFixed(3)) - } - } - - MyTextField { - id: touchZInputField - text: "0.00" - keyBoardUID: 206 - Layout.preferredWidth: 140 - Layout.leftMargin: 10 - Layout.rightMargin: 10 - horizontalAlignment: Text.AlignHCenter - function onInputEvent(input) { - var val = parseFloat(input) - if (!isNaN(val)) { - var v = val.toFixed(3) - ReviveTabController.setTouchZ(v, false) - text = v - } else { - text = ReviveTabController.touchZ.toFixed(3) - } - } - } - - MyPushButton2 { - id: touchZPlusButton - Layout.preferredWidth: 40 - text: "+" - onClicked: { - ReviveTabController.setTouchZ((ReviveTabController.touchZ + 0.005).toFixed(3)) - } - } - } - } - } - - - MyDialogOkCancelPopup { - id: revivePersonalInfoDialog - property double playerHeight: 0.0 - property double eyeHeight: 0.0 - dialogWidth: 600 - dialogHeight: 480 - dialogTitle: "Personal Information" - dialogContentItem: GridLayout { - rowSpacing: 6 - columnSpacing: 18 - columns: 2 - MyText { - text: "Username:" - } - MyTextField { - id: rpidUsername - text: "0.00" - keyBoardUID: 211 - Layout.fillWidth: true - function onInputEvent(input) { - rpidUsername.text = input - } - } - MyText { - text: "Name:" - } - MyTextField { - id: rpidName - text: "0.00" - keyBoardUID: 212 - Layout.fillWidth: true - function onInputEvent(input) { - rpidName.text = input - } - } - MyText { - text: "Gender:" - } - MyComboBox { - id: rpidGender - Layout.fillWidth: true - currentIndex: 2 - model: ["Unknown", "Male", "Female"] - } - MyText { - text: "Player Height:" - } - RowLayout { - Item { - Layout.fillWidth: true - } - MyPushButton2 { - id: pridPlayerHeighMinusButton - Layout.preferredWidth: 40 - text: "-" - onClicked: { - if (revivePersonalInfoDialog.playerHeight > 0.01) { - revivePersonalInfoDialog.playerHeight = (revivePersonalInfoDialog.playerHeight - 0.01).toFixed(2) - } - pridPlayerHeighInputField.text = revivePersonalInfoDialog.playerHeight.toFixed(2) - } - } - MyTextField { - id: pridPlayerHeighInputField - text: "0.00" - keyBoardUID: 213 - Layout.preferredWidth: 120 - Layout.leftMargin: 10 - Layout.rightMargin: 10 - horizontalAlignment: Text.AlignHCenter - function onInputEvent(input) { - var val = parseFloat(input) - if (!isNaN(val)) { - if (val < 0.01) { - val = 0.01 - } - revivePersonalInfoDialog.playerHeight = val.toFixed(2) - text = val.toFixed(2) - } else { - text = val.toFixed(2) - } - } - } - MyPushButton2 { - id: pridPlayerHeighPlusButton - Layout.preferredWidth: 40 - text: "+" - onClicked: { - revivePersonalInfoDialog.playerHeight = (revivePersonalInfoDialog.playerHeight + 0.01).toFixed(2) - pridPlayerHeighInputField.text = revivePersonalInfoDialog.playerHeight.toFixed(2) - } - } - Item { - Layout.fillWidth: true - } - } - MyText { - text: "Eye Height:" - } - RowLayout { - Item { - Layout.fillWidth: true - } - MyPushButton2 { - id: pridEyeHeighMinusButton - Layout.preferredWidth: 40 - text: "-" - onClicked: { - if (revivePersonalInfoDialog.eyeHeight > 0.01) { - revivePersonalInfoDialog.eyeHeight = (revivePersonalInfoDialog.eyeHeight - 0.01).toFixed(2) - } - pridEyeHeighInputField.text = revivePersonalInfoDialog.eyeHeight.toFixed(2) - } - } - MyTextField { - id: pridEyeHeighInputField - text: "0.00" - keyBoardUID: 214 - Layout.preferredWidth: 120 - Layout.leftMargin: 10 - Layout.rightMargin: 10 - horizontalAlignment: Text.AlignHCenter - function onInputEvent(input) { - var val = parseFloat(input) - if (!isNaN(val)) { - if (val < 0.01) { - val = 0.01 - } - revivePersonalInfoDialog.eyeHeight = val.toFixed(2) - text = val.toFixed(2) - } else { - text = val.toFixed(2) - } - } - } - MyPushButton2 { - id: pridEyeHeighPlusButton - Layout.preferredWidth: 40 - text: "+" - onClicked: { - revivePersonalInfoDialog.eyeHeight = (revivePersonalInfoDialog.eyeHeight + 0.01).toFixed(2) - pridEyeHeighInputField.text = revivePersonalInfoDialog.eyeHeight.toFixed(2) - } - } - Item { - Layout.fillWidth: true - } - } - - Item { - Layout.fillWidth: true - } - - RowLayout { - Item { - Layout.fillWidth: true - } - MyPushButton { - id: reviveCalibrateHeightButton - Layout.preferredWidth: 230 - text: "Calibrate Height" - onClicked: { - var hmdHeight = ReviveTabController.getCurrentHMDHeight() - revivePersonalInfoDialog.eyeHeight = hmdHeight.toFixed(2) - pridEyeHeighInputField.text = revivePersonalInfoDialog.eyeHeight - revivePersonalInfoDialog.playerHeight = (hmdHeight + 0.103).toFixed(2) - pridPlayerHeighInputField.text = revivePersonalInfoDialog.playerHeight - } - } - Item { - Layout.fillWidth: true - } - } - - } - function openPopup() { - rpidUsername.text = ReviveTabController.piUsername - rpidName.text = ReviveTabController.piName - rpidGender.currentIndex = ReviveTabController.piGender - playerHeight = ReviveTabController.piPlayerHeight - pridPlayerHeighInputField.text = playerHeight.toFixed(2) - eyeHeight = ReviveTabController.piEyeHeight - pridEyeHeighInputField.text = eyeHeight.toFixed(2) - open() - } - onClosed: { - if (okClicked) { - ReviveTabController.setPiUsername(rpidUsername.text, false) - ReviveTabController.setPiName(rpidName.text, false) - ReviveTabController.setPiGender(rpidGender.currentIndex, false) - ReviveTabController.setPiPlayerHeight(playerHeight, false) - ReviveTabController.setPiEyeHeight(eyeHeight, false) - } - } - } - - - - ColumnLayout { - spacing: 8 - Layout.topMargin: 12 - Layout.bottomMargin: 8 - RowLayout { - spacing: 8 - - MyText { - Layout.preferredWidth: 347 - text: "Controller Profile:" - } - - MyComboBox { - id: reviveControllerProfileComboBox - Layout.maximumWidth: 557 - Layout.minimumWidth: 557 - Layout.preferredWidth: 557 - Layout.fillWidth: true - model: [""] - onCurrentIndexChanged: { - if (currentIndex > 0) { - reviveControllerApplyProfileButton.enabled = true - reviveControllerDeleteProfileButton.enabled = true - } else { - reviveControllerApplyProfileButton.enabled = false - reviveControllerDeleteProfileButton.enabled = false - } - } - } - - MyPushButton { - id: reviveControllerApplyProfileButton - enabled: false - Layout.preferredWidth: 200 - text: "Apply" - onClicked: { - if (reviveControllerProfileComboBox.currentIndex > 0) { - ReviveTabController.applyControllerProfile(reviveControllerProfileComboBox.currentIndex - 1) - reviveControllerProfileComboBox.currentIndex = 0 - } - } - } - } - RowLayout { - spacing: 8 - Item { - Layout.fillWidth: true - } - MyPushButton { - id: reviveControllerDeleteProfileButton - enabled: false - Layout.preferredWidth: 200 - text: "Delete Profile" - onClicked: { - if (reviveControllerProfileComboBox.currentIndex > 0) { - reviveDeleteProfileDialog.profileIndex = reviveControllerProfileComboBox.currentIndex - 1 - reviveDeleteProfileDialog.open() - } - } - } - MyPushButton { - Layout.preferredWidth: 200 - text: "New Profile" - onClicked: { - reviveNewProfileDialog.openPopup() - } - } - } - } - - - Item { - Layout.fillHeight: true - } - - RowLayout { - MyPushButton { - id: revivePersonalInfoButton - Layout.preferredWidth: 300 - text: "Personal Information" - onClicked: { - revivePersonalInfoDialog.openPopup() - } - } - - Item { - Layout.fillWidth: true - } - - MyPushButton { - id: reviveResetButton - Layout.preferredWidth: 200 - text: "Reset" - onClicked: { - ReviveTabController.reset() - } - } - } - - Component.onCompleted: { - pixelsPerDisplayPixelToggle.checked = ReviveTabController.pixelsPerDisplayPixelOverrideEnabled - var v = ReviveTabController.pixelsPerDisplayPixelOverride.toFixed(1) - if (v <= pixelsPerDisplayPixelSlider.to) { - pixelsPerDisplayPixelSlider.value = v - } - pixelsPerDisplayPixelText.text = v - - gripButtonModeComboBox.currentIndex = ReviveTabController.gripButtonMode - toggleDelayText.text = ReviveTabController.toggleDelay.toFixed(2) - - v = ReviveTabController.thumbDeadzone.toFixed(2) - if (v <= thumbDeadzoneSlider.to) { - thumbDeadzoneSlider.value = v - } - thumbDeadzoneText.text = v - - v = ReviveTabController.thumbRange.toFixed(2) - if (v <= thumbRangeSlider.to) { - thumbRangeSlider.value = v - } - thumbRangeText.text = v - - touchPitchInputField.text = ReviveTabController.touchPitch.toFixed(1) + "°" - touchYawInputField.text = ReviveTabController.touchYaw.toFixed(1) + "°" - touchRollInputField.text = ReviveTabController.touchRoll.toFixed(1) + "°" - touchXInputField.text = ReviveTabController.touchX.toFixed(3) - touchYInputField.text = ReviveTabController.touchY.toFixed(3) - touchZInputField.text = ReviveTabController.touchZ.toFixed(3) - reloadControllerProfiles() - componentCompleted = true - } - - Connections { - target: ReviveTabController - onGripButtonModeChanged : { - gripButtonModeComboBox.currentIndex = ReviveTabController.gripButtonMode - } - onToggleDelayChanged : { - toggleDelayText.text = ReviveTabController.toggleDelay.toFixed(2) - } - onPixelsPerDisplayPixelOverrideEnabledChanged : { - pixelsPerDisplayPixelToggle.checked = ReviveTabController.pixelsPerDisplayPixelOverrideEnabled - } - onPixelsPerDisplayPixelOverrideChanged : { - var v = ReviveTabController.pixelsPerDisplayPixelOverride.toFixed(1) - if (v <= pixelsPerDisplayPixelSlider.to) { - pixelsPerDisplayPixelSlider.value = v - } - pixelsPerDisplayPixelText.text = v - } - onThumbDeadzoneChanged : { - var v = ReviveTabController.thumbDeadzone.toFixed(2) - if (v <= thumbDeadzoneSlider.to) { - thumbDeadzoneSlider.value = v - } - thumbDeadzoneText.text = v - } - onThumbRangeChanged : { - var v = ReviveTabController.thumbRange.toFixed(2) - if (v >= thumbRangeSlider.from && v <= thumbRangeSlider.to) { - thumbRangeSlider.value = v - } - thumbRangeText.text = v - } - onTouchPitchChanged : { - touchPitchInputField.text = ReviveTabController.touchPitch.toFixed(1) + "°" - } - onTouchYawChanged : { - touchYawInputField.text = ReviveTabController.touchYaw.toFixed(1) + "°" - } - onTouchRollChanged : { - touchRollInputField.text = ReviveTabController.touchRoll.toFixed(1) + "°" - } - onTouchXChanged : { - touchXInputField.text = ReviveTabController.touchX.toFixed(3) - } - onTouchYChanged : { - touchYInputField.text = ReviveTabController.touchY.toFixed(3) - } - onTouchZChanged : { - touchZInputField.text = ReviveTabController.touchZ.toFixed(3) - } - onControllerProfilesUpdated: { - reloadControllerProfiles() - } - } - } - - function reloadControllerProfiles() { - var profiles = [""] - var profileCount = ReviveTabController.getControllerProfileCount() - for (var i = 0; i < profileCount; i++) { - profiles.push(ReviveTabController.getControllerProfileName(i)) - } - reviveControllerProfileComboBox.currentIndex = 0 - reviveControllerProfileComboBox.model = profiles - } -} diff --git a/src/res/qml/RootPage.qml b/src/res/qml/RootPage.qml index f0d2472..60d06fa 100644 --- a/src/res/qml/RootPage.qml +++ b/src/res/qml/RootPage.qml @@ -103,18 +103,6 @@ MyStackViewPage { } } - MyPushButton { - id: reviveButton - activationSoundEnabled: false - text: "Revive" - Layout.fillWidth: true - visible: SettingsTabController.forceRevivePage ? true : ReviveTabController.isOverlayInstalled - onClicked: { - MyResources.playFocusChangedSound() - mainView.push(revivePage) - } - } - MyPushButton { id: utilitiesButton activationSoundEnabled: false @@ -467,12 +455,6 @@ MyStackViewPage { } } - Connections { - target: SettingsTabController - onForceRevivePageChanged: { - reviveButton.visible = SettingsTabController.forceRevivePage ? true : ReviveTabController.isOverlayInstalled - } - } function updateStatistics() { var rotations = StatisticsTabController.hmdRotations diff --git a/src/res/qml/SettingsPage.qml b/src/res/qml/SettingsPage.qml index cdd11d2..69664f5 100644 --- a/src/res/qml/SettingsPage.qml +++ b/src/res/qml/SettingsPage.qml @@ -18,14 +18,6 @@ MyStackViewPage { } } - MyToggleButton { - id: forceReviveToggle - text: "Force Revive Page" - onCheckedChanged: { - SettingsTabController.setForceRevivePage(checked, true) - } - } - MyToggleButton { id: allowExternalEditsToggle text: "Allow External App Chaperone Edits (Danger)" @@ -111,7 +103,6 @@ MyStackViewPage { Component.onCompleted: { settingsAutoStartToggle.checked = SettingsTabController.autoStartEnabled - forceReviveToggle.checked = SettingsTabController.forceRevivePage allowExternalEditsToggle.checked = MoveCenterTabController.allowExternalEdits oldStyleMotionToggle.checked = MoveCenterTabController.oldStyleMotion @@ -129,9 +120,6 @@ MyStackViewPage { onAutoStartEnabledChanged: { settingsAutoStartToggle.checked = SettingsTabController.autoStartEnabled } - onForceRevivePageChanged: { - forceReviveToggle.checked = SettingsTabController.forceRevivePage - } } Connections { diff --git a/src/res/qml/SteamVRPage.qml b/src/res/qml/SteamVRPage.qml index 1c79fb7..0a990f3 100644 --- a/src/res/qml/SteamVRPage.qml +++ b/src/res/qml/SteamVRPage.qml @@ -200,12 +200,10 @@ MyStackViewPage { value: 1.0 snapMode: Slider.SnapAlways Layout.fillWidth: true - onPositionChanged: { - var val = this.from + ( this.position * (this.to - this.from)) - steamvrSupersamplingText.text = val.toFixed(1) - } onValueChanged: { - SteamVRTabController.setSuperSampling(this.value.toFixed(1), false) + var val = this.value + steamvrSupersamplingText.text = val.toFixed(1) + SteamVRTabController.setSuperSampling(this.value.toFixed(1), true) } } @@ -244,9 +242,11 @@ MyStackViewPage { } MyToggleButton { id: steamvrAllowSupersampleOverrideToggle - text: "Enable Manual Supersampling Override" + text: "Enable Manual Supersampling Override: (refresh dashboard to take effect)" onCheckedChanged: { SteamVRTabController.setAllowSupersampleOverride(this.checked, false) + SteamVRTabController.setSuperSampling(steamvrSupersamplingSlider.value, true) + steamvrSupersamplingText.text = SteamVRTabController.superSampling.toFixed(1) if(!this.checked){ steamvrSupersamplingText.enabled = false steamvrSupersamplingSlider.enabled = false @@ -333,13 +333,14 @@ MyStackViewPage { target: SteamVRTabController onSuperSamplingChanged: { var s1 = SteamVRTabController.superSampling.toFixed(1) - if (s1 <= steamvrSupersamplingSlider.to && Math.abs(steamvrSupersamplingSlider.value-s1) > 0.08) { - steamvrSupersamplingSlider.value = s1 - } + steamvrSupersamplingSlider.value = s1 steamvrSupersamplingText.text = s1 } onAllowSupersampleOverrideChanged: { steamvrAllowSupersampleOverrideToggle.checked = SteamVRTabController.allowSupersampleOverride + var s1 = SteamVRTabController.superSampling.toFixed(1) + steamvrSupersamplingSlider.value = s1 + steamvrSupersamplingText.text = s1 } onAllowSupersampleFilteringChanged: { steamvrAllowSupersampleFilteringToggle.checked = SteamVRTabController.allowSupersampleFiltering diff --git a/src/res/qml/common/mainwidget.qml b/src/res/qml/common/mainwidget.qml index 2e65164..7e8ce42 100644 --- a/src/res/qml/common/mainwidget.qml +++ b/src/res/qml/common/mainwidget.qml @@ -64,11 +64,6 @@ Rectangle { visible: false } - property RevivePage revivePage: RevivePage { - stackView: mainView - visible: false - } - property UtilitiesPage utilitiesPage: UtilitiesPage { stackView: mainView visible: false diff --git a/src/tabcontrollers/FixFloorTabController.cpp b/src/tabcontrollers/FixFloorTabController.cpp index 5d16263..959e735 100644 --- a/src/tabcontrollers/FixFloorTabController.cpp +++ b/src/tabcontrollers/FixFloorTabController.cpp @@ -10,7 +10,7 @@ void FixFloorTabController::initStage2( OverlayController* var_parent ) this->parent = var_parent; } -void FixFloorTabController::eventLoopTick( +void FixFloorTabController::dashboardLoopTick( vr::TrackedDevicePose_t* devicePoses ) { if ( state > 0 ) diff --git a/src/tabcontrollers/FixFloorTabController.h b/src/tabcontrollers/FixFloorTabController.h index 40dae91..9155c69 100644 --- a/src/tabcontrollers/FixFloorTabController.h +++ b/src/tabcontrollers/FixFloorTabController.h @@ -56,6 +56,7 @@ public: void initStage2( OverlayController* parent ); void eventLoopTick( vr::TrackedDevicePose_t* devicePoses ); + void dashboardLoopTick( vr::TrackedDevicePose_t* devicePoses ); Q_INVOKABLE QString currentStatusMessage(); Q_INVOKABLE float currentStatusMessageTimeout(); diff --git a/src/tabcontrollers/ReviveTabController.cpp b/src/tabcontrollers/ReviveTabController.cpp deleted file mode 100644 index 8683ead..0000000 --- a/src/tabcontrollers/ReviveTabController.cpp +++ /dev/null @@ -1,1335 +0,0 @@ -#include "ReviveTabController.h" -#include -#include "../overlaycontroller.h" - -// application namespace -namespace advsettings -{ -constexpr auto appkey_overlay = "revive.dashboard.overlay"; -constexpr auto section_revive = "revive"; -constexpr auto key_pixelsPerDisplayPixel = "pixelsPerDisplayPixel"; -constexpr auto key_toggleGrip = "ToggleGrip"; -constexpr auto key_triggerAsGrip = "TriggerAsGrip"; -constexpr auto key_toggleDelay = "ToggleDelay"; -constexpr auto key_thumbDeadzone = "ThumbDeadzone"; -constexpr auto key_thumbSensitivity = "ThumbSensitivity"; -constexpr auto key_touchPitch = "TouchPitch"; -constexpr auto key_touchYaw = "TouchYaw"; -constexpr auto key_touchRoll = "TouchRoll"; -constexpr auto key_touchX = "TouchX"; -constexpr auto key_touchY = "TouchY"; -constexpr auto key_touchZ = "TouchZ"; -constexpr auto key_playerHeight = "PlayerHeight"; -constexpr auto key_eyeHeight = "EyeHeight"; -constexpr auto key_piUser = "User"; -constexpr auto key_piName = "Name"; -constexpr auto key_piGender = "Gender"; - -void ReviveTabController::initStage1( bool forceRevivePage ) -{ - m_isOverlayInstalled - = vr::VRApplications()->IsApplicationInstalled( appkey_overlay ); - if ( m_isOverlayInstalled || forceRevivePage ) - { - vr::EVRSettingsError vrSettingsError; - - float valuef = vr::VRSettings()->GetFloat( - section_revive, key_pixelsPerDisplayPixel, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not read \"revive::" - << key_pixelsPerDisplayPixel << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - else - { - if ( valuef == 0.0f ) - { - m_pixelsPerDisplayPixelOverrideEnabled = false; - m_pixelsPerDisplayPixelOverride = 1.0; - } - else - { - m_pixelsPerDisplayPixelOverrideEnabled = true; - m_pixelsPerDisplayPixelOverride = valuef; - } - } - - int valuei = vr::VRSettings()->GetInt32( - section_revive, key_toggleGrip, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not read \"revive::" << key_toggleGrip - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - else - { - m_gripButtonMode = valuei; - } - - bool valueb = vr::VRSettings()->GetBool( - section_revive, key_triggerAsGrip, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not read \"revive::" << key_triggerAsGrip - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - else - { - m_triggerAsGrip = valueb; - } - - valuef = vr::VRSettings()->GetFloat( - section_revive, key_toggleDelay, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not read \"revive::" << key_toggleDelay - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - else - { - m_toggleDelay = valuef; - } - - valuef = vr::VRSettings()->GetFloat( - section_revive, key_thumbDeadzone, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not read \"revive::" << key_thumbDeadzone - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - else - { - m_thumbDeadzone = valuef; - } - - valuef = vr::VRSettings()->GetFloat( - section_revive, key_thumbSensitivity, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not read \"revive::" - << key_thumbSensitivity << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - else - { - m_thumbRange = valuef; - } - - valuef = vr::VRSettings()->GetFloat( - section_revive, key_touchPitch, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not read \"revive::" << key_touchPitch - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - else - { - m_touchPitch = valuef; - } - - valuef = vr::VRSettings()->GetFloat( - section_revive, key_touchYaw, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not read \"revive::" << key_touchYaw - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - else - { - m_touchYaw = valuef; - } - - valuef = vr::VRSettings()->GetFloat( - section_revive, key_touchRoll, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not read \"revive::" << key_touchRoll - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - else - { - m_touchRoll = valuef; - } - - valuef = vr::VRSettings()->GetFloat( - section_revive, key_touchX, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not read \"revive::" << key_touchX - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - else - { - m_touchX = valuef; - } - - valuef = vr::VRSettings()->GetFloat( - section_revive, key_touchY, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not read \"revive::" << key_touchY - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - else - { - m_touchY = valuef; - } - - valuef = vr::VRSettings()->GetFloat( - section_revive, key_touchZ, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not read \"revive::" << key_touchZ - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - else - { - m_touchZ = valuef; - } - - valuef = vr::VRSettings()->GetFloat( - section_revive, key_playerHeight, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not read \"revive::" << key_playerHeight - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - else - { - m_piPlayerHeight = valuef; - } - - valuef = vr::VRSettings()->GetFloat( - section_revive, key_eyeHeight, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not read \"revive::" << key_eyeHeight - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - else - { - m_piEyeHeight = valuef; - } - - char buffer[1024]; - vr::VRSettings()->GetString( - section_revive, key_piUser, buffer, 1024, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not read \"revive::" << key_piUser - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - else - { - m_piUsername = buffer; - } - - vr::VRSettings()->GetString( - section_revive, key_piName, buffer, 1024, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not read \"revive::" << key_piName - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - else - { - m_piName = buffer; - } - - vr::VRSettings()->GetString( - section_revive, key_piGender, buffer, 1024, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not read \"revive::" << key_piGender - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - else - { - if ( QString( buffer ).compare( "male", Qt::CaseInsensitive ) == 0 ) - { - m_piGender = 1; - } - else if ( QString( buffer ).compare( "female", Qt::CaseInsensitive ) - == 0 ) - { - m_piGender = 2; - } - else - { - m_piGender = 0; - } - } - - reloadControllerProfiles(); - } -} - -void ReviveTabController::initStage2( OverlayController* var_parent ) -{ - this->parent = var_parent; -} - -void ReviveTabController::eventLoopTick() -{ - if ( m_isOverlayInstalled - || parent->m_settingsTabController.forceRevivePage() ) - { - if ( settingsUpdateCounter >= k_reviveSettingsUpdateCounter ) - { - if ( parent->isDashboardVisible() ) - { - vr::EVRSettingsError vrSettingsError; - - float valuef - = vr::VRSettings()->GetFloat( section_revive, - key_pixelsPerDisplayPixel, - &vrSettingsError ); - if ( vrSettingsError == vr::VRSettingsError_None ) - { - if ( valuef == 0.0f ) - { - setPixelsPerDisplayPixelOverrideEnabled( false ); - } - else - { - setPixelsPerDisplayPixelOverrideEnabled( true ); - setPixelsPerDisplayPixelOverride( valuef ); - } - } - - int valuei = vr::VRSettings()->GetInt32( - section_revive, key_toggleGrip, &vrSettingsError ); - if ( vrSettingsError == vr::VRSettingsError_None ) - { - setGripButtonMode( valuei ); - } - - bool valueb = vr::VRSettings()->GetBool( - section_revive, key_triggerAsGrip, &vrSettingsError ); - if ( vrSettingsError == vr::VRSettingsError_None ) - { - setTriggerAsGrip( valueb ); - } - - valuef = vr::VRSettings()->GetFloat( - section_revive, key_toggleDelay, &vrSettingsError ); - if ( vrSettingsError == vr::VRSettingsError_None ) - { - setToggleDelay( valuef ); - } - - valuef = vr::VRSettings()->GetFloat( - section_revive, key_thumbDeadzone, &vrSettingsError ); - if ( vrSettingsError == vr::VRSettingsError_None ) - { - setThumbDeadzone( valuef ); - } - - valuef = vr::VRSettings()->GetFloat( - section_revive, key_thumbSensitivity, &vrSettingsError ); - if ( vrSettingsError == vr::VRSettingsError_None ) - { - setThumbRange( valuef ); - } - - valuef = vr::VRSettings()->GetFloat( - section_revive, key_touchPitch, &vrSettingsError ); - if ( vrSettingsError == vr::VRSettingsError_None ) - { - setTouchPitch( valuef ); - } - - valuef = vr::VRSettings()->GetFloat( - section_revive, key_touchYaw, &vrSettingsError ); - if ( vrSettingsError == vr::VRSettingsError_None ) - { - setTouchYaw( valuef ); - } - - valuef = vr::VRSettings()->GetFloat( - section_revive, key_touchRoll, &vrSettingsError ); - if ( vrSettingsError == vr::VRSettingsError_None ) - { - setTouchRoll( valuef ); - } - - valuef = vr::VRSettings()->GetFloat( - section_revive, key_touchX, &vrSettingsError ); - if ( vrSettingsError == vr::VRSettingsError_None ) - { - setTouchX( valuef ); - } - - valuef = vr::VRSettings()->GetFloat( - section_revive, key_touchY, &vrSettingsError ); - if ( vrSettingsError == vr::VRSettingsError_None ) - { - setTouchY( valuef ); - } - - valuef = vr::VRSettings()->GetFloat( - section_revive, key_touchZ, &vrSettingsError ); - if ( vrSettingsError == vr::VRSettingsError_None ) - { - setTouchZ( valuef ); - } - - valuef = vr::VRSettings()->GetFloat( - section_revive, key_playerHeight, &vrSettingsError ); - if ( vrSettingsError == vr::VRSettingsError_None ) - { - setPiPlayerHeight( valuef ); - } - - valuef = vr::VRSettings()->GetFloat( - section_revive, key_eyeHeight, &vrSettingsError ); - if ( vrSettingsError == vr::VRSettingsError_None ) - { - setPiEyeHeight( valuef ); - } - - char buffer[1024]; - vr::VRSettings()->GetString( section_revive, - key_piUser, - buffer, - 1024, - &vrSettingsError ); - if ( vrSettingsError == vr::VRSettingsError_None ) - { - setPiUsername( buffer ); - } - - vr::VRSettings()->GetString( section_revive, - key_piName, - buffer, - 1024, - &vrSettingsError ); - if ( vrSettingsError == vr::VRSettingsError_None ) - { - setPiName( buffer ); - } - - vr::VRSettings()->GetString( section_revive, - key_piGender, - buffer, - 1024, - &vrSettingsError ); - if ( vrSettingsError == vr::VRSettingsError_None ) - { - if ( QString( buffer ).compare( "male", - Qt::CaseInsensitive ) - == 0 ) - { - valuei = 1; - } - else if ( QString( buffer ).compare( "female", - Qt::CaseInsensitive ) - == 0 ) - { - valuei = 2; - } - else - { - valuei = 0; - } - setPiGender( valuei ); - } - } - settingsUpdateCounter = 0; - } - else - { - settingsUpdateCounter++; - } - } -} - -bool ReviveTabController::isOverlayInstalled() const -{ - return m_isOverlayInstalled; -} - -int ReviveTabController::gripButtonMode() const -{ - return m_gripButtonMode; -} - -bool ReviveTabController::triggerAsGrip() const -{ - return m_triggerAsGrip; -} - -float ReviveTabController::toggleDelay() const -{ - return m_toggleDelay; -} - -bool ReviveTabController::isPixelsPerDisplayPixelOverrideEnabled() const -{ - return m_pixelsPerDisplayPixelOverrideEnabled; -} - -float ReviveTabController::pixelsPerDisplayPixelOverride() const -{ - return m_pixelsPerDisplayPixelOverride; -} - -float ReviveTabController::thumbDeadzone() const -{ - return m_thumbDeadzone; -} - -float ReviveTabController::thumbRange() const -{ - return m_thumbRange; -} - -float ReviveTabController::touchPitch() const -{ - return m_touchPitch; -} - -float ReviveTabController::touchYaw() const -{ - return m_touchYaw; -} - -float ReviveTabController::touchRoll() const -{ - return m_touchRoll; -} - -float ReviveTabController::touchX() const -{ - return m_touchX; -} - -float ReviveTabController::touchY() const -{ - return m_touchY; -} - -float ReviveTabController::touchZ() const -{ - return m_touchZ; -} - -float ReviveTabController::piPlayerHeight() const -{ - return m_piPlayerHeight; -} - -float ReviveTabController::piEyeHeight() const -{ - return m_piEyeHeight; -} - -const QString& ReviveTabController::piUsername() const -{ - return m_piUsername; -} - -const QString& ReviveTabController::piName() const -{ - return m_piName; -} - -int ReviveTabController::piGender() const -{ - return m_piGender; -} - -void ReviveTabController::setGripButtonMode( int value, bool notify ) -{ - if ( m_gripButtonMode != value ) - { - m_gripButtonMode = value; - vr::EVRSettingsError vrSettingsError; - vr::VRSettings()->SetInt32( section_revive, - key_toggleGrip, - m_gripButtonMode, - &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not set \"revive::" << key_toggleGrip - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - vr::VRSettings()->Sync(); - if ( notify ) - { - emit gripButtonModeChanged( m_gripButtonMode ); - } - } -} - -void ReviveTabController::setTriggerAsGrip( bool value, bool notify ) -{ - if ( m_triggerAsGrip != value ) - { - m_triggerAsGrip = value; - vr::EVRSettingsError vrSettingsError; - vr::VRSettings()->SetBool( section_revive, - key_triggerAsGrip, - m_triggerAsGrip, - &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not set \"revive::" << key_toggleGrip - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - vr::VRSettings()->Sync(); - if ( notify ) - { - emit triggerAsGripChanged( m_triggerAsGrip ); - } - } -} - -void ReviveTabController::setToggleDelay( float value, bool notify ) -{ - if ( m_toggleDelay != value ) - { - m_toggleDelay = value; - vr::EVRSettingsError vrSettingsError; - vr::VRSettings()->SetFloat( - section_revive, key_toggleDelay, m_toggleDelay, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not set \"revive::" << key_toggleDelay - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - vr::VRSettings()->Sync(); - if ( notify ) - { - emit toggleDelayChanged( m_toggleDelay ); - } - } -} - -void ReviveTabController::setPixelsPerDisplayPixelOverrideEnabled( bool value, - bool notify ) -{ - if ( m_pixelsPerDisplayPixelOverrideEnabled != value ) - { - m_pixelsPerDisplayPixelOverrideEnabled = value; - if ( m_pixelsPerDisplayPixelOverrideEnabled ) - { - vr::EVRSettingsError vrSettingsError; - vr::VRSettings()->SetFloat( section_revive, - key_pixelsPerDisplayPixel, - m_pixelsPerDisplayPixelOverride, - &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) - << "Could not set \"revive::" << key_pixelsPerDisplayPixel - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - } - else - { - vr::EVRSettingsError vrSettingsError; - vr::VRSettings()->RemoveKeyInSection( - section_revive, key_pixelsPerDisplayPixel, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) - << "Could not remove \"revive::" - << key_pixelsPerDisplayPixel << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - } - vr::VRSettings()->Sync(); - if ( notify ) - { - emit pixelsPerDisplayPixelOverrideEnabledChanged( - m_pixelsPerDisplayPixelOverrideEnabled ); - } - } -} - -void ReviveTabController::setPixelsPerDisplayPixelOverride( float value, - bool notify ) -{ - if ( m_pixelsPerDisplayPixelOverride != value ) - { - m_pixelsPerDisplayPixelOverride = value; - if ( m_pixelsPerDisplayPixelOverrideEnabled ) - { - vr::EVRSettingsError vrSettingsError; - vr::VRSettings()->SetFloat( section_revive, - key_pixelsPerDisplayPixel, - m_pixelsPerDisplayPixelOverride, - &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) - << "Could not set \"revive::" << key_pixelsPerDisplayPixel - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - vr::VRSettings()->Sync(); - } - if ( notify ) - { - emit pixelsPerDisplayPixelOverrideChanged( - m_pixelsPerDisplayPixelOverride ); - } - } -} - -void ReviveTabController::setThumbDeadzone( float value, bool notify ) -{ - if ( m_thumbDeadzone != value ) - { - m_thumbDeadzone = value; - vr::EVRSettingsError vrSettingsError; - vr::VRSettings()->SetFloat( section_revive, - key_thumbDeadzone, - m_thumbDeadzone, - &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not set \"revive::" << key_thumbDeadzone - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - vr::VRSettings()->Sync(); - if ( notify ) - { - emit thumbDeadzoneChanged( m_thumbDeadzone ); - } - } -} - -void ReviveTabController::setThumbRange( float value, bool notify ) -{ - if ( m_thumbRange != value ) - { - m_thumbRange = value; - vr::EVRSettingsError vrSettingsError; - vr::VRSettings()->SetFloat( section_revive, - key_thumbSensitivity, - m_thumbRange, - &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not set \"revive::" << key_thumbSensitivity - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - vr::VRSettings()->Sync(); - if ( notify ) - { - emit thumbRangeChanged( m_thumbRange ); - } - } -} - -void ReviveTabController::setTouchPitch( float value, bool notify ) -{ - if ( m_touchPitch != value ) - { - m_touchPitch = value; - vr::EVRSettingsError vrSettingsError; - vr::VRSettings()->SetFloat( - section_revive, key_touchPitch, m_touchPitch, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not set \"revive::" << key_touchPitch - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - vr::VRSettings()->Sync(); - if ( notify ) - { - emit touchPitchChanged( m_touchPitch ); - } - } -} - -void ReviveTabController::setTouchYaw( float value, bool notify ) -{ - if ( m_touchYaw != value ) - { - m_touchYaw = value; - vr::EVRSettingsError vrSettingsError; - vr::VRSettings()->SetFloat( - section_revive, key_touchYaw, m_touchYaw, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not set \"revive::" << key_touchYaw - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - vr::VRSettings()->Sync(); - if ( notify ) - { - emit touchYawChanged( m_touchYaw ); - } - } -} - -void ReviveTabController::setTouchRoll( float value, bool notify ) -{ - if ( m_touchRoll != value ) - { - m_touchRoll = value; - vr::EVRSettingsError vrSettingsError; - vr::VRSettings()->SetFloat( - section_revive, key_touchRoll, m_touchRoll, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not set \"revive::" << key_touchRoll - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - vr::VRSettings()->Sync(); - if ( notify ) - { - emit touchRollChanged( m_touchRoll ); - } - } -} - -void ReviveTabController::setTouchX( float value, bool notify ) -{ - if ( m_touchX != value ) - { - m_touchX = value; - vr::EVRSettingsError vrSettingsError; - vr::VRSettings()->SetFloat( - section_revive, key_touchX, m_touchX, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not set \"revive::" << key_touchX - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - vr::VRSettings()->Sync(); - if ( notify ) - { - emit touchXChanged( m_touchX ); - } - } -} - -void ReviveTabController::setTouchY( float value, bool notify ) -{ - if ( m_touchY != value ) - { - m_touchY = value; - vr::EVRSettingsError vrSettingsError; - vr::VRSettings()->SetFloat( - section_revive, key_touchY, m_touchY, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not set \"revive::" << key_touchY - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - vr::VRSettings()->Sync(); - if ( notify ) - { - emit touchYChanged( m_touchY ); - } - } -} - -void ReviveTabController::setTouchZ( float value, bool notify ) -{ - if ( m_touchZ != value ) - { - m_touchZ = value; - vr::EVRSettingsError vrSettingsError; - vr::VRSettings()->SetFloat( - section_revive, key_touchZ, m_touchZ, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not set \"revive::" << key_touchZ - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - vr::VRSettings()->Sync(); - if ( notify ) - { - emit touchZChanged( m_touchZ ); - } - } -} - -void ReviveTabController::setPiPlayerHeight( float value, bool notify ) -{ - if ( m_piPlayerHeight != value ) - { - m_piPlayerHeight = value; - vr::EVRSettingsError vrSettingsError; - vr::VRSettings()->SetFloat( section_revive, - key_playerHeight, - m_piPlayerHeight, - &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not set \"revive::" << key_playerHeight - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - vr::VRSettings()->Sync(); - if ( notify ) - { - emit piPlayerHeightChanged( m_piPlayerHeight ); - } - } -} - -void ReviveTabController::setPiEyeHeight( float value, bool notify ) -{ - if ( m_piEyeHeight != value ) - { - m_piEyeHeight = value; - vr::EVRSettingsError vrSettingsError; - vr::VRSettings()->SetFloat( - section_revive, key_eyeHeight, m_piEyeHeight, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not set \"revive::" << key_eyeHeight - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - vr::VRSettings()->Sync(); - if ( notify ) - { - emit piEyeHeightChanged( m_piEyeHeight ); - } - } -} - -void ReviveTabController::setPiUsername( const QString& value, bool notify ) -{ - if ( m_piUsername.compare( value ) != 0 ) - { - m_piUsername = value; - vr::EVRSettingsError vrSettingsError; - vr::VRSettings()->SetString( section_revive, - key_piUser, - m_piUsername.toStdString().c_str(), - &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not set \"revive::" << key_piUser - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - vr::VRSettings()->Sync(); - if ( notify ) - { - emit piUsernameChanged( m_piUsername ); - } - } -} - -void ReviveTabController::setPiName( const QString& value, bool notify ) -{ - if ( m_piName.compare( value ) != 0 ) - { - m_piName = value; - vr::EVRSettingsError vrSettingsError; - vr::VRSettings()->SetString( section_revive, - key_piName, - m_piName.toStdString().c_str(), - &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not set \"revive::" << key_piName - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - vr::VRSettings()->Sync(); - if ( notify ) - { - emit piNameChanged( m_piName ); - } - } -} - -void ReviveTabController::setPiGender( int value, bool notify ) -{ - if ( m_piGender != value ) - { - m_piGender = value; - vr::EVRSettingsError vrSettingsError; - const char* txt; - switch ( value ) - { - case 1: - txt = static_cast( "Male" ); - break; - case 2: - txt = static_cast( "Female" ); - break; - default: - txt = static_cast( "Unknown" ); - break; - } - vr::VRSettings()->SetString( - section_revive, key_piGender, txt, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not set \"revive::" << key_piGender - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - vr::VRSettings()->Sync(); - if ( notify ) - { - emit piGenderChanged( m_piGender ); - } - } -} - -void ReviveTabController::reset() -{ - vr::EVRSettingsError vrSettingsError; - - vr::VRSettings()->RemoveKeyInSection( - section_revive, key_pixelsPerDisplayPixel, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not remove \"revive::" - << key_pixelsPerDisplayPixel << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - - vr::VRSettings()->RemoveKeyInSection( - section_revive, key_toggleGrip, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not remove \"revive::" << key_toggleGrip - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - - vr::VRSettings()->RemoveKeyInSection( - section_revive, key_triggerAsGrip, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not remove \"revive::" << key_triggerAsGrip - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - - vr::VRSettings()->RemoveKeyInSection( - section_revive, key_toggleDelay, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not remove \"revive::" << key_toggleDelay - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - - vr::VRSettings()->RemoveKeyInSection( - section_revive, key_thumbDeadzone, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not remove \"revive::" << key_thumbDeadzone - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - - vr::VRSettings()->RemoveKeyInSection( - section_revive, key_thumbSensitivity, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not remove \"revive::" << key_thumbSensitivity - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - - vr::VRSettings()->RemoveKeyInSection( - section_revive, key_touchPitch, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not remove \"revive::" << key_touchPitch - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - - vr::VRSettings()->RemoveKeyInSection( - section_revive, key_touchYaw, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not remove \"revive::" << key_touchYaw - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - - vr::VRSettings()->RemoveKeyInSection( - section_revive, key_touchRoll, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not remove \"revive::" << key_touchRoll - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - - vr::VRSettings()->RemoveKeyInSection( - section_revive, key_touchX, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not remove \"revive::" << key_touchX - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - - vr::VRSettings()->RemoveKeyInSection( - section_revive, key_touchY, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not remove \"revive::" << key_touchY - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - - vr::VRSettings()->RemoveKeyInSection( - section_revive, key_touchZ, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) << "Could not remove \"revive::" << key_touchZ - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - - vr::VRSettings()->Sync(); - settingsUpdateCounter = 999; // Easiest way to get default values -} - -float ReviveTabController::getCurrentHMDHeight() -{ - float hmdHeight = 0.0f; - vr::TrackedDevicePose_t devicePoses[vr::k_unMaxTrackedDeviceCount]; - vr::VRSystem()->GetDeviceToAbsoluteTrackingPose( - vr::TrackingUniverseStanding, - 0.0f, - devicePoses, - vr::k_unMaxTrackedDeviceCount ); - vr::TrackedDevicePose_t& hmdPose - = devicePoses[vr::k_unTrackedDeviceIndex_Hmd]; - if ( hmdPose.eTrackingResult == vr::TrackingResult_Running_OK ) - { - hmdHeight = hmdPose.mDeviceToAbsoluteTracking.m[1][3]; - } - else - { - LOG( WARNING ) << "Error while getting HMD pose: Tracking result (" - << hmdPose.eTrackingResult - << ") is not TrackingResult_Running_OK"; - } - return hmdHeight; -} - -void ReviveTabController::reloadControllerProfiles() -{ - controllerProfiles.clear(); - auto settings = OverlayController::appSettings(); - settings->beginGroup( "reviveSettings" ); - auto profileCount = settings->beginReadArray( "controllerProfiles" ); - for ( int i = 0; i < profileCount; i++ ) - { - settings->setArrayIndex( i ); - controllerProfiles.emplace_back(); - auto& entry = controllerProfiles[static_cast( i )]; - entry.profileName - = settings->value( "profileName" ).toString().toStdString(); - entry.gripButtonMode = settings->value( "gripButtonMode", 0 ).toInt(); - entry.triggerAsGrip = settings->value( "triggerAsGrip", 0 ).toBool(); - entry.thumbDeadzone - = settings->value( "thumbDeadzone", 0.3f ).toFloat(); - entry.thumbRange = settings->value( "thumbRange", 2.0f ).toFloat(); - entry.touchPitch = settings->value( "touchPitch", -28.0f ).toFloat(); - entry.touchYaw = settings->value( "touchYaw", 0.0f ).toFloat(); - entry.touchRoll = settings->value( "touchRoll", -14.0f ).toFloat(); - entry.touchX = settings->value( "touchX", 0.016f ).toFloat(); - entry.touchY = settings->value( "touchY", 0.0f ).toFloat(); - entry.touchZ = settings->value( "touchZ", 0.016f ).toFloat(); - } - settings->endArray(); - settings->endGroup(); -} - -void ReviveTabController::saveControllerProfiles() -{ - auto settings = OverlayController::appSettings(); - settings->beginGroup( "reviveSettings" ); - settings->beginWriteArray( "controllerProfiles" ); - unsigned i = 0; - for ( auto& p : controllerProfiles ) - { - settings->setArrayIndex( static_cast( i ) ); - settings->setValue( "profileName", - QString::fromStdString( p.profileName ) ); - settings->setValue( "gripButtonMode", p.gripButtonMode ); - settings->setValue( "triggerAsGrip", p.triggerAsGrip ); - settings->setValue( "thumbDeadzone", p.thumbDeadzone ); - settings->setValue( "thumbRange", p.thumbRange ); - settings->setValue( "touchPitch", p.touchPitch ); - settings->setValue( "touchYaw", p.touchYaw ); - settings->setValue( "touchRoll", p.touchRoll ); - settings->setValue( "touchX", p.touchX ); - settings->setValue( "touchY", p.touchY ); - settings->setValue( "touchZ", p.touchZ ); - i++; - } - settings->endArray(); - settings->endGroup(); -} - -Q_INVOKABLE unsigned ReviveTabController::getControllerProfileCount() -{ - return static_cast( controllerProfiles.size() ); -} - -Q_INVOKABLE QString - ReviveTabController::getControllerProfileName( unsigned index ) -{ - if ( index >= controllerProfiles.size() ) - { - return QString(); - } - else - { - return QString::fromStdString( controllerProfiles[index].profileName ); - } -} - -void ReviveTabController::addControllerProfile( QString name ) -{ - ReviveControllerProfile* profile = nullptr; - for ( auto& p : controllerProfiles ) - { - if ( p.profileName.compare( name.toStdString() ) == 0 ) - { - profile = &p; - break; - } - } - if ( !profile ) - { - auto i = controllerProfiles.size(); - controllerProfiles.emplace_back(); - profile = &controllerProfiles[i]; - } - profile->profileName = name.toStdString(); - profile->gripButtonMode = gripButtonMode(); - profile->triggerAsGrip = triggerAsGrip(); - profile->thumbDeadzone = thumbDeadzone(); - profile->thumbRange = thumbRange(); - profile->touchPitch = touchPitch(); - profile->touchYaw = touchYaw(); - profile->touchRoll = touchRoll(); - profile->touchX = touchX(); - profile->touchY = touchY(); - profile->touchZ = touchZ(); - saveControllerProfiles(); - OverlayController::appSettings()->sync(); - emit controllerProfilesUpdated(); -} - -void ReviveTabController::applyControllerProfile( unsigned index ) -{ - if ( index < controllerProfiles.size() ) - { - auto& profile = controllerProfiles[index]; - setGripButtonMode( profile.gripButtonMode ); - setTriggerAsGrip( profile.triggerAsGrip ); - setThumbDeadzone( profile.thumbDeadzone ); - setThumbRange( profile.thumbRange ); - setTouchPitch( profile.touchPitch ); - setTouchYaw( profile.touchYaw ); - setTouchRoll( profile.touchRoll ); - setTouchX( profile.touchX ); - setTouchY( profile.touchY ); - setTouchZ( profile.touchZ ); - } -} - -void ReviveTabController::deleteControllerProfile( unsigned index ) -{ - if ( index < controllerProfiles.size() ) - { - auto pos = controllerProfiles.begin() + index; - controllerProfiles.erase( pos ); - saveControllerProfiles(); - OverlayController::appSettings()->sync(); - emit controllerProfilesUpdated(); - } -} - -} // namespace advsettings diff --git a/src/tabcontrollers/ReviveTabController.h b/src/tabcontrollers/ReviveTabController.h deleted file mode 100644 index 0cf1a7e..0000000 --- a/src/tabcontrollers/ReviveTabController.h +++ /dev/null @@ -1,199 +0,0 @@ - -#pragma once - -#include - -class QQuickWindow; -// application namespace -namespace advsettings -{ -// forward declaration -class OverlayController; - -struct ReviveControllerProfile -{ - std::string profileName; - int gripButtonMode; - bool triggerAsGrip; - float thumbDeadzone; - float thumbRange; - float touchPitch; - float touchYaw; - float touchRoll; - float touchX; - float touchY; - float touchZ; -}; - -class ReviveTabController : public QObject -{ - Q_OBJECT - Q_PROPERTY( int isOverlayInstalled READ isOverlayInstalled NOTIFY - isOverlayInstalledChanged ) - Q_PROPERTY( int gripButtonMode READ gripButtonMode WRITE setGripButtonMode - NOTIFY gripButtonModeChanged ) - Q_PROPERTY( int triggerAsGrip READ triggerAsGrip WRITE setTriggerAsGrip - NOTIFY triggerAsGripChanged ) - Q_PROPERTY( bool pixelsPerDisplayPixelOverrideEnabled READ - isPixelsPerDisplayPixelOverrideEnabled WRITE - setPixelsPerDisplayPixelOverrideEnabled NOTIFY - pixelsPerDisplayPixelOverrideEnabledChanged ) - Q_PROPERTY( float toggleDelay READ toggleDelay WRITE setToggleDelay NOTIFY - toggleDelayChanged ) - Q_PROPERTY( - float pixelsPerDisplayPixelOverride READ pixelsPerDisplayPixelOverride - WRITE setPixelsPerDisplayPixelOverride NOTIFY - pixelsPerDisplayPixelOverrideChanged ) - Q_PROPERTY( float thumbDeadzone READ thumbDeadzone WRITE setThumbDeadzone - NOTIFY thumbDeadzoneChanged ) - Q_PROPERTY( float thumbRange READ thumbRange WRITE setThumbRange NOTIFY - thumbRangeChanged ) - Q_PROPERTY( float touchPitch READ touchPitch WRITE setTouchPitch NOTIFY - touchPitchChanged ) - Q_PROPERTY( - float touchYaw READ touchYaw WRITE setTouchYaw NOTIFY touchYawChanged ) - Q_PROPERTY( float touchRoll READ touchRoll WRITE setTouchRoll NOTIFY - touchRollChanged ) - Q_PROPERTY( float touchX READ touchX WRITE setTouchX NOTIFY touchXChanged ) - Q_PROPERTY( float touchY READ touchY WRITE setTouchY NOTIFY touchYChanged ) - Q_PROPERTY( float touchZ READ touchZ WRITE setTouchZ NOTIFY touchZChanged ) - Q_PROPERTY( float piPlayerHeight READ piPlayerHeight WRITE setPiPlayerHeight - NOTIFY piPlayerHeightChanged ) - Q_PROPERTY( float piEyeHeight READ piEyeHeight WRITE setPiEyeHeight NOTIFY - piEyeHeightChanged ) - Q_PROPERTY( QString piUsername READ piUsername WRITE setPiUsername NOTIFY - piUsernameChanged ) - Q_PROPERTY( - QString piName READ piName WRITE setPiName NOTIFY piNameChanged ) - Q_PROPERTY( - int piGender READ piGender WRITE setPiGender NOTIFY piGenderChanged ) - -private: - OverlayController* parent; - - bool m_isOverlayInstalled = false; - int m_gripButtonMode = 0; - float m_toggleDelay = 0.5f; - bool m_triggerAsGrip = false; - bool m_pixelsPerDisplayPixelOverrideEnabled = false; - float m_pixelsPerDisplayPixelOverride = 1.0f; - float m_thumbDeadzone = 0.3f; - float m_thumbRange = 2.0f; - float m_touchPitch = -28.0f; - float m_touchYaw = 0.0f; - float m_touchRoll = -14.0f; - float m_touchX = 0.016f; - float m_touchY = -0.036f; - float m_touchZ = 0.016f; - float m_piPlayerHeight = 1.778f; - float m_piEyeHeight = 1.675f; - QString m_piUsername = ""; - QString m_piName = ""; - int m_piGender = 0; // 0 .. Unknown, 1 .. Male, 2 .. Female - - unsigned settingsUpdateCounter = 0; - - std::vector controllerProfiles; - -public: - void initStage1( bool forceRevivePage ); - void initStage2( OverlayController* parent ); - - void eventLoopTick(); - - bool isOverlayInstalled() const; - - int gripButtonMode() const; - bool triggerAsGrip() const; - float toggleDelay() const; - - bool isPixelsPerDisplayPixelOverrideEnabled() const; - float pixelsPerDisplayPixelOverride() const; - - float thumbDeadzone() const; - float thumbRange() const; - - float touchPitch() const; - float touchYaw() const; - float touchRoll() const; - float touchX() const; - float touchY() const; - float touchZ() const; - - float piPlayerHeight() const; - float piEyeHeight() const; - const QString& piUsername() const; - const QString& piName() const; - int piGender() const; // 0 .. Unknown, 1 .. Male, 2 .. Female - - Q_INVOKABLE float getCurrentHMDHeight(); - - void reloadControllerProfiles(); - void saveControllerProfiles(); - - Q_INVOKABLE unsigned getControllerProfileCount(); - Q_INVOKABLE QString getControllerProfileName( unsigned index ); - -public slots: - void setGripButtonMode( int value, bool notify = true ); - void setTriggerAsGrip( bool value, bool notify = true ); - void setToggleDelay( float value, bool notify = true ); - - void setPixelsPerDisplayPixelOverrideEnabled( bool value, - bool notify = true ); - void setPixelsPerDisplayPixelOverride( float value, bool notify = true ); - - void setThumbDeadzone( float value, bool notify = true ); - void setThumbRange( float value, bool notify = true ); - - void setTouchPitch( float value, bool notify = true ); - void setTouchYaw( float value, bool notify = true ); - void setTouchRoll( float value, bool notify = true ); - void setTouchX( float value, bool notify = true ); - void setTouchY( float value, bool notify = true ); - void setTouchZ( float value, bool notify = true ); - - void setPiPlayerHeight( float value, bool notify = true ); - void setPiEyeHeight( float value, bool notify = true ); - void setPiUsername( const QString& value, bool notify = true ); - void setPiName( const QString& value, bool notify = true ); - void setPiGender( int value, - bool notify - = true ); // 0 .. Unknown, 1 .. Male, 2 .. Female - - void addControllerProfile( QString name ); - void applyControllerProfile( unsigned index ); - void deleteControllerProfile( unsigned index ); - - void reset(); - -signals: - void isOverlayInstalledChanged( bool value ); - - void gripButtonModeChanged( int value ); - void triggerAsGripChanged( bool value ); - void toggleDelayChanged( float value ); - - void pixelsPerDisplayPixelOverrideEnabledChanged( bool value ); - void pixelsPerDisplayPixelOverrideChanged( float value ); - - void thumbDeadzoneChanged( float value ); - void thumbRangeChanged( float value ); - - void touchPitchChanged( float value ); - void touchYawChanged( float value ); - void touchRollChanged( float value ); - void touchXChanged( float value ); - void touchYChanged( float value ); - void touchZChanged( float value ); - - void piPlayerHeightChanged( float value ); - void piEyeHeightChanged( float value ); - void piUsernameChanged( const QString& value ); - void piNameChanged( const QString& value ); - void piGenderChanged( int value ); - - void controllerProfilesUpdated(); -}; - -} // namespace advsettings diff --git a/src/tabcontrollers/SettingsTabController.cpp b/src/tabcontrollers/SettingsTabController.cpp index cd516db..7d14e66 100644 --- a/src/tabcontrollers/SettingsTabController.cpp +++ b/src/tabcontrollers/SettingsTabController.cpp @@ -9,14 +9,6 @@ void SettingsTabController::initStage1() { m_autoStartEnabled = vr::VRApplications()->GetApplicationAutoLaunch( application_strings::applicationKey ); - auto settings = OverlayController::appSettings(); - settings->beginGroup( "applicationSettings" ); - auto value = settings->value( "forceRevivePage", m_forceRevivePage ); - settings->endGroup(); - if ( value.isValid() && !value.isNull() ) - { - m_forceRevivePage = value.toBool(); - } } void SettingsTabController::initStage2( OverlayController* var_parent ) @@ -24,15 +16,12 @@ void SettingsTabController::initStage2( OverlayController* var_parent ) this->parent = var_parent; } -void SettingsTabController::eventLoopTick() +void SettingsTabController::dashboardLoopTick() { if ( settingsUpdateCounter >= k_settingsTabSettingsUpdateCounter ) { - if ( parent->isDashboardVisible() ) - { - setAutoStartEnabled( vr::VRApplications()->GetApplicationAutoLaunch( - application_strings::applicationKey ) ); - } + setAutoStartEnabled( vr::VRApplications()->GetApplicationAutoLaunch( + application_strings::applicationKey ) ); settingsUpdateCounter = 0; } else @@ -66,26 +55,4 @@ void SettingsTabController::setAutoStartEnabled( bool value, bool notify ) } } -bool SettingsTabController::forceRevivePage() const -{ - return m_forceRevivePage; -} - -void SettingsTabController::setForceRevivePage( bool value, bool notify ) -{ - if ( m_forceRevivePage != value ) - { - m_forceRevivePage = value; - auto settings = OverlayController::appSettings(); - settings->beginGroup( "applicationSettings" ); - settings->setValue( "forceRevivePage", m_forceRevivePage ); - settings->endGroup(); - settings->sync(); - if ( notify ) - { - emit forceRevivePageChanged( m_forceRevivePage ); - } - } -} - } // namespace advsettings diff --git a/src/tabcontrollers/SettingsTabController.h b/src/tabcontrollers/SettingsTabController.h index 1b3cc4d..f8bd9d8 100644 --- a/src/tabcontrollers/SettingsTabController.h +++ b/src/tabcontrollers/SettingsTabController.h @@ -15,8 +15,6 @@ class SettingsTabController : public QObject Q_OBJECT Q_PROPERTY( bool autoStartEnabled READ autoStartEnabled WRITE setAutoStartEnabled NOTIFY autoStartEnabledChanged ) - Q_PROPERTY( bool forceRevivePage READ forceRevivePage WRITE - setForceRevivePage NOTIFY forceRevivePageChanged ) private: OverlayController* parent; @@ -24,24 +22,20 @@ private: unsigned settingsUpdateCounter = 0; bool m_autoStartEnabled = false; - bool m_forceRevivePage = false; public: void initStage1(); void initStage2( OverlayController* parent ); - void eventLoopTick(); + void dashboardLoopTick(); bool autoStartEnabled() const; - bool forceRevivePage() const; public slots: void setAutoStartEnabled( bool value, bool notify = true ); - void setForceRevivePage( bool value, bool notify = true ); signals: void autoStartEnabledChanged( bool value ); - void forceRevivePageChanged( bool value ); }; } // namespace advsettings diff --git a/src/tabcontrollers/SteamVRTabController.cpp b/src/tabcontrollers/SteamVRTabController.cpp index 2e3ec90..6a144ba 100644 --- a/src/tabcontrollers/SteamVRTabController.cpp +++ b/src/tabcontrollers/SteamVRTabController.cpp @@ -9,7 +9,7 @@ void SteamVRTabController::initStage1() { initMotionSmoothing(); initSupersampleOverride(); - eventLoopTick(); + dashboardLoopTick(); reloadSteamVRProfiles(); } @@ -18,105 +18,98 @@ void SteamVRTabController::initStage2( OverlayController* var_parent ) this->parent = var_parent; } -void SteamVRTabController::eventLoopTick() +void SteamVRTabController::dashboardLoopTick() { if ( settingsUpdateCounter >= k_steamVrSettingsUpdateCounter ) { - if ( parent->isDashboardVisible() ) + vr::EVRSettingsError vrSettingsError; + // checks supersampling override and resynchs if necessry + // also prints error if can't find. + auto sso = vr::VRSettings()->GetBool( + vr::k_pch_SteamVR_Section, + vr::k_pch_SteamVR_SupersampleManualOverride_Bool, + &vrSettingsError ); + if ( vrSettingsError != vr::VRSettingsError_None ) { - vr::EVRSettingsError vrSettingsError; - // checks supersampling override and resynchs if necessry - // also prints error if can't find. - auto sso = vr::VRSettings()->GetBool( - vr::k_pch_SteamVR_Section, - vr::k_pch_SteamVR_SupersampleManualOverride_Bool, - &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) + LOG( WARNING ) << "Could not read \"" + << vr::k_pch_SteamVR_SupersampleManualOverride_Bool + << "\" setting: " + << vr::VRSettings()->GetSettingsErrorNameFromEnum( + vrSettingsError ); + } + setAllowSupersampleOverride( sso ); + // checks supersampling and re-synchs if necessary + auto ss = vr::VRSettings()->GetFloat( + vr::k_pch_SteamVR_Section, + vr::k_pch_SteamVR_SupersampleScale_Float, + &vrSettingsError ); + if ( vrSettingsError != vr::VRSettingsError_None ) + { + LOG( WARNING ) << "Could not read \"" + << vr::k_pch_SteamVR_SupersampleScale_Float + << "\" setting: " + << vr::VRSettings()->GetSettingsErrorNameFromEnum( + vrSettingsError ); + if ( m_superSampling != 1.0f ) { - LOG( WARNING ) - << "Could not read \"" - << vr::k_pch_SteamVR_SupersampleManualOverride_Bool - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); + LOG( DEBUG ) << "OpenVR returns an error and we have a custom " + "supersampling value: " + << m_superSampling; + setSuperSampling( 1.0 ); } - setAllowSupersampleOverride( sso ); - // checks supersampling and re-synchs if necessary - auto ss = vr::VRSettings()->GetFloat( - vr::k_pch_SteamVR_Section, - vr::k_pch_SteamVR_SupersampleScale_Float, - &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) - << "Could not read \"" - << vr::k_pch_SteamVR_SupersampleScale_Float - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - if ( m_superSampling != 1.0f ) - { - LOG( DEBUG ) - << "OpenVR returns an error and we have a custom " - "supersampling value: " - << m_superSampling; - setSuperSampling( 1.0 ); - } - } - else if ( m_superSampling != ss ) - { - LOG( DEBUG ) << "OpenVR reports a changed supersampling value: " - << m_superSampling << " => " << ss; - setSuperSampling( ss ); - } - // checks if Supersampling filter is on and changes if it has been - // changed elsewhere - auto sf = vr::VRSettings()->GetBool( - vr::k_pch_SteamVR_Section, - vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool, - &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) - << "Could not read \"" - << vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - setAllowSupersampleFiltering( sf ); + } + else if ( fabs( static_cast( m_superSampling - ss ) ) > 0.05 ) + { + LOG( INFO ) << "OpenVR reports a changed supersampling value: " + << m_superSampling << " => " << ss; + setSuperSampling( ss ); + } + // checks if Supersampling filter is on and changes if it has been + // changed elsewhere + auto sf = vr::VRSettings()->GetBool( + vr::k_pch_SteamVR_Section, + vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool, + &vrSettingsError ); + if ( vrSettingsError != vr::VRSettingsError_None ) + { + LOG( WARNING ) << "Could not read \"" + << vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool + << "\" setting: " + << vr::VRSettings()->GetSettingsErrorNameFromEnum( + vrSettingsError ); + } + setAllowSupersampleFiltering( sf ); - // Checks if Motion smoothing setting can be read and synchs adv - // settings to steamvr/openvr - auto ms = vr::VRSettings()->GetBool( - vr::k_pch_SteamVR_Section, - vr::k_pch_SteamVR_MotionSmoothing_Bool, - &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) - << "Could not read \"" - << vr::k_pch_SteamVR_MotionSmoothing_Bool << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - setMotionSmoothing( ms ); + // Checks if Motion smoothing setting can be read and synchs adv + // settings to steamvr/openvr + auto ms + = vr::VRSettings()->GetBool( vr::k_pch_SteamVR_Section, + vr::k_pch_SteamVR_MotionSmoothing_Bool, + &vrSettingsError ); + if ( vrSettingsError != vr::VRSettingsError_None ) + { + LOG( WARNING ) << "Could not read \"" + << vr::k_pch_SteamVR_MotionSmoothing_Bool + << "\" setting: " + << vr::VRSettings()->GetSettingsErrorNameFromEnum( + vrSettingsError ); + } + setMotionSmoothing( ms ); - // Checks and synchs performance graph - auto pg - = vr::VRSettings()->GetBool( vr::k_pch_Perf_Section, + // Checks and synchs performance graph + auto pg = vr::VRSettings()->GetBool( vr::k_pch_Perf_Section, vr::k_pch_Perf_PerfGraphInHMD_Bool, &vrSettingsError ); - if ( vrSettingsError != vr::VRSettingsError_None ) - { - LOG( WARNING ) - << "Could not read \"" << vr::k_pch_Perf_PerfGraphInHMD_Bool - << "\" setting: " - << vr::VRSettings()->GetSettingsErrorNameFromEnum( - vrSettingsError ); - } - setPerformanceGraph( pg ); + if ( vrSettingsError != vr::VRSettingsError_None ) + { + LOG( WARNING ) << "Could not read \"" + << vr::k_pch_Perf_PerfGraphInHMD_Bool + << "\" setting: " + << vr::VRSettings()->GetSettingsErrorNameFromEnum( + vrSettingsError ); } + setPerformanceGraph( pg ); + settingsUpdateCounter = 0; } else @@ -310,9 +303,9 @@ void SteamVRTabController::setSuperSampling( float value, const bool notify ) { bool override = false; // Mirrors Desktop Clamp - if ( value <= 0.2f ) + if ( value < 0.2f ) { - LOG( WARNING ) << "Encountered a supersampling value <= 0.01, setting " + LOG( WARNING ) << "Encountered a supersampling value <= 0.2, setting " "supersampling to 1.0"; value = 1.0f; override = true; diff --git a/src/tabcontrollers/SteamVRTabController.h b/src/tabcontrollers/SteamVRTabController.h index ec3ce60..e8bc698 100644 --- a/src/tabcontrollers/SteamVRTabController.h +++ b/src/tabcontrollers/SteamVRTabController.h @@ -63,6 +63,7 @@ public: void initStage2( OverlayController* parent ); void eventLoopTick(); + void dashboardLoopTick(); float superSampling() const; bool motionSmoothing() const; diff --git a/src/tabcontrollers/VideoTabController.cpp b/src/tabcontrollers/VideoTabController.cpp index fa36172..44463aa 100644 --- a/src/tabcontrollers/VideoTabController.cpp +++ b/src/tabcontrollers/VideoTabController.cpp @@ -113,8 +113,6 @@ void VideoTabController::reloadVideoConfig() setColorGreen( settings->value( "colorGreen", 0.0f ).toFloat() ); setColorBlue( settings->value( "colorBlue", 0.0f ).toFloat() ); settings->endGroup(); - LOG( INFO ) << "bright opacityValue: " << m_brightnessOpacityValue - << " REd value is: " << m_colorRed; setBrightnessOpacityValue(); loadColorOverlay(); settings->sync();