Add Old-Style Motion Setting

This commit is contained in:
Kung-vr
2019-04-21 17:57:39 +09:00
parent 9fd3ab0dee
commit 48f0743bf9
3 changed files with 59 additions and 2 deletions
+41 -2
View File
@@ -128,6 +128,11 @@ void MoveCenterTabController::initStage1()
{
m_allowExternalEdits = value.toBool();
}
value = settings->value( "oldStyleMotion", m_oldStyleMotion );
if ( value.isValid() && !value.isNull() )
{
m_oldStyleMotion = value.toBool();
}
settings->endGroup();
m_lastDragUpdateTimePoint = std::chrono::steady_clock::now();
m_lastGravityUpdateTimePoint = std::chrono::steady_clock::now();
@@ -797,6 +802,31 @@ void MoveCenterTabController::setAllowExternalEdits( bool value, bool notify )
}
}
bool MoveCenterTabController::oldStyleMotion() const
{
return m_oldStyleMotion;
}
void MoveCenterTabController::setOldStyleMotion( bool value, bool notify )
{
// detect incoming change to old style, and hide working set
if ( value && !m_oldStyleMotion )
{
vr::VRChaperoneSetup()->HideWorkingSetPreview();
}
m_oldStyleMotion = value;
auto settings = OverlayController::appSettings();
settings->beginGroup( "playspaceSettings" );
settings->setValue( "oldStyleMotion", m_oldStyleMotion );
settings->endGroup();
settings->sync();
if ( notify )
{
emit oldStyleMotionChanged( m_oldStyleMotion );
}
}
void MoveCenterTabController::modOffsetX( float value, bool notify )
{
if ( !m_lockXToggle )
@@ -2259,8 +2289,17 @@ void MoveCenterTabController::updateSpace()
vr::VRChaperoneSetup()->SetWorkingStandingZeroPoseToRawTrackingPose(
&offsetUniverseCenter );
vr::VRChaperoneSetup()->ShowWorkingSetPreview();
m_chaperoneCommitted = false;
if ( m_oldStyleMotion )
{
vr::VRChaperoneSetup()->CommitWorkingCopy(
vr::EChaperoneConfigFile_Live );
m_chaperoneCommitted = true;
}
else
{
vr::VRChaperoneSetup()->ShowWorkingSetPreview();
m_chaperoneCommitted = false;
}
// loadChaperoneData( false ), false so that we don't load live data, and
// reference the working set instead.