Convert m_adjustChaperone to new settings API

This commit is contained in:
Vasily
2019-12-10 08:28:41 +01:00
committed by username223
parent 9755ffac64
commit 289de29d69
2 changed files with 9 additions and 30 deletions
+9 -29
View File
@@ -39,9 +39,6 @@ namespace advsettings
{ {
void MoveCenterTabController::initStage1() void MoveCenterTabController::initStage1()
{ {
m_adjustChaperone = settings::getSetting(
settings::BoolSetting::PLAYSPACE_adjustChaperone );
m_settingsRightHandDragEnabled = settings::getSetting( m_settingsRightHandDragEnabled = settings::getSetting(
settings::BoolSetting::PLAYSPACE_moveShortcutRight ); settings::BoolSetting::PLAYSPACE_moveShortcutRight );
m_settingsLeftHandDragEnabled = settings::getSetting( m_settingsLeftHandDragEnabled = settings::getSetting(
@@ -223,10 +220,6 @@ void MoveCenterTabController::deleteOffsetProfile( unsigned index )
void MoveCenterTabController::outputLogSettings() void MoveCenterTabController::outputLogSettings()
{ {
if ( !m_adjustChaperone )
{
LOG( WARNING ) << "LOADED SETTINGS: Adjust Chaperone DISABLED";
}
if ( m_settingsRightHandDragEnabled ) if ( m_settingsRightHandDragEnabled )
{ {
LOG( INFO ) << "LOADED SETTINGS: Right Hand Space-Drag Bind Enabled"; 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 bool MoveCenterTabController::adjustChaperone() const
{ {
return m_adjustChaperone; return settings::getSetting(
settings::BoolSetting::PLAYSPACE_adjustChaperone );
} }
void MoveCenterTabController::setAdjustChaperone( bool value, bool notify ) void MoveCenterTabController::setAdjustChaperone( bool value, bool notify )
{ {
if ( m_adjustChaperone != value ) settings::setSetting( settings::BoolSetting::PLAYSPACE_adjustChaperone,
value );
if ( notify )
{ {
m_adjustChaperone = value; emit adjustChaperoneChanged( 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;
}
} }
} }
@@ -2856,7 +2835,8 @@ void MoveCenterTabController::updateSpace( bool forceUpdate )
&offsetSeatedCenter ); &offsetSeatedCenter );
} }
if ( m_adjustChaperone ) if ( settings::getSetting(
settings::BoolSetting::PLAYSPACE_adjustChaperone ) )
{ {
// make a copy of our bounds and // make a copy of our bounds and
// reorient relative to new universe center // reorient relative to new universe center
@@ -121,7 +121,6 @@ private:
int m_tempRotation = 0; int m_tempRotation = 0;
int m_snapTurnAngle = 4500; int m_snapTurnAngle = 4500;
int m_smoothTurnRate = 100; int m_smoothTurnRate = 100;
bool m_adjustChaperone = true;
bool m_moveShortcutRightPressed = false; bool m_moveShortcutRightPressed = false;
bool m_moveShortcutLeftPressed = false; bool m_moveShortcutLeftPressed = false;
vr::TrackedDeviceIndex_t m_activeMoveController; vr::TrackedDeviceIndex_t m_activeMoveController;