Move new camera settings to the Settings Registry and connect them to viewport border elements (#1267)

* ensure the new camera respects changing ui values and move camera settings to the settings registry

* factor out creation of modular camera controller

* small updates before posting PR

* updates following review feedback

* updates following review feedback
This commit is contained in:
Tom Hulton-Harrop
2021-06-14 12:32:35 +01:00
committed by GitHub
parent 259542b3ca
commit 0f09a6d8bf
15 changed files with 562 additions and 290 deletions
-35
View File
@@ -441,9 +441,6 @@ void CCryEditApp::RegisterActionHandlers()
ON_COMMAND(ID_VIEW_CYCLE2DVIEWPORT, OnViewCycle2dviewport)
#endif
ON_COMMAND(ID_DISPLAY_GOTOPOSITION, OnDisplayGotoPosition)
ON_COMMAND(ID_CHANGEMOVESPEED_INCREASE, OnChangemovespeedIncrease)
ON_COMMAND(ID_CHANGEMOVESPEED_DECREASE, OnChangemovespeedDecrease)
ON_COMMAND(ID_CHANGEMOVESPEED_CHANGESTEP, OnChangemovespeedChangestep)
ON_COMMAND(ID_FILE_SAVELEVELRESOURCES, OnFileSavelevelresources)
ON_COMMAND(ID_CLEAR_REGISTRY, OnClearRegistryData)
ON_COMMAND(ID_VALIDATELEVEL, OnValidatelevel)
@@ -3706,38 +3703,6 @@ void CCryEditApp::OnDisplayGotoPosition()
dialog.exec();
}
//////////////////////////////////////////////////////////////////////////
void CCryEditApp::OnChangemovespeedIncrease()
{
gSettings.cameraMoveSpeed += m_moveSpeedStep;
if (gSettings.cameraMoveSpeed < 0.01f)
{
gSettings.cameraMoveSpeed = 0.01f;
}
}
//////////////////////////////////////////////////////////////////////////
void CCryEditApp::OnChangemovespeedDecrease()
{
gSettings.cameraMoveSpeed -= m_moveSpeedStep;
if (gSettings.cameraMoveSpeed < 0.01f)
{
gSettings.cameraMoveSpeed = 0.01f;
}
}
//////////////////////////////////////////////////////////////////////////
void CCryEditApp::OnChangemovespeedChangestep()
{
bool ok = false;
int fractionalDigitCount = 5;
float step = aznumeric_caster(QInputDialog::getDouble(AzToolsFramework::GetActiveWindow(), QObject::tr("Change Move Increase/Decrease Step"), QStringLiteral(""), m_moveSpeedStep, std::numeric_limits<float>::lowest(), std::numeric_limits<float>::max(), fractionalDigitCount, &ok));
if (ok)
{
m_moveSpeedStep = step;
}
}
//////////////////////////////////////////////////////////////////////////
void CCryEditApp::OnFileSavelevelresources()
{