From 289de29d6995fadaa8c8b64a85b49cc166c9d666 Mon Sep 17 00:00:00 2001 From: Vasily Date: Sun, 1 Dec 2019 13:54:50 +0100 Subject: [PATCH] Convert m_adjustChaperone to new settings API --- .../MoveCenterTabController.cpp | 38 +++++-------------- src/tabcontrollers/MoveCenterTabController.h | 1 - 2 files changed, 9 insertions(+), 30 deletions(-) diff --git a/src/tabcontrollers/MoveCenterTabController.cpp b/src/tabcontrollers/MoveCenterTabController.cpp index e03dd35..38c6b04 100644 --- a/src/tabcontrollers/MoveCenterTabController.cpp +++ b/src/tabcontrollers/MoveCenterTabController.cpp @@ -39,9 +39,6 @@ namespace advsettings { void MoveCenterTabController::initStage1() { - m_adjustChaperone = settings::getSetting( - settings::BoolSetting::PLAYSPACE_adjustChaperone ); - m_settingsRightHandDragEnabled = settings::getSetting( settings::BoolSetting::PLAYSPACE_moveShortcutRight ); m_settingsLeftHandDragEnabled = settings::getSetting( @@ -223,10 +220,6 @@ void MoveCenterTabController::deleteOffsetProfile( unsigned index ) void MoveCenterTabController::outputLogSettings() { - if ( !m_adjustChaperone ) - { - LOG( WARNING ) << "LOADED SETTINGS: Adjust Chaperone DISABLED"; - } if ( m_settingsRightHandDragEnabled ) { LOG( INFO ) << "LOADED SETTINGS: Right Hand Space-Drag Bind Enabled"; @@ -598,32 +591,18 @@ void MoveCenterTabController::setSmoothTurnRate( int value, bool notify ) bool MoveCenterTabController::adjustChaperone() const { - return m_adjustChaperone; + return settings::getSetting( + settings::BoolSetting::PLAYSPACE_adjustChaperone ); } void MoveCenterTabController::setAdjustChaperone( bool value, bool notify ) { - if ( m_adjustChaperone != value ) + settings::setSetting( settings::BoolSetting::PLAYSPACE_adjustChaperone, + value ); + + if ( notify ) { - m_adjustChaperone = value; - auto settings = OverlayController::appSettings(); - settings->beginGroup( "playspaceSettings" ); - settings->setValue( "adjustChaperone", m_adjustChaperone ); - settings->endGroup(); - settings->sync(); - if ( notify ) - { - emit adjustChaperoneChanged( m_adjustChaperone ); - } - if ( !m_adjustChaperone ) - { - LOG( WARNING ) << "CHANGED SETTINGS: Adjust Chaperone DISABLED"; - } - else - { - LOG( INFO ) << "CHANGED SETTINGS: Adjust Chaperone Set: " - << m_adjustChaperone; - } + emit adjustChaperoneChanged( value ); } } @@ -2856,7 +2835,8 @@ void MoveCenterTabController::updateSpace( bool forceUpdate ) &offsetSeatedCenter ); } - if ( m_adjustChaperone ) + if ( settings::getSetting( + settings::BoolSetting::PLAYSPACE_adjustChaperone ) ) { // make a copy of our bounds and // reorient relative to new universe center diff --git a/src/tabcontrollers/MoveCenterTabController.h b/src/tabcontrollers/MoveCenterTabController.h index f7571f9..aef2e75 100644 --- a/src/tabcontrollers/MoveCenterTabController.h +++ b/src/tabcontrollers/MoveCenterTabController.h @@ -121,7 +121,6 @@ private: int m_tempRotation = 0; int m_snapTurnAngle = 4500; int m_smoothTurnRate = 100; - bool m_adjustChaperone = true; bool m_moveShortcutRightPressed = false; bool m_moveShortcutLeftPressed = false; vr::TrackedDeviceIndex_t m_activeMoveController;