[Accessibility] Add ability to disable camera re-centering on idle (#2503)

* Add ability to disable camera recentering on idle

* Remove platform check

* Update else camera comment
This commit is contained in:
David Chavez 2023-03-01 03:42:15 +01:00 committed by GitHub
parent 0daa91f4e3
commit b74be9196c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -302,6 +302,15 @@ namespace GameMenuBar {
UIWidgets::EnhancementRadioButton("French", "gLanguages", LANGUAGE_FRA);
ImGui::EndMenu();
}
UIWidgets::Spacer(0);
if (ImGui::BeginMenu("Accessibility")) {
UIWidgets::PaddedEnhancementCheckbox("Disable Idle Camera Re-Centering", "gA11yDisableIdleCam");
UIWidgets::Tooltip("Disables the automatic re-centering of the camera when idle.");
ImGui::EndMenu();
}
ImGui::EndMenu();
}

View File

@ -1677,16 +1677,18 @@ s32 Camera_Normal1(Camera* camera) {
Camera_ClampDist(camera, eyeAdjustment.r, norm1->distMin, norm1->distMax, anim->unk_28);
if (anim->startSwingTimer <= 0) {
if (CVarGetInteger("gA11yDisableIdleCam", 0)) return;
eyeAdjustment.pitch = atEyeNextGeo.pitch;
eyeAdjustment.yaw =
Camera_LERPCeilS(anim->swingYawTarget, atEyeNextGeo.yaw, 1.0f / camera->yawUpdateRateInv, 0xA);
} else if (anim->swing.unk_18 != 0) {
if (CVarGetInteger("gA11yDisableIdleCam", 0)) return;
eyeAdjustment.yaw =
Camera_LERPCeilS(anim->swing.unk_16, atEyeNextGeo.yaw, 1.0f / camera->yawUpdateRateInv, 0xA);
eyeAdjustment.pitch =
Camera_LERPCeilS(anim->swing.unk_14, atEyeNextGeo.pitch, 1.0f / camera->yawUpdateRateInv, 0xA);
} else {
// rotate yaw to follow player.
// rotate yaw to follow player while moving around - to keep player on camera.
eyeAdjustment.yaw =
Camera_CalcDefaultYaw(camera, atEyeNextGeo.yaw, camera->playerPosRot.rot.y, norm1->unk_14, sp94);
eyeAdjustment.pitch =