diff --git a/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp b/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp index f16d4b4ca4..49175f6ce5 100644 --- a/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp +++ b/soh/soh/Enhancements/controls/SohInputEditorWindow.cpp @@ -1464,8 +1464,15 @@ void SohInputEditorWindow::DrawCameraControlPanel() { .Max(5.0f) .DefaultValue(1.0f) .ShowButtons(true)); - CVarSliderInt("Camera Distance: %d", CVAR_SETTING("FreeLook.MaxCameraDistance"), - IntSliderOptions().Color(THEME_COLOR).Min(100).Max(900).DefaultValue(185).ShowButtons(true)); + CVarCheckbox("Follow Default Camera Distance", CVAR_SETTING("FreeLook.UseGameDistance"), + CheckboxOptions() + .Color(THEME_COLOR) + .Tooltip("Lets the free camera pull in and out using the game's default distance for the " + "current situation instead of a fixed distance.")); + if (!CVarGetInteger(CVAR_SETTING("FreeLook.UseGameDistance"), 0)) { + CVarSliderInt("Camera Distance: %d", CVAR_SETTING("FreeLook.MaxCameraDistance"), + IntSliderOptions().Color(THEME_COLOR).Min(100).Max(900).DefaultValue(185).ShowButtons(true)); + } CVarSliderInt("Camera Transition Speed: %d", CVAR_SETTING("FreeLook.TransitionSpeed"), IntSliderOptions().Color(THEME_COLOR).Min(0).Max(900).DefaultValue(25).ShowButtons(true)); Ship::GuiWindow::EndGroupPanel(0); diff --git a/soh/src/code/z_camera.c b/soh/src/code/z_camera.c index f6f0a607e3..af665014d7 100644 --- a/soh/src/code/z_camera.c +++ b/soh/src/code/z_camera.c @@ -1513,7 +1513,11 @@ s32 Camera_Free(Camera* camera) { camera->play->camY = -0x228C; } - f32 distTarget = CVarGetInteger(CVAR_SETTING("FreeLook.MaxCameraDistance"), para1->distTarget); + // SOH [Enhancement] When set, use the game's per-mode default distance (para1->distTarget) + // instead of the fixed free-look distance. + f32 distTarget = CVarGetInteger(CVAR_SETTING("FreeLook.UseGameDistance"), 0) + ? para1->distTarget + : CVarGetInteger(CVAR_SETTING("FreeLook.MaxCameraDistance"), para1->distTarget); f32 speedScaler = CVarGetInteger(CVAR_SETTING("FreeLook.TransitionSpeed"), 25); f32 distDiff = ABS(distTarget - camera->dist); if (distDiff > 0)