From 089862e876027cef6fecd43d59e9ada0ec148197 Mon Sep 17 00:00:00 2001 From: Kung-vr Date: Tue, 15 Jan 2019 23:23:34 +0900 Subject: [PATCH 1/3] Apply fix for reset button rotation from alpha-kung branch --- src/res/qml/PlayspacePage.qml | 26 +++++++++++-------- .../MoveCenterTabController.cpp | 22 +++++++++++++--- src/tabcontrollers/MoveCenterTabController.h | 7 +++++ 3 files changed, 41 insertions(+), 14 deletions(-) diff --git a/src/res/qml/PlayspacePage.qml b/src/res/qml/PlayspacePage.qml index a109652..cb2d24f 100644 --- a/src/res/qml/PlayspacePage.qml +++ b/src/res/qml/PlayspacePage.qml @@ -233,11 +233,11 @@ MyStackViewPage { Layout.preferredWidth: 40 text: "-" onClicked: { - var val = MoveCenterTabController.rotation - 45 + var val = MoveCenterTabController.tempRotation - 45 if (val < -180) { val = val + 360; } - MoveCenterTabController.rotation = val + MoveCenterTabController.tempRotation = val } } @@ -250,11 +250,11 @@ MyStackViewPage { Layout.fillWidth: true onPositionChanged: { var val = this.from + ( this.position * (this.to - this.from)) - playspaceRotationText.text = Math.round(val) + "°" + MoveCenterTabController.tempRotation = Math.round(val) } onValueChanged: { - MoveCenterTabController.rotation = playspaceRotationSlider.value - playspaceRotationText.text = Math.round(playspaceRotationSlider.value) + "°" + MoveCenterTabController.tempRotation = Math.round(playspaceRotationSlider.value) + //playspaceRotationText.text = Math.round(playspaceRotationSlider.value) + "°" } } @@ -263,11 +263,11 @@ MyStackViewPage { Layout.preferredWidth: 40 text: "+" onClicked: { - var val = MoveCenterTabController.rotation + 45 + var val = MoveCenterTabController.tempRotation + 45 if (val > 180) { val = val -360; } - MoveCenterTabController.rotation = val + MoveCenterTabController.tempRotation = val } } @@ -282,10 +282,10 @@ MyStackViewPage { var val = parseInt(input) if (!isNaN(val)) { val = val % 180 - MoveCenterTabController.rotation = val - text = MoveCenterTabController.rotation + "°" + MoveCenterTabController.tempRotation = val + text = MoveCenterTabController.tempRotation + "°" } else { - text = MoveCenterTabController.rotation + "°" + text = MoveCenterTabController.tempRotation + "°" } } } @@ -294,7 +294,7 @@ MyStackViewPage { Layout.preferredWidth: 145 text:"Apply" onClicked: { - MoveCenterTabController.applyRotation() + MoveCenterTabController.rotation = MoveCenterTabController.tempRotation } } @@ -409,6 +409,10 @@ MyStackViewPage { onRotationChanged: { playspaceRotationSlider.value = MoveCenterTabController.rotation } + onTempRotationChanged: { + playspaceRotationSlider.value = MoveCenterTabController.tempRotation + playspaceRotationText.text = MoveCenterTabController.tempRotation + "°" + } onAdjustChaperoneChanged: { playspaceAdjustChaperoneToggle.checked = MoveCenterTabController.adjustChaperone } diff --git a/src/tabcontrollers/MoveCenterTabController.cpp b/src/tabcontrollers/MoveCenterTabController.cpp index e5c932c..5219087 100644 --- a/src/tabcontrollers/MoveCenterTabController.cpp +++ b/src/tabcontrollers/MoveCenterTabController.cpp @@ -136,13 +136,20 @@ int MoveCenterTabController::rotation() const return m_rotation; } +int MoveCenterTabController::tempRotation() const +{ + return m_tempRotation; +} + void MoveCenterTabController::setRotation( int value, bool notify ) { if ( m_rotation != value ) { - // float angle = (value - m_rotation) * 2 * M_PI / 360.0; - // parent->RotateUniverseCenter((vr::TrackingUniverseOrigin)m_trackingUniverse, - // angle, m_adjustChaperone); + float angle = ( value - m_rotation ) * 2 * M_PI / 360.0; + parent->RotateUniverseCenter( + ( vr::TrackingUniverseOrigin ) m_trackingUniverse, + angle, + m_adjustChaperone ); m_rotation = value; if ( notify ) { @@ -151,6 +158,15 @@ void MoveCenterTabController::setRotation( int value, bool notify ) } } +void MoveCenterTabController::setTempRotation( int value, bool notify ) +{ + m_tempRotation = value; + if ( notify ) + { + emit tempRotationChanged( m_tempRotation ); + } +} + void MoveCenterTabController::applyRotation() { if ( m_rotation != m_rotationOld ) diff --git a/src/tabcontrollers/MoveCenterTabController.h b/src/tabcontrollers/MoveCenterTabController.h index 75af55d..70809ad 100644 --- a/src/tabcontrollers/MoveCenterTabController.h +++ b/src/tabcontrollers/MoveCenterTabController.h @@ -25,6 +25,8 @@ class MoveCenterTabController : public QObject float offsetZ READ offsetZ WRITE setOffsetZ NOTIFY offsetZChanged ) Q_PROPERTY( int rotation READ rotation WRITE setRotation NOTIFY rotationChanged ) + Q_PROPERTY( int tempRotation READ tempRotation WRITE setTempRotation NOTIFY + tempRotationChanged ) Q_PROPERTY( bool adjustChaperone READ adjustChaperone WRITE setAdjustChaperone NOTIFY adjustChaperoneChanged ) Q_PROPERTY( bool moveShortcutRight READ moveShortcutRight WRITE @@ -49,6 +51,7 @@ private: float m_offsetY = 0.0f; float m_offsetZ = 0.0f; int m_rotation = 0; + int m_tempRotation = 0; int m_rotationOld = 0; bool m_adjustChaperone = true; bool m_moveShortcutRightPressed = false; @@ -78,6 +81,7 @@ public: float offsetY() const; float offsetZ() const; int rotation() const; + int tempRotation() const; bool adjustChaperone() const; bool moveShortcutRight() const; bool moveShortcutLeft() const; @@ -96,6 +100,8 @@ public slots: void setRotation( int value, bool notify = true ); + void setTempRotation( int value, bool notify = true ); + void setAdjustChaperone( bool value, bool notify = true ); void setMoveShortcutRight( bool value, bool notify = true ); @@ -119,6 +125,7 @@ signals: void offsetYChanged( float value ); void offsetZChanged( float value ); void rotationChanged( int value ); + void tempRotationChanged( int value ); void adjustChaperoneChanged( bool value ); void moveShortcutRightChanged( bool value ); void moveShortcutLeftChanged( bool value ); From 008b516a2f4f3aef18471439ccc6884fcd39e1e1 Mon Sep 17 00:00:00 2001 From: Vasily Date: Tue, 15 Jan 2019 18:11:40 +0100 Subject: [PATCH 2/3] Release 2.8.0 This commit should change version numbers, but since they're already changed it'll add a file that should be removed next commit. --- 2-8-0-release | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 2-8-0-release diff --git a/2-8-0-release b/2-8-0-release new file mode 100644 index 0000000..e69de29 From 474b1a7587df952653d6b8f833f31529d2b7f191 Mon Sep 17 00:00:00 2001 From: Vasily Date: Wed, 16 Jan 2019 16:27:28 +0100 Subject: [PATCH 3/3] Rename version strings to 2.8.0-dev Since version strings are displayed in logs and on the main screen, this will prevent situations where the master branch is confused with the 2.8.0-release branch. The 2-8-0-release file was a one time thing because the version numbers were already changed, it should not be created for future releases. --- 2-8-0-release | 0 build_scripts/win/common.py | 2 +- installer/installer.nsi | 2 +- src/overlaycontroller.h | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 2-8-0-release diff --git a/2-8-0-release b/2-8-0-release deleted file mode 100644 index e69de29..0000000 diff --git a/build_scripts/win/common.py b/build_scripts/win/common.py index 6a462cd..90e58b6 100644 --- a/build_scripts/win/common.py +++ b/build_scripts/win/common.py @@ -11,7 +11,7 @@ import distutils.dir_util #Const globals #Version string must be bumped every release. #TODO: See developer documentation. -VERSION_STRING = "2-8-0" +VERSION_STRING = "2-8-0-dev" EXIT_CODE_SUCCESS = 0 EXIT_CODE_FAILURE_BUILD_APP = 1 diff --git a/installer/installer.nsi b/installer/installer.nsi index 9bb87f0..f3d09b0 100644 --- a/installer/installer.nsi +++ b/installer/installer.nsi @@ -11,7 +11,7 @@ !define THIRDDIR "..\third-party" !define PACKAGEDIR "..\src\package_files" !define PROJECTDIR "..\" - !define VERSION_STRING "2-8-0" + !define VERSION_STRING "2-8-0-dev" ;Name and file Name "OpenVR Advanced Settings" diff --git a/src/overlaycontroller.h b/src/overlaycontroller.h index 4a4f031..8b22da9 100644 --- a/src/overlaycontroller.h +++ b/src/overlaycontroller.h @@ -49,7 +49,7 @@ public: static constexpr auto applicationName = "OpenVRAdvancedSettings"; static constexpr const char* applicationKey = "matzman666.AdvancedSettings"; static constexpr const char* applicationDisplayName = "Advanced Settings"; - static constexpr const char* applicationVersionString = "v2.8.0"; + static constexpr const char* applicationVersionString = "v2.8.0-dev"; private: vr::VROverlayHandle_t m_ulOverlayHandle = vr::k_ulOverlayHandleInvalid;